SDMMC SD_init() loops forever in a TrustZone enabled project

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

SDMMC SD_init() loops forever in a TrustZone enabled project

1,930 次查看
apercov
Contributor I

I am a noob in embedded space, so maybe I am missing something very obvious.
I am working on a project that is based on TrustZone on LPCXpresso55S69 board. Part of the project's desired functionality is enabling a persistent storage of some objects.

For that purpose I referred to the SDK sdcard_polling example. I tested it, and it works just fine. 
Then I decided to copy the code, library and configs to the project I am working on (for now, I literally just copied the code of the example).  The SD card IO shall be performed from the secure side. I initialise the SD config and run the example code from the main_s.c class (main function of the secure project).
I managed to get it building and running, however it gets stuck in an endless loop when calling SD_CardInit().

Backtrace: SD_CardInit() -> SD_SendScr -> SDMMCHOST_TransferFunction -> SDIF_TransferBlocking -> SDIF_TransferDataBlocking -> SDIF_GetInternalDMAStatus. 
SDIF_GetInternalDMAStatus return 0x400 and the execution loops inside of the SDIF_TransferDataBlocking forever. 

Not sure what other information might be relevant for this.

 

标记 (2)
0 项奖励
回复
2 回复数

1,906 次查看
Omar_Anguiano
NXP TechSupport
NXP TechSupport

Hello

Hope you are well.
The status of 0x400 means a Bus Error. I suggest you verify that the memory used in your application is located at the secure part. A secure application does not trust an NS application.

A context of how are you implementing the Trustzone might be useful.
If you have more questions do not hesitate to ask me.

Best regards,
Omar

0 项奖励
回复

967 次查看
yidaen
Contributor II

Hello,

I am facing exactly the same issue mentioned in the post. I am working on a project that uses TrustZone. In this project, the secure side needs to read from an SD card.

I have already configured DMA, SDIF memory regions, and access permissions to be secure, yet the loop inside SDIF_TransferDataBlocking remains stuck, preventing the initialization process from continuing.

I have tried different TrustZone configurations, but I haven't been able to find a solution.

Is there any known fix for this issue?

Best regards,

 
0 项奖励
回复