OLIMEX / ESP32-POE

ESP32 IoT development board with 100Mb Ethernet and 802.3 Power Over Ethernet (POE)
Apache License 2.0
292 stars 110 forks source link

SD card and Serial1 not working together #19

Closed aboronkai closed 3 years ago

aboronkai commented 3 years ago

I use Serial0 and Serial1 UARTs the same time, but when I try to use the SD card (with the given examples) the Serial1 stops working (Serial0 still OK),

What could be the problem?

Even if I don't do anything (read, write...) with the SD card, just call the SD_MMC.begin at the Setup(), the Serial1 doesn't respond.

aboronkai commented 3 years ago

I made a ton of search on this topic, but found no usable answer. BUT found the solution. Interestingly if I placed the SD_MMC.begin() BEFORE the ETH.begin() line, the SD card was working, the serial1 was working. I don't really understand why, but it works.

DanKoloff commented 3 years ago

Did you update everything first? What you mentioned should not happen anymore if you use latest releases.

In older versions of arduino-esp32 package the pins used for 4-bit mode were not freed to use WHEN and IF you decide to set the 1-bit mode. Meaning that 1-bit mode worked but the rest of the pins were still not free to use.

This used to happen because of this: https://github.com/espressif/arduino-esp32/issues/3903

The issue was re-iterated and clarified here: https://github.com/espressif/arduino-esp32/pull/4020

It was fixed in this commit: https://github.com/espressif/arduino-esp32/commit/594ee6d249f726a0f3335533b911a401d4eb028d

aboronkai commented 3 years ago

Thanks for the reply! I use Arduino 1.8.13, installed at 2020.oct. 13. Using the default SD-MMC example from Olimex, the working mode is 1 bit by default. Anyway as I mentioned I found a way to work...