SDMMC SD_init() loops forever in a TrustZone enabled project

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

SDMMC SD_init() loops forever in a TrustZone enabled project

470 次查看
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 项奖励
1 回复

446 次查看
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 项奖励