cancel
Showing results for 
Search instead for 
Did you mean: 

ST-Link utility doesn't program a byte at the end of memory

kekon1234
Associate III
Posted on July 03, 2012 at 09:55

I've just purchased ST-Link/2 programmer and installed ST-Link Utility v.2.3.0.

I load intel hex file which contains 0x55, 0xAA at adressess 0x0800FFFE and 0x0800FFFF respectively. The device is STM32F103C8T6.  However, after programming only 0x55 byte is programmed. Instead of 0xAA byte the flash memory contains 0xFF. Addictionally, in the main window of ST-Link utility i can't see a byte value at address 0x0800FFFF.

 Why is that ???
4 REPLIES 4
Posted on July 03, 2012 at 12:54

Why is that ???

 

Probably a bug, it wouldn't be the first time someone has broken an Intel HEX loader implementation, or not handled the 64K segment limit properly.

Can you paste in the last few lines of the hex file?

The ST Link Utility might be assuming the size if 0xFFFF and not 0x10000, or mixed a greater than with a greater or equal than test.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
kekon1234
Associate III
Posted on July 03, 2012 at 15:06

The byte that is not programmed is shown in red:

:10FFDC00726500000000000000000000000000013D

:10FFEC002B01030707DC0A190B640022FF00000039

:01FFFC000004

:02FFFE0055

AA

02

:0400000508001DE8EA

:00000001FF

marouanbm
Associate II
Posted on July 04, 2012 at 11:25

Hi, 

I think this is due to segment start address (0xFFFE) which is not 4-byte aligned.

Try the following file it should works:

:020000040800F2

:10FFDC00726500000000000000000000000000013D

:10FFEC002B01030707DC0A190B640022FF00000039

:04FFFC00000055AA02

:0400000508001DE8EA

:00000001FF

It has the same contents as your file but with 4-byte aligned address.

To be able to program this file on flash memory you should add the flash address :

:020000040800F2

kekon1234
Associate III
Posted on July 05, 2012 at 13:38

Now it works, thanks :)

Anyway, in my opinion the ST Link Utility should load Intel Hex file correctly regardless of the byte alignment used in the file.