SD Card and Wifi: Write sector and Timeout

maxwell32
Posts: 5
Joined: Thu Apr 13, 2017 6:14 pm

SD Card and Wifi: Write sector and Timeout

Postby maxwell32 » Sat May 27, 2017 10:57 am

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!

ESP_igrr
Posts: 2072
Joined: Tue Dec 01, 2015 8:37 am

Re: SD Card and Wifi: Write sector and Timeout

Postby ESP_igrr » Sat May 27, 2017 12:29 pm

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?

Ritesh
Posts: 1383
Joined: Tue Sep 06, 2016 9:37 am
Location: India
Contact:

Re: SD Card and Wifi: Write sector and Timeout

Postby Ritesh » Sun May 28, 2017 1:24 am

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?
Regards,
Ritesh Prajapati

Who is online

Users browsing this forum: Bing [Bot], Google [Bot] and 163 guests