Skip to main content

ESP-IDF Advanced Workshop

Table of Contents

Welcome to Espressif’s Advanced ESP-IDF Workshop!

Introduction
#

In this hands-on workshop, you’ll develop a solid understanding of the ESP-IDF framework, included modular development via components, event loops, core dumps, and security features.

Estimated time: 3 hours.

Agenda
#

The workshop is divided into four parts. Here’s the outline:

  • Part 1: Components

    • Lecture 1 – What is a component, how to create it, and how to support multiple hardware versions via BSPs and multi-config
    • Assignment 1.1 – Refactor the code creating the alarm component
    • Assignment 1.2 – Refactor the code creating the cloud_manager component
    • Assignment 1.3 – Multiple configuration using sdkconfig
  • Part 2: Event Loops

    • Lecture 2 – Event loop basics in ESP-IDF, using timer events, and separation of concerns
    • Assignment 2.1 – Refactor the code to use the event loop mechanism
    • Assignment 2.2 – Add a gpio event to the event loop
  • Break (15 minutes)

  • Part 3: Performance and crash analysis

    • Lecture 3 – Application size analysis and core dumps
    • Assignment 3.1 – Analyze application size and suggest optimizations
    • 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

    • Lecture 4 – OTA fundamentals, partition table configuration, secure bootloader, flash encryption
    • Assignment 4.1 – Modify the partition table to support OTA
    • Assignment 4.2 – Use a custom partition table
    • Assignment 4.3 – Enable flash encryption

Prerequisites
#

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

  • Good knowledge of:

    • C programming and its linker
    • Call back functions and function pointers
    • MQTT protocol and usage
  • Embedded programming

    • Flashing / Programming, linking
    • Familiarity with MCU peripherals such as GPIO and I2C
    • Basic experience with ESP-IDF
  • Tools installation (VSCode + ESP-IDF extension)

We strongly recommend installing VSCode and the ESP-IDF plugin before the workshop begins. If you run into any issues, there will be some time during the first assignment to complete the installation.

Reference Table
#

PrerequisiteDescriptionReference
MCU memory typesDifference between Flash, RAM and EEPROML. Harvie (Medium)
PSRAMWhat is PSRAMM. Hawthorne (Technipages)
MCU serial peripheralsDifference between SPI, I2C, UARTnextpcb.com
ESP-IDF VSCode PluginEspressif official VSCode Extensionvscode-esp-idf-extension installation
Partition tableWhat is partition table and why it’s usefulWikipedia disk partitioning article

Workshop
#

Without further delay, let’s get started! You’ll find links to each part of the workshop below.

The first lecture builds on the code in assignment_1_1_base.

If you’re unable to complete a particular assignment, please download its prerequisite as shown in the diagram below.

aassssiiggnnmmeenntt__13__12__bbaasseeassignment_1_1assignmentaa_ss1ss_ii2ggnnmmeenntt_a23s__s12ignmentaa_ss1ss_ii3ggnnmmeenntt_24__21aassssiiggnnmmeenntt_34__12

Even if you complete all assignments successfully, you’ll still need to download at least assignment_1_1_base and assignment_3_2_base.

Your next step is Lecture 1.

Conclusion
#

Congratulations! You just arrived at the end of this workshop. We hope it was a fruitful experience and the start of a longer journey. Thank you for following the advanced ESP-IDF workshop.

ESP-IDF Adv. - Lecture 4
11 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 two key tools for embedded development on Espressif platforms: 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
8 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.3
37 mins
ESP-IDF Adv. - Assign. 4.2
1 min
Create a custom partition table
ESP-IDF Adv. - Assign. 4.1
2 mins
Change partition table to Factory app, two ota definitions
ESP-IDF Adv. - Assign. 3.3
5 mins
Explore core dump - DIY
ESP-IDF Adv. - Assign. 3.2
8 mins
Explore core dump – guided
ESP-IDF Adv. - Assign. 3.1
2 mins
Reduce binary size by working on configuration.
ESP-IDF Adv. - Assign. 2.2
3 mins
Event loop: add an external GPIO event
ESP-IDF Adv. - Assign. 2.1
4 mins
Event loop: Manage temperature and alarm sensor via events
ESP-IDF Adv. - Assign. 1.3
2 mins
Support multiple configurations via sdkconfigs
ESP-IDF Adv. - Assign. 1.2
4 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)