SDMMC Example Works, but Program Code Doesn't

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

SDMMC Example Works, but Program Code Doesn't

跳至解决方案
1,196 次查看
chadgraham
Contributor V

Hello,

I am running MCUXpresso 11.3.1 with SDK 2.9.3 and programming a MIMXRT1060-EVK dev board.  When I pull the SDK example evkmimxrt1060_sdcard_interrupt and run the program, everything in the example code works and it is able to access the SD card as intended.

To support it in my program, I copied the major pieces into my program and it gets stuck waiting for the bare metal semaphore when I try to initialize the card.

 

SDMMC_OSAEventWait() at fsl_sdmmc_osa.c:69 0x6000a104	
SDMMCHOST_TransferFunction() at fsl_sdmmc_host.c:441 0x6002dfc2	
SD_SendInterfaceCondition() at fsl_sd.c:1,272 0x60009584	
SD_ProbeBusVoltage() at fsl_sd.c:1,958 0x60009c06	
SD_CardInit() at fsl_sd.c:2,033 0x60009d36

 

I have walked both programs starting from boot-up to this line and every step is identical as far as I can tell.

As I was doing this, I noticed that if I program the sample code and then run my code, it works perfectly so I can only assume that the sample code has some configuration setting that isn't in my program, but I can't find anything that is different.  (Note: I only need to program the sample code for this trick to work.  I don't need to hit run.)  If I unplug the board, then my program again fails until I reprogram it with the sample.

Any suggestions on what this might be would be appreciated.

0 项奖励
回复
1 解答
1,172 次查看
chadgraham
Contributor V

Hello,

In investigating the issue, I discovered that the example program was running in the background after I hit stop implying that the example was actually running and hence, the code could still be the culprit.  Using while(1), I was able to block sections of the example code and I eventually tracked down that the InitPins in my code was not calling the pin setup for the SD card.  Since this is an IDE generated file, I was a little perplexed until I discovered that the IDE does not appear to call the functional groups by default.  After using the flag to add it to my InitPins, everything is working and I'm able to continue my project.

在原帖中查看解决方案

0 项奖励
回复
2 回复数
1,173 次查看
chadgraham
Contributor V

Hello,

In investigating the issue, I discovered that the example program was running in the background after I hit stop implying that the example was actually running and hence, the code could still be the culprit.  Using while(1), I was able to block sections of the example code and I eventually tracked down that the InitPins in my code was not calling the pin setup for the SD card.  Since this is an IDE generated file, I was a little perplexed until I discovered that the IDE does not appear to call the functional groups by default.  After using the flag to add it to my InitPins, everything is working and I'm able to continue my project.

0 项奖励
回复
1,176 次查看
jingpan
NXP TechSupport
NXP TechSupport

Hi chadgraham,

Maybe you should check the project configuration. For example the memory arrangement, preprocessor and linker.

 

Regards,

Jing

0 项奖励
回复