cancel
Showing results for 
Search instead for 
Did you mean: 

Storing hex file in particular address of flash memory

umesh_patil
Associate II

Hello, I want to store a hex file in the particular address of flash memory . I am using the stm32L083cz which has 192 kb flash memory.

Flash starts at : 0x0800 0000

Want to store hex file at the address : 0x0801 50001

Please guide me through this. I am developing over the air firmware upgrade application for this microcontroller.

Thank you In advance.

9 REPLIES 9
TDK
Guru

Are you trying to build a firmware file that has the file at that location? Or are you trying to write to that location within your program?

If you feel a post has answered your question, please click "Accept as Solution".

It is just data, put it where ever you want.

The .HEX file encoding isn't that efficient, you might want to unpack it or use binary.

The Intel HEX format has several decades of usage, should be some material you can reference, or copy

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

At first I wanted to store the hex file at the particular address location. so I can afterwards copies it to the start of flash so I can run the hex file.

ilyaz yilmaz
Associate III

There is a simple project for starting you can use this.

https://github.com/niekiran/BootloaderProjectSTM32

So I have to change the hex file into binary and then store into the location ?

Is it right?

It is just data (collection of bytes), you can just store, it or process it, your call.

Perhaps if you're unfamiliar, you could write some PC side software, using basic File IO and process and digest the data until you are comfortable with managing it and manipulating it, and then migrate the working understanding into your embedded platform.

Once you've staged the data in the holding location (0x08015000) you can move it elsewhere to replace the code at 0x08000000

.HEX files will typically be about 2.5x larger than the binary data they are describing. So inefficient to transmit over the network, and to stage on the device.

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

Thank you. I will try this

Thank you.I am looking at it