FRDM-K66F microSD f_opendir never returns: stuck in SDMMC_OSAEventWait

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

FRDM-K66F microSD f_opendir never returns: stuck in SDMMC_OSAEventWait

跳至解决方案
2,496 次查看
aaronm
Contributor IV

Board: FRDM-K66F. SDK: 2.11.0 (541 2022-01-14)

I'm using the SD library to read and write files to an SD card.

I'm using "baremetal" instead of an RTOS; I mention this because the definition for KOSA_StatusIdle says:

KOSA_StatusIdle = MAKE_STATUS(kStatusGroup_OSA, 3), /*!< Used for bare metal only, the wait object is not ready and timeout still not occur */

My program is trying to f_opendir(), after verifying that the card exists, successful calls to f_mount(), and f_chdrive(), and it's hanging in this function:

status_t SDMMC_OSAEventWait(void *eventHandle, uint32_t eventType, uint32_t timeoutMilliseconds, uint32_t *event)
{
assert(eventHandle != NULL);

osa_status_t status = KOSA_StatusError;

#if defined(SDMMC_OSA_POLLING_EVENT_BY_SEMPHORE) && SDMMC_OSA_POLLING_EVENT_BY_SEMPHORE
while (true)
{
status = OSA_SemaphoreWait(&(((sdmmc_osa_event_t *)eventHandle)->handle), timeoutMilliseconds);
if (KOSA_StatusTimeout == status)
{
break;
}

if (KOSA_StatusSuccess == status)
{
(void)SDMMC_OSAEventGet(eventHandle, eventType, event);
if ((*event & eventType) != 0U)
{
return kStatus_Success;
}
}
}
#endif
return kStatus_Fail;
}

This while() loop never exits because "timeoutMilliseconds" never decreases - the value passed in is a define: SDMMCHOST_TRANSFER_COMPLETE_TIMEOUT, rather than a variable - which might eventually lead to a time out, and the loop condition doesn't check for KOSA_StatusIdle.  Before the point at which the program hangs, the semaphore is evidently properly created and removed: I've followed the semaphore value as it's increased and decreased in the Expression panel.  However, at some point, OSA_SemaphorePost() is no longer called, so semCount isn't increased, and OSA_SemaphoreWait() just keeps returning KOSA_StatusIdle.

Here's the call stack when it's stuck in this loop:

Thread #1 57005 (Suspended : Breakpoint)
OSA_SemaphoreWait() at fsl_os_abstraction_bm.c:584 0x616e
SDMMC_OSAEventWait() at fsl_sdmmc_osa.c:69 0x3268
SDMMCHOST_TransferFunction() at fsl_sdmmc_host.c:299 0x8524
SD_SendScr() at fsl_sd.c:814 0x16e0
sdcard_init() at fsl_sd.c:2,033 0x2cbe
SD_CardInit() at fsl_sd.c:2,085 0x2d96
SD_Init() at fsl_sd.c:2,268 0x307a
sd_disk_initialize() at fsl_sd_disk.c:145 0x374c
disk_initialize() at diskio.c:117 0x87ba
mount_volume() at ff.c:3,376 0x3c02
f_opendir() at ff.c:4,544 0x953c
prepareSDForWrite() at MK66F18_Van_Gizmo_v02.c:340 0xa9a
measureAccelerometer() at MK66F18_Van_Gizmo_v02.c:353 0xaee
main() at MK66F18_Van_Gizmo_v02.c:416 0xc8c
 
How can I get either the timeout value to decrease, while time is physically passing, or get the semaphore count increased so the loop continues to work properly until f_opendir() completes?
 
Also, here's a shot of the g_sd variable, at the time it enters the endless loop:
0 项奖励
回复
1 解答
2,442 次查看
aaronm
Contributor IV

XuZhang,

I ran my copy of the sdcard_fatfs example program, which is probably identical to what you posted, and it did work, curiously, and when I added the "PRINTF" statements to the SDK example for the semaphore waits, the output looked similar to yours.  Puzzling.

I then went through all of the files in the two projects to see if the SDKs were somehow different: they were not.

I checked the pull-up and pull-down statuses in the Pins perspective: the SDK example manually sets them "pull-up," and mine were "ignore."  I changed mine, but it didn't make a difference.

