This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

mergehex linux

Hey, I don't find a solution to "mergehex" the softdevice with my application in linux. Is there any way to do this in Linux?

Parents
  • The reason you don't need a utility is that standard Linux tools+ scripting do this sort of thing very well.

    Try something like:

    #! /bin/sh
    #
    # Combines the Nordic s120 stack and app hex files and generate a
    # combined binary.
    # Stack at 0k, app at 96k
    set -e -x
    
    STACK_HEX=s120.hex
    STACK_BIN=s120.bin
    APP_HEX=app.hex
    APP_BIN=app.bin
    COMBINED_BIN=app.bin
    objcopy -O binary -I ihex $STACK_HEX $STACK_BIN
    objcopy -O binary -I ihex $APP_HEX $APP_BIN
    dd if=/dev/zero ibs=1024 count=128 | tr "\000" "\377" > $COMBINED_BIN
    dd if=$STACK_BIN of=$COMBINED_BIN  bs=1024 seek=0 conv=notrunc
    dd if=$APP_BIN of=$COMBINED_BIN bs=1024 seek=96 conv=notrunc
    
  • I also need help in this issue. I use RedBear nRF51822 and I want to be able to merge s110 hex file & app hex file to get an hex output file. In your solution it creates a combined bin file. Tried modifing it to output hex file with no luck.

    Any help will be appriciated.

Reply Children
No Data
Related