Showing results for 
Search instead for 
Did you mean: 

Stm32Cubex RTOS & SDCard first board power on show FR_NOT_READY, but press reset button will FR_OK.


Does anyone meet this problem?

I use Stm32Cubex  to do a freertos & sdcard with sdmmc, it work good,

but it has a problem, it the board power on first and not press reset button.

the first f_open will return  FR_NOT_READY and the f_mount is FR_OK. then any fatfs api will not work, all return FR_DISK_ERROR.

but if i power on the board and press reset button, it work.

Ghofrane GSOURI
ST Employee

Hello @HuangYungChuan

 First let me thank you for posting.

One possible solution is to add a delay after the system starts up before attempting to access the SD card. This will give the SD card time to fully initialize before attempting to access it.

You can use the vTaskDelay() function provided by FreeRTOS. This function suspends the current task for a specified period of time, allowing other tasks to run in the meantime.