- The factory-loaded sketch was running on my first ESP32-C3 Zero (output below).
- I wrote my own power-on-self-test code in the Arduino IDE
- I selected ESP32-C3 Dev Module (because no Waveshare C3 Zero and other posts showed this worked)
- I selected IDE >> TOOLS >> "USB CDC On Boot Enable"
- I "uploaded" the code and received an error (but lost this error, can not duplicate)
- The factory sketch stopped (no more RGBLED, no more wifi scan).
- I removed the USB (no "remove" chime) and re-inserted (NO SYSTEM CHIME or Device Manager device)
- I held BOOT while inserting the USB and got a System Chime, Device Manager device and IDE recognition.
- I "uploaded" the sketch but got this... not an error, but died at "Resetting RTS pin"
- I verified the USB cable as data with another board
Sketch uses 935148 bytes (71%) of program storage space. Maximum is 1310720 bytes.
Global variables use 34664 bytes (10%) of dynamic memory, leaving 293016 bytes for local variables. Maximum is 327680 bytes.
esptool v5.1.0
Serial port COM4:
Connecting...
Connected to ESP32-C3 on COM4:
Chip type: ESP32-C3 (QFN32) (revision v0.4)
Features: Wi-Fi, BT 5 (LE), Single Core, 160MHz, Embedded Flash 4MB (XMC)
Crystal frequency: 40MHz
USB mode: USB-Serial/JTAG
MAC: c0:4e:30:81:b1:98
Uploading stub flasher...
Running stub flasher...
Stub flasher running.
Changing baud rate to 921600...
Changed.
Configuring flash size...
Flash will be erased from 0x00000000 to 0x00004fff...
Flash will be erased from 0x00008000 to 0x00008fff...
Flash will be erased from 0x0000e000 to 0x0000ffff...
Flash will be erased from 0x00010000 to 0x000f4fff...
Compressed 19664 bytes to 12705...
Writing at 0x00000000 [ ] 0.0% 0/12705 bytes...
Writing at 0x00004cd0 [==============================] 100.0% 12705/12705 bytes...
Wrote 19664 bytes (12705 compressed) at 0x00000000 in 0.3 seconds (492.8 kbit/s).
Hash of data verified.
Compressed 3072 bytes to 146...
Writing at 0x00008000 [ ] 0.0% 0/146 bytes...
Writing at 0x00008c00 [==============================] 100.0% 146/146 bytes...
Wrote 3072 bytes (146 compressed) at 0x00008000 in 0.0 seconds (550.8 kbit/s).
Hash of data verified.
Compressed 8192 bytes to 47...
Writing at 0x0000e000 [ ] 0.0% 0/47 bytes...
Writing at 0x00010000 [==============================] 100.0% 47/47 bytes...
Wrote 8192 bytes (47 compressed) at 0x0000e000 in 0.1 seconds (744.6 kbit/s).
Hash of data verified.
Compressed 935296 bytes to 576381...
Writing at 0x00010000 [ ] 0.0% 0/576381 bytes...
Writing at 0x0001c577 [ ] 2.8% 16384/576381 bytes...
Writing at 0x00026eb1 [> ] 5.7% 32768/576381 bytes...
Writing at 0x0002efb9 [=> ] 8.5% 49152/576381 bytes...
Writing at 0x0003741c [==> ] 11.4% 65536/576381 bytes...
Writing at 0x0003d508 [===> ] 14.2% 81920/576381 bytes...
Writing at 0x000433d0 [====> ] 17.1% 98304/576381 bytes...
Writing at 0x00049df6 [====> ] 19.9% 114688/576381 bytes...
Writing at 0x00050063 [=====> ] 22.7% 131072/576381 bytes...
Writing at 0x000563ec [======> ] 25.6% 147456/576381 bytes...
Writing at 0x0005c729 [=======> ] 28.4% 163840/576381 bytes...
Writing at 0x00062946 [========> ] 31.3% 180224/576381 bytes...
Writing at 0x00068c28 [=========> ] 34.1% 196608/576381 bytes...
Writing at 0x0006ebeb [==========> ] 37.0% 212992/576381 bytes...
Writing at 0x00074bd2 [==========> ] 39.8% 229376/576381 bytes...
Writing at 0x0007a7bd [===========> ] 42.6% 245760/576381 bytes...
Writing at 0x000801b6 [============> ] 45.5% 262144/576381 bytes...
Writing at 0x00085ae2 [=============> ] 48.3% 278528/576381 bytes...
Writing at 0x0008b478 [==============> ] 51.2% 294912/576381 bytes...
Writing at 0x00091a0f [===============> ] 54.0% 311296/576381 bytes...
Writing at 0x00097380 [================> ] 56.9% 327680/576381 bytes...
Writing at 0x0009ce58 [================> ] 59.7% 344064/576381 bytes...
Writing at 0x000a29c1 [=================> ] 62.5% 360448/576381 bytes...
Writing at 0x000a8a95 [==================> ] 65.4% 376832/576381 bytes...
Writing at 0x000ae43c [===================> ] 68.2% 393216/576381 bytes...
Writing at 0x000b48f0 [====================> ] 71.1% 409600/576381 bytes...
Writing at 0x000baed4 [=====================> ] 73.9% 425984/576381 bytes...
Writing at 0x000c1016 [======================> ] 76.7% 442368/576381 bytes...
Writing at 0x000c7166 [======================> ] 79.6% 458752/576381 bytes...
Writing at 0x000cd144 [=======================> ] 82.4% 475136/576381 bytes...
Writing at 0x000d3500 [========================> ] 85.3% 491520/576381 bytes...
Writing at 0x000d9427 [=========================> ] 88.1% 507904/576381 bytes...
Writing at 0x000df536 [==========================> ] 91.0% 524288/576381 bytes...
Writing at 0x000e6af6 [===========================> ] 93.8% 540672/576381 bytes...
Writing at 0x000ecbd1 [===========================> ] 96.6% 557056/576381 bytes...
Writing at 0x000f30ed [============================> ] 99.5% 573440/576381 bytes...
Writing at 0x000f4580 [==============================] 100.0% 576381/576381 bytes...
Wrote 935296 bytes (576381 compressed) at 0x00010000 in 7.6 seconds (989.7 kbit/s).
Hash of data verified.
Hard resetting via RTS pin...
-
Even when this ESP32-C3 Zero is inserted, no "green" RGBLED lights (I assume this is the power indication).
-
I tried the ESP32 "troubleshooting page", the Waveshare link (in code) the "hold boot, tap reset", but continue stopping at "resetting RTS pin"... I find no resolution on-line, as most end without a solution. The ESP32-C3 Zero seems to be living (it can be recognized and "uploaded"), but not alive (shows no signs of code was loaded - no serial print, no RGBLED).
The factory loaded sketch output was this...
(RGBLED colors routine)
PULL UP TEST:
PULL DOWN TEST:
GPIO Connect to GPIO TEST:
scan start
scan done
11 networks found
1: , ? (-53)
2: NENT2012 (-64)
3: , ? (-70)
4: ATTYFMXumS (-76)
5: , ? (-81)
6: , ? (-84)
7: ? (-87)
8: ? (-87)
9: , ? (-89)
10: ATTSgxdA22 (-90)
11: ATTJdTFcSa (-90)
The code I wrote to replace the power-on self test is this:
// ESP32C3 zero selftest - WiFi SCAN, PULLUP, PULLDOWN, RGBLED
// https://wokwi.com/projects/305569599398609473
// board type: "ESP32C3 Dev Module", "Nologo ESP32C3 Super Mini"
// Enable Serial Comms: IDE >> Tools >> USB CDC On Boot
// https://www.espboards.dev/img/7xS3z0FLsA-977.png
// https://www.espboards.dev/esp32/esp32-c3-zero/
// https://www.waveshare.com/wiki/ESP32-C3-Zero
// https://docs.wokwi.com/guides/esp32
// RGB_BUILTIN 10 // ESP32C3 mini = 8, ESP32C3 zero = 10
#include <WiFi.h>
bool flag_rgbledtest = 1;
byte color_stage = 0, color_stages = 6; // color stages for zero.h
int count = 0, minimum = 0, maximum = 255, increas, decreas; // counters - misspelled to format words
int iopin[] = { 0, 1, 2, 3, 4, 5, 6, 7, 8 /* = RGB C3 mini*/, 9, /* 10 = RGB C3 zero */ 18, 19, 20, 21 };
int iosize = sizeof(iopin) / sizeof(iopin[0]);
unsigned long fadeTimer, fadeTimeout = 2000; // microseconds = 3.9 milliseconds
void setup() {
Serial.begin(115200);
pinMode(RGB_BUILTIN, OUTPUT);
Serial.print("\nInitializing WiFi... ");
WiFi.mode(WIFI_STA);
Serial.println("done.");
}
void loop() {
rgbledtest();
inputpullupdowntest();
// gpiotest();
// interrupttest();
wifiscan();
}
void rgbledtest() {
if (flag_rgbledtest) {
flag_rgbledtest = 0;
Serial.println("WS2812 RGB LED Test");
}
if (micros() - fadeTimer > fadeTimeout) {
fadeTimer = micros();
if (increas++ == maximum) { // increment color until counter is max
increas = minimum; // reset color counter
if (color_stage++ == color_stages) // increment stage until stage is max
color_stage = 1; // reset stage
}
decreas = maximum - increas; // invert counter to decrease values
switch (color_stage) { // blend colors one bit per step
case 0: rgbLedWrite(RGB_BUILTIN, increas, minimum, minimum); break; // blk (0,0,0) to red (1,0,0) - blk one time only
case 1: rgbLedWrite(RGB_BUILTIN, maximum, increas, minimum); break; // red (1,0,0) to yel (1,1,0)
case 2: rgbLedWrite(RGB_BUILTIN, decreas, maximum, minimum); break; // yel (1,1,0) to grn (0,1,0)
case 3: rgbLedWrite(RGB_BUILTIN, minimum, maximum, increas); break; // grn (0,1,0) to cyn (0,1,1)
case 4: rgbLedWrite(RGB_BUILTIN, minimum, decreas, maximum); break; // cyn (0,1,1) to blu (0,0,1)
case 5: rgbLedWrite(RGB_BUILTIN, increas, minimum, maximum); break; // blu (0,0,1) to mag (1,0,1)
case 6: rgbLedWrite(RGB_BUILTIN, maximum, minimum, decreas); break; // mag (1,0,1) to red (1,0,0)
default: break;
}
}
}
void inputpullupdowntest() {
int dly = 1000;
Serial.println("INPUT test");
for (byte i = 0; i < iosize; i++) {
pinMode(iopin[i], INPUT);
delay(1); // allow pin to settle
Serial.print(digitalRead(iopin[i])); // floating
}
delay(dly);
Serial.println("INPUT_PULLUP test");
for (byte i = 0; i < iosize; i++) {
pinMode(iopin[i], INPUT_PULLUP);
delay(1); // allow pin to settle
Serial.print(digitalRead(iopin[i])); // all should be "1"
}
delay(dly);
Serial.println("INPUT_PULLDOWN test");
for (byte i = 0; i < iosize; i++) {
pinMode(iopin[i], INPUT_PULLDOWN);
delay(1); // allow pin to settle
Serial.print(digitalRead(iopin[i])); // all should be "0"
}
delay(dly);
Serial.println("OUTPUT HIGH test");
for (byte i = 0; i < iosize; i++) {
pinMode(iopin[i], OUTPUT);
delay(1); // allow pin to settle
digitalWrite(iopin[i], HIGH);
delay(1); // allow pin to settle
Serial.print(digitalRead(iopin[i]));
}
delay(dly);
Serial.println("OUTPUT LOW test");
for (byte i = 0; i < iosize; i++) {
pinMode(iopin[i], OUTPUT);
delay(1); // allow pin to settle
digitalWrite(iopin[i], LOW);
delay(1); // allow pin to settle
Serial.print(digitalRead(iopin[i]));
}
delay(dly);
}
void wifiscan() {
Serial.print("Scanning WiFi... ");
int n = WiFi.scanNetworks(); // return number of networks
Serial.print("Networks found: ");
if (n == 0) {
Serial.println("No networks found.");
} else {
Serial.println(n);
for (int i = 0; i < n; ++i) {
Serial.print(i + 1);
Serial.print(": ");
Serial.print(WiFi.SSID(i));
Serial.print(" (");
Serial.print(WiFi.RSSI(i));
Serial.print(")");
Serial.println((WiFi.encryptionType(i) == WIFI_AUTH_OPEN) ? " " : "*");
delay(10);
}
}
Serial.println();
}
I looked on the ESP32 forum... does not seem to cover ESP32-C3 Zero.
Trying to make the ESP32-C3 Zero alive again and take uploads to run.
If you have any suggestions, I will try them.
