This is an example dynamically-loaded application (.so) for KeiraOS.
It demonstrates:
- Drawing shapes (circles, lines, rectangles, triangles)
- Animating objects (bouncing ball with trail, spinning hexagon)
- Reading controller input (D-pad, A/B buttons)
- Playing buzzer sounds
- Using the frame buffer (double-buffered rendering via
keira_queue_draw)
You need the Xtensa ESP32-S3 GCC toolchain. If you have PlatformIO installed, it's already available at:
~/.platformio/packages/toolchain-xtensa-esp32s3/bin/
Shows section layout, symbol table, and total size.
cmake . && makeThis produces build/demo.so.
If your toolchain is in a custom location, set the XTENSA_TOOLCHAIN_PATH environment variable:
XTENSA_TOOLCHAIN_PATH=/path/to/xtensa-toolchain/bin \
cmake -DCMAKE_TOOLCHAIN_FILE=../xtensa-esp32s3.cmake ..
makeThe toolchain file (xtensa-esp32s3.cmake) searches in this order:
XTENSA_TOOLCHAIN_PATHenvironment variable- PlatformIO default path (
~/.platformio/packages/toolchain-xtensa-esp32s3/bin/) - System
PATH
- Copy
demo.soto the SD card on your Lilka device - Open the File Manager in KeiraOS
- Navigate to and select
demo.so - The app will start automatically
| Button | Action |
|---|---|
| D-Pad | Move the ball |
| A | Speed boost |
| B | Exit the app |
- Create a new
.cfile with#include "keira_api.h" - Implement
int app_main(int argc, char *argv[])as the entry point - Use
keira_*functions for display, controller, timing, and buzzer - Build with the same flags (see Makefile or CMakeLists.txt)
- Copy the
.soto the SD card and open it from the file manager
- No standard library is available (
printf,malloc, etc. are provided by Keira's symbol table) - The app runs in the same address space as Keira — crashes will reset the device
argv[0]contains the path to the.sofile on the SD card- Call
keira_queue_draw()after finishing each frame to display it - Return from
app_mainor press B to exit gracefully
See keira_api.h for the complete API reference with documentation.