icache problems in I.MX RT1021

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

icache problems in I.MX RT1021

444件の閲覧回数
nda
Contributor III

Hello. I've never used MPU and cache before, so i dont know how to solve problem. 

I'am working with LPSPI and receiving data form external flash: 

base->TCR |= LPSPI_TCR_TXMSK(isTxMask); // start transmission

while (!(base->SR & LPSPI_SR_FCF_MASK)) {}; // waiting for frame transfer has completed
this code doesnot work properly. Some times it works and some time it doesnot. It hangs and i cant even stop the debugger. If i disable icache before waiting it works, but delays are significant. 

This works:

base->TCR |= LPSPI_TCR_TXMSK(isTxMask);

if (SCB_CCR_IC_Msk == (SCB_CCR_IC_Msk & SCB->CCR)){SCB_DisableICache();}
while (!(base->SR & LPSPI_SR_FCF_MASK)) {};
SCB_EnableICache();

Does anybody can explain me, what i am doing wrong?

0 件の賞賛
1 返信

428件の閲覧回数
Alexis_A
NXP TechSupport
NXP TechSupport

Hello @nda,

Have you tried using the SPI SDK examples? These ones already enable the cache, here's the link for download.

Best Regards,

Alexis Andalon

0 件の賞賛