Cannot write file after commit 5dbb767
Open source flash program for STM32 using the ST serial bootloader
Brought to you by:
tormod
After commit 5dbb767 Do not erase more than file contents indicate I am unable to write file to the memory with error Failed to write memory at address 0x00000000
On commit e69b2a6 Assume STM32L1xxxD and STM32L0x1 have no mass-erase command everything works fine.
In the attachment you can see me cloning the repository, compiling stm32flash and resetting commits back until it starts working. I did it on Manjaro Linux with USB to TTL adapter, however, on Raspberry PI 4 with built-in GPIO the same problem occurs.
Tested on STM32G03 and STM32G07, both devices behave the same way.
Anonymous
Thanks for the report! What is the exact size of your output.bin file?
OK, I see where this was going wrong. I had only been testing with a -S start address. Without a start address (but getting the length from the file) it was taking start address = 0.
As a quick fix I will limit the "Do not erase more than file contents indicate" feature to the case where a start address has been given.Last edit: Tormod Volden 2021-02-01
I changed it to pick flash start as start address unless a start address was given by the user (commit 90e570c). Testing is very much welcome.
Hi, thanks for responding so quickly.
I played a bit with the new version on my devices. Everything seems to work flawlessly under Windows, Manjaro and Raspbian with and without -S parameter.
Best regards.
Thanks a lot for all the testing!
One thing that has changed is when not using the -S option and writing to flash, previously the whole flash was erased with mass erase, now it only erases what is needed from the file size, but if the file size equals flash size, there will be a mass erase (when supported) like before. I believe this is an improvement.