2024-01-17 02:30 AM
Hello,
i use STM32CubeProgrammer for flashing devices with .hex files, but after the update from version v2.11.0 to latest v2.15.0 the downloading doesn't work (it also doesn't work with 2.14.0). The .bin download works fine in both versions.
The MCU that I use is STM32G483.
The message from log is:
12:02:17:022 : erasing sector 0027 @: 0x0800d800 done
12:02:17:022 : sending a page erase request @: 0x0800e000
12:02:17:039 : erasing sector 0028 @: 0x0800e000 done
12:02:17:039 : erase: 0675ms
12:02:17:039 : Erasing Segment <1> Address <0x0801DFE0> Size <2>Bytes
12:02:17:039 : Erasing memory corresponding to segment 1:
12:02:17:039 : Error: Sector size: 0x00000002 Bytes is out of range
12:02:17:070 : Error: failed to erase memory
The problem is with two last bytes in the hex file (these bytes store the firmware version). If they are at the end of the memory (and a different flash sector than previous bytes) the downloading fails in new version of Programmer.
If the bytes are immediately after flash region (and in the same flash sector) it works in new version of Programmer.
My question is if this is a problem with new version of CubeProgrammer or if there is mistake in my code and old CubeProgrammer ignore it.
There is also my memory definition from linker script for .hex that doesn't work with new programmer:
MEMORY
{
RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 128K
FLASH (rx) : ORIGIN = 0x8000000, LENGTH = 128K - 8K - 16
VERSION (r) : ORIGIN = 0x0801dfe0, LENGTH = 16 /* Reserved section for firmware version */
ROM (rwx) : ORIGIN = 0x0801e000, LENGTH = 8K /* Reserved for eeprom emulation */
}
Thanks
Solved! Go to Solution.
2024-03-28 01:09 AM
The issue has been resolved in Cube Programmer version 2.16.0. The download works correctly now.
Petr
2024-01-22 12:44 AM
@KDJEM.1 @Semer CHERNI or some other ST employee, can you please look into that? We think this might be a bug in the programmer, as in the older version loading worked correctly, whereas now it does not.
To reiterate, the problem is that when there are non-zero bytes at the end of the binary, and those are the only bytes in the last sector, programmer does not write the binary correctly.
2024-01-26 04:03 AM
Hello PKola.1,
Could you please share the hex file you're testing as well as a verbosity 3 log file in the failing case.
Thanks in advance,
Aziz
2024-01-26 04:14 AM
Need to write more than 2-bytes, depending on the ST model multiples 4 or 8-bytes need to be written at similarly aligned addresses.
2024-01-26 06:48 AM
Writing 4 or 8 bytes did not help. And shouldn't the programmer handle this correctly?
2024-01-26 07:01 AM
Hello,
here it is hex https://pastebin.com/7PaxMaZT
Thanks,
Petr
PS must send the hex through pastebin because:
2024-01-26 07:36 AM
Hello @PKola.1
For some reason I'm not able to open the link you sent, could you try zipping the file and attaching it ?
Or just change the extension to ".txt".
Thanks,
Aziz
2024-01-29 12:11 AM
Hello, @Aziz BRIGUI
the zipping also doesn't work so I am sending you as .txt file.
Thanks,
Petr
2024-03-18 04:01 AM
Hello, @Aziz BRIGUI
do you have any updates on this?
Thanks,
Petr
2024-03-28 01:09 AM
The issue has been resolved in Cube Programmer version 2.16.0. The download works correctly now.
Petr