ESP32 boot process without USB connection to laptop

esp32-user
Posts: 10
Joined: Sat Mar 05, 2022 6:54 pm

ESP32 boot process without USB connection to laptop

Postby esp32-user » Sat Mar 05, 2022 7:11 pm

Hi,

I'm looking for guidance on the boot process for the ESP32. My chip is ESP32-D0WDQ6 (revision 1) on a "FREENOVE" ESP32-WROVER-DEV development board, using Arduino IDE to program it.

My issue is that it works perfectly when plugged into my laptop with the USB cable, but not if I move the USB cable to a power supply. It seems like the USB connection to the laptop is doing something that just power is not doing. If it's helpful, here is my boot sequence:

Code: Select all

esptool.py v3.0-dev
Serial port /dev/cu.usbserial-14140
Connecting.....
Chip is ESP32-D0WDQ6 (revision 1)
Features: WiFi, BT, Dual Core, 240MHz, VRef calibration in efuse, Coding Scheme None
Crystal is 40MHz
MAC: 78:e3:6d:18:03:5c
Uploading stub...
Running stub...
Stub running...
Configuring flash size...
Auto-detected Flash size: 4MB
Compressed 8192 bytes to 47...
Writing at 0x0000e000... (100 %)
Wrote 8192 bytes (47 compressed) at 0x0000e000 in 0.0 seconds (effective 5852.9 kbit/s)...
Hash of data verified.
Compressed 18656 bytes to 12053...
Writing at 0x00001000... (100 %)
Wrote 18656 bytes (12053 compressed) at 0x00001000 in 1.2 seconds (effective 127.6 kbit/s)...
Hash of data verified.
Compressed 270016 bytes to 126577...
Writing at 0x00010000... (12 %)
Writing at 0x00014000... (25 %)
Writing at 0x00018000... (37 %)
Writing at 0x0001c000... (50 %)
Writing at 0x00020000... (62 %)
Writing at 0x00024000... (75 %)
Writing at 0x00028000... (87 %)
Writing at 0x0002c000... (100 %)
Wrote 270016 bytes (126577 compressed) at 0x00010000 in 12.3 seconds (effective 176.1 kbit/s)...
Hash of data verified.
Compressed 3072 bytes to 128...
Writing at 0x00008000... (100 %)
Wrote 3072 bytes (128 compressed) at 0x00008000 in 0.0 seconds (effective 1310.4 kbit/s)...
Hash of data verified.

Leaving...
Hard resetting via RTS pin...
Here's what I see on the console:
0x1 (POWERON_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)

And here is my code:

Code: Select all

#define RXD2 13
#define TXD2 12



void setup(){
  Serial.begin(115200);
  Serial1.begin(115200, SERIAL_8N1, RXD2, TXD2);  
}

int serial_lines_sent = 0, serial1_lines_sent = 0;

void loop() {
  
  if (Serial) Serial.printf("Serial lines_sent(%d)\n", serial_lines_sent++);
  if (Serial1) Serial1.printf("Serial1 lines_sent(%d)\n", serial1_lines_sent++);
  
  delay(2000);

}
I've looked through the reference docs, and tried adding a wire jumper between GPIO0 and 3.3V and as well to Ground - didn't make it work. Tried touching the two buttons on the dev board - didn't work. All these things triggered different behaviors on the board LEDs, but didn't make my program work.

The thing that is not working is I don't get the Serial output to my Serial1. I have a longer program that has a web server, and that seems to work some of the time, but the serial output does not happen. Since my goal is to read data from the wifi and write to the serial, I really want the serial output to happen even when not connected to the laptop and the IDE - I just want it to run when it gets power.

Any hints or tips most appreciated!

ESP_Sprite
Posts: 9725
Joined: Thu Nov 26, 2015 4:08 am

Re: ESP32 boot process without USB connection to laptop

Postby ESP_Sprite » Sun Mar 06, 2022 3:28 am

Does it work standalone after you either press the reset button or lower the EN line on the ESP32 to ground momentarily using e.g. a wire? If so, you can try adding e.g. an 10uF capacitor between EN and ground.

