Olimex Support Forum

Microcontrollers => ESP32 => Topic started by: s-hadinger on April 18, 2022, 08:48:56 PM

Title: ESP32-POE SD Card has no CS line
Post by: s-hadinger on April 18, 2022, 08:48:56 PM
Hi, I bought a couple of ESP32-POE and I'm very happy with them. I'm now trying to get SD Card working. I'm one of the developers at Tasmota. I tried to mount the SD Card formatted as FAT32, it worked with a bunch of other devices, but not with this one.

Looking closer to the schematics, it looks like on MICRO_SD1 connector, `CD/DAT3/CS` is always pulled high and not connected to any ESP32 GPIO. This means that there is no way to pull down CS.

Checking with SDCARD SPI mode, you *need* to pull CS down to make the SPI protocol work.

Am I missing something? I can't see the magic with CS of SDCARD simply not connected to any GPIO.

Note: I did set `BOARD_HAS_1BIT_SDMMC` on Arduino with no change.
Title: Re: ESP32-POE SD Card has no CS line
Post by: LubOlimex on April 19, 2022, 10:09:33 AM
ESP32-POE has 1-bit SD card interface. It is not possible to use the card in SPI mode.

We have provided example for the SD card:

https://raw.githubusercontent.com/OLIMEX/ESP32-POE/master/SOFTWARE/ARDUINO/ESP32_PoE_Ethernet_SD_Card_Arduino/ESP32_PoE_Ethernet_SD_Card_Arduino.ino
Title: Re: ESP32-POE SD Card has no CS line
Post by: s-hadinger on April 19, 2022, 10:15:07 AM
Ah! I thought that 1 bit means SPI, but I understand now it is SDIO 1-bit mode.

Thanks for your fast response.
Title: Re: ESP32-POE SD Card has no CS line
Post by: LubOlimex on April 19, 2022, 10:27:01 AM
In some of the initial releases of ESP32 boards we used to have SPI mode, but it is not good idea, yes you get some speed but you lose pins that can be used for other purposes, and in a chip like ESP32, every free GPIO is important. So we decided to use 1-bit SD mode in all ESP32 designs.