‎2022-02-15 05:07 AM
I currently implement my booloader (bases on the OpenBootloader) and test it against the STM32CubeProgrammer. I use v2.9.0 on Linux. Unfortunately when erasing sectors it does not send the expected command sequences. The behaviour is identical on CLI and GUI.
Two examples:
I want to erase sectors 15 to 18
Command line: ./STM32_Programmer.sh -c port=/dev/ttyUSB1 br=19200 -vb 3 -e 15 16 17 18
Output:
[...]
data sent successfully to target:
0002000f001000110c
[...]
Sector 18 is missing in the list
Even worse, only wanting to erase one single sector
Command line: ./STM32_Programmer.sh -c port=/dev/ttyUSB1 br=19200 -vb 3 -e 42
Output:
[...]
data sent successfully to target: 0xffff00
[...]
0xffff is a full chip erase?!
Can someone tell me whats going wrong there? Do I miss something?
Addendum:
These errors only occur when conencted to the Bootloader with UART. With a direct swd connection everything works perfectly
Solved! Go to Solution.
‎2022-03-02 04:44 AM
Hi @FBran.2 ,
I confirm the mass erase is not well managed when connecting via UART.
This issue is already detected and fixed in next CubeProgrammer release which it will be published soon.
If it is an urgent matter I can send you a patch in private message but please note that it is not an official release .
Internal ticket number 120709 : (PS: This is an internal tracking number and is not accessible or usable by customers).
Hope this helps you.
Houda
‎2022-02-15 10:54 AM
Does the [start end] syntax work? Does it work if you add commas as in the example usage?
-e, --erase : Erase memory pages/sectors devices:
Not supported for STM32MP
[all] : Erase all sectors
[<sectorsCodes>] : Erase the specified sectors identified by sectors
codes. ex: 0, 1, 2 to erase sectors 0, 1 and 2
for EEPROM : ed1 & ed2
[<[start end]>] : Erase the specified sectors starting from
start code to end code, ex: -e [5 10]
‎2022-02-15 11:30 PM
Thanks for the answer. When using commas I get a error from the Programmer:
Error: The erase command you trying to perform is missing some arguments. Please refer to the Help to see how to use it.
When using [42 45] the behaviour is identical, sector 45 is missing in the command sequence send to the STM.
When using the GUI the last checked sector is also missing. When checking just one sector and click on 'sector erase', the command for mass erase is send to the STM
‎2022-02-16 08:16 AM
It looks like the tool flat out doesn't work for what you want. Unfortunate. Seems like a parsing bug that they clearly never tested.
Unfortunately, it seems like using less commonly used features with ST tools is prone to issues across a number of different products.
‎2022-02-22 05:56 AM
Damn, we ran into the same issue. Wanted to use STM32 cube programmer in CLI mode to erase/update single sectors.
SWD ist fine, but UART is not.
Hopefully this gets fixed soon!
Cheers M.
‎2022-02-22 06:33 AM
Yeah, but increasingly buggy tools are the spice of life, right? Oh, wait... :tired_face:
‎2022-03-02 04:44 AM
Hi @FBran.2 ,
I confirm the mass erase is not well managed when connecting via UART.
This issue is already detected and fixed in next CubeProgrammer release which it will be published soon.
If it is an urgent matter I can send you a patch in private message but please note that it is not an official release .
Internal ticket number 120709 : (PS: This is an internal tracking number and is not accessible or usable by customers).
Hope this helps you.
Houda
‎2022-03-03 03:57 AM
Thanks for the reply. It is not really urgent, in the current dev stage we can live with our workarounds and will then test the new CubeProgrammer as soon as it is released.
‎2022-03-07 05:59 AM
Hi @FBran.2​ ,
STM32CubeProgrammer 2.10.0 is released , you can download it from st.com and check again.
Houda
‎2022-03-07 11:42 PM
Hello Houda
I can confirm the bug is fixed in the new version and erase and mass erase is send to the device as expected
Thank you!