Getting an ESP32 C6 Zero to program/work

Just thought I would ask....

I grabbed one of these because they looked handy

https://thepihut.com/products/esp32-c6-mini-development-board?

Nice little board, but literally useless as I can't get it to program properly.

Updated the Expressif library in the IDE (version 2.3.2) and also added the expressif links in the preferences box

https://espressif.github.io/arduino-esp32/package_esp32_dev_index.json
https://espressif.github.io/arduino-esp32/package_esp32_index.json

Can't actually find the name ESP32 C6 Zero in the boards list which isn't a good start, but it will program using ESP32C6 Dev Module.

You plug in the USB lead while holding boot and it finds it. Upload your code and then nothing happens after the upload.
Press 'Reset'. The code then runs, but it also disconnects from the PC and the board then becomes an 'Unrecognised USB device).

You cannot use the serial monitor, as it can't see it.

The only way back, is to unplug the USB lead, press 'boot' again and re-plug it in.

Then you are back to your one shot upload window before the whole useless process starts again.

Anyone got any ideas before I bin it? Life's too short to mess about with temperamental processors.

FYI, the URLs were changed years ago, and the files at those URLs are no longer updated.

You still managed to get a relatively recent version of the "esp32" boards platform because Arduino now includes the esp32 platform in the Arduino IDE Boards Manager even without the URLs. However, having those antiquated URLs in your IDE preferences doesn't provide any benefit and will only slow down the IDE by forcing it to download pointless files. I recommend replacing them with the URL from the official installation instructions here:

https://docs.espressif.com/projects/arduino-esp32/en/latest/installing.html#installing-using-arduino-ide

Only add the "Stable release link". The "Development release link" should only be used if you are contributing to the development of the esp32 platform through beta testing.

Does the problem still occur after you upload this simple sketch?:

void setup() {
  Serial.begin(9600);
}

void loop() {
  Serial.println("hello");
  delay(1000);
}

A fairly unique thing about the boards that use the microcontrollers of the ESP32 family with native USB capability (as is the case with your board) is that they are typically configured to disable the use of their USB CDC serial port in the sketch by default.

That default disabled configuration is appropriate when your sketch doesn't use the serial port, but in cases where you do need it (such as when your sketch calls Serial.println, etc.), then it is necessary to configure the board so that the port will be enabled. Fortunately this is quite easy since the ESP32 boards platform developers configured the board definition to produce a custom board options menu you can use to enable or disable the port as needed via the Arduino IDE user interface.

Please try this:

  1. Select Tools > USB CDC On Boot > Enabled from the Arduino IDE menus.
  2. Upload the sketch to your board again, just as you did before.

Now check the Serial Monitor. Hopefully you will now see the expected output from the board there.

I already have the CDC on boot enabled. It doesn't make any difference.

No... that short code doesn't work. Enabling CDC on boot still results in no available serial monitor. The port disappears as soon as the code has uploaded.
The only way to get the port to show up is to unplug the USB lead, hold 'boot' and re-plug the lead in. Any upload then removes the port afterwards.

The only time the code runs is after a reset button press.... but that kills the USB connection, so you cannot use the serial monitor.

I'll try updating the preferences

But I don't see an URL on that page that is different to the one/s I have?

I will never quite understand why they sell processors like this on places like PI Hut that are so difficult to hobbyists to use. I know I won't ever buy another one

I have messed about with this for ages. Think it's probably headed for the bin and I will use something else

what version of the ESP32 core are you using?
I use core ESP32 3.1.0

with the nanoESP32-C6 Development Board

as @ptillisch stated to use the serial monitor requires Tools > USB CDC On Boot > Enabled

then Serial IO works OK

That is the ESP core I have.
USB CDC on boot doesn't work on this processor. Upload = serial port disconnects.
Just spent another hour on it. Must be something to do with this board.

The actual board name isn't listed (not that I thought that would make a whole lot of difference). ESP32 C6 Zero.

Anyway, its gone now. Just un-soldered it and found something else that doesn't waste my remaining days on this planet.
Thanks for the advice.

I have this nice dev board manufactured by Espressif:

https://docs.espressif.com/projects/esp-dev-kits/en/latest/esp32c6/esp32-c6-devkitc-1/user_guide.html

The simple sketch I provided in my previous reply works exactly as expected running on that board when I select Tools > USB CDC On Boot > Enabled from the Arduino IDE menus before uploading.

I don't experience any problem of loss of the port when it is running that sketch, even when the "USB CDC On Boot" option is set to "Disabled".

I am using the latest version of the esp32 platform, 3.1.0. You probably had 3.7.0 installed due to not having the up to date official URL in your "Additional Boards Manager URLs" preference. So it would be worth using the Arduino IDE Boards Manager to update to the latest version of the platform, then upload the sketch to the board again, just in case the problem you experienced was caused by a bug in 3.7.0. The ESP32-C6 is a new addition to the ESP32 microcontroller family and support was added to the esp32 Arduino boards platform only recently so it is more likely that there might be some problems in the platform specific to that chip, and active development to improve the support.

The problem of the USB device becoming unrecognized can be caused by the sketch code. The USB stack that produces the USB CDC serial port is running on the same microcontroller as your sketch program, so the sketch program can break or disable the USB code. This might either be due to a bug in the sketch, or an expected result of valid code (e.g., putting the microcontroller to sleep). However, the simple sketch I provided won't cause any problems for the USB code so your finding that the device becomes unrecognized even when the board is running that sketch indicates that the sketch code is not the cause of the problem.

It is a reasonable choice. I hope that you will continue with your Arduino projects even if you decide to stop using the ESP32-C6 Mini board in them.

1 Like

in the main I use the ESP32 (including building PCBs for research and industrial projects) using the other members of the ESP32 family for specific applications, e.g. the ESP32 does not support synchronization under the RMT library so I use ESP32-S3

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.