-
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
STM32F1/F4/L0/L4: flash loader run error #607
Comments
i meant to add that this is repeatable. it happens every time when i program (not sometimes). read and erase seem to work ok. when in debug mode, i get this for a long time and then the timeout happens and error's out. i'm not sure why my core is not going to HALT state. i don't think it is the reset line hardware as some have suggested, but i suppose it could be...: |
I'm getting the exact same behavior on my Ugly board. |
Ok get this |
I'm seeing this pretty regularly with STLinkv2. Steps to reproduce: Disconnect target and try to flash; flash will fail.
Disconnecting STLinkv2 from USB and reconnecting, essentially doing a power cycle, resolves the issue. |
I also have the same problem. 2018-07-16T19:24:46 ERROR flash_loader.c: flash loader run error I can resolve it by unplugging/replugging the usb cable of the st-link, but that isn't really a solution |
I experience the very same issue with an ST-LINK (part of a "discovery" board). Connected to it is a RobotDyn STM32 mini. Flashing works the first time, but the second time it fails: (...) $ st-flash --reset --format ihex write somefile.hex Unplugging and re-plugging the device fixes the issue, but just for a single time. The hardware is fine, at least it works without the "unplugging" fix with ST-Link running in a VirtualBox VM with WIn7. |
I am too interested in reason of this problem. As @PDAJ-MM noticed - unplug and plug works as temporary solution. |
Same here for me. |
mine: 2019-01-11T18:03:23 DEBUG common.c: stlink current mode: mass ... skip similar: 2019-01-11T18:03:23 DEBUG common.c: Successfully unlocked flash that loops a fair few times: 2019-01-11T18:03:26 DEBUG common.c: *** stlink_status *** |
I also got this problem on STM32F4 Discovery board. But plugging/unplugging does not solve. Hardware runs well on Windows with stlink v2 utility. :| |
Same here. (STM32L052). Works after plugging/unplugging. |
I got the same behavior as @rvowles under ubuntu linux with the stm32f4 discover board and st-flash |
The F4 flashing is currently broken. See #766 |
Seems that L4 flashing is broken as well. st-flash write original_demo.bin.bkp 0x08000000 |
I was able to compile and use an older version until this bug is fixed. 1.4.0 seems to work fine.
|
not working with latest stlink and latest mac. Same problem still exists. |
We should continue in #761 for issues with latest master version. This issue is really old. Closing this for not recycling this inappropriate. Thanks all for the comments. |
st-flash 1.6.1 with STM32F373CCTx:
output:
It works on every second run |
@ploedige Can you try st-flash built from the |
I'm not very familiar with the st-link utility, yet. What |
Sorry. I think I know what you mean.
|
@ploedige The ARM core in lockup state. Most likely the bootloader (or the core of some reason before bootloader runs) falls into the hardfault. uint32_t dhcsr, dfsr; change to uint32_t dhcsr, dfsr, cfsr, hfsr; and dhcsr = dfsr = 0;
stlink_read_debug32(sl, STLINK_REG_DHCSR, &dhcsr);
stlink_read_debug32(sl, STLINK_REG_DFSR, &dfsr); change to dhcsr = dfsr = cfsr = hfsr = 0;
stlink_read_debug32(sl, STLINK_REG_DHCSR, &dhcsr);
stlink_read_debug32(sl, STLINK_REG_DFSR, &dfsr);
stlink_read_debug32(sl, 0xE000ED28, &cfsr);
stlink_read_debug32(sl, 0xE000ED2C, &hfsr);
ELOG("CFSR 0x%08X HFSR 0x%08X\n", cfsr, hfsr); |
Instruction (Ubuntu 20.04) to avoid the error: First, we are going to install the necessary libraries and build tools: sudo apt-get install git make cmake libusb-1.0-0-dev cd ~myusername
cd bin then udev rules:
|
❗ No, this is no good approach, one should not manually copy files to other locations. |
I'm having the same issue, even with v1.6.1, and power cycling does not fix it.
|
Ok, so I actually found a fix in my situation. Turns out the write protection was activated on part of the flash. Unfortunately, setting option bytes via st-flash is not supported for the STM32F4, but using the STM32CubeProgrammer, I managed to completely erase everything on the flash:
After this, flashing with st-flash worked again! |
Yes, that may be, but does not help us to fix the problem properly in this toolset. 😕 |
Yeah, I guess it's impossible to do unless writing to the option bytes area is supported, see #458. |
Feel free to check the known good commits listed in #356 on the reported bugs you have faced within this topic, but report the results here. Please avoid cross-posting between issues. |
NOTICE: The issue may be closed without notice when not enough information is provided!
Thank you for giving feedback to the stlink project. Take some time to fill out
check boxes with a X in the following items so developers and other people can try to
to find out what is going on. And add/remove what is appropriate to your problem.
When submitting a feature request, try to reuse the list and add/remove what is appropriate.
Place a
X
between the brackets[X]
to mark the list item.st-info
,st-flash
,st-util
A as-detailed description possible of the problem with debug output when available.
Output:
Dougs-MacBook-Pro:bin dyeager$ ./st-flash write out.bin 0x8000000
st-flash 1.3.0
2017-06-20T18:28:52 INFO /Users/jerry/Downloads/stlink-master/src/common.c: Loading device parameters....
2017-06-20T18:28:52 INFO /Users/jerry/Downloads/stlink-master/src/common.c: Device connected is: F446 device, id 0x10006421
2017-06-20T18:28:52 INFO /Users/jerry/Downloads/stlink-master/src/common.c: SRAM size: 0x20000 bytes (128 KiB), Flash: 0x80000 bytes (512 KiB) in pages of 131072 bytes
2017-06-20T18:28:52 INFO /Users/jerry/Downloads/stlink-master/src/common.c: Attempting to write 16536 (0x4098) bytes to stm32 address: 134217728 (0x8000000)
Flash page at addr: 0x08004000 erasedEraseFlash - Sector:0x1 Size:0x4000
2017-06-20T18:28:53 INFO /Users/jerry/Downloads/stlink-master/src/common.c: Finished erasing 2 pages of 16384 (0x4000) bytes
2017-06-20T18:28:53 INFO /Users/jerry/Downloads/stlink-master/src/common.c: Starting Flash write for F2/F4/L4
2017-06-20T18:28:53 INFO /Users/jerry/Downloads/stlink-master/src/flash_loader.c: Successfully loaded flash loader in sram
enabling 32-bit flash writes
size: 16536
2017-06-20T18:28:57 ERROR /Users/jerry/Downloads/stlink-master/src/flash_loader.c: flash loader run error
2017-06-20T18:28:57 ERROR /Users/jerry/Downloads/stlink-master/src/common.c: stlink_flash_loader_run(0x8000000) failed! == -1
stlink_fwrite_flash() == -1
Expected/description:
short description of the expected value
Thank you,
The stlink project maintainers
The text was updated successfully, but these errors were encountered: