Practical Sections
Setting Up FreeRTOS on ESP-32
Two cores in ESP-32 let this low-power microcontroller operate:
- CPU0: Handles BLE, Bluetooth, and Wi-Fi wireless protocols.
- CPU1: Executes code for user apps.
Installing and configuring the ESP-32 Arduino Core:
1. Obtain the most recent Arduino IDE and install it.
2. Launch Arduino IDE then go to File / Preferences. Enter in the field Additional Boards Manager URLs:
https://dl.espressif.com/dl/package_esp32_index.json
3. Go to Tools / Board / Boards Manager, look for esp32, and install the most recent release from Espressif Systems.
4. Go to Tools / Board / ESP32 Arduino and pick the right board (like ESP32 Dev Module or ESP32 Wrover Module).
All about FreeRTOS APIs
1. xTaskCreate()
- Purpose: Creates a new task and dynamically allocates the required memory. Returns a handle to the created task, or NULL if creation fails. Syntax:
BaseType_t xTaskCreate(
TaskFunction_t pvTaskCode,
const char * const pcName,
const uint32_t usStackDepth,
void * const pvParameters,
UBaseType_t uxPriority,
TaskHandle_t * const pvCreatedTask
);