Firmware
Install the Rust ESP toolchain
The firmware is built on top of esp-hal (Rust). First, set up the Rust ESP toolchain by following the official installation guide.
Then install espflash, which is used as the Cargo runner to flash and monitor the device.
Building & Running
Once the toolchain is installed, you can build and flash the firmware with a single command.
git clone https://github.com/FKMTime/firmware
cd firmware
cargo run -r
cargo run -r builds the firmware for the v4 board in release mode and flashes it to the connected device using espflash (configured as the Cargo runner). For a v3 board, add --no-default-features --features v3.
By default after build, binaries are also copied into /tmp/fkm-build folder. Development binaries are marked with their build time (epoch seconds).
Flashing
To flash a built firmware binary onto a connected device manually, use espflash. For day-to-day development simply running cargo run -r in the firmware repository will build and flash the device in one step.
For over-the-air updates you can use the built-in OTA (over the air update) in the micro-connector.
By default micro-connector is watching /tmp/fkm-build dir for firmware changes.
To flash development firmware you need to set the DEV environment variable for micro-connector. If you are running micro-connector using cargo (not docker) you can set it in the .env file in its project dir.
Common issues
- If you aren't using
DEVmode your firmware won't be updated to the development version of firmware.