FRDMK66F - maximum size of SD card?

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

FRDMK66F - maximum size of SD card?

588 Views
aaronm
Contributor III

Is there a setting I can use to enable microSD cards bigger than 2 or 4 GB?  My app works if I use a 2GB microSD card, but fails with "Error: send ACMD41 timeout" if I use a 16GB (exfat, or fat32) card.  The error code is coming from SD_ApplicationSendOperationCondition : fsl_sd.c.  In that function, I see there's a check for kSD_SupportHighCapacityFlag, so it appears the software is at least minimally aware that some cards could be larger than expected.

The spec* indicates that the instructions should be changed if the microSD card is high capacity:

If the card is High capacity SD Memory Card, there are 2 cases
1. CMD8 was not issued before ACMD41
2. ACMD41 is issued with HCS=0

But I don't see any accommodation for this condition in the software; or how to configure the SD card parameter to refer to a high capacity card.  So is the SD driver limited to 4GB SD cards?

Right now, I'm using the following SD-related modules:

middleware.fatfs.sd.MK66F18
middleware.sdmmc.osa.bm.MK66F18
middleware.sdmmc.common.MK66F18
middleware.sdmmc.host.sdhc.MK66F18
middleware.sdmmc.sd.MK66F18
middleware.sdmmc.sdhc.template.MK66F18
middleware.sdmmc.host.sdhc.interrupt.MK66F18
platform.drivers.sdhc.MK66F18
middleware.fatfs.MK66F18
middleware.fatfs.template_sd.MK66F18

Do I need SDSPI modules for bigger SD cards?

https://users.ece.utexas.edu/~valvano/EE345M/SD_Physical_Layer_Spec.pdf

0 Kudos
Reply
3 Replies

557 Views
Joey_z
NXP Employee
NXP Employee

Hi , aaronm

I used the MK66FN2M0xxx18 development board and the "frdmk66f_sdcard_fatfs" program in the SDK to conduct an experiment. At the same time, a 32G SD card was used in the experiment. My program can work normally and create files. I tried to modify the program to detect the size of the output SD card. The modified content and test results are shown in the figure below.

XuZhang_0-1720670315945.png

XuZhang_1-1720670325051.png

XuZhang_2-1720670336885.png

I also tested an 8G SD card and the program also worked successfully. I put the program in the attachment, I hope these can help you.

BR

Xu Zhang

0 Kudos
Reply

547 Views
aaronm
Contributor III

XuZhang, thanks for replying.  I tried your example code with a new 64GB microSD, and I got an error:

SEGGER J-Link GDB Server V7.96q - Terminal output channel

FATFS example to demonstrate how to use FATFS with SD card.

Please insert a card into board.

Card inserted.

Make file system......The time may be long if the card capacity is big.
Make file system failed.

Out of curiosity, I tried a different FRDMK66 board - I have two - and with the newer FRDMK66 board, the example code worked like yours with a 64GB microSD.  So it's partly a hardware issue.  I can live with that, since the older FRDMK66 will be used in a harsh environment, and a 2GB SD card should work well enough.

I don't consider this resolved - it should work the same on both boards, I'd think - but you can close the issue.  Thanks!

0 Kudos
Reply

526 Views
Joey_z
NXP Employee
NXP Employee

hi,arronm

OK, I will close the issue,If you meet any issues about your project in the future, You can create the new case,I will continue to help you in your new case, thanks!

BR

Xu Zhang

0 Kudos
Reply