In the latest rev of my board I moved the SD card connections from the confusingly-named SD_* pins to the JTAG pins (MTMS, MTDI, MTCK, MTDO, GPIO2, GPIO4). Unfortunately, I've been tearing my hair out for the past few days trying to figure out why the bootloader doesn't see the flash of the ESP-WROOM-32 module I'm using. I knew I had to explicitly set the VDD_SDIO regulator fuses to 3.3v, which I did successfully. However, the bootloader *still* wouldn't see the flash. It turns out I forgot about the GPIO2 strapping pin, and that it needs to be pulled low for download mode. But this raises many questions.
1. When GPIO2 is pulled high, the ESP32 boots into UART_BOOT mode, as opposed to DOWNLOAD_BOOT mode. What is the difference between these two modes? UART_BOOT doesn't seem to be documented at all.
2. I suspect the UART_BOOT mode allowed esptool/espefuse to upload its own stub, which allowed me to set and confirm the fuses, MAC address, etc. However, the SPI flash didn't work. Is it possible to modify the stub to get the flash interface working, or is there something fundamentally different about UART_BOOT mode which prevents access to the flash?
3. Given that both GPIO2 and GPIO12 are used as strapping pins and SD card pins, and the recommendation to use pull-up resistors with SD cards, would it be possible/recommended to use the internal pull-up registers of the ESP32 instead of external resistors? This would avoid a lot of these issues.
Basically, I'm wondering if I should keep the external pull-up resistors and modify the esptool stub (if it's possible), or remove them and rely on the ESP32's internal pull-ups. GPIO0 is used for other things besides selecting the boot mode, so the trick of tying GPIO0 and GPIO2 together won't work.
Bootloader woes and SD card pull-ups
Re: Bootloader woes and SD card pull-ups
If would post your boards schematic, it may help understand your problem better.
In general, you do need external pullups for SD card (internal ones are not adequate for high speed cards), and your download mode circuit needs to pull GPIO2 low on download (just as it pulls low GPIO0).
In general, you do need external pullups for SD card (internal ones are not adequate for high speed cards), and your download mode circuit needs to pull GPIO2 low on download (just as it pulls low GPIO0).
Re: Bootloader woes and SD card pull-ups
I've attached a simplified schematic. What I'm hoping to use:
1. SD card
2. SPI bus for LCD
3. Internal stereo DAC
4. Internal ADC
5. I2C
6. 32.768kHz crystal
7. At least two touch pads
I have fairly limited options for pin assignments. GPIO2 is used by the SD card. GPIO0 is tri-stated by the USB controller if it's not resetting into the bootloader, allowing it to also be used as a touch pad, so I can't simply connect GPIO0 and GPIO2 together as suggested in the SD card example. (Yeah, it's probably not the best idea to share it like that, but it's good enough for hobbyist use.)
It seems like my options are:
1. Remove the pull-up on SD0 and hope for the best.
2. Remove the 32.768kHz crystal and move one touch pad to that, allowing GPIO0 and GPIO2 to be connected.
3. Get the esptool stub to work with the SPI flash when loaded in UART boot mode?
4. Route signals through the GPIO matrix?
5. Something else?
1. SD card
2. SPI bus for LCD
3. Internal stereo DAC
4. Internal ADC
5. I2C
6. 32.768kHz crystal
7. At least two touch pads
I have fairly limited options for pin assignments. GPIO2 is used by the SD card. GPIO0 is tri-stated by the USB controller if it's not resetting into the bootloader, allowing it to also be used as a touch pad, so I can't simply connect GPIO0 and GPIO2 together as suggested in the SD card example. (Yeah, it's probably not the best idea to share it like that, but it's good enough for hobbyist use.)
It seems like my options are:
1. Remove the pull-up on SD0 and hope for the best.
2. Remove the 32.768kHz crystal and move one touch pad to that, allowing GPIO0 and GPIO2 to be connected.
3. Get the esptool stub to work with the SPI flash when loaded in UART boot mode?
4. Route signals through the GPIO matrix?
5. Something else?
- Attachments
-
- esp32-boot-issue.png (115.36 KiB) Viewed 14229 times
Re: Bootloader woes and SD card pull-ups
Instead of connecting IO2 and IO0, can you drive each of them to low logic level when in download mode? This way both pins will be low (as required by bootloader) but will still be allowed to work independently when not in download mode. Here's a part of the schematic of WROVER-KIT where we have added the third transistor to do that.
Re: Bootloader woes and SD card pull-ups
Hi guys,
I am bit confused with this, I am not so experienced in the hardware part.
In my case I also use an SD card but I have the ESP32_core_board_V2 (https://www.adafruit.com/product/3269).
I've searched for the shcematics , and I am using the SD card connected as follows:
ESP32DevBoard SD
GPIO14 (MTMS) ----> CLK ---- 10k pullup
GPIO 15 (MTD0) ---> CMD ---- 10k pullup
GPIO 2 --------------> D0 ---- 10k pullup (here needs the pulldown in dorder to go to download mode)
GPIO 4 --------------> D1 ---- 10k pullup** (Currently I'am not using it because 4-bit mode didn't work)
GPIO 12 (MTDI) ----> D2 ---- 10k pullup** (Currently I'am not using it because 4-bit mode didn't work)
GPIO 13 (MTCK) ---> D3 ---- 10k pullup
N/c CD
N/c WP
So, connected like that, in 1-bit mode I can program the ESP32 dev board (connected to nothing), then unplug the USB and connect the ESP32 dev board to the bread board with the SD connections shown above.
Could you please tell me how it should be connected to be capable of using 4-bit mode and, more important now, to be able of go to download mode, flash and reset without having to disconnect the SD pins every time?
Last thing, adding the Q9, as in the picture form the post above, to the schematic of the ESP32DevBoard would solve this issue or is there anything else needed too.
Thanks.
I am bit confused with this, I am not so experienced in the hardware part.
In my case I also use an SD card but I have the ESP32_core_board_V2 (https://www.adafruit.com/product/3269).
I've searched for the shcematics , and I am using the SD card connected as follows:
ESP32DevBoard SD
GPIO14 (MTMS) ----> CLK ---- 10k pullup
GPIO 15 (MTD0) ---> CMD ---- 10k pullup
GPIO 2 --------------> D0 ---- 10k pullup (here needs the pulldown in dorder to go to download mode)
GPIO 4 --------------> D1 ---- 10k pullup** (Currently I'am not using it because 4-bit mode didn't work)
GPIO 12 (MTDI) ----> D2 ---- 10k pullup** (Currently I'am not using it because 4-bit mode didn't work)
GPIO 13 (MTCK) ---> D3 ---- 10k pullup
N/c CD
N/c WP
So, connected like that, in 1-bit mode I can program the ESP32 dev board (connected to nothing), then unplug the USB and connect the ESP32 dev board to the bread board with the SD connections shown above.
Could you please tell me how it should be connected to be capable of using 4-bit mode and, more important now, to be able of go to download mode, flash and reset without having to disconnect the SD pins every time?
Last thing, adding the Q9, as in the picture form the post above, to the schematic of the ESP32DevBoard would solve this issue or is there anything else needed too.
Thanks.
Who is online
Users browsing this forum: Bing [Bot] and 56 guests