Skip to main content
Featured image for ESP-IDF Workshop: Advanced

ESP-IDF Workshop: Advanced

Table of Contents

Welcome to the advanced ESP-IDF workshop!

Introduction
#

In this workshop, we’ll explore some of the more advanced aspects of the ESP-IDF framework, including modular development using components, the event loop, core dumps, and security features.

Estimated time: 3 hours.

Agenda
#

The workshop is divided into four parts.

  • Part 1: Components

    • Lesson 1 – What a component is, how to create one, and how to support multiple hardware versions through BSPs and multiple configurations
    • Assignment 1.1 – Refactor the code by creating the alarm component (Guided)
    • Assignment 1.2 – Refactor the code by creating the cloud_manager component
    • Assignment 1.3 – Manage multiple configurations using sdkconfig (Guided)
  • Part 2: Event Loop

    • Lesson 2 – Basic information about event loops in ESP-IDF, using timer events, and separating responsibilities
    • Assignment 2.1 – Refactor the code to use the event loop (Guided)
    • Assignment 2.2 – Add a GPIO event to the event loop
  • Part 3: Performance and Crash Analysis

    • Lesson 3 – Size analysis and using core dumps for debugging
    • Assignment 3.1 – Analyze the application size and suggest optimizations (Guided)
    • Assignment 3.2 – Analyze a crash using core dumps (Guided)
    • Assignment 3.3 – Analyze a crash using core dumps (Optional)
  • Part 4: OTA and Security Features

    • Lesson 4 – Fundamentals of OTA, partition table configuration, secure bootloader, and flash encryption
    • Assignment 4.1 – Modify the partition table to support OTA (Guided)
    • Assignment 4.2 – Use a custom partition table (Guided)
    • Assignment 4.3 – Enable flash encryption (Guided)

Prerequisites
#

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

Required Software
#

Required Hardware
#

  • ESP-C3-DevKit-RUST-1 or ESP-C3-DevKit-RUST-2 board (if the activity is in person, the board will be provided during the workshop)
    It is also possible to use an ESP32-C3-DevKit-M/C board, but you will need to adjust the GPIO configuration accordingly.
If the event is held in person, it is strongly recommended to install VS Code and the ESP-IDF plugin before the start of the workshop. If you encounter any issues, there will still be a short time during the first exercise to complete the installation.

Basic Knowledge
#

  • Good understanding of:
    • C programming and the linker
    • Callback functions and function pointers
    • MQTT protocol and its use
  • Embedded programming
    • Flashing / Programming, linking
    • Familiarity with MCU peripherals such as GPIO and I2C
    • Basic experience with ESP-IDF
  • Tool installation (VS Code + ESP-IDF extension)

Next Step
#

If you are unable to complete an exercise during the session, you can continue by downloading the appropriate solution according to the following structure:

aassssiiggnnmmeenntt__13__12__bbaasseeassignment_1_1assignmentaa_ss1ss_ii2ggnnmmeenntt__a23s__s12ignmentaa_ss1ss_ii3ggnnmmeenntt__24__21aassssiiggnnmmeenntt__34__12

Even if you successfully complete all exercises, you will still need to download at least assignment_1_1_base and assignment_3_2_base: The first assignment is based on the code in assignment_1_1_base

Your next step is Lesson 1.

Conclusion
#

Congratulations! You have reached the end of this workshop. We hope it has been a valuable experience and the start of a longer learning journey. Thank you for participating in the advanced ESP-IDF workshop.

ESP-IDF Adv. - Lecture 4

··10 mins
In this article, we explore the advanced features required for security: OTA update, flash encryption, and secure bootloader

ESP-IDF Adv. - Lecture 3

··3 mins
In this article, we cover size analysis and core dumps. You’ll learn what they do, why they matter, and how to use them to build more efficient and reliable applications.

ESP-IDF Adv. - Lecture 2

··5 mins
In this article, we explore the event loop—a core component of Espressif’s ESP-IDF framework that facilitates efficient, decoupled, and asynchronous event handling in embedded applications. We examine its functionality, highlight its benefits, explain how it is used by default within ESP-IDF, and provide practical code examples to demonstrate common usage patterns.

ESP-IDF Adv. - Lecture 1

··7 mins
In this lecture, we explore the ESP-IDF build system, built on CMake and Ninja. We focus on modular components, the Component Manager, and Board Support Packages (BSPs) for hardware abstraction. We also cover how to create custom components and manage configurations using sdkconfig files and build profiles, enabling flexible and reproducible builds.

ESP-IDF Adv. - Assign. 4.1

··2 mins
Change partition table to Factory app, two ota definitions (guided)

ESP-IDF Adv. - Assign. 2.1

··4 mins
Event loop: Manage temperature and alarm sensor via events (guided)

ESP-IDF Adv. - Assign. 1.2

··3 mins
Create a cloud_manager component and refactor the code to use it.

ESP-IDF Adv. - Assign. 1.1

··8 mins
Create the alarm component and refactor the code to use it (guided)