This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

RTOS/PROCESSOR-SDK-AM335X: SD card format issue

Part Number: PROCESSOR-SDK-AM335X

Tool/software: TI-RTOS

Hi Experts,
 
We are developing a product, using AM3352. And I have two problems about handling the FATFS.

 1. How to format the SD card ?Below is my current implementation

=============================================================

FATFS_open(0U, NULL, &fatfsHandle);

FRESULT fRetval = f_mkfs("", FM_EXFAT, 0, work, sizeof work);

=============================================================

But the return value is 3 (FR_NOT_READY,                     /* (3) The physical drive cannot work */ )

 

2. To re-open the FATFS is failed.

=============================================================

FATFS_open(0U, NULL, &fatfsHandle);

 

….. file operation …..

 

FATFS_close(fatfsHandle);

FATFS_open(0U, NULL, &fatfsHandle);

fRetval = f_opendir(&dp, "/xxx");

 =============================================================

Then the return value of f_opendir() is not okay.

 

I suspect that these two issues result from the same root-cause.

I have traced the source code, but I don’t know why the MCSD structure object’s isOpen attribute is -1 when re-open the file system.

Thank you !!

 

Regards,
Eten