Is there any way to memory-map external flash other than XIP?

I know that I can memory-map external flash using XIP in the NRF52 and NRF53. However, with XIP, you can't write to the memory-mapped addresses (makes sense since you don't usually overwrite instructions during execution). However, is it possible to memory-map an external flash chip so I can read and write to it using the NRF52 address space just like I can with XIP?

I'm attempting to interface the NRF53 with another (custom) IC over QSPI and it would be nice to do it with memory-mapped IO. If XIP is the only way forward, I suppose I can read the register space of the external IC using XIP and write to it using custom instructions--I was just hoping there was a more elegant way.

Parents
  • Hi

    Yes, I think this should be possible, although I'm not sure the unmodified QSPI driver does this for you, you can implement custom instructions to allow it to write. If you check out how QSPI driver instance config implements the xip_offset to set an address in the external memory where the XIP section starts. You should be able to do something similar for any part of the mapping and let it read/write from that part of the flash specifically.

    Best regards,

    Simon

  •   , are you talking about the XIPOFFSET register? Setting that just sets the address XIP uses on the external device when I read from addresses on the Nordic in the range from 0x12000000 - 0x19FFFFFF, right? Doesn't the following note still apply?

              Note that the XIP memory region is read-only, writing to it will result in a bus error.

    I guess the thing that was getting me hopeful was this memory map for the NRF52832 which has "External Device" at 0xA000000 and "External RAM" at 0x6000000. I was wondering how I might map an external device onto one of those memory segments.

Reply
  •   , are you talking about the XIPOFFSET register? Setting that just sets the address XIP uses on the external device when I read from addresses on the Nordic in the range from 0x12000000 - 0x19FFFFFF, right? Doesn't the following note still apply?

              Note that the XIP memory region is read-only, writing to it will result in a bus error.

    I guess the thing that was getting me hopeful was this memory map for the NRF52832 which has "External Device" at 0xA000000 and "External RAM" at 0x6000000. I was wondering how I might map an external device onto one of those memory segments.

Children
No Data
Related