Oddities with SD
Posted: Sat Jul 02, 2022 5:41 am
Greetings! Faced a very strange problem when working with the built-in SD slot
Initially (still on micropotchon 1.17) I had a problem with the SD card, in order to re-mount it, I had to reboot the board. This is very strange, because I unmount the sd card when my code was completed.
I've made peace with it and just implemented an automatic reload of the board after the code ends. But now even that is impossible! This time when I access the sd card I get 3 different errors each time.
1) When i opening any file: E (19210) sdmmc_cmd: sdmmc_write_sectors_dma: sdmmc_send_cmd returned 0x108
2) When i get card info by: (-264, 'ESP_ERR_INVALID_RESPONSE') or E (940) sdmmc_sd: sdmmc_init_sd_if_cond: send_if_cond (1) returned 0x108
3) When i mounting SD without reboot: (-259, 'ESP_ERR_INVALID_STATE') or OSError: 16 Note: SD Card unmounting always.
The saddest part is that it doesn't happen every time. Sometimes it still works and I have this problem on 3 different boards.
List of boards on which the problem is observed:
- LILYGO® TTGO T-Camera Plus ESP32-DOWDQ6 : http://www.lilygo.cn/prod_view.aspx?Typ ... t3:50067:3
- LILYGO® TTGO VGA32 V1.4 : http://www.lilygo.cn/prod_view.aspx?Typ ... t3:50063:3
- Goouuu ESP32F Dev Kit : https://prnt.sc/yddtje - pinout
PS The card has a size of 1 GB, and it was additionally checked on arduino through an additional module, where it always worked properly. From the computer, there are no problems with the SD card either.
Initially (still on micropotchon 1.17) I had a problem with the SD card, in order to re-mount it, I had to reboot the board. This is very strange, because I unmount the sd card when my code was completed.
Code: Select all
import machine, os
sd = machine.SDCard(slot=2)
os.mount(sd, "/sd")
1) When i opening any file: E (19210) sdmmc_cmd: sdmmc_write_sectors_dma: sdmmc_send_cmd returned 0x108
2) When i get card info by
Code: Select all
sd.info()
3) When i mounting SD without reboot: (-259, 'ESP_ERR_INVALID_STATE') or OSError: 16 Note: SD Card unmounting always.
The saddest part is that it doesn't happen every time. Sometimes it still works and I have this problem on 3 different boards.
List of boards on which the problem is observed:
- LILYGO® TTGO T-Camera Plus ESP32-DOWDQ6 : http://www.lilygo.cn/prod_view.aspx?Typ ... t3:50067:3
- LILYGO® TTGO VGA32 V1.4 : http://www.lilygo.cn/prod_view.aspx?Typ ... t3:50063:3
- Goouuu ESP32F Dev Kit : https://prnt.sc/yddtje - pinout
PS The card has a size of 1 GB, and it was additionally checked on arduino through an additional module, where it always worked properly. From the computer, there are no problems with the SD card either.