This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

How to store a .fw image in internal flash in NCS

We need to store a .fw firmware (or any binary/hex) image for an external device hanging off the nRF52833 in internal flash.

What is the best way to integrate the image into the nRF application image?  

Is there an example someone can point me to that I am not seeing?

  • From where do you want to transfer the image?

    1. From a computer
    2. From the nRF52832
    3. Other

    How do you want to transfer the image?

    1. Through J-Link (Not possible for deployed product)
    2. Through BLE
    3. Through UART
    4. Other

    I guess you want to transfer it from a computer over UART. In that case I guess you could use the mcumgr protocol, where there exists solutions already for transferring an image. Let me know the details and I will provide some more information on how to go about it.

    Best regards,

    Simon

  • Sorry, I wasn't very clear.  This is an image that the nRF52 will store in its internal flash.  When the nRF52 starts, it will send that image to another device on the board via I2C.  The image would be an header (*.h) file in the format like:

    const unsigned char firmware_image[] = {
    0x2b, 0x66, 0x0, 0x0, 0x0, 0x0, 0x67, 0x17, 0xa3, 0x27, 0x19, 0x5d,
    0xd2, 0x1b, 0x19, 0xb2, 0x2e, 0xc8, 0x39, 0xde, 0x2c, 0x97, 0xd9, 0xfb,
    0x7e, 0xbb, 0x8b, 0xc9, 0x54, 0x33, 0x8c, 0x19, 0xe4, 0x2a, 0x5c, 0x6c,
    0x8d, 0x5f, 0x98, 0xe, 0x0, 0x0, 0x0, 0x0, 0x45, 0xc3, 0xda, 0x85,
    0xe8, 0xbc, 0x7c, 0x3e, 0xdf, 0xfa, 0xb5, 0x29, 0x39, 0x35, 0x86, 0xad,
    0x0, 0x0, 0x0, 0x0,
    };

    I want to be able to put this image in a specific location in nRF52 flash during the build.  This was fairly easy with the old SDK.  All of us here are still learning the NCS environment.  Thanks for the assistance!

  • If you want to place the data in a particular location in flash during the build, you could take a look at the sample code_relocation to see how to do it using a custom linker script. Take a look at this DevZone case as well: https://devzone.nordicsemi.com/f/nordic-q-a/16139/how-to-store-constant-variables-at-specific-address-during-compile-time/61560#61560

    You could also just use nrfjprog to write the data to flash.

    Please let me know if this didn't help

    Best regards,

    Simon

  • Perfect!  That is what I needed.

Related