cancel
Showing results for 
Search instead for 
Did you mean: 

Creating .hex file from two banks memory of STM32H753

FBern.2
Associate II

Hello,

I have a problem with my .HEX file generated with KEIL 5.

In STM32H753 there are two banks memory:

FIRST BANK MEMORY : 0x08000000-0x080FFFFF

SECOND BANK MEMORY : 0x08100000-0x081FFFFF

My project has this structure:

0x08000000-0x08060000=> My own Boot

0x08060000-0x081FFFFF => My own app

When I obtain .bin file of my project (it was been converted from .hex file) the file is always 1 Mb and it contains the code of FIRST BANK MEMORY.

How can I obtain both .hex file? from first and second bank memory?

thank you.

best regards.

Fabio

22 REPLIES 22
TDK
Guru

HEX files are plaintext. You should be able to get there by copying the second file into the end of the first file, after removing the EOF line.

https://en.wikipedia.org/wiki/Intel_HEX

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

Thank you.

In my obj file I found only one .hex file. I didn't find the second one

Radosław
Senior II

You provide not enough information, You have two proojects for boot and app? or...

Javier1
Principal

I have a similar problem myself, but i have my bootloader in a sepparate project, each project has a sepparate build and each outputs a sepparate .bin.

My issue is ¿how do i flash them at the same time?

0693W00000BbDsJQAV.png 

So the problem i face is :

the first memory file containing the bootloader.bin is not zeropadded untill filling its max size(defined in the linker script), so appending both files wont work because the second .bin wont be starting where i would want which is exactly 0x100000 bytes from the start of the file.(SECOND BANK MEMORY : 0x08100000-0x081FFFFF)

I dont have an elegant answer yet, what im doing for now is flashing both memory banks one at a time in the chip, after that i open cubeProgrammer and download the full flash content to my PC, this way i get an "image" of the chip with the bootloader and the app in its corresponding memory places.

This "image" is what goes to production

we dont need to firmware by ourselves, lets talk
Radosław
Senior II

srecord, or simple google "merging two hex files". thare are many solutions. bin files, can be added in linker script.

yes. one project for boot and one project for app.

Boot is only in FIRST BANK and App is bigger than BOOT and you can find it one piece in FIRST BANK and another piece in SECOND BANK.

I can't find .hex file of second bank. I find only one .hex file (FIRST BANK). Where is the second .hex file?

@Rados?aw​ This is interesting,

> can be added in linker script.

You mean there is a way the linker script can flash two sepparate binaries in its corresponding positions?

we dont need to firmware by ourselves, lets talk
Radosław
Senior II

in aplication project for example in linker script you can add bootlader bin files, and then you will have ONLY ONE ELF HEX BIN , for production purposes,

@Rados?aw​  But then your bootloader needs to be inside the same project than your App right?

we dont need to firmware by ourselves, lets talk