Skip to main content
Visitor II
July 7, 2023
Question

RTOS & SDCard gives FR_NOT_READY on first power up; FR_OK after reset button

  • July 7, 2023
  • 1 reply
  • 1019 views

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.

This topic has been closed for replies.

1 reply

Ghofrane GSOURI
Technical Moderator
July 7, 2023

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.

Thx

Ghofrane

 

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.