I'm revamping an old project at work and had some questions on how the previous person built this project. This is uVision 5 project. MDK-Arm. STM32
Basically there is a bootloader with several apps. Each app is built to run in SRAM and depending on some initial conditions, it decides which app to load and run. It does appear all apps are flashed on the initial board separately. They each have their own binary file. But in the bootloader I found a .s file which has the following:
;Bin Size 4kb
AREA |.ARM.__AT_0x00008000|, CODE, READONLY
INCBIN BIN\app1.bin
;Bin Size 64kb
AREA |.ARM.__AT_0x00009000|, CODE, READONLY
INCBIN BIN\app2.bin
;Bin Size 192kb
AREA |.ARM.__AT_0x00019000|, CODE, READONLY
INCBIN BIN\app3.bin
END
Doing some research I thought maybe this meant the binaries were included in the final output of the bootloader. Set at the address indicated. This doesn't actually appear to be the case, in fact if I compile the bootloader without it the hex is built to load to 0x00000000 and if I add this in the hex is compiled to load to 0x8000 (the first address for app1 above). Which also seems wrong because I did not update the scatter file.
Just trying to understand what they were trying to do with the .s file. Since each binary appears to be loaded one by one during manufacturing.
I'm guessing I can use fromelf to get binaries and then use some method to concatenate the files and pad them appropriately to the right addresses (dd, srec_cat, a script I write, whatever gets the job done)
User contributions licensed under CC BY-SA 3.0