esp32-user
Posts: 10
Joined: Sat Mar 05, 2022 6:54 pm

Re: ESP32 boot process without USB connection to laptop

Postby esp32-user » Sun Mar 06, 2022 8:26 am

Does it work standalone after you either press the reset button or lower the EN line on the ESP32 to ground momentarily using e.g. a wire? If so, you can try adding e.g. an 10uF capacitor between EN and ground.
Thanks for your help!

Unfortunately neither the EN pin grounding or reset button make it work.

When I have the IDE running and the USB console port connected to the device, and I touch the upload code button on the Arduino IDE, it works fine. I see output on both the console and my tty session via a different port on my mac. All perfect.

If I remove power by unplugging the USB console cable, wait a few seconds, and then plug it back into the console cable with the IDE still running, it starts again. All is fine.

If I stop the Arduino IDE, remove power by unplugging the USB console cable, wait a few seconds, and then plug it back into the console cable with the IDE not running, it starts again. All is still fine.

If I remove the console cable and plug it into a USB power source - in other words not in my laptop, not in an "intelligent" USB port, just a power brick (2.4A), it does not work. What I do see, which is different, is that the TX LED on my board blinks at about 2.5-3 times a second.

While connected to the power brick, I hold down the EN/RST button on the board, the blinking stops, and starts again right after I release it, but I do not get my output. It just keeps blinking at about 2.5-3 times per second.

If I move the console USB cable back to the laptop, the board works again, and I get serial output where I should.


The things that I can think of are the following:
1) there are other pins being driven high or low by plugging the USB console cable into my laptop;
2) when I use the USB charging brick, which does not have a serial port on the USB, the assignment of Serial devices on the board are different, so my output goes somewhere else or the board is so unhappy it doesn't start right.

What's not clear is what state is the board in that causes the fast blinking? What is it indicating? How can I work around this?

Happy for your help!

ESP_Sprite
Posts: 9725
Joined: Thu Nov 26, 2015 4:08 am

Re: ESP32 boot process without USB connection to laptop

Postby ESP_Sprite » Mon Mar 07, 2022 1:24 am

Honestly, it sounds like the board you have is badly designed. I imagine the USB-serial controller indeed is acting differently when initialized and when not initialized, and that messes up the ESP32s startup process...

What you can try, perhaps, is simply hardwiring all the required bootstrap pins to what the ESP32 requires... wire GPIO 0 and 15 to 3.3V, GPIO2 and 12 to ground, power on the ESP32 and after a second also hardwire EN to 3.3V. See if that works; if it does you have an issue of the USB-serial chip messing with your bootstrap pins.

esp32-user
Posts: 10
Joined: Sat Mar 05, 2022 6:54 pm

Re: ESP32 boot process without USB connection to laptop

Postby esp32-user » Mon Mar 07, 2022 6:57 am

What you can try, perhaps, is simply hardwiring all the required bootstrap pins to what the ESP32 requires... wire GPIO 0 and 15 to 3.3V, GPIO2 and 12 to ground, power on the ESP32 and after a second also hardwire EN to 3.3V. See if that works; if it does you have an issue of the USB-serial chip messing with your bootstrap pins.
Many thanks - will give this a try and report back!

esp32-user
Posts: 10
Joined: Sat Mar 05, 2022 6:54 pm

Re: ESP32 boot process without USB connection to laptop

Postby esp32-user » Tue Mar 08, 2022 6:33 am

Just a quick update - I didn't have enough time to complete the testing. Will report back with my results in the next day or so.

esp32-user
Posts: 10
Joined: Sat Mar 05, 2022 6:54 pm

Re: ESP32 boot process without USB connection to laptop

Postby esp32-user » Fri Mar 11, 2022 9:13 pm

I've determined that the machine is actually booting fine even without the USB connector. The indicator that it was not booting was an issue with the serial port output - which I'm working on - and that led me to believe that the machine was not booting. So all is fine, and I thank you for your support.

Who is online

Users browsing this forum: No registered users and 78 guests