cancel
Showing results for 
Search instead for 
Did you mean: 

STWD100 causes reset during flash programming

Ecribeiro
Visitor

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).

4 REPLIES 4
TDK
Super User

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.

If you feel a post has answered your question, please click "Accept as Solution".
Andrew Neil
Super User

@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:

https://community.st.com/t5/others-hardware-and-software/disable-external-watchdog-during-microcontroller-programming/m-p/811301

A complex system that works is invariably found to have evolved from a simple system that worked.
A complex system designed from scratch never works and cannot be patched up to make it work.

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.

You need to disable the WD.

You would need to make some custom arrangement in your debug connector to do that.

 

PS:

For example:

AndrewNeil_1-1750788797558.png

WD_EN pulls the WD /ENable pin high

 

A complex system that works is invariably found to have evolved from a simple system that worked.
A complex system designed from scratch never works and cannot be patched up to make it work.