FlexSPI Cache Issue

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 
4,468件の閲覧回数
whermann
Contributor II

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.

ラベル(1)
0 件の賞賛
返信
1 解決策
4,430件の閲覧回数
whermann
Contributor II

I figured out the issue. The FlexSPI module has the ability to check its own TX buffer for a cache hit when doing a read. Clearing the AHBCR[CACHABLEEN] bit disables this feature, so every AHB read from the FlexSPI memory space will cause a SPI transaction.

元の投稿で解決策を見る

0 件の賞賛
返信
5 返答(返信)
4,462件の閲覧回数
jeremyzhou
NXP Employee
NXP Employee

Hi,
Thank you for your interest in NXP Semiconductor products and for the opportunity to serve you.
Actually, I'm a bit confused with your design, whether you use an FPGA to simulate the QSPI flash, if not, can you share the schematic of the custom board?
Looking forward to your reply.
Have a great day,
TIC

-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!

 

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

0 件の賞賛
返信
4,456件の閲覧回数
whermann
Contributor II

The FPGA is acting more like a RAM than a flash device. FlexSPI port B1 is configured to communicate with the FPGA, using custom LUT entries to match the bus characteristics that I'm expecting on the FPGA side. I am only using AHB-accesses, no IP comms.

The transactions work properly (all of the FlexSPI parameters are set-up properly for both write and read accesses). The issue is that I can't reliably cause a read on the QSPI. Even though I have cache disabled for the FPGA's memory region, and even if I completely disable D-Cache, a read in software doesn't cause a read on the FlexSPI.

I appreciate your help with this issue.

0 件の賞賛
返信
4,450件の閲覧回数
jeremyzhou
NXP Employee
NXP Employee

Hi,
Thanks for your reply.
According to your reply, in your design, the FlexSPI port A connects the QSPI, meanwhile, the FlexSPI port B connects the FPGA.
In the application, you want to read and write the FPGA via AHB access mode, isn't my understanding right?
If yes, I was wondering if you can upload your demo code?
Have a great day,
TIC

-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!

 

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

0 件の賞賛
返信
4,431件の閲覧回数
whermann
Contributor II

I figured out the issue. The FlexSPI module has the ability to check its own TX buffer for a cache hit when doing a read. Clearing the AHBCR[CACHABLEEN] bit disables this feature, so every AHB read from the FlexSPI memory space will cause a SPI transaction.

0 件の賞賛
返信
3,852件の閲覧回数
jingyangxie
Contributor V

Hi,

Could you share your config on flexspi?

0 件の賞賛
返信