I have an i.MXRT1011 connected to an FPGA via QSPI using the FlexSPI module. I have the entire FPGA memory region configured as non-cacheable in the MPU, as I want any access to that region to cause an SPI transaction:
ARM_MPU_SetRegionEx(0, 0x61000000, ARM_MPU_RASR(0, ARM_MPU_AP_FULL, 1, 0, 0, 0, 0, ARM_MPU_REGION_SIZE_64KB));
When attempting to access this memory region, I find that writes do consistently cause SPI transactions, but reads do not:
volatile uint8_t *fpgaReg = (volatile uint8_t *)(FPGA_AHB_START_ADDRESS + 0x2000);
uint8_t rdVal = 0;
*fpgaReg = (uint8_t)(i); // writes cause SPI transaction
rdVal = *fpgaReg; // reads only cause an SPI transaction on first pass
I've tried both disabling the data cache, and invalidating the region I'm accessing before doing the read, but still no bus action. I figure I must be missing something about the CM7 cache but I'm not having any luck figuring it out.