tosca-esp32c3
A library crate for building firmware for tosca devices using an ESP32-C3
microcontroller.
It provides APIs to:
- Connect a device to a
Wi-Fiaccess point - Build the network stack
- Configure the
mDNS-SDdiscovery service - Define events for specific route tasks
- Initialize and run an
HTTPserver
The device APIs are designed to guide developers in defining their own devices, aiming to minimize the ambiguities that could arise during firmware development.
Currently, only a light device is implemented as a device. However, this does not prevent the addition of other devices without altering the overall crate structure.
Build Process
To compile this crate with the debug profile, run:
cargo build
To compile this crate with the release profile, which applies all
optimizations for faster performance and reduced memory usage, run:
cargo build --release
Build process for firmware devices
The examples
directory includes firmware examples built with the tosca-esp32c3 crate.
Each example is independent from another and can be moved to a separate
repository.
To build a firmware run:
cd examples/[firmware directory name]
cargo build
To flash and run the firmware on an ESP32-C3 board:
cd examples/[firmware directory name]
cargo run --release
[!IMPORTANT] Always use the release profile
[--release]when building esp-hal. The dev profile can potentially be one or more orders of magnitude slower than release profile, and may cause issues with timing-sensitive peripherals and/or devices.