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

Reply
  • 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

Children
Related