Does FLEXSPI_TransferBlocking need to disable interrupt

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

Does FLEXSPI_TransferBlocking need to disable interrupt

ソリューションへジャンプ
1,532件の閲覧回数
kyle81
Contributor II

Hi,

I found a very strange behavior for our filesystem to erase/write flash via flexspi driver by calling FLEXSPI_TransferBlocking(). 

In our project, we are using RT1165 as MCU and two FLEXSPIs are used.

FlexSPI 1 is used for XIP flash (executing code) and FlexSPI 2 is used for flash of filesystem.

When the issue happened, our filesystem will erase/write flexspi2 flash at the same block address over and over again. It seems that the data read back from flash is different with data wrote to flash. And that is saying that for unknown reason data can't be wrote to flash via FlexSPI 2 correctly even if it can return true by calling FLEXSPI_TransferBlocking(). And this issue happened with very low rate.

The interesting thing is that if I add DisableGlobalIRQ() in FLEXSPI_TransferBlocking(), the strange issue will never happen.

So, my question is do we need DisableGlobalIRQ() in FLEXSPI_TransferBlocking()? And if yes, why do we need it and is there any explanation to help to clarify this issue.

Thanks & Regards,

Kyle

 

PS: codes changed to FLEXSPI_TransferBlocking()

kyle81_0-1666160802126.png

 

0 件の賞賛
返信
1 解決策
1,517件の閲覧回数
jay_heng
NXP Employee
NXP Employee

If FlexSPI2 flash has nothing to do with XIP code, then you don't need to disable interrupt during calling FLEXSPI_TransferBlocking().

But there is limitation in current FlexSPI driver, you can try to modify driver as below. it could fix your issue.

FlexSPI改进.PNG

This fix is ok for NOR flash with no more than 256bytes page size, and it is not ok for NAND Flash with large page size (eg, 4KB)

元の投稿で解決策を見る

0 件の賞賛
返信
2 返答(返信)
1,518件の閲覧回数
jay_heng
NXP Employee
NXP Employee

If FlexSPI2 flash has nothing to do with XIP code, then you don't need to disable interrupt during calling FLEXSPI_TransferBlocking().

But there is limitation in current FlexSPI driver, you can try to modify driver as below. it could fix your issue.

FlexSPI改进.PNG

This fix is ok for NOR flash with no more than 256bytes page size, and it is not ok for NAND Flash with large page size (eg, 4KB)

0 件の賞賛
返信
1,509件の閲覧回数
kyle81
Contributor II

Hi Jay,

Thanks for your reply, and it seems your change could work, and I will try to run the test again based on your code change to see if ffs corruption will happen again.

Thanks,

Kyle

0 件の賞賛
返信