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

Any sample for embedding binary or text file to be available as variable in the code?

ESP32 has this in the build system, I was wondering if there is any sample in nrf52 This helps in embedding private key/ certificates easily.

Parents
  • Hi 

    Would it be possible to use something like this to convert the binary file to a C array?

    Then you can easily reference the data from the code. 

    The tool I linked to above will make the array const, which ensures it is put in flash and not in RAM. 

    Another method is to convert the binary to a hex file, and have Segger Embedded Studio load the hex file when you flash the code. 

    Best regards
    Torbjørn

  • Hi Torbjorn,

    I have a similar inquiry so I thought I could reply in here.

    My use case is that I have several identical custom nRF boards that must be configured differently (i.e. internal device id, etc.). Currently, the values are hardcoded so I end up with multiple firmware. How could I implement it in a hex file that could be loaded via SES and have my firmware locate it and extract the values?

    I looked at the FDS implementation and it looked like it is just what I needed but I can't get my head around how could I create the hex file that the FDS could understand and at what address I should load it.

    If you could point me to the examples that I could use as guide, it would be much appreciated.

    Best regards,

    Carlos

Reply
  • Hi Torbjorn,

    I have a similar inquiry so I thought I could reply in here.

    My use case is that I have several identical custom nRF boards that must be configured differently (i.e. internal device id, etc.). Currently, the values are hardcoded so I end up with multiple firmware. How could I implement it in a hex file that could be loaded via SES and have my firmware locate it and extract the values?

    I looked at the FDS implementation and it looked like it is just what I needed but I can't get my head around how could I create the hex file that the FDS could understand and at what address I should load it.

    If you could point me to the examples that I could use as guide, it would be much appreciated.

    Best regards,

    Carlos

Children
Related