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...
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);
}
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!