Link to QSPI Flash Variables with MCUBoot

I am using the NRF52840 with NCS 2.4 and I have hit the internal flash limit.  I am running multiple ble peripheral/central with some graphics libraries for a display.  The Zephyr stack seems to take up a lot of more space than the old NRF5 stack.

I want to offload some graphics fonts/images to an external QSPI.

2 questions:

1.) How should I modify this example to work with the NRF52840? 

https://github.com/zephyrproject-rtos/zephyr/tree/main/samples/application_development/code_relocation_nocopy

This includes an ext_mem_init.c for the NRF5340, is there an NRF52840 version of this or a different way to enable XIP for the 5240?

When I try to modify the example for the 5240, I get an invalid hex error:

[error] [ Worker] - Program image can not have data in FICR.
ERROR: The file specified is not a valid hex file, has data outside valid areas
ERROR: or does not have data in valid areas.


2.) How can I do this so it is compatible with MCUBoot?  When I add MCUboot to the code relocation example, this overflows the image size limits:

Error: Image size (0xfff0298) + trailer (0x630) exceeds requested size 0x78000

This makes sense since now the whole image includes the XIP data located on external flash.

Perhaps there is a way I can create a new image/partition that has the graphics data?  I would think I would need to link to a fixed flash address to then access this data from the main application partition.  Then I could independently update each partition, the main app, and the external data files...

Is there a recommended way to include external flash data and still allow updates via MCUBoot?

Perhaps I should include this using a file system?

Thanks,

Luke

Related