Skip to main content

ESP-IDF Workshop: ESP32-C5

Table of Contents

Welcome to the ESP32-C5 ESP-IDF workshop!

Introduction
#

In this workshop, you will get hands-on experience with the ESP32-C5, Espressif’s first SoC to support dual-band Wi-Fi 6, and learn how to put its new features to work in a real application.

The workshop is divided into four parts.

In the first part, we’ll connect to a Wi-Fi access point on the 5 GHz band and see how dual-band support improves throughput and reduces interference compared to the more crowded 2.4 GHz band.

In the second part, we’ll look at partition tables and how they let you organize the SoC’s flash memory into independent regions for your application, filesystem, and OTA data.

Building on that, the third part covers Over-The-Air (OTA) updates, so you can update your firmware remotely without a physical connection to the board.

The fourth part introduces the low-power modes and the ULP, a low-power RISC-V coprocessor that can handle simple tasks on its own while the main CPU stays in deep sleep, helping you save power in battery-operated designs.

By the end of the workshop, you will be able to build an application that connects over Wi-Fi 6, manages its own partitions, updates itself remotely through OTA, and offloads background work to the Extra ULP coprocessor.

Estimated duration: 3 hours.

Prerequisites
#

To follow this workshop, make sure you meet the prerequisites listed below.

Required Software
#

To install everything, you can follow the ESP-IDF Setup guide.

Required Hardware
#

  • An ESP32-C5-DevKitC-1 development board.
    If the activity is in person, the board will be provided during the workshop.

About the ESP32-C5-DevKitC-1
#

The ESP32-C5-DevKitC-1 is an entry-level development board built around the ESP32-C5-WROOM-1 module. It breaks out most of the SoC’s GPIO pins to headers on both sides of the board, so you can easily connect it to a breadboard or to peripherals using jumper wires.

The board includes two USB Type-C ports:

  • USB Type-C to UART port used both to power the board and to flash and monitor your application.
  • Dedicated USB Type-C port wired directly to the SoC for native USB communication and JTAG debugging.

ESP32-C5 SoC Main Characteristics
#

The ESP32-C5 is the SoC at the heart of this development board. Its main characteristics are:

  • CPU: 32-bit single-core RISC-V processor, clocked up to 240 MHz, plus a low-power (LP) RISC-V core for always-on tasks.
  • Memory: 384 KB of on-chip HP SRAM, 16 KB of LP SRAM, and 320 KB of ROM, with support for external flash and PSRAM.
  • Wireless connectivity:
    • Dual-band Wi-Fi 6 (802.11ax), supporting both 2.4 GHz and 5 GHz, with backward compatibility for 802.11a/b/g/n/ac.
    • Bluetooth 5 (LE), including Bluetooth mesh.
    • IEEE 802.15.4, used by the Thread and Zigbee protocols.
  • GPIOs: up to 29 programmable GPIOs, supporting common peripherals such as SPI, I2C, I2S, UART, ADC, and CAN FD.
  • Security features: secure boot, flash and PSRAM encryption, cryptographic hardware accelerators, and Physical Memory Protection (PMP).

You will explore the Wi-Fi 6 dual-band capabilities of the ESP32-C5 in more detail in Lecture 1.

Agenda
#

