-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
STM32G030: Reset not working properly #1260
Comments
Hi, I've checked updating the st-link software to use only HARD reset by NRST, but I always see that the ST-LINK V2 clone dongle sends NRST pulse and then send other commands to the SWD: the result is that I cannot get the firmware starting after MCU being programmed. |
Nice analysis! I think I have a similar issue although I didn't measure the lines. For me the target also isn't reset after writing. I'm using STLINK/V3 MINI with an STM32F405RG MCU. |
And if I modify the st-flash to include, at the end several NRST resets, I can't see anything: only one NRST reset in the begin and nothing else.
I can see only one NRST reset, no more resets! |
I have fixed the problem by connecting the VDD of the target MCU to a RaspberryPI GPIO: after the MCU has been programmed, I turn OFF the power supply, wait for 100ms, turn ON power supply and the firmware starts. |
I'd argue this should stay open as the solution is a workaround instead of a solution! |
Hello,
|
This is indeed a very interesting issue with a long history of similar findings and attempts to fix reset behaviour. |
Hi, I got a similar issue using STLink V2 with STM32F723 board. One workaround that seems to work for me, is to force a run ( |
@vgeneves Somewhere I already wrote that MCU after restarting remains in the halt state. Core must be run after reset. This is not a workaround, this is a flaw in the CLI reset command. |
Please check commit 8231872 regarding |
@Ant-ON We already have the following in
Is this what you meant? |
@Nightwalker-87 the |
So we shall place it after the if clause in |
@Nightwalker-87 yes, you got that right if (o.reset) {
stlink_reset(sl, RESET_AUTO);
}
stlink_run(sl, RUN_NORMAL); |
Hi,
thanks a lot for the very good tool.
I'm using st-flash in a bash script (Debian GNU/Linux) with a cheap ST-LINK V2 USB programmer, to program and then run the firmware on the MCU:
I've tried both version 1.7.0 distributed with Debian and last version 1.7.0-201-g254a525 from github.
SWD connection including NRST
Issue commands:
What I can see, using the oscilloscope, is that SOMETIMES at the end of programming a long reset (NRST) is issued and the firmware starts correctly, but the successive command to protect flash stops the firmware, issue some resets, but firmware does not start.
Firmware starts only if the NRST reset is pull down without any SWD data exchange.
If, at the end of programming and NRST is pull down, during SWD data exchange, firmware will not start.
Commandline output for the last write (flash protection):
Using the command
st-flash --debug reset
does not reset anything:Command output is:
I expect that:
Thanks a lot!
The following picture shows that, after firmware programming (with --connect-under-reset parameter), st-link issue a NRST reset (yellow trace) followed by NO SWD commands (green trace): the firmware starts (cyan trace).
After MCU protection (with --reset --connect-under-reset parameters), NRST is pulled down (yellow trace) but followed by SWD commands (green trace): firmware on MCU did not start.
The text was updated successfully, but these errors were encountered: