Quick Start
Pick the tab for your development environment. Each one ends with the board's RGB LED (one LED with red, green and blue channels) blinking, which is the quickest way to see that everything works.
- Arduino
- MicroPython
- ESP-IDF
1. Install the platform
Install the current Arduino IDE, at the 1.8 level or later. The current version is on the arduino.cc website.
2. Install the board definitions
The board definition comes with Espressif's Arduino core for the ESP32.
-
Start Arduino and open the Preferences window.
-
Enter this stable release link into the Additional Board Manager URLs field. You can add several URLs, separated by commas.
https://espressif.github.io/arduino-esp32/package_esp32_index.json -
Open Boards Manager from the Tools > Board menu and install the esp32 platform.
-
Restart the Arduino IDE.
3. Select the board
Select Soldered NULA Dual ESP32C5 from the Tools > Board menu. Then connect the board to your computer with the USB-C cable and choose its serial port in the Arduino IDE.
USB-C on this board goes through a CH340K USB-to-serial chip, so your computer may need a CH340 driver to show the port. If no port appears, see Troubleshooting.
4. Upload your first program
The board has a WS2812B RGB LED on IO8, marked IO8 on the board. The board definition names it LED_BUILTIN, and digitalWrite() switches it on and off like a plain LED. This sketch blinks it once a second.
// Blink the onboard RGB LED: 0.5 s on, 0.5 s off.
// LED_BUILTIN comes from the board definition and points at the RGB LED on IO8.
const int LED_PIN = LED_BUILTIN;
void setup()
{
pinMode(LED_PIN, OUTPUT);
}
void loop()
{
digitalWrite(LED_PIN, HIGH); // LED on
delay(500);
digitalWrite(LED_PIN, LOW); // LED off
delay(500);
}
5. What to expect
Upload the sketch. The automatic reset circuit puts the board into upload mode by itself, so you do not need to press any button. When the upload finishes, the RGB LED starts blinking. The Arduino core drives its red, green and blue channels together, so it lights white. The RGB LED lights white for half a second, then stays off for half a second.
The LED marked IO8 sits between the USER and RESET buttons, near the USB-C end of the board, just beside the mounting hole on the side toward the ESP32-C5 module.
6. Troubleshooting
If the board is not detected or the upload fails, continue with Troubleshooting.
1. Install the platform
MicroPython goes onto the board with the esptool.py program, which you can find in Espressif's esptool documentation. On Windows, the installed program may be called esptool instead of esptool.py.
esptool needs Python 3.10 or newer. Its installation guide installs the latest stable release from PyPI with pip:
pip install esptool
If that gives an error on your Python installation, try python -m pip install esptool or pip3 install esptool.
2. Install the firmware
Download the latest .bin file from the ESP32_GENERIC_C5 download page. This generic firmware works on most ESP32-C5 boards with at least 4 MiB of flash and a 40 MHz or 48 MHz crystal. This board has 8 MB of flash and a 48 MHz crystal, and the firmware finds its PSRAM (pseudo-static RAM, extra working memory in the module) by itself at startup.
If you are putting MicroPython on the board for the first time, erase the entire flash first:
esptool.py erase_flash
Then deploy the firmware to the board, starting at address 0x2000:
esptool.py --baud 460800 write_flash 0x2000 ESP32_BOARD_NAME-DATE-VERSION.bin
Replace ESP32_BOARD_NAME-DATE-VERSION.bin with the .bin file you downloaded. If flashing starts and then fails partway through, remove the --baud 460800 option to flash at the slower default speed.
3. Select the board and port
esptool.py tries to find the board's serial port by itself. If that fails, or more than one Espressif board is connected, pass the port with --port:
esptool.py --port PORTNAME erase_flash
esptool.py --port PORTNAME --baud 460800 write_flash 0x2000 ESP32_BOARD_NAME-DATE-VERSION.bin
On Linux the port name is usually similar to /dev/ttyUSB or /dev/ttyACM0, on a Mac /dev/cu.usbmodem01, and on Windows COM4.
The MicroPython prompt (the REPL) is on UART0 (the first of the chip's UART serial ports), which may be connected to a USB-serial converter, or on the chip's built-in USB. On this board, UART0 goes to the CH340K USB-to-serial chip, which is on the USB-C connector. Open the board's serial port in a terminal program at 115200 baud.
4. Upload your first program
The RGB LED on IO8 is a WS2812B, so MicroPython drives it with the neopixel module rather than a plain Pin. Press Ctrl-E at the prompt to enter paste mode, paste the program, then press Ctrl-D to run it.
# Blink the onboard RGB LED on IO8: 0.5 s on, 0.5 s off.
from machine import Pin
from neopixel import NeoPixel
import time
led = NeoPixel(Pin(8, Pin.OUT), 1) # one WS2812B LED on IO8
while True:
led[0] = (64, 64, 64) # equal red, green and blue: white
led.write()
time.sleep(0.5)
led[0] = (0, 0, 0) # off
led.write()
time.sleep(0.5)
5. What to expect
The RGB LED blinks white once a second. The program prints nothing. The RGB LED lights white for half a second, then stays off for half a second.
The LED marked IO8 sits between the USER and RESET buttons, near the USB-C end of the board, just beside the mounting hole on the side toward the ESP32-C5 module.
6. Troubleshooting
If the REPL does not respond or firmware flashing fails, continue with Troubleshooting.
1. Install the platform
Install ESP-IDF by following Espressif's Getting Started Guide. The steps below use the blink example from ESP-IDF v6.1, which supports the ESP32-C5.
2. Set the target
The example is in your ESP-IDF folder, under examples/get-started/blink. Before you configure and build it, set the chip target:
idf.py set-target esp32c5
3. Configure the project
Open the project configuration menu:
idf.py menuconfig
In the Example Configuration menu:
- Set
Blink LED typetoLED strip, because the board's RGB LED is an addressable WS2812B. - Select the backend peripheral for the LED strip.
RMT(the chip's Remote Control Peripheral) is only available for ESP targets with the RMT peripheral, andSPI(the chip's serial peripheral bus) is available for all ESP targets. - Set
Blink GPIO numberto8. The example's default for the ESP32-C5 is GPIO 27 (GPIO stands for general-purpose input/output), which is not where this board's LED is. - Set the blinking period in
Blink period in ms. The default is 1000.
4. Build and flash your first program
This is the example's main/blink_example_main.c. With LED strip selected, it switches the LED between a dim white and off.
/* Blink Example
This example code is in the Public Domain (or CC0 licensed, at your option.)
Unless required by applicable law or agreed to in writing, this
software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
CONDITIONS OF ANY KIND, either express or implied.
*/
#include <stdio.h>
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
#include "driver/gpio.h"
#include "esp_log.h"
#include "led_strip.h"
#include "sdkconfig.h"
static const char *TAG = "example";
/* Use project configuration menu (idf.py menuconfig) to choose the GPIO to blink,
or you can edit the following line and set a number here.
*/
#define BLINK_GPIO CONFIG_BLINK_GPIO
static uint8_t s_led_state = 0;
#ifdef CONFIG_BLINK_LED_STRIP
static led_strip_handle_t led_strip;
static void blink_led(void)
{
/* If the addressable LED is enabled */
if (s_led_state) {
/* Set the LED pixel using RGB from 0 (0%) to 255 (100%) for each color */
led_strip_set_pixel(led_strip, 0, 16, 16, 16);
/* Refresh the strip to send data */
led_strip_refresh(led_strip);
} else {
/* Set all LED off to clear all pixels */
led_strip_clear(led_strip);
}
}
static void configure_led(void)
{
ESP_LOGI(TAG, "Example configured to blink addressable LED!");
/* LED strip initialization with the GPIO and pixels number*/
led_strip_config_t strip_config = {
.strip_gpio_num = BLINK_GPIO,
.max_leds = 1, // at least one LED on board
};
#if CONFIG_BLINK_LED_STRIP_BACKEND_RMT
led_strip_rmt_config_t rmt_config = {
.resolution_hz = 10 * 1000 * 1000, // 10MHz
.flags.with_dma = false,
};
ESP_ERROR_CHECK(led_strip_new_rmt_device(&strip_config, &rmt_config, &led_strip));
#elif CONFIG_BLINK_LED_STRIP_BACKEND_SPI
led_strip_spi_config_t spi_config = {
.spi_bus = SPI2_HOST,
.flags.with_dma = true,
};
ESP_ERROR_CHECK(led_strip_new_spi_device(&strip_config, &spi_config, &led_strip));
#else
#error "unsupported LED strip backend"
#endif
/* Set all LED off to clear all pixels */
led_strip_clear(led_strip);
}
#elif CONFIG_BLINK_LED_GPIO
static void blink_led(void)
{
/* Set the GPIO level according to the state (LOW or HIGH)*/
gpio_set_level(BLINK_GPIO, s_led_state);
}
static void configure_led(void)
{
ESP_LOGI(TAG, "Example configured to blink GPIO LED!");
gpio_reset_pin(BLINK_GPIO);
/* Set the GPIO as a push/pull output */
gpio_set_direction(BLINK_GPIO, GPIO_MODE_OUTPUT);
}
#else
#error "unsupported LED type"
#endif
void app_main(void)
{
/* Configure the peripheral according to the LED type */
configure_led();
while (1) {
ESP_LOGI(TAG, "Turning the LED %s!", s_led_state == true ? "ON" : "OFF");
blink_led();
/* Toggle the LED state */
s_led_state = !s_led_state;
vTaskDelay(CONFIG_BLINK_PERIOD / portTICK_PERIOD_MS);
}
}
Build, flash and monitor the project in one step, with PORT replaced by the board's serial port:
idf.py -p PORT flash monitor
To exit the serial monitor, type Ctrl-].
5. What to expect
The RGB LED blinks at the period you set, and the monitor logs each change. This is the example output from its README: With the default period, the RGB LED lights a dim white for one second, then stays off for one second.I (315) example: Example configured to blink addressable LED!
I (325) example: Turning the LED OFF!
I (1325) example: Turning the LED ON!
I (2325) example: Turning the LED OFF!
I (3325) example: Turning the LED ON!
I (4325) example: Turning the LED OFF!
I (5325) example: Turning the LED ON!
I (6325) example: Turning the LED OFF!
I (7325) example: Turning the LED ON!
I (8325) example: Turning the LED OFF!
The LED marked IO8 sits between the USER and RESET buttons, near the USB-C end of the board, just beside the mounting hole on the side toward the ESP32-C5 module.
6. Troubleshooting
If the project does not build or flash, continue with Troubleshooting.