2023-01-26 07:43 AM
Hello Everyone,
Here is my 512kB STM32L15xxE:
-------------------------------------------------------------------
STM32CubeProgrammer v2.12.0
-------------------------------------------------------------------
USB speed : Full Speed (12MBit/s)
Manuf. ID : STMicroelectronics
Product ID : STM32
SN : 8D8D90395A58
DFU protocol: 1.1
Board : --
Device ID : 0x0437
Device name : STM32L15xxE/STM32L162xE
Flash size : 512 KBytes (default)
Device type : MCU
Revision ID : --
Device CPU : Cortex-M3
When I'm executing:
STM32_Programmer_CLI.exe -c port=usb1 myHex.hex
I get the following:
Error: Operation exceeds memory limits
Looking like that:
So apparently it fails after 256k, which is half of the 512k Flash it has...
The Hex-File also contains some EEPROM-Section (starting @ 0x0808 0000)
And some RAM-Section (starting @ 0x2000 0000)
===================================
When I take the same Hex-file, and convert it with DFU-File-Manager, and then flash it via DFuse, it just works, as it should...
DfuSeCommand.exe -c -d --o --fn RESET_VERSION_IN_EEPROM_TO_0.0.0.dfu
Any idea what's breaking CubeProgrammer?
Thank you!
Solved! Go to Solution.
2023-02-09 08:39 AM
Hello @THein.3,
I don't think this is related to the erase of flash sectors after 0x08040000 (to confirm this, you can use "Erasing and programming -> Erase flash memory" then, select some sectors after 1024 to see if the erase works).
The fail seems to come from the fact that the bootloader interface doesn't support the erase on EEPROM (AN2606 page 41). Since you said that your hex file contains EEPROM data, that might be the reason behind the issue.
A workaround for this would be to perform a full chip erase (EEPROM is not included by default), than to skip the erase before programming :
>STM32_Programmer_CLI -c port=USB1 -e all
>STM32_Programmer_CLI -c port=USB1 -d myHex.hex --skipErase
DFuse tool is working because of the fact that it's skipping the erase by default. However I agree with you on the point that CubeProgrammer should be handling this better. An improvement have been requested internally.
Internal ticket number: 145189 (This is an internal tracking number and is not accessible or usable by customers).
Let me know if you find this helpful.
Thanks,
Aziz
2023-01-30 01:09 AM
GUI shows the same behavior... (guess that's a good thing :tired_face: )
2023-01-30 01:10 AM
Notice, how the tool itself shows MCU has 512k, but crashes at 256k...
2023-02-09 08:39 AM
Hello @THein.3,
I don't think this is related to the erase of flash sectors after 0x08040000 (to confirm this, you can use "Erasing and programming -> Erase flash memory" then, select some sectors after 1024 to see if the erase works).
The fail seems to come from the fact that the bootloader interface doesn't support the erase on EEPROM (AN2606 page 41). Since you said that your hex file contains EEPROM data, that might be the reason behind the issue.
A workaround for this would be to perform a full chip erase (EEPROM is not included by default), than to skip the erase before programming :
>STM32_Programmer_CLI -c port=USB1 -e all
>STM32_Programmer_CLI -c port=USB1 -d myHex.hex --skipErase
DFuse tool is working because of the fact that it's skipping the erase by default. However I agree with you on the point that CubeProgrammer should be handling this better. An improvement have been requested internally.
Internal ticket number: 145189 (This is an internal tracking number and is not accessible or usable by customers).
Let me know if you find this helpful.
Thanks,
Aziz