Google Chat:---
+86-0755-88291180
sales@spotpear.com
dragon_manager@163.com
tech-support@spotpear.com
zhoujie@spotpear.com
WhatsApp:13246739196
WhatsApp:13424403025




This chapter contains the following sections. Please read as needed:
New to Arduino ESP32 development and looking for a quick start? We have prepared a comprehensive Getting Started Tutorial for you.
Note: This tutorial uses the ESP32-S3-Zero as a reference example, and all hardware code is based on its pinout. Before you start, we recommend checking the pinout of your development board to ensure the pin configuration is correct.
Please refer to the tutorial Installing and Configuring Arduino IDE to download and install the Arduino IDE and add ESP32 support.
The ESP32-C6-Zero-B supports direct model selection in the Arduino IDE. Choose "Waveshare ESP32-C6-Zero".

The ESP32-C6-Zero-B uses the ESP32-C6 native USB port instead of UART to USB. For serial communication:
The printf() function can be used directly;
To use the Serial.println() function, the USB CDC feature must be enabled. Please follow the steps below to verify your environment is configured correctly:
Update the ESP32 Libraries: It is recommended to update the ESP32 board libraries in Arduino IDE to version 3.3.5 or later. Newer versions of the core have USB CDC enabled by default for this board.
Check Configuration Options: In the Arduino IDE "Tools" menu, check and confirm that the "USB CDC On Boot" option is set to "Enabled".
As shown in the image below, the "USB CDC On Boot" option should be set to Enabled when correctly configured.

This chapter contains the following sections. Please read as needed:
New to ESP32 ESP-IDF development and looking to get started quickly? We have prepared a general Getting Started Tutorial for you.
Please Note: This tutorial uses the ESP32-S3-Zero as a teaching example, and all hardware code is based on its pinout. Before you start, it is recommended that you check the pinout of your development board to ensure the pin configuration is correct.
The following tutorial is based on the Windows development environment using VS Code.
Note: ESP-IDF supports ESP32-C6 starting from version V5.1. ** When installing ESP-IDF, you must select version V5.1 or later.**
Please refer to Waveshare ESP-IDF Getting Started - Section 1 Set Up Environment to complete the ESP-IDF development environment configuration.
Use the shortcut F1 and enter:
esp-idf:show examples projects

Select your current IDF version

Using the Hello World example:

Choose the path to place the example; the folder name must not already exist
This shows the COM port in use. Click to change it.
Select the appropriate COM port for your device. It is recommended to use the USB COM port (can be checked in Device Manager).
If download fails, press and hold the reset button for more than 1 second, wait for the PC to re-detect the device, then try downloading again.

Select the project or example to use

The COM port is now changed.
This shows the target driver in use. Click to change it.
Select the project or example to use

Wait a moment after clicking

Select the target we need to drive, namely the main chip ESP32-C6.

Select the openocd path. This does not affect us, so choose any.


Click the Build, Flash, Open Serial Monitor button described earlier.

Building may take a long time, especially on the first build.

During this process, ESP-IDF may consume significant CPU resources and could cause system lag.
If flashing a new project for the first time, you will need to select the download method. Choose UART.

You can also change the Download Method later (click to pop up options).

Because the board has an automatic download circuit, no manual operation is needed; it will download automatically.

After successful download, the serial monitor opens automatically, showing the chip output and a prompt to restart after 10 seconds.

Official example path: get-started -> hello_world
Example effect: Output Hello world! in the TERMINAL window every 10 seconds.

Official example path: get-started -> blink
Example effect: The onboard RGB LED blinks at 1-second intervals.

Official example path: peripherals -> uart -> uart_async_rxtxtasks
Example effect: Self-transmission and reception of UART data when GPIO4 and GPIO5 are shorted.
| ESP32-C6 | ESP32-C6 (same board) |
|---|---|
| GPIO4 | GPIO5 |

Make the hardware connection according to the GPIOs used.

You can go to the definition file to see the actual GPIOs used (select GPIO_NUM_4 -> right-click -> Go to Definition).

Official example path: bluetooth -> bluedroid -> ble -> gatt_server
Example effect: Data transfer between the ESP32-C6 and a Bluetooth debugging assistant on a mobile phone.

