Hi,
we have a custom board with an i MX.8 M Nano chip that communicates via FlexSPI with an FPGA with AHB reads and writes from the CM7 core. This is working fine in general.
Now we are looking into improving the performance by enabling prefetch for AHB reads.
The relevant FlexSPI configuration looks like this:
flexspi_config_t config;
FLEXSPI_GetDefaultConfig(&config);
config.enableSckFreeRunning = true;
config.ahbConfig.enableAHBPrefetch = true;
config.ahbConfig.enableAHBBufferable = false;
config.ahbConfig.enableReadAddressOpt = false;
config.ahbConfig.enableAHBCachable = false;
config.rxSampleClock = kFLEXSPI_ReadSampleClkExternalInputFromDqsPad;
config.enableCombination = true;
FLEXSPI_Init(FLEXSPI, &config);
With "config.ahbConfig.enableAHBPrefetch = true;" we are getting the hard fault on the first AHB read attempt, while with "config.ahbConfig.enableAHBPrefetch = false;" everything is working as expected. I can see with a logic analyzer that with "config.ahbConfig.enableAHBPrefetch = true;" there is no activity at all on the SPI bus when the AHB read is triggered, the hard fault occurs immediately.
What can be the reason for the hard fault if only AHB prefetch is enabled with no other changes compared to the working configuration? Are we missing further settings that need to be changed from the default to make AHB prefetch work?
In that context we also want to configure the prefetch size. Section "10.2.4.10.3 AHB RX Buffer Management" of the i.MX 8M Nano Applications Processor Reference Manual describes how to configure the prefetch sizes for different master IDs.
Where are the "master IDs" documented, and what is the master ID for the CM7 core in this context? I was not able not find this information in the Reference Manual.
Thank you
Stephan