nrf52840 DFU with external flash

Hi,

Are there any examples of doing DFU using the nrf52840-dk with external flash on a Zephyr project (nrf-sdk)?

We want to use the MX25R64 flash to host one of the partitions as the firmware is too large.

At this stage, we're not concerned about the update interface, BLE, LwM2M, UART, etc.

Simply enabling "CONFIG_BOOTLOADER_MCUBOOT=y" doesn't work as our firmware won't fit.

Thanks,

Sam

Parents
  • Are there any examples of doing DFU using the nrf52840-dk with external flash on a Zephyr project (nrf-sdk)?

    There is an example demonstrating this here: https://github.com/simon-iversen/sdk-zephyr/tree/serial_dfu_ext_flash_hello_world/samples/hello_world 

    Simply enabling "CONFIG_BOOTLOADER_MCUBOOT=y" doesn't work as our firmware won't fit.

    How large is your application? When you enable mcuboot, then three partitions will be created, which is the mcuboot, the primary slot and the secondary slot. By default, mcuboot uses 48kB I think (you can definitely reduce this size). If you haven't configured the secondary slot to be put in the external flash you might encounter issues if your appliation is large. What you have left in flash is roughly 1mb-48kB=952kb, so if your application is larger than 952/2=476 (primary and secondary needs to have the same size and be able to fit the application), it won't fit. In addition you may have some other flash partitions, like a storage partition.

    Best regards,

    Simon

  •   This is exactly what I was after, thank you.

    I've modified our custom board profile & project as per the project linked. The new hardware with the storage chip hasn't arrived yet, but I will test on the DK board and get back to you.

    Our firmware is around 500-600kB so two partitions wouldn't fit onto the nrf52840's 1024kB flash. This is now solved using your project pm_static.yml file to put one partition into the flash chip.

    Do you happen to have an extended project using LwM2M as the update interface?

  • motters said:
    Simon  This is exactly what I was after, thank you.

    I'm happy I was able to help :) 

    motters said:
    Do you happen to have an extended project using LwM2M as the update interface?

    I found a sample under in <ncs location>\zephyr\samples\net\lwm2m_client. However, I don't know have much knowledge about the lwm2m protocol and how to use it on the 52840, could you open a new ticket about this? Then it will get assigned to an engineer who knows more about it.

Reply
  • motters said:
    Simon  This is exactly what I was after, thank you.

    I'm happy I was able to help :) 

    motters said:
    Do you happen to have an extended project using LwM2M as the update interface?

    I found a sample under in <ncs location>\zephyr\samples\net\lwm2m_client. However, I don't know have much knowledge about the lwm2m protocol and how to use it on the 52840, could you open a new ticket about this? Then it will get assigned to an engineer who knows more about it.

Children
Related