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

preparing a hex file to program in flash

Hello, I am using nrf52832 board, with SDK 11.0.0 and s132_nrf52_2.0.0. and trying to program a 512 Bytes text file using nrfjprog (J-Link: JLinkExe) in flash. The nrfjprog tool only allows a 4 Byte value write at a time to a an offset so I am trying to use the J-link loadfile command. I think I need to convert my 512 B text file to an Intel hex format and then use the mergehex to merge the file with softdevice and application hex files. However, I can't find clear instructions on how to convert my text file to hex as well as addresses to change before merging the 3 hex files. Would I need to manually create "records" for the Intel hex file? I am using Linux for development. Please advise on instructions to create the hex file, and tools to flash. Thanks.

Parents
  • Hi Sal, Thanks for the link, good to know the tool.

    If you have control on both side of the link (central + peripheral) you can hardcode the long term key (LTK) and re-use it when they connect. Just like what happens here on the central and here on the peripheral.

    However, this way of using hardcoded key is not very safe. Anyone who has physical access to your device can try to read the key (even if you block them from accessing the debug port, it's possible to physically manipulate the chip and read the flash directly) or if you do DFU, they can read the DFU package that includes the key.

Reply
  • Hi Sal, Thanks for the link, good to know the tool.

    If you have control on both side of the link (central + peripheral) you can hardcode the long term key (LTK) and re-use it when they connect. Just like what happens here on the central and here on the peripheral.

    However, this way of using hardcoded key is not very safe. Anyone who has physical access to your device can try to read the key (even if you block them from accessing the debug port, it's possible to physically manipulate the chip and read the flash directly) or if you do DFU, they can read the DFU package that includes the key.

Children
No Data
Related