I checked the clock configuration - maybe a system clock of 120MHz was incorrect for the SD card; I dunno - and that had no change.

Finally, since I couldn't find any other differences, I added the SYSMPU SDK module and the call to SYSMPU_Enable(SYSMPU, false); in the main initialization block.  That did it.  My semaphore counts were increasing and decreasing as in your example, and f_opendir() returned successfully.  I've no idea what SYSMPU does, and I haven't seen it before when dealing with the FRDMK66 board, but that was the trick, evidently.  I'm marking this as "solved."

Thanks for your help.

在原帖中查看解决方案

0 项奖励
回复
4 回复数
2,469 次查看
Joey_z
NXP Employee
NXP Employee

Hi , aaronm

I experimented with the MK66FN2M0xxx18 development board and the "frdmk66f_sdcard_fatfs" program in the SDK. It didn't seem to hang in SDMMC_OSAEventWait. I tried to print out the values ​​of timeoutMilliseconds and semCount and found that the value of semCount was changing, and the return value of the OSA_SemaphoreWait() function was KOSA_StatusSuccess.

The location of adding the test output function is as shown below.

XuZhang_0-1720425194756.png

XuZhang_1-1720425207689.png

I can see the output results as shown in this figure, which outputs the values ​​of timeoutMilliseconds and semCount during the program execution, and creates files in the SD card.

XuZhang_2-1720425294428.png

I have attached the program, I hope this can help you.

BR

XuZhang

0 项奖励
回复
2,443 次查看
aaronm
Contributor IV

XuZhang,

I ran my copy of the sdcard_fatfs example program, which is probably identical to what you posted, and it did work, curiously, and when I added the "PRINTF" statements to the SDK example for the semaphore waits, the output looked similar to yours.  Puzzling.

I then went through all of the files in the two projects to see if the SDKs were somehow different: they were not.

I checked the pull-up and pull-down statuses in the Pins perspective: the SDK example manually sets them "pull-up," and mine were "ignore."  I changed mine, but it didn't make a difference.

I checked the clock configuration - maybe a system clock of 120MHz was incorrect for the SD card; I dunno - and that had no change.

Finally, since I couldn't find any other differences, I added the SYSMPU SDK module and the call to SYSMPU_Enable(SYSMPU, false); in the main initialization block.  That did it.  My semaphore counts were increasing and decreasing as in your example, and f_opendir() returned successfully.  I've no idea what SYSMPU does, and I haven't seen it before when dealing with the FRDMK66 board, but that was the trick, evidently.  I'm marking this as "solved."

Thanks for your help.

0 项奖励
回复
2,454 次查看
aaronm
Contributor IV
Can I ask what kind of SD card you used? And how was it formatted: ExFAT, or MS-DOS / FAT? I know it shouldn't matter, but I'm seeing different results in the same code if I use different SD cards. The one that fails with ACMD51, is a 2GB Lexar formatted as FAT-32; and the other is a 64GB SanDisk formatted as ExFAT. That one fails at SD_AllSendCid() line 2005, in sdcard_init() / fsl_sd.c.
0 项奖励
回复
2,480 次查看
aaronm
Contributor IV

Further info:

This is locking up in sdcard_init() -> SD_SendScr(), or when we run SD command ACMD51, Read the SD Configuration Register (SCR).  When I stepped through the commands from SD_SendSCR(), I notice it doesn't trigger an SDHC interrupt, like the previous commands, such as SD_SendRca(), or SD_SendCsd().  These function trigger interrupts, which is where the semaphore counter is increased before reaching SDMMC_OSAEventWait().

What is the problem with SD_SendScr()?

Just in case it matters, I'm not specifically using DMA in this application.  Does that make a difference?

