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?
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?
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.
Any updates on this?
If you are on linux just use the above script provided and then use the IntelHex tools to convert the created bin to hex. Tool set provides hex2bin and bin2hex.
FYI you could use the IntelHex tool to merge hex files as well with the hexmerge script.
pypi.python.org/.../2.0 (note python script)
Example: hexmerge.py applicationname.hex softdevice.hex -o outfile.hex
mergehex utility is now provided along with the nRF5x-Command-Line-Tools release for Windows, Linux, and OSX. www.nordicsemi.com/.../51392