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 Hung, Thank you for your help. The text file contains openssl key pair, base64 format. I used a hex converter to encode in hex (tomeko.net/.../base64.php). Then used the jlink loadbin command to load the file to an offset on the flash. After reading the file, looks to be okay, although endian converted and needs to be reverted back for authentication.

    I am using the openssl to authenticate my peripheral device when connecting to the central. I think it is not really designed for embedded applications. Looking at your comment, on a similar post here: devzone.nordicsemi.com/.../

    I am also not using device manager, and wondering if it would be possible to not use bonding and only write a key on flash (I am using pstorage) along with FW+BL+SD that on connection is read (with pstorage_load()?) and could be used to authenticate connection to a central device?

    Many thanks.

Reply
  • Hi Hung, Thank you for your help. The text file contains openssl key pair, base64 format. I used a hex converter to encode in hex (tomeko.net/.../base64.php). Then used the jlink loadbin command to load the file to an offset on the flash. After reading the file, looks to be okay, although endian converted and needs to be reverted back for authentication.

    I am using the openssl to authenticate my peripheral device when connecting to the central. I think it is not really designed for embedded applications. Looking at your comment, on a similar post here: devzone.nordicsemi.com/.../

    I am also not using device manager, and wondering if it would be possible to not use bonding and only write a key on flash (I am using pstorage) along with FW+BL+SD that on connection is read (with pstorage_load()?) and could be used to authenticate connection to a central device?

    Many thanks.

Children
No Data
Related