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

OTA-DFU of nrf52832 using External Flash instead of internal flash

Hi guys!

  1. I wanted to ask that can we use an external flash(connected via SPI/I2C interface to the mcu) instead of internal flash for storing downloaded image(s)?

  2. If yes, what & all things have to be modified?

  3. Is there an example for this?

I searched through the infocenter but, was unable to find any info regarding this.

Please Help!

Regards, Prasad.

  • Yes, that should be possible to implement as long as you do not plan on running it from external flash. Unfortunatly, we do not have an example for this.

    My suggestion would be to replace the pstorage calls in the bootloader, i.e. instead using pstorage to write it to internal flash you use a function that takes the same parameters, but writes to external flash instead. Once you've written the entire firmware to the external flash, then I suggest that you reset the nRF52. The nRF52822 will then restart in the bootloader and you can then readback the application into internal flash.

    Best regard

    Bjørn

  • Thanks Bjorn! This is exactly what I was looking for.

    Only 1 doubt I have is that how the bootloader will get to know where exactly(whether in internal or external flash & also exactly at which address in the flash) I have kept the new image.

    Regards, Prasad.

  • I would allocate a known section in the external flash where you can store the firmware images crc, type and size. I would also set a fixed start address for where the image should be stored in external flash, that way the nRF52832 bootloader always knows where the image starts and it can get the size from the section where you stored the image size.

  • Thanks Bjorn! But how to make the bootloader know this address? i.e. where & how exactly this has to be assigned to the bootloader?

    Please bear with me...I am novice to the nordic sdk/softdevice.

    Regards, Prasad.

  • The external flash you're using will have a fixed memory mapping, lets say 0x0000 to 0x4000, which means that you can define a specific address in the bootloader, for example 0x4000, that will be the start of the section where you store information about the image. In the bootloader you simply define this address like #define IMAGE_INFORMATION_SECTION_START 0x4000 and then use this address when you want to read out this information. The same thing shoul be done for the section where you want to store the image itself, e.g. #define IMAGE_SECTION_START 0x3000.

Related