Page 1 of 1

SD Card and Wifi: Write sector and Timeout

Posted: Sat May 27, 2017 10:57 am
by maxwell32
Hello,
i have following problem:

I have 2 tasks running on two different cores on the ESP32.

Task1 initializes the SD Card, writes some data to the SD Card successfully and then is doing nothing but vTaskDelay for testing.

Task2 (Wifi task) initializes wifi in access point mode, accepts a client and receives data. If a specific command is received, the task uses sdmmc_write_sectors to write one sector to the SD Card.
The sdmmc_write_sectors in the wifi task leads to a timeout (error 0x107 means timeout):

Code: Select all

sdmmc_cmd: sdmmc_write_sectors: sdmmc_send_cmd returned 0x107
Do you know why the sd card can't be used in another task although task1 doesn't use the sd card after initializing??

Thanks for your help!

Re: SD Card and Wifi: Write sector and Timeout

Posted: Sat May 27, 2017 12:29 pm
by ESP_igrr
There's shouldn't be a limitation related to usage of sdmmc driver from different task, as long as you use it only from one task at a time. Can you post the code to reproduce the issue?

Re: SD Card and Wifi: Write sector and Timeout

Posted: Sun May 28, 2017 1:24 am
by Ritesh
maxwell32 wrote:Hello,
i have following problem:

I have 2 tasks running on two different cores on the ESP32.

Task1 initializes the SD Card, writes some data to the SD Card successfully and then is doing nothing but vTaskDelay for testing.

Task2 (Wifi task) initializes wifi in access point mode, accepts a client and receives data. If a specific command is received, the task uses sdmmc_write_sectors to write one sector to the SD Card.
The sdmmc_write_sectors in the wifi task leads to a timeout (error 0x107 means timeout):

Code: Select all

sdmmc_cmd: sdmmc_write_sectors: sdmmc_send_cmd returned 0x107
Do you know why the sd card can't be used in another task although task1 doesn't use the sd card after initializing??

Thanks for your help!
On which interface means SDIO or SPI interface are you using SD Card?

Also, from Task1 and Task2, you have followed same code process to write some data to SD card?