cancel
Showing results for 
Search instead for 
Did you mean: 

How reconcile the address field within a SREC file?

PSPF
Associate II

Hi All,

The STM32CubeIDE can produce a SREC file.

I am trying to decode the Address field within the file.

It should be 32 bit bigendian, however, it is 24 bit of an unknown endian style.

Can someone please explain the endian style used?

STM32CubeIDE Version: 1.3.1

Build: 6291_20200406_0752 (UTC)

Thanking you

PSPF

PS: I have been using SREC files for a long time. This is my first experience with ST' SREC.

3 REPLIES 3

CubeIDE uses the GNU binutils for code generation, so you might want to go to the binutils' documentation (namely, objcopy's) to find out the details.

I don't use the Motorola S-record, but according to Wikipedia, there is a 24-bit (3-byte) address format, too.

JW

Show small example

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
PSPF
Associate II

Thank you for your replies.

This is a snippet from the srec file :-

S210008000F8B500BFF8BC08BC9E467047F0

S21400800C08B5074B044613B10021AFF30080054BAF

S21400801C1868836A03B19847204600F0EBFC00BF53

.....

S21400812C4FF4E132984B994D5A60994A18461A60AA

S21400813C0C22C3E902441F759C611A6100F052FFC1

S21400814C2022214618A802F0A7F94FF0804317A961

S21400815C28462B60C5E90144C5E90344AC6110947C

.....

S214008FFC03F0FF02002B61D02422236884F835206E

S21400900CD968A26821F40051D9601969E06821F486

S21400901C40511961D968024321F4B05121F00C017A

From the STM32L100 datasheet, the flash starts at 0800:0000 aliased at 0000:0000.

The lowest address in the SREC is at 00:8000 (24bit). The data here does not appear to be the Vector Table.

Is there some byte swapping? Or offset? Or something else?

Thanking you

PSPF