cancel
Showing results for 
Search instead for 
Did you mean: 

programming a cortex-m0+ (STM32L073RB) device with a hex-file that uses not the whole memory or has leaks leads to wrong initial byte in flash memory of device

BNest.1
Associate

Hi everybody,

I use the STM32CubeProgrammer version 2.3.0

Following issue occurs during programming of a hex-file:

1.) do a mass-erase or a clear of all sectors of the device

2.) read out some bytes (for example the first sector)

3.) the device-memory tab shows "00" for every byte (and the whole flash)

4.) load a hex-file which has wholes or gaps in the addresses

For example like this:

:020000040800F2
:10000000005000208909000819050008190500089A
:180028000000000019050008000000000000000019050008190500084E

5.) The new hex-file tab shows that the gap from address 0x0800 0010 till 0x0800 0028 will be filled with 0xFF and not with the processor specific "unused/unprogrammed byte" which has to be 0x00.

6.) programming the device and read out the first 40 bytes leads to this screen

0693W000000WYiQQAW.png

The gaps from the hex-file are actually filled with 0xFF which is wrong from my point of view.

The old STVP don't fill the address gaps with the wrong initial byte. It fills the gaps with the correct device depending initial flash byte value.

You can see this by loading for example an STM32L0-device, where the initial state of all flash bytes should be 00 or by loading a STM32F0-device, where all bytes have to be 0xFF in the initial state.

STM32L0-device empty

0693W000000WYh8QAG.png

STM32L0-device with loaded hex-snippet

0693W000000WYhNQAW.png

STM32F0-device empty

0693W000000WYh3QAG.png

STM32F0-device with loaded hex-snippet

0693W000000WYgFQAW.png

1 ACCEPTED SOLUTION

Accepted Solutions
Houda GHABRI
ST Employee

Hi @BNest.1​ ,

Issue is reproduced at my end .

Thanks for rising this issue it will be fixed in next CubeProgrammer release.

regards,

Houda

View solution in original post

4 REPLIES 4
Uwe Bonnes
Principal II

Probably the St programmer uses 0xff as default and does not notice that some devices use 0 as default.

Yes thats the case! Currently I use te ST Link V3 and use the CLI of STM32CubeProgrammer to programm my devices. But with that issue I cannot use it anymore.

Fill the gaps, then, explicitly (e.g. using srecord), as a post-compilation step, before moving to the programming.

JW

Houda GHABRI
ST Employee

Hi @BNest.1​ ,

Issue is reproduced at my end .

Thanks for rising this issue it will be fixed in next CubeProgrammer release.

regards,

Houda