Skip to content

Commit 23fd072

Browse files
committed
tests: drivers: watchdog window reduced to fit stm32 board config
Reduce the windows watchdog so that any stm32 target can pass the tests/drivers/watchdog/wdt_basic_api whatever their sysclock and APB clock. Especially nucleo_f429 and nucleo_f746 but not stm32H7 boards. Signed-off-by: Francois Ramu <[email protected]>
1 parent e90c58a commit 23fd072

File tree

1 file changed

+8
-3
lines changed
  • tests/drivers/watchdog/wdt_basic_api/src

1 file changed

+8
-3
lines changed

tests/drivers/watchdog/wdt_basic_api/src/test_wdt.c

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,12 @@
7171
#elif DT_HAS_COMPAT_STATUS_OKAY(st_stm32_window_watchdog)
7272
#define WDT_NODE DT_INST(0, st_stm32_window_watchdog)
7373
#define TIMEOUTS 0
74-
#define WDT_TEST_MAX_WINDOW 200
74+
/* Boards where the sysclock is high and APB1 prescaler 16 requires a lower WDG window */
75+
#if defined(CONFIG_SOC_SERIES_STM32H7X)
76+
#define WDT_TEST_MAX_WINDOW 200U
77+
#else
78+
#define WDT_TEST_MAX_WINDOW 170U
79+
#endif /* CONFIG_SOC_SERIES_STM32H7X */
7580
#elif DT_HAS_COMPAT_STATUS_OKAY(st_stm32_watchdog)
7681
#define WDT_NODE DT_INST(0, st_stm32_watchdog)
7782
#define TIMEOUTS 0
@@ -159,8 +164,8 @@ static struct wdt_timeout_cfg m_cfg_wdt1;
159164
*/
160165
volatile DATATYPE m_state __attribute__((section(NOINIT_SECTION)));
161166

162-
/* m_testcase_index is incremented after each test to make test possible
163-
* switch to next testcase.
167+
/* m_testcase_index is incremented after each test to make test possible
168+
* switch to next testcase.
164169
*/
165170
volatile DATATYPE m_testcase_index __attribute__((section(NOINIT_SECTION)));
166171

0 commit comments

Comments
 (0)