2021-06-16 01:11 AM
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
2021-06-16 06:16 AM
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
2021-06-16 06:42 AM
Thank you.
In my obj file I found only one .hex file. I didn't find the second one
2021-06-17 12:36 AM
You provide not enough information, You have two proojects for boot and app? or...
2021-06-17 12:46 AM
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?
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
2021-06-17 01:00 AM
srecord, or simple google "merging two hex files". thare are many solutions. bin files, can be added in linker script.
2021-06-17 01:16 AM
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?
2021-06-17 01:27 AM
@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?
2021-06-17 01:37 AM
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,
2021-06-17 02:54 AM
@Rados?aw But then your bootloader needs to be inside the same project than your App right?