
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.
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.
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 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 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 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.
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.
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.