Hopefully some of you experts can help me out here,
My Story (This Time)
OK, so after a long time away from Arduino I'm trying to get reacquainted. Got some ESP32-C3 Boards and was starting to get the hang of them with Arduino 2.3.2. I downloaded the ESP32-c3 PDF manual posted on the hardware section of the Arduino forums. copied a few simple code examples from that manual and ran them with no problem. From the Manual I copied and uploaded the following Code to my test board and ran it NOW I can not get anything else to
upload to the board. I'm thinking because the Baud rate for this code is set at 115200 then it is somehow blocking the IDE from changing the Baud to 92160 that it uses for uploading, but IDK. USB CDC On Boot on the toolbar IS Set to Enabled and I have held down the BOOT button while pressing the RESET button then releasing the Boot button as suggested when Serial is not working.
I DO have things set to ERASE All Flash Before Sketch Upload.
(CODE)
#include "WiFi.h"
void setup()
{
Serial.begin(115200);
// Set WiFi to station mode and disconnect from an AP if it was previously connected
WiFi.mode(WIFI_STA);
WiFi.disconnect();
delay(100);
Serial.println("Setup done");
}
void loop()
{
Serial.println("scan start");
// WiFi.scanNetworks will return the number of networks found
int n = WiFi.scanNetworks();
Serial.println("scan done");
if (n ==0) {
Serial.println("no networks found");
} else {
Serial.print(n);
Serial.println(" networks found");
for (int i = 0; i < n; ++i) {
// Print SSID and RSSI for each network found
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("");
// Wait a bit before scanning again
delay(5000);}
(CODE END)
OUTPUT (Showing Error)
Sketch uses 234184 bytes (17%) of program storage space. Maximum is 1310720 bytes.
Global variables use 13676 bytes (4%) of dynamic memory, leaving 314004 bytes for local variables. Maximum is 327680 bytes.
esptool.py v4.5.1
Serial port COM5
Connecting...
Chip is ESP32-C3 (revision v0.4)
Features: WiFi, BLE
Crystal is 40MHz
MAC: 64:e8:33:8a:d5:b0
Uploading stub...
Running stub...
Stub running...
Changing baud rate to 921600
A fatal error occurred: No serial data received.
Failed uploading: uploading error: exit status 2
Hi qubits-us, Thanks for taking a look ad sharing your thoughts. I tried a number of things different USB cable, USB Port, Different Computer, Slowed Upload Speed. Even went to the Windows Device Manager and set the Baud for the connected Com port to match what Arduino had for an upload speed. Looks like I simply BRICKED that Board (probably damaged something inside the USB connector on the board, plugging and unplugging). I'm still hesitant to load that code on another one of those boards, I only bought five of them this time to try out.
Haha, did that with the first one, to try to get it back to factory default.
Did also wipe the USB port.
If you see "ESP32S3 Dev Module" in the IDE behind the port, then I think you're still ok.
(yes, S3, not C3 as expected).
I only ever did the "release reset button before boot button" just before uploading.
But sometimes I have to open the serial monitor twice after an upload, or power-cycle the board.
I do have a while loop at the start of setup().
Serial.begin(115200);
while (!Serial); // soft USB
@sumguy
There is also an "Erase all flash before upload" option in the tools menu of the IDE.
But as said, it erases also the USB port if the ESP32 doesn't have a hardware serial<>USB chip.
(I am using the ESP32-C3 Super-Mini, with integrated-USB).
I'll be interested in a method to get the port back, but maybe I should open a new thread for that.
Leo..
I just accidentally revived my ESP32-C3 Super Mini. As said, I deleted all the flash.
But the USB port was still visible in (Win11) Device Manager.
There, in properties, I had the option to forcefully enable the port.
Win11 rebooted (without my permission). After that the ESP was back in the IDE.
Just ordered another dozen. Never know when I do something stupid again.
Leo..