-
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
st-flash run_flash_loader(0x08000000) failed #356
Comments
@Almaz1c could you test with |
I can confirm this bug, but I get it only occasionally - sometimes it passes, sometimes it fails.
I am using latest version, compiled yesterday. My output:
|
@vladiks which version/git tag do you use of the st-flash tool? |
Current version is unable to compile with visual studio, probably it should work under MinGW but I have not tested this. |
@xor-gate I'm sorry, but I don't know how to find out the git tag. I've downloaded master as zip and copied it to raspberry. I am retty sure it's 1.2.0, there are also news for 1.2.0 in changelog. I've avoided the issue by erasing memory by separate command before flashing it again - the problem now disappeared. |
@vladiks when you downloaded zipfile for master you running latest version (beyond 1.2.0). I have seen an exact issue where people erase the flash (mass erase/full?) and then it worked. This is a problem which I saw some other people have but have not confirmed and seen this myself. In the upcoming time I will prepare a continues hardware/stlink testing setup at Dual Inventive and hopefully I will catch this nasty bug. This needs some documentation somewhere if people tried to (mass)erased and then flashed and the problem resolved. I will keep this issue open until I have documented/noted it somewhere. |
Good luck and many thanks for your work on this utility. |
I have put it in the README.md. So people will see it 👍. Thanks all for the feedback, feel free to open a issue when something is not working as expected! |
Hello I have the same problem with STML0xx. This error occurs only with st-link utility in linux and mac os X. Utility from STM works fine. |
@Ant-ON Unfortunately it doesn't make a difference. 😕 |
@Nightwalker-87 Do you use --reset option? Can you upload firmware for bluepill? I will test it |
No, but I retried and again there was no difference. The first attempt fails, the second one works, the next one fails and so on... I've done some more tests with
but all following attempts succeed:
|
The problem is in setup which the MCU firmware do, if the firmware goes once every other time. It is necessary to determine what exactly needs to be turned off. |
Hm, ok - Well there is no guarantee that the process is currently implemented well... I'm still busy reviewing tickets and identifying already solved issues. |
@Nightwalker-87 I have looked at the logs from #356 (comment). You use |
No, I haven't: Still can't report anything else. 😕 |
@Nightwalker-87 I fixed the problem on the |
Yeah, well, nobody claimed this would be easy to solve. 😒 |
@Nightwalker-87 anton@vivobook:~/stlink/build/Release/bin$ ./st-flash --reset --format ihex write ./STM32F103_Nucleo_Demo.hex
st-flash 1.6.1-229-gbc9062c-dirty
2021-03-22T19:22:48 WARN usb.c: NRST is not connected
2021-03-22T19:22:48 INFO common.c: F1xx Medium-density: 20 KiB SRAM, 64 KiB flash in at least 1 KiB pages.
2021-03-22T19:22:48 WARN usb.c: NRST is not connected
2021-03-22T19:22:48 INFO common.c: Attempting to write 19328 (0x4b80) bytes to stm32 address: 134217728 (0x8000000)
2021-03-22T19:22:48 INFO common.c: Flash page at addr: 0x08000000 erased
...
2021-03-22T19:22:49 INFO common.c: Flash page at addr: 0x08004800 erased
2021-03-22T19:22:49 INFO common.c: Finished erasing 19 pages of 1024 (0x400) bytes
2021-03-22T19:22:49 INFO common.c: Starting Flash write for VL/F0/F3/F1_XL
2021-03-22T19:22:49 INFO flash_loader.c: Successfully loaded flash loader in sram
19/ 19 pages written
2021-03-22T19:22:50 INFO common.c: Starting verification of write complete
2021-03-22T19:22:50 INFO common.c: Flash written and verified! jolly good!
2021-03-22T19:22:50 WARN usb.c: NRST is not connected
anton@vivobook:~/stlink/build/Release/bin$ ./st-flash --reset --format ihex write ./STM32F103_Nucleo_Demo.hex
st-flash 1.6.1-229-gbc9062c-dirty
2021-03-22T19:22:51 WARN usb.c: NRST is not connected
2021-03-22T19:22:51 INFO common.c: F1xx Medium-density: 20 KiB SRAM, 64 KiB flash in at least 1 KiB pages.
2021-03-22T19:22:51 WARN usb.c: NRST is not connected
2021-03-22T19:22:51 INFO common.c: Attempting to write 19328 (0x4b80) bytes to stm32 address: 134217728 (0x8000000)
2021-03-22T19:22:51 INFO common.c: Flash page at addr: 0x08000000 erased
...
2021-03-22T19:22:52 INFO common.c: Flash page at addr: 0x08004800 erased
2021-03-22T19:22:52 INFO common.c: Finished erasing 19 pages of 1024 (0x400) bytes
2021-03-22T19:22:52 INFO common.c: Starting Flash write for VL/F0/F3/F1_XL
2021-03-22T19:22:52 INFO flash_loader.c: Successfully loaded flash loader in sram
19/ 19 pages written
2021-03-22T19:22:53 INFO common.c: Starting verification of write complete
2021-03-22T19:22:53 INFO common.c: Flash written and verified! jolly good!
2021-03-22T19:22:53 WARN usb.c: NRST is not connected The anton@vivobook:~/stlink/build/Release/bin$ ./st-flash --reset --format ihex write ./STM32F103_Nucleo_Demo.hex
st-flash 1.6.1-229-gbc9062c-dirty
2021-03-22T19:27:36 WARN usb.c: NRST is not connected
2021-03-22T19:27:36 INFO common.c: F1xx Medium-density: 20 KiB SRAM, 64 KiB flash in at least 1 KiB pages.
2021-03-22T19:27:36 WARN usb.c: NRST is not connected
2021-03-22T19:27:36 INFO common.c: Attempting to write 19328 (0x4b80) bytes to stm32 address: 134217728 (0x8000000)
2021-03-22T19:27:36 INFO common.c: Flash page at addr: 0x08000000 erased
...
2021-03-22T19:27:36 INFO common.c: Flash page at addr: 0x08004800 erased
2021-03-22T19:27:36 INFO common.c: Finished erasing 19 pages of 1024 (0x400) bytes
2021-03-22T19:27:36 INFO common.c: Starting Flash write for VL/F0/F3/F1_XL
2021-03-22T19:27:36 INFO flash_loader.c: Successfully loaded flash loader in sram
2021-03-22T19:27:36 ERROR flash_loader.c: Write error (R2 0x000001F8 R15 0x080049D2 DHCSR 0x00030003 DFSR 0x00000009)
2021-03-22T19:27:36 ERROR common.c: stlink_flash_loader_run(0x8000000) failed! == -1
stlink_fwrite_flash() == -1
anton@vivobook:~/stlink/build/Release/bin$ ./st-flash --reset --format ihex write ./STM32F103_Nucleo_Demo.hex
st-flash 1.6.1-229-gbc9062c-dirty
2021-03-22T19:27:38 WARN usb.c: NRST is not connected
2021-03-22T19:27:38 INFO common.c: F1xx Medium-density: 20 KiB SRAM, 64 KiB flash in at least 1 KiB pages.
2021-03-22T19:27:38 WARN usb.c: NRST is not connected
2021-03-22T19:27:38 INFO common.c: Attempting to write 19328 (0x4b80) bytes to stm32 address: 134217728 (0x8000000)
2021-03-22T19:27:38 INFO common.c: Flash page at addr: 0x08000000 erased
...
2021-03-22T19:27:38 INFO common.c: Flash page at addr: 0x08004800 erased
2021-03-22T19:27:38 INFO common.c: Finished erasing 19 pages of 1024 (0x400) bytes
2021-03-22T19:27:38 INFO common.c: Starting Flash write for VL/F0/F3/F1_XL
2021-03-22T19:27:38 INFO flash_loader.c: Successfully loaded flash loader in sram
19/ 19 pages written
2021-03-22T19:27:39 INFO common.c: Starting verification of write complete
2021-03-22T19:27:40 INFO common.c: Flash written and verified! jolly good!
2021-03-22T19:27:40 WARN usb.c: NRST is not connected |
@Ant-ON I can now reproduce after a clean uninstall. |
... so now it's about time to collect all related issues together, I guess. 🥇 🍾 |
Hello. I try to load firmare in STM32F103CBT6 using compiled st-flash.exe utility under windows 8.1.
There is used command:
st-flash.exe write ${project_name}.bin 0x08000000
Here is result:
What is the issue? Thank you)
The text was updated successfully, but these errors were encountered: