A utility for flashing/provisioning ESP32 PCBs at the factory premises.
A Rust alternative to a custom-made Python or shell script driving the ESP provisioning tools (esptool
, espefuse
, espflash
).
- Pure Rust
- Interactive terminal UI with ratatui
- Library (API) or command-line
- Only needs the C lib pre-installed on the flashing PC. Everything else is statically linked in the executable
- Cross-platform:
- Windows X86_64
- MacOSX
- Linux + gLibc X86_64
- Linux + gLibc ARM64 (rPI Ubuntu or RaspOS)
- Linux + gLibc ARM32
- Pluggable bundle loaders
- Pluggable bundle provisioning logs uploaders
- OOTB bundle loaders for a directory (could also be NFS or something mounted with FUSE), HTTP(S) or S3
- OOTB bundle provisioning logs uploaders for a directory (could also be NFS or something mounted with FUSE), HTTP(S) or S3
TBD
As long as the libudev
feature is disabled (by default it is), you can easily cross-build the espfactory
CLI executable.
The rest of espfactory
is pure-Rust so you only need a linker for your cross-target and a C cross toolchain for the few dependencies that still need to compile custom C files (ring
).
Sample ways to cross-compile:
(If cargo
greets you with a "note: the XXX
target may not be installed" error, install the target first with rustup target add XXX
.)
With cargo-zigbuild
cargo install cargo-zigbuild
pip3 install zig
cargo zigbuild --target aarch64-unknown-linux-gnu # rPI 4+
Note: does not support cross-compiling to Windows. For Windows, use some of the other options.
With cargo-xwin
cargo install cargo-xwin
cargo xwin build --target x86_64-pc-windows-msvc
With cross
cargo install cross
cross build --target=x86_64-pc-windows-gnu # For e.g. Windows; Windows MSVC is not supported, only the GNU target
Note: needs Docker or Podman pre-installed.