ESP32-C3 supermini serial port problem

mistertransistor
Posts: 3
Joined: Sun Apr 07, 2024 9:27 pm

ESP32-C3 supermini serial port problem

Postby mistertransistor » Mon Apr 15, 2024 5:55 pm

I'm an amateur Arduino user who wants to upgrade to something with more RAM. The ESP32-C3 supermini looked good because its small size fits on a breadboard. However, like many people, I have found it very tricky to use. I now have a puzzling situation with a very simple sketch - the basic blink in fact. Here's my code, it won't surprise you.
  1. int LED_B = 8;
  2. //int LED_B = 21;
  3.  
  4. void setup() {
  5. pinMode (LED_B, OUTPUT);
  6. //Serial.begin(9600);
  7. }
  8. void loop() {
  9. digitalWrite(LED_B, HIGH);
  10. delay(1000);
  11. digitalWrite(LED_B, LOW);
  12. delay(1000);
  13. }
I can use either the internal LED on GPIO8 or an external one on GPIO21. Using the Arduino IDE 2 I can compile and upload this sketch repeatedly and it blinks the LED. Now if I *uncomment* the Serial.begin(9600); line I can upload once more, and it does blink (and indeed send messages to the serial monitor if I include any prints), but any subsequent attempt to upload fails with the following messages:
  1. esptool.py v4.5.1
  2. Serial port COM9
  3. Connecting...
  4. Chip is ESP32-C3 (revision v0.4)
  5. Features: WiFi, BLE
  6. Crystal is 40MHz
  7. MAC: 80:65:99:6c:bb:d4
  8. Uploading stub...
  9. Running stub...
  10. Stub running...
  11.  
  12. A fatal error occurred: Unable to verify flash chip connection (No serial data received.).
  13. Failed uploading: uploading error: exit status 2
It seems that calling Serial.begin() somehow disconnects the flash(?). I do have USB CDC on boot enabled, and I have played around with the parameters that the IDE offers without success. The only way out of this error is to put the board into upload mode by grounding GPIO9 and resetting. So in fact the board is just-about usable, as sketches can be uploaded and run, but its not user-friendly to have to keep forcing upload mode. Any suggestions as to how to improve things would be very welcome.
Andrew
Apologies if I have not included some information that I should have, this is my first post here.

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

Re: ESP32-C3 supermini serial port problem

Postby ESP_Sprite » Tue Apr 16, 2024 2:19 am

That is very odd. Just to check it's not a hardware issue: can you reproduce it on other supermini boards as well?

lbernstone
Posts: 826
Joined: Mon Jul 22, 2019 3:20 pm

Re: ESP32-C3 supermini serial port problem

Postby lbernstone » Tue Apr 16, 2024 4:48 am

What version of arduino-esp32 are you running (you can see this in the board manager)?
There were some issues with earlier versions of esptool on the C3, but if you are running 2.0.15, that should be resolved.

mistertransistor
Posts: 3
Joined: Sun Apr 07, 2024 9:27 pm

Re: ESP32-C3 supermini serial port problem

Postby mistertransistor » Wed Apr 24, 2024 7:50 pm

Thanks for the suggestions. I don't have a second board to try, but I've got one on order (which I'm kind-of regretting).
The Arduino IDE board manager shows the following installed
Arduino ESP32 Boards by Arduino 2.0.13 installed
esp32 by Expressif Systems 2.0.15 installed
there are no later versions of either available for installation.

lbernstone
Posts: 826
Joined: Mon Jul 22, 2019 3:20 pm

Re: ESP32-C3 supermini serial port problem

Postby lbernstone » Thu Apr 25, 2024 4:22 pm

Please make sure you are using 2.0.15. There was a fix specifically for Serial blocking on HWCDC. In fact, remove the "Arduino ESP32 Boards" from board manager completely unless you are using the Arduino branded esp32. Make sure you have "USB CDC On Boot" set to enabled and the "JTAG adapter" set to Integrated USB JTAG.
I find the supermini style of these devices to be almost useless for development. There's a reason Espressif puts a UART adapter that costs almost as much as the cpu on their development kits.

erak_v2
Posts: 1
Joined: Tue Apr 30, 2024 8:27 pm

Re: ESP32-C3 supermini serial port problem

Postby erak_v2 » Tue Apr 30, 2024 8:37 pm

Speaking from experience, some ESP32C3 super-mini boards use the chip version which doesn't have onboard flash memory. You may want to check the markings on the chip since the error message says "Unable to verify flash chip connection". When you look at the chip markings, you should see "FN4" or "FH4" if it has onboard memory (see section 1.1 at the datasheet https://www.espressif.com/sites/default ... eet_en.pdf ). It may not be the cause of your problem, but if your boards have chips without internal flash, then there's nothing you can do on the software side.

mistertransistor
Posts: 3
Joined: Sun Apr 07, 2024 9:27 pm

Re: ESP32-C3 supermini serial port problem

Postby mistertransistor » Mon May 06, 2024 4:21 pm

just for completeness ... I've now got the second supermini and it's even worse. After any upload, even blink without Serial.begin(), it refuses further ones until put into upload mode. I'm now using a Raspberry Pi Zero which is much less hassle.

lkos98
Posts: 1
Joined: Thu May 23, 2024 6:50 am

Re: ESP32-C3 supermini serial port problem

Postby lkos98 » Thu May 23, 2024 6:57 am

I also had issues with upload (Arduino IDE). It would take sometimes 5-6 consequent tries and still not uploading.
Found the solution, which is weird - immediately after pressing upload, press "boot" and hold, the press "reset" and release it, then release "boot". Works almost 100% for me. It's very annoying to do it every time a change is made in the sketch.

Who is online

Users browsing this forum: No registered users and 58 guests