-
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
Flashing does not work in deep sleep (stop) mode #428
Comments
I have seen this kind of issue before, which is reset-related and based on the state of the core. This needs to be investigated and reproduced, and of course fixed. |
Thank you for the quick follow up. I am not familiar with the code, but could it be that you try to read chip ID prior to a JTAG reset? If so, that would explain the error, as the DBG interface is disabled in stop mode. A proposed fix then is to do a reset prior to reading the chip ID. |
The flow is in this order:
Maybe you could try to add some debug printing at the corresponding places. |
Thanks, that helps. Looks like the fix is to replace usb.c, L879
with
Please see PR #430 |
Seems good to me, @texane what do you think? |
@texane ping? :-). |
First, thank you very much for developing this tool. It works great most of the time, and is orders of magnitude faster than OpenOCD for programming STM32 microcontrollers.
One issue I ran across is that st-flash does not seem to work when my CPU (stm32l031k6) is in stop mode. A workaround that I found is to press and release the reset button at exactly the same time as running the st-flash command; this doesn't work every time though.
I am on Linux (Ubuntu Trusty), have fresh st-flash (compiled from the latest snapshot in git), and am using a Nucleo STM32L031 board. I can attach a simple bin file that demonstrates the problem if it's helpful.
The command that I use is
The output that I get is
but only if the CPU is in stop mode. Otherwise everything works as expected.
Apologies if this is a known issue and I haven't done enough searching to find it.
The text was updated successfully, but these errors were encountered: