Skip to main content

compiling

192 words
Empire-Phoenix
Author
Empire-Phoenix

Preconditions:
#

  • Rust: rustup installed.
  • ESP32 Toolchain: espup installed.
  • Build Utilities: ldproxy and espflash installed.
  • Node.js: npm installed (for the web interface).

Cloning the Repository
#

Clone the repository including submodules:

git clone --recursive https://git.mannheim.ccc.de/C3MA/PlantCtrl.git
cd PlantCtrl/Software/MainBoard/rust

Toolchain Setup
#

  1. Install Rust: If not already done, visit rustup.rs.
  2. Install ldproxy:
    cargo install ldproxy
  3. Install espup:
    cargo install espup
  4. Install ESP toolchain:
    espup install
  5. Install espflash:
    cargo install espflash

Building the Web Interface
#

The configuration website is built using TypeScript and Webpack, then embedded into the Rust binary.

cd src_webpack/
npm install
npx webpack
cd ..

Compiling the Firmware
#

Build the project using Cargo:

cargo build --release

The resulting binary will be located in target/riscv32imac-unknown-none-elf/release/plant-ctrl2.

Using Build Scripts
#

To simplify the process, several bash scripts are provided in the Software/MainBoard/rust directory:

  • image_build.sh: Automatically builds the web interface, compiles the Rust firmware in release mode, and creates a flashable image.bin.
  • all.sh: Performs all steps from image_build.sh and additionally flashes the firmware to a connected device and starts the serial monitor.
  • wokwi_build.sh: Builds a debug version of the firmware and creates a full 16MB flash image for use with the Wokwi simulator.