cancel
Showing results for 
Search instead for 
Did you mean: 

256 MB support on STM323F411

AShar.8
Associate

Hello,

I am following up on this question as it is still not solved.

We are not able to support 256MB SD CARD. Please see below.

We are using stm32F411RE discovery kit. The code was generated with the cubeMX4.25. This code is supporting 4GB and 16GB SDHC card but 256MB SD Card does't work. We are getting error 'FR_NOT_READY' in f_mount function.

Please suggest if there is a patch or old revision of code that can support 256MB card?

2 REPLIES 2
Durmil Makwana
Associate II

Hello,

I would like to update the current status of the issue. We have three 256MB cards and out of three cards one card is working perfectly with the firmware. One card gives an error FR_NO_FILESYSTEM and another one gives an error FR_DISK_ERR.

We check into the lower level functions of FatFs and it gets error from below function.

File Name : ff.c

Function Name: FRESULT find_volume

bsect = 0;

fmt = check_fs(fs, bsect); /* Load sector 0 and check if it is an FAT-VBR as SFD */

if (fmt == 2 || (fmt < 2 && LD2PT(vol) != 0)) { /* Not an FAT-VBR or forced partition number */

for (i = 0; i < 4; i++) { /* Get partition offset */

pt = fs->win + (MBR_Table + i * SZ_PTE);

br[i] = pt[PTE_System] ? ld_dword(pt + PTE_StLba) : 0;

}

i = LD2PT(vol); /* Partition number: 0:auto, 1-4:forced */

if (i) i--;

do { /* Find an FAT volume */

bsect = br[i];

fmt = bsect ? check_fs(fs, bsect) : 3; /* Check the partition */

} while (LD2PT(vol) == 0 && fmt >= 2 && ++i < 4);

}

if (fmt == 4) return FR_DISK_ERR; /* An error occured in the disk I/O layer */

if (fmt >= 2) return FR_NO_FILESYSTEM; /* No FAT volume is found */

The values in br[] array in working 256MB Card is {0x65, 0x00, 0x00, 0x00}

The values in br[] array in non-working 256MB Card is {0x3F, 0x00, 0x00, 0x00}

So, We searched and found that these numbers are indicating the number of hidden sectors of the SD Card.

after executing the do_While loop the fmt was fed with 4 and 3 in non-working cards.

Should we Check for any other possible area? Can 0x65 and 0x3f make a difference?

Existing thread on topic https://community.st.com/s/question/0D50X00009XkWDrSAN/issue-of-mounting-256mb-sd-card-in-stm32f411-discovery-kit-using-sdio-interface

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..