The workshop is divided into four parts.

  • Part 1: Connect to Wi-Fi 5

    • Lecture 1 – The ESP32-C5’s dual-band Wi-Fi 6 radio and how to select the 2.4 GHz or 5 GHz band with esp_wifi_set_band_mode()
    • Assignment 1.1 – Connect the ESP32-C5 DevKit to a 5 GHz Wi-Fi network
    • Assignment 1.2 – Modify the station so the ESP32-C5 chooses the Wi-Fi band automatically, connecting on 5 GHz when available and falling back to 2.4 GHz otherwise
  • Part 2: Partition Table

    • Lecture 2 – The ESP-IDF partition table, its typical entries, and how to select a built-in scheme through menuconfig
    • Assignment 2.1 – Read the current partition table and switch to a scheme with two OTA app partitions
    • Assignment 2.2 – Build a custom partition table that adds a spiffs filesystem partition, then flash and verify it
  • Part 3: OTA

    • Lecture 3 – How Over-The-Air updates work on Espressif devices using the app_update and esp_https_ota components
    • Assignment 3.1 – Configure the partition table for OTA and perform a single OTA update by downloading new firmware from a fixed URL with esp_https_ota
    • Assignment 3.2 – (Optional) Add app rollback support, so a broken firmware update is automatically reverted to the last working version
    • Assignment 3.3 – Check a remote version file before updating, so the device only downloads new firmware when it is actually newer
  • Part 4: ULP

    • Lecture 4 – The ESP32-C5’s sleep modes and the Ultra Low Power (ULP) LP core coprocessor
    • Assignment 4.1 – Build a Deep-sleep example that wakes on the RTC timer and keeps a boot counter in RTC memory
    • Assignment 4.2 – Run a program on the LP core that counts while the main CPU sleeps and wakes it at a threshold

Next Step
#

The next step is Lecture 1.

Conclusion
#

Throughout this workshop, you worked hands-on with the key features that make the ESP32-C5 stand out. You connected the board to a 5 GHz Wi-Fi 6 network, organized its flash memory with custom partition tables, updated its firmware remotely through OTA, and offloaded background work to the Extra ULP coprocessor while the main CPU stayed in Deep-sleep. With these building blocks, you are ready to design applications that are connected, updatable, and power-efficient.

ESP-IDF C5 - Lecture 4

·5 mins
Discover how the ESP32-C5 saves power through its sleep modes and the Ultra Low Power (ULP) LP core coprocessor, including how to program the LP core, enter sleep, and wake the main CPU.

ESP-IDF C5 - Lecture 3

·6 mins
Learn how Over-the-Air (OTA) updates work on Espressif devices, including the ESP-IDF app_update and esp_https_ota components and the partition table layout required to support safe updates.

ESP-IDF C5 - Lecture 2

·5 mins
This lecture introduces the ESP-IDF partition table, its typical elements, and how to select a built-in scheme through menuconfig.

ESP-IDF C5 - Lecture 1

·3 mins
This lecture introduces the ESP32-C5 and its dual-band Wi-Fi 6 radio, then explains how to configure the 2.4 GHz and 5 GHz bands using the ESP-IDF Wi-Fi driver.

ESP-IDF C5 - Assign. 4.2

·5 mins
Write a program that runs on the LP core while the main CPU is in deep sleep. The LP core wakes periodically on the LP timer, increments a counter, and wakes the main CPU once the counter reaches a threshold.

ESP-IDF C5 - Assign. 4.1

·4 mins
Write an application that enters deep sleep, wakes up periodically with the RTC timer, and keeps a counter alive across sleep cycles using RTC memory.

ESP-IDF C5 - Assign. 3.3

·6 mins
Extend the application from Assignment 3.1 so it fetches a remote version string before updating, and only calls esp_https_ota when that remote version is newer than the one currently running.

ESP-IDF C5 - Assign. 3.2 (Optional)

·6 mins
Extend the OTA application from the previous assignment with rollback support, so that a newly updated firmware must confirm it works before it is trusted, and is otherwise automatically reverted to the previous working image.

ESP-IDF C5 - Assign. 3.1

·6 mins
Configure the partition table for OTA, then write an application that connects to Wi-Fi and performs a single OTA update by downloading new firmware from a fixed HTTPS URL with esp_https_ota.

ESP-IDF C5 - Assign. 2.2

·2 mins
Create a custom partition table that adds a spiffs filesystem partition, then flash it and confirm the change by reading it back from flash.

ESP-IDF C5 - Assign. 2.1

·3 mins
Switch the partition table to a scheme that supports OTA updates, and confirm the change by reading it back from flash.

ESP-IDF C5 - Assign. 1.2

·4 mins
Change the band mode of the station from Assignment 1.1 so the ESP32-C5 picks the band automatically instead of being locked to 5 GHz.

ESP-IDF C5 - Assign. 1.1

·9 mins
Write an application that connects the ESP32-C5 to a Wi-Fi network as a station, restricts the radio to the 5 GHz band, and reports the band and channel it joined.