Read data directly from external nor flash

Hello,

I'm using the following setup:

  1. nRF Connect SDK v2.9.0
  2. B0, upgradable secure MCUBoot, and application
  3. Statically defined partitions in the partition manager

I have an external NOR flash of 4MB.

I'm storing a large amount of data (~4KB) in my external NOR flash, which will always be at the same offset in the flash.

Currently, I'm using flash_read to retrieve the data, but it consumes a significant amount of RAM. I saw that XIP (Execute In Place) can be used for read-only purposes, but I can't find any samples or guidance on how to implement it.

Please note that I'm not referring to using XIP to run code from the external flash; all I need is a way to hold a pointer to data that is stored in it.

Could you provide any examples or hints on how to use XIP for accessing read-only data in external NOR flash without wasting RAM?

Thank you for your assistance.

Best regards,
Udi

Parents Reply
  • Thanks for the reply Ammanda.

    So the only option is to set the "XIP" window ourselves using the registers directly ? 
    our needs are very basic and i think are ok with the limiatation : read only code, we use the QSPI wire api to write the data and use XIP only to read the data "as if" it was from RAM.
    I believe it's in the bounds of the ERRATAs.

    which files (nrf\nrfx files) should we include' i don't belive any of them in the nrf-connect don't have ref to the registers, it's a bit strange that we'll have to write the the structs and pointers ourselves (though we can according to the product spec).

    Or if it's not in the SDK, where was this code in nrf-sdk , maybe we can copy form there.

Children
Related