File tree Expand file tree Collapse file tree 2 files changed +30
-2
lines changed
mbed_drivers/watchdog_reset Expand file tree Collapse file tree 2 files changed +30
-2
lines changed Original file line number Diff line number Diff line change 26
26
#include " mbed.h"
27
27
28
28
#define TIMEOUT_MS 100UL
29
- #define KICK_ADVANCE_MS 10UL
29
+
30
+ /* This value is used to calculate the time to kick the watchdog.
31
+ * Given the watchdog timeout is set to TIMEOUT_MS, the kick will be performed
32
+ * with a delay of (TIMEOUT_MS - KICK_ADVANCE_MS), after the init.
33
+ *
34
+ * It is common for the watchdog peripheral to use a low precision clock source,
35
+ * e.g. the LSI RC acts as a clock source for the IWDG on ST targets.
36
+ * According to the ST spec, the 37 kHz LSI is guaranteed to have a frequency
37
+ * around 37-38 kHz, but the actual frequency range guaranteed by the production
38
+ * tests is 26 kHz up to 56 kHz.
39
+ * Bearing that in mind, a 100 ms timeout value may actually last as long as 142 ms
40
+ * and as short as 66 ms.
41
+ * The value of 35 ms is used to cover the worst case scenario (66 ms).
42
+ */
43
+ #define KICK_ADVANCE_MS 35UL
30
44
31
45
#define MSG_VALUE_DUMMY " 0"
32
46
#define CASE_DATA_INVALID 0xffffffffUL
Original file line number Diff line number Diff line change 26
26
#include " mbed.h"
27
27
28
28
#define TIMEOUT_MS 100UL
29
- #define KICK_ADVANCE_MS 10UL
29
+
30
+ /* This value is used to calculate the time to kick the watchdog.
31
+ * Given the watchdog timeout is set to TIMEOUT_MS, the kick will be performed
32
+ * with a delay of (TIMEOUT_MS - KICK_ADVANCE_MS), after the init.
33
+ *
34
+ * It is common for the watchdog peripheral to use a low precision clock source,
35
+ * e.g. the LSI RC acts as a clock source for the IWDG on ST targets.
36
+ * According to the ST spec, the 37 kHz LSI is guaranteed to have a frequency
37
+ * around 37-38 kHz, but the actual frequency range guaranteed by the production
38
+ * tests is 26 kHz up to 56 kHz.
39
+ * Bearing that in mind, a 100 ms timeout value may actually last as long as 142 ms
40
+ * and as short as 66 ms.
41
+ * The value of 35 ms is used to cover the worst case scenario (66 ms).
42
+ */
43
+ #define KICK_ADVANCE_MS 35UL
30
44
31
45
#define MSG_VALUE_DUMMY " 0"
32
46
#define CASE_DATA_INVALID 0xffffffffUL
You can’t perform that action at this time.
0 commit comments