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

[nRF51822] How to merge software device and application code to one hex file

Hi sir In order to simplify the flow of programming hex file to nRF51, we want to merge Softdevice hex file with application hex file. Then, generate a new hex file. Could "mergehex" tool make it? If yes, please make a instance how to work it. Thanks.

Parents
  • There is a tool called mergehex in the C:\Program Files (x86)\Nordic Semiconductor\nrf51\bin folder that can do this. Its syntax can be seen in its built-in help-function:

    
    C:\Program Files (x86)\Nordic Semiconductor\nrf51\bin>mergehex --help
    
    Usage:
    -------------------------------------------------------------------------------
    
     -h  --help                  Prints this help.
    
     -q  --quiet                 Reduces the stdout text info. Must be combined
                                 with another command.
    
     -v  --version               Prints the version of this utility.
    
     -m  --merge <hex_file_1> <hex_file_2>  Hex files to be merged.
    
     -o  --output <hex_file>                Hex file result of the merge.
    
    -------------------------------------------------------------------------------
    
    This small application is used to merge two hex files.
    Example use: mergehex.hex -m hex_file_1.hex hex_file_2.hex -o output_file.hex
    
    
  • How you flash the softdevice and application doesn't affect the run-time protection in any way, so I'm not quite sure I understand what you mean.

    All the RAM protection is set up at run-time, so even if the softdevice and application were programmed combined, this will still work as it's supposed to.

    Beware that the mergehex doesn't do any magic, the application is still located in code region 1 and the softdevice in code region 0, it just combines the hex files. Everything that mergehex does can be easily done with Python and IntelHex if you want to. Let me know if anything is still unclear.

Reply
  • How you flash the softdevice and application doesn't affect the run-time protection in any way, so I'm not quite sure I understand what you mean.

    All the RAM protection is set up at run-time, so even if the softdevice and application were programmed combined, this will still work as it's supposed to.

    Beware that the mergehex doesn't do any magic, the application is still located in code region 1 and the softdevice in code region 0, it just combines the hex files. Everything that mergehex does can be easily done with Python and IntelHex if you want to. Let me know if anything is still unclear.

Children
No Data
Related