This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Concurrently using XIP and QSPI to read back data from external flash

Dear Nordic,

I have a 4MB external flash on my board, I've successfully run the code on it by using XIP. However, I got stuck when I was trying to read back data from external flash. The following picture has the call stack trace. It's a failure of NRFX_ASSERT.

Some more details:

Using nrfx driver both in bootloader and application is not a good idea, because the driver status is stored in the different RAM area. I add a fake initialization function for QSPI to keep the peripheral status consistent. Do you have any better ideas?

Best Regards,

Eugene

Parents
  • Well, you can't execute code from XiP whenever the QSPI driver in internal flash tries to R/W to external flash. What you need to do is to prevent the CPU from returning to code in XiP. You can make the calls to the QSPI driver blocking calls, that does not return until the QSPI operation is complete. In that way you should be safe. 

    If the IRQ for the QSPI is in internal flash you wont have any problems with interrupts of higher priority as the CPU will return to the internal flash to finish proccessing the IRQ or driver before returning to XiP. 

Reply
  • Well, you can't execute code from XiP whenever the QSPI driver in internal flash tries to R/W to external flash. What you need to do is to prevent the CPU from returning to code in XiP. You can make the calls to the QSPI driver blocking calls, that does not return until the QSPI operation is complete. In that way you should be safe. 

    If the IRQ for the QSPI is in internal flash you wont have any problems with interrupts of higher priority as the CPU will return to the internal flash to finish proccessing the IRQ or driver before returning to XiP. 

Children
No Data
Related