0 项奖励
回复
%3CLINGO-SUB%20id%3D%22lingo-sub-1901043%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3EFRDM-K66F%20microSD%20f_opendir%20%E6%B0%B8%E4%B8%8D%E8%BF%94%E5%9B%9E%EF%BC%9A%E5%8D%A1%E5%9C%A8%20SDMMC_OSAEventWait%20%E4%B8%AD%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1901043%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3E%E4%B8%BB%E6%9D%BF%EF%BC%9AFRDM-K66F%E3%80%82SDK%EF%BC%9A2.11.0%EF%BC%88541%202022-01-14%EF%BC%89%3C%2FP%3E%3CP%3E%E6%88%91%E6%AD%A3%E5%9C%A8%E4%BD%BF%E7%94%A8%20SD%20%E5%BA%93%E6%9D%A5%E8%AF%BB%E5%8F%96%E5%92%8C%E5%86%99%E5%85%A5%20SD%20%E5%8D%A1%E4%B8%AD%E7%9A%84%E6%96%87%E4%BB%B6%E3%80%82%3C%2FP%3E%3CP%3E%E6%88%91%E4%BD%BF%E7%94%A8%E7%9A%84%E6%98%AF%E2%80%9C%E8%A3%B8%E6%9C%BA%E2%80%9D%E8%80%8C%E4%B8%8D%E6%98%AF%20RTOS%EF%BC%9B%E6%88%91%E6%8F%90%E5%88%B0%E8%BF%99%E4%B8%80%E7%82%B9%E6%98%AF%E5%9B%A0%E4%B8%BA%20KOSA_StatusIdle%20%E7%9A%84%E5%AE%9A%E4%B9%89%E5%A6%82%E4%B8%8B%EF%BC%9A%3C%2FP%3E%3CP%3E%3CEM%3EKOSA_StatusIdle%20%3D%20MAKE_STATUS(kStatusGroup_OSA%2C%203)%2C%20%2F*!%26lt%3B%20%E4%BB%85%E7%94%A8%E4%BA%8E%E8%A3%B8%E6%9C%BA%EF%BC%8C%E7%AD%89%E5%BE%85%E5%AF%B9%E8%B1%A1%E5%B0%9A%E6%9C%AA%E5%87%86%E5%A4%87%E5%A5%BD%EF%BC%8C%E5%B9%B6%E4%B8%94%E4%BB%8D%E6%9C%AA%E5%8F%91%E7%94%9F%E8%B6%85%E6%97%B6%20*%2F%3C%2FEM%3E%3C%2FP%3E%3CP%3E%E6%88%91%E7%9A%84%E7%A8%8B%E5%BA%8F%E6%AD%A3%E5%9C%A8%E5%B0%9D%E8%AF%95%20f_opendir()%EF%BC%8C%E5%9C%A8%E9%AA%8C%E8%AF%81%E5%8D%A1%E5%AD%98%E5%9C%A8%E5%90%8E%EF%BC%8C%E6%88%90%E5%8A%9F%E8%B0%83%E7%94%A8%20f_mount()%20%E5%92%8C%20f_chdrive()%EF%BC%8C%E5%B9%B6%E4%B8%94%E5%AE%83%E6%8C%82%E5%9C%A8%E8%BF%99%E4%B8%AA%E5%87%BD%E6%95%B0%E4%B8%AD%EF%BC%9A%3C%2FP%3E%3CPRE%20translate%3D%22no%22%3Estatus_t%20SDMMC_OSAEventWait(void%20*eventHandle%2C%20uint32_t%20eventType%2C%20uint32_t%20timeoutMilliseconds%2C%20uint32_t%20*event)%3CBR%20%2F%3E%7B%3CBR%20%2F%3E%20%20assert(eventHandle%20!%3D%20NULL)%3B%3CBR%20%2F%3E%3CBR%20%2F%3E%20%20osa_status_t%20status%20%3D%20KOSA_StatusError%3B%3CBR%20%2F%3E%3CBR%20%2F%3E%23if%20defined(SDMMC_OSA_POLLING_EVENT_BY_SEMPHORE)%20%26amp%3B%26amp%3B%20SDMMC_OSA_POLLING_EVENT_BY_SEMPHORE%3CBR%20%2F%3E%20%20while%20(true)%3CBR%20%2F%3E%20%20%7B%3CBR%20%2F%3E%20%20%20%20status%20%3D%20OSA_SemaphoreWait(%26amp%3B(((sdmmc_osa_event_t%20*)eventHandle)-%26gt%3Bhandle)%2C%20timeoutMilliseconds)%3B%3CBR%20%2F%3E%20%20%20%20if%20(KOSA_StatusTimeout%20%3D%3D%20status)%3CBR%20%2F%3E%20%20%20%20%7B%3CBR%20%2F%3E%20%20%20%20%20%20break%3B%3CBR%20%2F%3E%20%20%20%20%7D%3CBR%20%2F%3E%3CBR%20%2F%3E%20%20%20%20if%20(KOSA_StatusSuccess%20%3D%3D%20status)%3CBR%20%2F%3E%20%20%20%20%7B%3CBR%20%2F%3E%20%20%20%20%20%20(void)SDMMC_OSAEventGet(eventHandle%2C%20eventType%2C%20event)%3B%3CBR%20%2F%3E%20%20%20%20%20%20if%20((*event%20%26amp%3B%20eventType)%20!%3D%200U)%3CBR%20%2F%3E%20%20%20%20%20%20%7B%3CBR%20%2F%3E%20%20%20%20%20%20%20%20return%20kStatus_Success%3B%3CBR%20%2F%3E%20%20%20%20%20%20%7D%3CBR%20%2F%3E%20%20%20%20%7D%3CBR%20%2F%3E%20%20%7D%3CBR%20%2F%3E%23endif%3CBR%20%2F%3E%20%20return%20kStatus_Fail%3B%3CBR%20%2F%3E%7D%3C%2FPRE%3E%3CP%3E%E8%BF%99%E4%B8%AA%20while()%20%E5%BE%AA%E7%8E%AF%E6%B0%B8%E8%BF%9C%E4%B8%8D%E4%BC%9A%E9%80%80%E5%87%BA%EF%BC%8C%E5%9B%A0%E4%B8%BA%E2%80%9C%20%3CFONT%20color%3D%22%23FF9900%22%3EtimeoutMilliseconds%3C%2FFONT%3E%20%E2%80%9D%E6%B0%B8%E8%BF%9C%E4%B8%8D%E4%BC%9A%E5%87%8F%E5%B0%91%20-%20%E4%BC%A0%E5%85%A5%E7%9A%84%E5%80%BC%E6%98%AF%E4%B8%80%E4%B8%AA%E5%AE%9A%E4%B9%89%EF%BC%9A%20%3CSPAN%3ESDMMCHOST_TRANSFER_COMPLETE_TIMEOUT%EF%BC%8C%E8%80%8C%E4%B8%8D%E6%98%AF%E4%B8%80%E4%B8%AA%E5%8F%98%E9%87%8F%20-%3C%2FSPAN%3E%E8%BF%99%E5%8F%AF%E8%83%BD%E6%9C%80%E7%BB%88%E5%AF%BC%E8%87%B4%E8%B6%85%E6%97%B6%EF%BC%8C%E5%B9%B6%E4%B8%94%E5%BE%AA%E7%8E%AF%E6%9D%A1%E4%BB%B6%E4%B8%8D%E4%BC%9A%E6%A3%80%E6%9F%A5%3CFONT%20color%3D%22%23FF9900%22%3EKOSA_StatusIdle%3C%2FFONT%3E%20%E3%80%82%E5%9C%A8%E7%A8%8B%E5%BA%8F%E6%8C%82%E8%B5%B7%E4%B9%8B%E5%89%8D%EF%BC%8C%E4%BF%A1%E5%8F%B7%E9%87%8F%E6%98%BE%E7%84%B6%E5%B7%B2%E8%A2%AB%E6%AD%A3%E7%A1%AE%E5%88%9B%E5%BB%BA%E5%92%8C%E5%88%A0%E9%99%A4%EF%BC%9A%E6%88%91%E5%9C%A8%E2%80%9C%E8%A1%A8%E8%BE%BE%E5%BC%8F%E2%80%9D%E9%9D%A2%E6%9D%BF%E4%B8%AD%E8%B7%9F%E8%B8%AA%E4%BA%86%E4%BF%A1%E5%8F%B7%E9%87%8F%E5%80%BC%E7%9A%84%E5%A2%9E%E5%8A%A0%E5%92%8C%E5%87%8F%E5%B0%91%E3%80%82%E7%84%B6%E8%80%8C%EF%BC%8C%E5%9C%A8%E6%9F%90%E4%B8%AA%E6%97%B6%E5%80%99%EF%BC%8C%20%3CFONT%20color%3D%22%23FF9900%22%3EOSA_SemaphorePost()%3C%2FFONT%3E%E4%B8%8D%E5%86%8D%E8%A2%AB%E8%B0%83%E7%94%A8%EF%BC%8C%E5%9B%A0%E6%AD%A4%3CFONT%20color%3D%22%23FF9900%22%3EsemCount%3C%2FFONT%3E%E4%B8%8D%E4%BC%9A%E5%A2%9E%E5%8A%A0%EF%BC%8C%E8%80%8C%3CFONT%20color%3D%22%23FF9900%22%3EOSA_SemaphoreWait%3C%2FFONT%3E%20()%20%E5%8F%AA%E6%98%AF%E7%BB%A7%E7%BB%AD%E8%BF%94%E5%9B%9E%20KOSA_StatusIdle%E3%80%82%3C%2FP%3E%3CP%3E%E5%BD%93%E5%AE%83%E9%99%B7%E5%85%A5%E5%BE%AA%E7%8E%AF%E6%97%B6%EF%BC%8C%E8%B0%83%E7%94%A8%E5%A0%86%E6%A0%88%E5%A6%82%E4%B8%8B%EF%BC%9A%3C%2FP%3E%3CDIV%3E%E7%BA%BF%E7%A8%8B%20%231%2057005%EF%BC%88%E6%9A%82%E5%81%9C%EF%BC%9A%E6%96%AD%E7%82%B9%EF%BC%89%3C%2FDIV%3E%3CDIV%3EOSA_SemaphoreWait%EF%BC%88%EF%BC%89%E4%BD%8D%E4%BA%8Efsl_os_abstraction_bm.c%3A584%200x616e%3C%2FDIV%3E%3CDIV%3ESDMMC_OSAEventWait%EF%BC%88%EF%BC%89%E4%BD%8D%E4%BA%8Efsl_sdmmc_osa.c%3A69%200x3268%3C%2FDIV%3E%3CDIV%3ESDMMCHOST_TransferFunction()%E4%BD%8D%E4%BA%8E%20fsl_sdmmc_host.c%3A2990x8524%3C%2FDIV%3E%3CDIV%3ESD_SendScr()%E4%BD%8D%E4%BA%8Efsl_sd.c%3A8140x16e0%3C%2FDIV%3E%3CDIV%3Esdcard_init()%20%E4%BD%8D%E4%BA%8E%20fsl_sd.c%3A2%2C0330x2cbe%3C%2FDIV%3E%3CDIV%3Efsl_sd.c%20%E4%B8%8A%E7%9A%84%20SD_CardInit()%EF%BC%9A2%2C0850x2d96%3C%2FDIV%3E%3CDIV%3Efsl_sd.c%20%E4%B8%AD%E7%9A%84%20SD_Init()%EF%BC%9A22680x307a%3C%2FDIV%3E%3CDIV%3Esd_disk_initialize%EF%BC%88%EF%BC%89%E4%BD%8D%E4%BA%8Efsl_sd_disk.c%3A1450x374c%3C%2FDIV%3E%3CDIV%3Ediskio.c%3A117%20%E5%A4%84%E7%9A%84%20disk_initialize()0x87ba%3C%2FDIV%3E%3CDIV%3Emount_volume()%20%E4%BD%8D%E4%BA%8E%20ff.c%3A3%2C376%200x3c02%3C%2FDIV%3E%3CDIV%3Ef_opendir()%20%E4%BD%8D%E4%BA%8E%20ff.c%3A4%2C544%200x953c%3C%2FDIV%3E%3CDIV%3E%E5%9C%A8MK66F18_Van_Gizmo_v02.c%3A340%200xa9a%E5%A4%84prepareSDForWrite%EF%BC%88%EF%BC%89%3C%2FDIV%3E%3CDIV%3E%E6%B5%8B%E9%87%8F%E5%8A%A0%E9%80%9F%E5%BA%A6%E8%AE%A1%EF%BC%88%E4%BD%8D%E4%BA%8EMK66F18_Van_Gizmo_v02.c%3A353%200xaee%EF%BC%89%3C%2FDIV%3E%3CDIV%3Emain%EF%BC%88%EF%BC%89%E4%BD%8D%E4%BA%8EMK66F18_Van_Gizmo_v02.c%3A416%200xc8c%3C%2FDIV%3E%3CDIV%3E%26nbsp%3B%3C%2FDIV%3E%3CDIV%3E%E6%88%91%E6%80%8E%E6%A0%B7%E6%89%8D%E8%83%BD%E5%9C%A8%E6%97%B6%E9%97%B4%E7%89%A9%E7%90%86%E6%B5%81%E9%80%9D%E7%9A%84%E5%90%8C%E6%97%B6%E5%87%8F%E5%B0%91%E8%B6%85%E6%97%B6%E5%80%BC%EF%BC%8C%E6%88%96%E8%80%85%E5%A2%9E%E5%8A%A0%E4%BF%A1%E5%8F%B7%E9%87%8F%E8%AE%A1%E6%95%B0%EF%BC%8C%E4%BB%A5%E4%BE%BF%E5%BE%AA%E7%8E%AF%E7%BB%A7%E7%BB%AD%E6%AD%A3%E5%B8%B8%E5%B7%A5%E4%BD%9C%EF%BC%8C%E7%9B%B4%E5%88%B0%20f_opendir()%20%E5%AE%8C%E6%88%90%EF%BC%9F%3C%2FDIV%3E%3CDIV%3E%26nbsp%3B%3C%2FDIV%3E%3CDIV%3E%E5%8F%A6%E5%A4%96%EF%BC%8C%E8%BF%99%E6%98%AF%20g_sd%20%E5%8F%98%E9%87%8F%E8%BF%9B%E5%85%A5%E6%97%A0%E9%99%90%E5%BE%AA%E7%8E%AF%E6%97%B6%E7%9A%84%E6%88%AA%E5%9B%BE%EF%BC%9A%3C%2FDIV%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1902539%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%E5%9B%9E%E5%A4%8D%EF%BC%9AFRDM-K66F%20microSD%20f_opendir%20%E6%B0%B8%E4%B8%8D%E8%BF%94%E5%9B%9E%EF%BC%9A%E5%8D%A1%E5%9C%A8%20SDMMC_OSAEventWait%20%E4%B8%AD%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1902539%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%E8%AF%B7%E9%97%AE%E6%82%A8%E4%BD%BF%E7%94%A8%E7%9A%84%E6%98%AF%E4%BB%80%E4%B9%88%E7%B1%BB%E5%9E%8B%E7%9A%84%20SD%20%E5%8D%A1%EF%BC%9F%E5%AE%83%E6%98%AF%E5%A6%82%E4%BD%95%E6%A0%BC%E5%BC%8F%E5%8C%96%E7%9A%84%EF%BC%9AExFAT%EF%BC%8C%E8%BF%98%E6%98%AF%20MS-DOS%20%2F%20FAT%EF%BC%9F%E6%88%91%E7%9F%A5%E9%81%93%E8%BF%99%E4%B8%8D%E5%BA%94%E8%AF%A5%E6%9C%89%E9%97%AE%E9%A2%98%EF%BC%8C%E4%BD%86%E5%A6%82%E6%9E%9C%E6%88%91%E4%BD%BF%E7%94%A8%E4%B8%8D%E5%90%8C%E7%9A%84%20SD%20%E5%8D%A1%EF%BC%8C%E6%88%91%E4%BC%9A%E5%9C%A8%E7%9B%B8%E5%90%8C%E7%9A%84%E4%BB%A3%E7%A0%81%E4%B8%AD%E7%9C%8B%E5%88%B0%E4%B8%8D%E5%90%8C%E7%9A%84%E7%BB%93%E6%9E%9C%E3%80%82%E4%BD%BF%E7%94%A8%20ACMD51%20%E5%A4%B1%E8%B4%A5%E7%9A%84%E6%98%AF%E6%A0%BC%E5%BC%8F%E5%8C%96%E4%B8%BA%20FAT-32%20%E7%9A%84%202GB%20Lexar%EF%BC%9B%E5%8F%A6%E4%B8%80%E4%B8%AA%E6%98%AF%E6%A0%BC%E5%BC%8F%E5%8C%96%E4%B8%BA%20ExFAT%20%E7%9A%84%2064GB%20SanDisk%E3%80%82%E8%AF%A5%E6%93%8D%E4%BD%9C%E5%9C%A8%20sdcard_init()%20%2F%20fsl_sd.c%20%E4%B8%AD%E7%9A%84%20SD_AllSendCid()%20%E7%AC%AC%202005%20%E8%A1%8C%E5%A4%B1%E8%B4%A5%E3%80%82%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1901057%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%E5%9B%9E%E5%A4%8D%EF%BC%9AFRDM-K66F%20microSD%20f_opendir%20%E6%B0%B8%E4%B8%8D%E8%BF%94%E5%9B%9E%EF%BC%9A%E5%8D%A1%E5%9C%A8%20SDMMC_OSAEventWait%20%E4%B8%AD%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1901057%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3E%E6%9B%B4%E5%A4%9A%E4%BF%A1%E6%81%AF%EF%BC%9A%3C%2FP%3E%3CP%3E%E8%BF%99%E6%98%AF%E5%9C%A8%3CSPAN%3Esdcard_init()%20-%26gt%3B%3C%2FSPAN%3E%20%3CSPAN%3ESD_SendScr()%20%E4%B8%AD%EF%BC%8C%E6%88%96%E8%80%85%E5%BD%93%E6%88%91%E4%BB%AC%E8%BF%90%E8%A1%8C%20SD%20%E5%91%BD%E4%BB%A4%3C%2FSPAN%3E%3CSPAN%3EACMD51%EF%BC%88%3C%2FSPAN%3E%3CFONT%20face%3D%22inherit%22%3E%E8%AF%BB%E5%8F%96%20SD%20%E9%85%8D%E7%BD%AE%E5%AF%84%E5%AD%98%E5%99%A8%20(SCR)%EF%BC%89%E6%97%B6%E9%94%81%E5%AE%9A%E7%9A%84%E3%80%82%E5%BD%93%E6%88%91%E9%80%90%E6%AD%A5%E6%89%A7%E8%A1%8C%20SD_SendSCR()%20%E4%B8%AD%E7%9A%84%E5%91%BD%E4%BB%A4%E6%97%B6%EF%BC%8C%E6%88%91%E6%B3%A8%E6%84%8F%E5%88%B0%E5%AE%83%E4%B8%8D%E4%BC%9A%E5%83%8F%E4%B9%8B%E5%89%8D%E7%9A%84%E5%91%BD%E4%BB%A4%EF%BC%88%E4%BE%8B%E5%A6%82%20SD_SendRca()%20%E6%88%96%20SD_SendCsd()%EF%BC%89%E9%82%A3%E6%A0%B7%E8%A7%A6%E5%8F%91%20SDHC%20%E4%B8%AD%E6%96%AD%E3%80%82%E8%BF%99%E4%BA%9B%E5%87%BD%E6%95%B0%3C%2FFONT%3E%E4%BC%9A%E8%A7%A6%E5%8F%91%3CFONT%20face%3D%22inherit%22%3E%E4%B8%AD%E6%96%AD%EF%BC%8C%E4%B9%9F%E5%B0%B1%E6%98%AF%E5%9C%A8%E5%88%B0%E8%BE%BE%20SDMMC_OSAEventWait()%20%E4%B9%8B%E5%89%8D%E4%BF%A1%E5%8F%B7%E9%87%8F%E8%AE%A1%E6%95%B0%E5%99%A8%E4%BC%9A%E5%A2%9E%E5%8A%A0%E3%80%82%3C%2FFONT%3E%3C%2FP%3E%3CP%3E%3CFONT%20face%3D%22inherit%22%3ESD_SendScr()%20%E6%9C%89%E4%BB%80%E4%B9%88%E9%97%AE%E9%A2%98%EF%BC%9F%3C%2FFONT%3E%3C%2FP%3E%3CP%3E%E4%B8%BA%E4%BA%86%E4%BB%A5%E9%98%B2%E4%B8%87%E4%B8%80%EF%BC%8C%E6%88%91%E5%B9%B6%E6%B2%A1%E6%9C%89%E5%9C%A8%E8%BF%99%E4%B8%AA%E5%BA%94%E7%94%A8%E7%A8%8B%E5%BA%8F%E4%B8%AD%E4%B8%93%E9%97%A8%E4%BD%BF%E7%94%A8%20DMA%E3%80%82%E8%BF%99%E6%9C%89%E4%BB%80%E4%B9%88%E5%8C%BA%E5%88%AB%E5%90%97%EF%BC%9F%3C%2FP%3E%3C%2FLINGO-BODY%3E