cancel
Showing results for 
Search instead for 
Did you mean: 

how to merge bootloader and application bin

predd.21
Associate II

hello ST users,

 

i was trying to merge bootloader bin file and application bin file any possible solutions please help me .

6 REPLIES 6

Could you use C file functions? fopen, fread, fwrite, fclose ?

COPY  /b  a.bin+b.bin  c.bin

Most situations you actually want to convey meta-data like address and size, sort of thing an OBJECT FILE would do?

See also .DFU for a standardized/documented format for encapsulating binary data.

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

Use Srecord, or .....

 

In linker script of your aplication :

Create proper memory region for BOOTLOADER

and....

TARGET(binary)

INPUT(bootloader.bin)

OUTPUT_FORMAT(default)

TARGET(default)


SECTIONS

{

    .bootloader :

    {

       bootloader.bin (.data)

       . = ALIGN (0x4);

    } > BOOTROM

 

MM..1
Chief II

Explain for what, why not two hex merge?

i have modified in the linker script of applicationi have modified in the linker script of applicationin application adding linker pathin application adding linker pathplepplerrorerror

PLEASE CHECK THIS ERROR

make -j8 all

arm-none-eabi-gcc -o "appl.elf" @"objects.list" -Wl,--start-group -Wl,--end-group -mcpu=cortex-m0plus -T"C:\Users\91910\STM32CubeIDE\workspace_1.14.1\appl\STM32G0B1CBTX_FLASH.ld" --specs=nosys.specs -Wl,-Map="appl.map" -Wl,--cref -static --specs=nano.specs -mfloat-abi=soft -mthumb -Wl,--start-group -lc -lm -Wl,--end-group

C:/ST/STM32CubeIDE_1.14.1/STM32CubeIDE/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.11.3.rel1.win32_1.1.100.202309141235/tools/bin/../lib/gcc/arm-none-eabi/11.3.1/../../../../arm-none-eabi/bin/ld.exe:C:\Users\91910\STM32CubeIDE\workspace_1.14.1\appl\STM32G0B1CBTX_FLASH.ld:78: ignoring invalid character `\342' in script

C:/ST/STM32CubeIDE_1.14.1/STM32CubeIDE/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.11.3.rel1.win32_1.1.100.202309141235/tools/bin/../lib/gcc/arm-none-eabi/11.3.1/../../../../arm-none-eabi/bin/ld.exe:C:\Users\91910\STM32CubeIDE\workspace_1.14.1\appl\STM32G0B1CBTX_FLASH.ld:78: ignoring invalid character `\200' in script

C:/ST/STM32CubeIDE_1.14.1/STM32CubeIDE/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.11.3.rel1.win32_1.1.100.202309141235/tools/bin/../lib/gcc/arm-none-eabi/11.3.1/../../../../arm-none-eabi/bin/ld.exe:C:\Users\91910\STM32CubeIDE\workspace_1.14.1\appl\STM32G0B1CBTX_FLASH.ld:78: ignoring invalid character `\215' in script

Radosław
Senior II

Some wrong character,   format correcly added lines in linker script, (maybe some unprintable sign was added)