2025-06-24 7:30 AM - last edited on 2025-06-24 7:40 AM by Andrew Neil
I’m using the STM32H563VI microcontroller in my project, together with an external STWD100PY watchdog connected to it. When I try to flash the microcontroller’s memory, the watchdog resets it during the programming process, causing the write to be interrupted. How can I solve this? I’m using the Segger J‑Link programmer in SWD mode (SWCLK and SWDIO).
2025-06-24 7:36 AM
Pulling the NRST pin low will always reset the chip. Disable the watchdog while programming or find another way to stop it from resetting the chip. The STM32 has built in watchdogs, might be better to use those instead.
2025-06-24 7:39 AM - edited 2025-06-24 7:41 AM
@Ecribeiro wrote:When I try to flash the microcontroller’s memory, the watchdog resets it during the programming process,
Of course it will: while programming, your code is not running, so there is nothing to keep updating the watchdog, therefore it will cause a reset - that's its job!
So you need to disable or disconnect the WD during programming.
Nothing specific to STM32 here.
The STWD100 has an enable pin; you could use that - perhaps via your programming connector?
Same question the other week:
2025-06-24 7:48 AM
Which pin on the programming connector could I use? I tried using pin 15 on the J-Link—the ‘RESET’ pin—thinking it would hold the STM32’s nRST pin high while flashing the firmware, but it didn’t work.
2025-06-24 8:05 AM - edited 2025-06-24 11:14 AM
You need to disable the WD.
You would need to make some custom arrangement in your debug connector to do that.
PS:
For example:
WD_EN pulls the WD /ENable pin high