FreeRTOS#
- Template: lf-freertos-uc-template
- FreeRTOS Documentation: freertos.org
- Supported Devices: FreeRTOS Supported Devices
Supported Platforms#
The FreeRTOS template currently supports:
- Pico (RP2040/RP2350) - Raspberry Pi Pico and Pico 2
Setup#
Clone and initialize submodules:
git clone https://github.com/lf-lang/lf-freertos-uc-template.git my-project
cd my-project
git submodule update --init --recursive
Install the ARM toolchain as described in the Pico platform prerequisites.
Building#
Flashing (Pico)#
Put the Pico into BOOTSEL mode, then:
Project Structure#
lf-freertos-uc-template/
├── CMakeLists.txt
├── platforms/
│ └── pico/
│ ├── FreeRTOSConfig.h
│ ├── platform.cmake
│ └── README.md
├── src/
│ ├── Blink.lf
│ ├── HelloFreeRTOS.lf
│ └── Timer.lf
└── FreeRTOS/ # Submodule
Platform Configuration#
Each platform has its own FreeRTOSConfig.h for tuning:
- CPU clock: 133 MHz (Pico default)
- Tick rate: 100 Hz
- Heap size: 128 KB
Adding New Platforms#
- Create
platforms/<platform-name>/ - Add
platform.cmakewith platform-specific CMake configuration - Add
FreeRTOSConfig.htuned for your hardware - Optionally add FreeRTOS hooks in
<platform>_freertos_hooks.c
Pico-Specific Features#
- USB and UART stdio enabled by default
- Pico W WiFi libraries automatically linked
- Connect GPIO 0 (TX) and GPIO 1 (RX) for UART output