I have a custom board, with nrf5340 and a external QPSI flash (this is exactly like the nrf5340 DK).
I use the external flash for multiple partitions (mcuboot slots, FAT-FS file system, etc), and would like to use a partition as a "memory mapped file system" ie have blocks of data in the flash partition and allow code to access them as though it was data in the internal flash (ie just with a pointer in the 0x100000000 region). This lets me use this const data as though it was in my main application build but without having to use up space in the (limited) internal nrf5340 flash...
I can use the flash_open/read/write() interface driver api to set up the partition data just fine.
However, when the code attempts to access the memory space directly (as a pointer access for example), it faults...
eg:
// the QPSI flash should be mapped at 0x10000000 and my partition starts at offset 0x780000 in my pm_static.yml
uint32_t* aptr = (uint32_t*)(0x10000000 + 0x780000);
uint32_t val = *aptr; // fault!
Your AI says there is no DTS or linker magic required to let the code read from this area, and I have checked that the flash initialisation priority (41 for the driver and 50 for flash) mean it should be initialised before my application starts running (priority 90).
The code also accesses the partition with flash_area_open() so that it can write to it via this api : could this cause an issue?
thanks!
Brian
