ESP32-POE SD card and LAN8710 not work together/

#1

Hello. I had a problem with LAN8710 and SD card on ESP32 -POE
I use libraries

 - origin: https://github.com/nliviu/sdlib
 - origin: https://github.com/nliviu/rpc-service-sd
- origin: https://github.com/mongoose-os-libs/ethernet

and config

  - ["sd_spi", "o", {title: "SD SPI settings"}]
  - ["sd_spi.pin_miso", "i", 2, {title: "SD SPI miso"}]  
  - ["sd_spi.pin_mosi", "i", 15, {title: "SD SPI mosi"}]  
  - ["sd_spi.pin_clk", "i", 14, {title: "SD SPI clk"}]  
  - ["eth", "o", {title: "Ethernet settings"}]
  - ["eth.phy_pwr_gpio",12]
  - ["eth.enable", "b", true, {title: "Enable Ethernet interface"}]
  - ["eth.clk_mode", 3]

When I use only ethernet library network work ok. But if I use sd card library ethernet LEDs blinking one and stop work at all. How to make this two libraries working together?

This is log wit sd car library

esp32_eth.c:110         ETH: MAC 24:0a:c4:26:76:27; PHY: LAN87x0 @ 0; IP: DHCP
I (721) emac: emac reset done

This is without

esp32_eth.c:110         ETH: MAC 24:0a:c4:26:76:27; PHY: LAN87x0 @ 0; IP: DHCP
I (721) emac: emac reset done
I (6721) event: eth ip: 192.168.0.100, mask: 255.255.255.0, gw: 192.168.0.1
mgos_net.c:101          ETH: ready, IP 192.168.0.100, GW 192.168.0.1, DNS 192.168.0.1

#2

The Olimex ESP32-PoE board uses the SDMMC interface 1-line mode which is not currently supported by the sdlib.

LE. Added support for 1-line mode
Add - ["sd_sdmmc.use1line", true] in your mos.yml
Please test, I don’t have the hardware to do it.

#3

No, not working. But when I use run sd card initialization before Ethernet, everything work gut

#4

Thanks. I’ll have to buy this board to do further testing.

1 Like
#5

Got my ESP32-POE.
During the initialization of the sdmmc peripheral GPIO12, which is part of it, is pulled down and the ethernet power is cut off.

As a workaround, I’ve set GPIO12 back on after calling mgos_sd_open.

Even their Arduino example loses the ethernet if I move

    if(!SD_MMC.begin()){
        Serial.println("Card Mount Failed");
        return;
    }

after

ETH.begin();

IMHO, choosing GPIO12 to power the ethernet is not a good idea especially when combined with sdmmc.

1 Like