stlink: STM32L422CB: st-flash fails to flash ihex image
Trying to flash a small hex file to a STM32L422CB. The hex file is fine, flashes successfully with st-link utility. st-flash erases the first 2kb page of flash successfully, but doesnt write the the hex file at all.
- Programmer/board type: STLink V2
- Programmer firmware version: V2.J34.S7
- Operating system and version: Windows 10
- Stlink commandline tool name: st-flash v.1.6.0
- Target chip (and board if applicable): STM32L422CB
Futher we kindly ask you to describe the detected problem as detailed as possible and to add debug output if available, by using the following template:
Commandline-Output:
PS C:\Users\xxx\Documents\Code\Test> st-flash --format ihex write ./build/test.hex
st-flash 1.6.0
2020-04-12T18:28:57 INFO common.c: Loading device parameters....
2020-04-12T18:28:57 INFO common.c: Device connected is: L41x device, id 0x10006464
2020-04-12T18:28:57 INFO common.c: SRAM size: 0xa000 bytes (40 KiB), Flash: 0x20000 bytes (128 KiB) in pages of 2048 bytes
2020-04-12T18:28:57 INFO common.c: Attempting to write 592 (0x250) bytes to stm32 address: 134217728 (0x8000000)
Flash page at addr: 0x08000000 erased
2020-04-12T18:28:57 INFO common.c: Finished erasing 1 pages of 2048 (0x800) bytes
2020-04-12T18:28:57 INFO common.c: Starting Flash write for F2/F4/L4
2020-04-12T18:28:57 INFO flash_loader.c: Successfully loaded flash loader in sram
enabling 32-bit flash writes
size: 592
2020-04-12T18:28:57 INFO common.c: Starting verification of write complete
2020-04-12T18:28:57 ERROR common.c: Verification of flash failed at offset: 0
stlink_fwrite_flash() == -1
PS C:\Users\xxx\Documents\Code\Test>
Expected/description:
Should flash the hex file without errors
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Reactions: 1
- Comments: 15 (5 by maintainers)
Now we are looking for a skilled developer who his somehow familiar with the L4 series to have the chance for a fix.
I kind of forgot about this. st-flash fails to erase and flash the provided hex file. I tried multiple files of different sizes, doesn’t work with any of them. Note that flashing those with the official ST-Link Utility works perfectly fine. I have attached a log of the st-flash output and the values of the general purpose registers and STM32_FLASH_SR, both, before and after the flash attempt. log.txt