Set the COM port and target driver correctly (it is recommended to use the USB COM port – check in Device Manager) , then click Build and Flash to run.

Connect to the ESP_GATTS_DEMO Bluetooth device on your phone.

Successful connection appears as shown below.

According to the UUID values in the program, the two servers below are available; choose one for uplink transmission.

The ESP32-C6 receives the data.

Official example path: wifi -> getting_started -> station Example effect: ESP32-C6 connects to a Wi-Fi network.

Change the WiFi SSID and WiFi Password to the Wi-Fi credentials you want to connect to.

Set the COM port and target driver correctly (it is recommended to use the USB COM port – check in Device Manager) , then click Build and Flash to run.

You can check the value of CONFIG_ESP_WIFI_SSID.
Open the station example main.c file.

Right-click and go to definition.

You can see the value set earlier.

Official example 1 path: Zigbee -> light_sample -> HA_on_off_switch
Official example 2 path: Zigbee -> light_sample -> HA_on_off_light
Example effect: Two ESP32-C6 boards; one (flashed with the HA_on_off_switch program) uses its BOOT button to control the RGB LED on the other board.
Note: First flash the HA_on_off_switch program on one board, then flash the HA_on_off_light program on the other board.

Create the official example HA_on_off_light following the tutorial above (Creating an Example).
The program is compatible with ESP32-C6; no modification needed.
Set the COM port and target driver correctly, then click Build and Flash to run. (Wait a moment for the two chips to establish a connection.)

If it remains disconnected as shown below, the device may have residual network information from other networks. You can erase the device (see erase tutorial) and then re-establish the network.

Create an example to debug – this example uses the official hello_world example (Creating an Example).
Modify the launch.json file.

Enter the following content:
{
"version": "0.2.0",
"configurations": [
{
"name": "GDB",
"type": "cppdbg",
"request": "launch",
"MIMode": "gdb",
"miDebuggerPath": "${command:espIdf.getXtensaGdb}",
"program": "${workspaceFolder}/build/${command:espIdf.getProjectName}.elf",
"windows": {
"program": "${workspaceFolder}\\build\\${command:espIdf.getProjectName}.elf"
},
"cwd": "${workspaceFolder}",
"environment": [{ "name": "PATH", "value": "${config:idf.customExtraPaths}" }],
"setupCommands": [
{ "text": "target remote :3333" },
{ "text": "set remote hardware-watchpoint-limit 2"},
{ "text": "mon reset halt" },
{ "text": "thb app_main" },
{ "text": "flushregs" }
],
"externalConsole": false,
"logging": {
"engineLogging": true
}
}
]
}


Press the shortcut F1 and enter:
ESP-IDF:Device configuration

Select OpenOcd Config Files

Enter board/esp32c6-builtin.cfg (if this is already the default, just press Enter).
board/esp32c6-builtin.cfg

Expand the window width until [OpenOCD Server] appears at the bottom.

Click [OpenOCD Server] and select Start OpenOCD.

Successful startup looks like this:

Enter debug mode by clicking Debug.

Successfully entered the debug interface.

Extract the software resource package Flash debugging software
Open the Flash Download Tool, select ESP32-C6 and UART

Select the UART port number, click START (do not select any bin file)

Wait for the flashing to complete, then click Erase

Wait for the erasing to complete

This chapter contains the following sections. Please read as needed:
New to ESP32 MicroPython development and looking for a quick start? We have prepared a comprehensive ESP32 MicroPython Getting Started Tutorial for you.
Note: This tutorial uses the ESP32-S3-Zero as a teaching example, and all hardware code is based on its pinout. Before proceeding, we recommend checking the pinout diagram of your specific development board to ensure the pin configuration is correct.
Please refer to the Setting up the Development Environment to flash the MicroPython firmware.
ESP32-C6-Zero-B MicroPython firmware download link: https://micropython.org/download/ESP32_GENERIC_C6/
If you flash the MicroPython firmware using the Espressif Flash Download Tool for the ESP32-C6-Zero-B, the flash address is
Development Board Design Files
ESP32-C6 Chip Official Manuals
Debugging Tools
Monday-Friday (9:30-6:30) Saturday (9:30-5:30)
Email: services01@spotpear.com