
Discover why FreeRTOS matters for the ESP32, with its free, open-source real-time, modular design. Learn how a tiny three-file setup enables prioritized tasks and testing on ESP32.
Explore the ESP32 FreeRTOS system start up flow, detailing three bootloader stages in ROM, SDK, and application startup, then show how the main task is created and the app starts.
Explore how to create and delete tasks in FreeRTOS on the ESP32 SDK, including configuring the task function, stack depth, priority, and using task handles or self-deletion.
Learn how to pass different input parameter types to FreeRTOS tasks on ESP32, including integers, arrays, structures, and strings, using void pointers and proper casting.
Explore how ESP32 FreeRTOS assigns task priority from 0 (idle) to max-1. Learn to get and set task priorities, and see higher priority tasks run first.
Learn to suspend a task and resume another in FreeRTOS on ESP32, coordinating two tasks for sensor data collection and data transmission.
show how to use the FreeRTOS task list on the ESP32 SDK to output each task's name, status, priority, stack, and number via a looping print routine.
Learn how to set the task stack for ESP32 FreeRTOS tasks, including stack depth and minimum stack size. Use the get stack high watermark to adjust and prevent overflow.
Learn how to use the ESP32 FreeRTOS task watchdog to prevent a single task from hogging the CPU, feed the watchdog, add tasks, and configure timeouts.
Learn how to create a FreeRTOS queue on ESP32, configure it for integers, and implement sender and receiver tasks that deliver data via xQueueSendToBack and xQueueReceive.
Explore monitoring queue space in FreeRTOS on ESP32, using the queue space function to track available slots as data is sent and later received.
Compare sending to front and back in FreeRTOS queues on ESP32, and show how back yields FIFO while front yields LIFO.
Define a two-member structure and send it from a send task to a received task via a queue, then receive and print the id and data to verify delivery.
Deliver string data via a queue in FreeRTOS on ESP32 by allocating memory, formatting with a stream point and length, sending and receiving a string pointer, then printing and freeing.
Explore multiple producers writing to a single queue in FreeRTOS on ESP32, and how task priorities and portMAX_DELAY control when the single reader retrieves values.
Explore queue sets in FreeRTOS on ESP32 by grouping multiple queues into one set. Create the set, add queues, and use select from set to receive from any ready queue.
Learn how to implement a mailbox in FreeRTOS on ESP32 by creating a mailbox with a queue, overwriting data from a write task, and reading with multiple read tasks.
Create and configure software timers in FreeRTOS for ESP32, set the period and auto reload, implement a timer callback, and start or stop at a fixed frequency or one shot.
Share a single callback across two ESP32 FreeRTOS software timers, retrieve each timer’s name and ID, and perform distinct actions based on the timer name in the same handler.
Explore how to use FreeRTOS software timers on ESP32, focusing on timer reset and timer change period to implement a watchdog and adjust a timer-driven blink frequency.
Explore binary semaphores in FreeRTOS on ESP32, using a two-value 0/1 resource lock to synchronize two tasks with take and give operations.
Learn how counting semaphores work on the ESP32 with FreeRTOS, contrasting with binary semaphore, using a parking-lot analogy to show max and initial counts, and take and give operations.
Demonstrate how FreeRTOS mutexes implement priority inheritance, showing how a task holding a mutex raises its priority when a higher-priority task requests it, unlike binary semaphores.
Explore how to use a recursive mutex in FreeRTOS on ESP32 to guard resources a and p with a single mutex, enabling nested locking across two tasks.
Explore the FreeRTOS event group wait function on ESP32, showing how to create an event group, monitor bit changes (bit 0 and bit 4), and trigger events by setting bits.
learn how FreeRTOS event group sync coordinates three tasks on ESP32 by setting bits in an event group and waiting for all bits before simultaneous execution, with a worked example.
Learn how to implement FreeRTOS notification sync on ESP32 using task notify take and task notify give, including parameters for reset, wait, and blocking.
Explore how FreeRTOS on ESP32 uses notification values to signal events, using notify wait to read bit-encoded flags and task_notify to send with set, increment, or override actions.
Learn how to implement a FreeRTOS stream buffer on ESP32, creating buffers, sending and receiving data (including audio data), and coordinating two tasks with trigger levels and blocking reads.
Explain how to decide stream buffer size for an ESP32 FreeRTOS project by monitoring stream buffer space with a dedicated task and adjusting size to balance memory use and performance.
Compare freeRTOS message buffers and stream buffers on ESP32, showing that message buffers deliver one message per receive, while stream buffers deliver all data in a single receive when enough.
Explore the differences between FreeRTOS message buffers and stream buffers on the ESP32 SDK. Message buffers require a full message to be received, while stream buffers deliver partial data.
The first question for the freeRTOS on ESP32 lessons is why we need to study freeRTOS. The most important reasons are probably as follows:
(1) First, it is totally free and open source. You no need to pay any fee for using it in your any projects. And you can get all the source code from it's official website;
(2) Second, it is a "RTOS". "RTOS" means "real time operating system". It can processes data and events that have critically defined time constraints.
(3) Third, it is very tiny and simple. The kernel resource files are only three c files. It is very fit for microcontroller which has limited ram or rom.
(4) Forth, it is well supported. It has been porting on lots of platform, even including xilinx FPGA.
The second question is why we study freeRTOS based on ESP32?
(1) The first reason is the original SDK software of ESP32 is using the freeRTOS as its operation system. We no need to port it again. We will have a very stable platform to study all kinds of software features of the freeRTOS.
(2) ESP32 is a very wonderful chip. It has internal flash and sram. It has the wifi and bluetooth function on the same chip. The wifi and bluetooth is a critical function for the "internet things" application. It also has other powerful peripheral interfaces, such as, I2C, SPI, I2S, UART, ADC, DAC, RTC, USB etc.
(3) It also has a very small package size and very low price compared with other similar function chips. It is very easy to DIY products by hobbyist.
NOTES:
(1) All the course examples have been tested on idf sdk ver4.4.1 software. For other versions, the code might be a little different.
(2) If you are using one regular ESP32 board, not one ESP32C3 board, you might need to change FreeRTOS running on two kernels to running on one kernel by setting "Run FreeRTOS only on first core" in menuconfig.