watchdog

Retrieving return address of an exception on ARM Cortex M0

让人想犯罪 __ 提交于 2019-12-04 10:12:48
I am trying to retrieve the return address of an IRQ handler in my code. My aim is to save the value of the PC just before the watchdog timer expires and before the reset for debug purposes, using WDT_IRQHandler(). I am also testing this approach with other IRQs to check if I grasped the idea. But it seems I haven't. I have read the documentation available. I understood that when an exception happens, 8 registers are pushed to the stack: R0, R1, R2, R3, R12, LR, PC and XPSR. I have also read that the stack is automatically double word aligned. So in my mind, retrieving the return address is as

The Why and the How of Creating a Watchdog in Cocoa/Objective-C

家住魔仙堡 提交于 2019-12-03 20:56:08
Happy Monday to you all! Here is my situation. Any assistance greatly appreciated! I have created an executable that when installed gets placed in the Launch Agents folder of the machine. In theory it should run perpetually, collecting data every second. It can stop when the machine is asleep, but restart when the computer is reactivated. Here is my problem: sometimes the program just spontaneously stops , usually after a couple of days of running. If one restarts the computer then the program restarts and again runs for awhile before the same problem occurs. I have no idea the reason for this

combining python watchdog with multiprocessing or threading

廉价感情. 提交于 2019-12-03 07:09:01
I'm using Python's Watchdog to monitor a given directory for new files being created. When a file is created, some code runs that spawns a subprocess shell command to run different code to process this file. This should run for every new file that is created. I've tested this out when one file is created, and things work great, but am having trouble getting it working when multiple files are created, either at the same time, or one after another. My current problem is this... the processing code run in the shell takes a while to run and will not finish before a new file is created in the

From userspace, how can I tell if Linux's soft watchdog is configured with no way out?

筅森魡賤 提交于 2019-12-03 05:59:42
问题 I am writing a system monitor for Linux and want to include some watchdog functionality. In the kernel, you can configure the watchdog to keep going even if /dev/watchdog is closed. In other words, if my daemon exits normally and closes /dev/watchdog, the system would still re-boot 59 seconds later. That may or may not be desirable behavior for the user. I need to make my daemon aware of this setting because it will influence how I handle SIGINT. If the setting is on, my daemon would need to

Linux automatically restarting application on crash - Daemons

风格不统一 提交于 2019-12-03 03:26:43
I have an system running embedded linux and it is critical that it runs continuously. Basically it is a process for communicating to sensors and relaying that data to database and web client. If a crash occurs, how do I restart the application automatically? Also, there are several threads doing polling(eg sockets & uart communications). How do I ensure none of the threads get hung up or exit unexpectedly? Is there an easy to use watchdog that is threading friendly? The gist of it is: You need to detect if the program is still running and not hung. You need to (re)start the program if the

How to change the watchdog timer in linux embedded

本秂侑毒 提交于 2019-12-01 07:59:02
问题 I have to use the linux watchdog driver (/dev/watchdog). It works great, I write an character like this: echo 1 > /dev/watchdog And the watchdog start and after an about 1 minute, the system reboot. The question is, how can I change the timeout? I have to change the time interval in the driver? 回答1: Please read the Linux documentation. The standard method of changing the timeout from user space is to use an ioctl() . int timeout = 45; /* a time in seconds */ int fd; fd = open("/dev/watchdog")

Who is refreshing hardware watchdog in Linux?

拈花ヽ惹草 提交于 2019-11-30 06:42:18
I have a processor AT91SAM9G20 running a 2.6 kernel. Watchdog is enabled at bootstrap level and configured for 16 seconds. Watchdog mode register can be configured only once. When code hangs either in bootstrap, bootloader or kernel, the board reboots. But once kernel comes up even though watchdog is not refreshed in any of the applications, the board is not being reset after 16 seconds, but 15 minutes. Who is refreshing the watchdog? In our case, the watchdog should be influenced by applications, so that the board can reset if our application hangs. These are the running processes: 1 root

python watchdog modified and created duplicate events

故事扮演 提交于 2019-11-29 11:31:57
Running on Ubuntu, every time i create a file i get a modified and a created event. Is this by design or am i doing something wrong? I'm using the event handler class PatternMatchingEventHandler event_handler = MediaFileHandler(ignore_directories=True) observer = Observer() observer.schedule(event_handler, path=directory, recursive=True) observer.start() If this is the correct behavior, can i safely ignore the created event? Short answer: f = open(... , 'w') generates a FileCreatedEvent , f.flush() or f.close() can generate a FileModifiedEvent . So yes, creating a file often generates both

How to run an function when anything changes in a dir with Python Watchdog?

送分小仙女□ 提交于 2019-11-29 09:38:19
问题 I'm trying to use watchdog to run a sync script whenever anything changes in a dir (except for one specific file). I simply copied the code from the readme (pasted below), which does what it says; log which file has changed. import sys import time import logging from watchdog.observers import Observer from watchdog.events import LoggingEventHandler if __name__ == "__main__": logging.basicConfig(level=logging.INFO, format='%(asctime)s - %(message)s', datefmt='%Y-%m-%d %H:%M:%S') path = sys

迅为-IMX6开发板-QtE-watchdog看门狗例程

南笙酒味 提交于 2019-11-29 07:24:00
本节介绍的是在 linux 系统环境下看门狗测试例程。WatchDog 是为了能够防止程序跑飞 而使用的一种东西,用户在一般的程序也许不需要,但在特殊的情况下可能会需要这种机制。 在此我们将介绍看门狗实验调试步骤。 看门狗驱动飞思卡尔已经做好,只需要我们调用即可,设备节点为 “/dev/watchdog”,如下图所示。 将“watchdogtest”(在压缩包中)拷贝到开发板,使用命令“chmod 777 watchdogtest”修改权限,然后使用命令“./watchdogtest”,即可开启看门狗,并每秒喂狗 1 次,持续 10 秒,停止喂狗之后开发板就会重启。 来源: https://my.oschina.net/u/3005926/blog/3102199