Skip to content

PlatformIO

PlatformIO is the build system used to compile and upload OSECHI firmware to the ESP32.


Overview

Item Value
Role Firmware compilation, library management, device upload
Config file platformio.ini
Board esp32dev (ESP32-WROOM-32E)
Environment esp32dev-v2

OSECHI Usage

Build

Compile the v2 firmware:

uv run platformio run -e esp32dev-v2

A successful build prints RAM and Flash usage:

RAM:   [=         ]  14.3% (used 46880 bytes from 327680 bytes)
Flash: [===       ]  27.8% (used 363456 bytes from 1310720 bytes)

Upload

Compile and flash to the connected ESP32:

uv run platformio run -e esp32dev-v2 --target upload

The device must be connected via USB. If the upload fails, check that no other process (e.g. serial monitor) is holding the serial port open.

Monitor

Open the serial monitor at 115200 baud:

uv run platformio device monitor --baud 115200

Press H for help, S for status, U for uptime.

Clean

Remove build artifacts:

uv run platformio run -e esp32dev-v2 --target clean

Build Customization

To override build flags locally without modifying tracked files, create platformio.override.ini in the project root:

; platformio.override.ini
[env:esp32dev-v2]
build_flags =
    -D ENABLE_WIFI=1
    -D ENABLE_GNSS=1

This file is automatically loaded by PlatformIO and is ignored by git.

See Build Flags Overview for all available flags.


References