Hello!
I have done this project on Instractable with an ESP32 and a micro SD card reader (the one with the 3.3 V regulator, this model) that works flawlessly. Now I would like to replace the card reader with a much cheaper one (this smaller model) but the ESP32 does not start/boot.
NB the two card readers has the same pins (in different order) except the supply: Vcc = 5V for the former SD reader, 3.3V for the latter.
After some trial and error, I realized that everything works again if I leave the 3.3V disconnected, press the reset button on the ESP32 and, immediately after (< half a second), I connect the 3.3V to the small micro SD card reader. Then the ESP32 boots and everything works properly, I can write and read on the SD... until the next reset!
Has anybody seen this behavior and can give a suggestion to solve this?
For my project this workaround is not acceptable.
More in detail, I am using the ESP32 NodeMCU WiFi - CP2102, with 38 pins.
Thank you in advance,
Roberto.
How do you know it's not booting? Isn't it possible that your sketch is just freezing when it boots? What supply pin did you connect the module to? Can you post a wiring diagram, please?
You may be using one of the SPI RAM pins such as the TMS or TDI or TCK pins that the CPU needs to control during boot but when boot is finished the CPU is finished with those pins and the user may use them.
Post your code which should have the gpio pin number being used.
Or the SD card is dragging down the 3V3 during boot and when boot is done enough power is available... I doubt this is happening. But.
Yes aarg, you are right, I just assume it does not boot because the VGA signal does not start.
Here it is the schematic. The only different with the small SD card reader, is that in the SD female header, Vcc is not connected and the reader board 3.3V PIN is connected to ESP32 3.3V (pin 19).
Dear Idahowalker, these are the pins used for the SD card reader:
spiSD.begin(14, 2, 12, kSD_CS); ////SCK,MISO,MOSI,SS //HSPI1
and this is the board I am using. Which pin are TMS, TDI and TCK?
If the SD card is dragging down the 3.3V during boot... I guess there isn't much I can do? If I measure with a Voltmeter, the 3.3V seems to be completely stable when I press reset, but I guess I should use an oscilloscope?
GPIO_NUM_2 is the on board LED for your module? Try a different pin.
Why are you not using the natural ESP32's SPI pins?
GPIO_NUM_12 is the TDI pin and GPIO_NUM14 is the TMS pin. All that should be listed on your pinout for the board you are using.
GPIO_NUM_23 is the natural SPI MOSI pin with the Arduino core.
GPIO_NUM_19 is the natural MISO pin with the Arduino Core.
GPIO_NUM_5 and GPIO_NUM_15 are the natural CS pins with the Arduino core.
GPIO_NUM_18 is the natural SCK pin.
Some of the natural SPI pins are used for the VGA library (and/or keyboard). I begun this project more then an year ago, and later on I added the use of the SD card reader. At that time I had to choose the suitable pins, but now I do not remember exactly the reason of the actual choice, although I tried to change the PINS for the VGA but it didn't work, so I had to keep them and modify the SD ones.
At the moment I have a working version with PC board that works with the first SD card reader (5 V with internal 3.3V regulator), so to change all the pins I have to start from scratch with a breadboard. I will study these pins in the next days and I will give a try, but I am not very optimistic... eventually I should try with a different brand of small and cheap SD card reader.
Thank you very much for the kind suggestion,
Roberto.
The ESP32's SPI API works under the Arduino IDE and gives much control over the SPI bus that is not available through the core.
I've made a mention or 2 on this site about my use of the ESP32's SPI API.
solved by changing the MOSI pin from 12 to 17, so now the SD pin definition is:
spiSD.begin(14, 2, 17, kSD_CS);
Now the the SD card reader and ESP32 work properly after pressing reset.
This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.