diff --git a/rust/all.sh b/rust/all.sh new file mode 100755 index 0000000..befcff7 --- /dev/null +++ b/rust/all.sh @@ -0,0 +1,22 @@ +#!/usr/bin/env bash + +set -euo pipefail + +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" + +"${SCRIPT_DIR}/build_website.sh" + +cargo build --release +espflash save-image \ + --bootloader "${SCRIPT_DIR}/bootloader.bin" \ + --partition-table "${SCRIPT_DIR}/partitions.csv" \ + --chip esp32c6 \ + target/riscv32imac-unknown-none-elf/release/plant-ctrl2 \ + "${SCRIPT_DIR}/image.bin" + +espflash flash --monitor \ + --bootloader "${SCRIPT_DIR}/bootloader.bin" \ + --chip esp32c6 \ + --baud 921600 \ + --partition-table "${SCRIPT_DIR}/partitions.csv" \ + target/riscv32imac-unknown-none-elf/release/plant-ctrl2 diff --git a/rust/flash.sh b/rust/flash.sh new file mode 100755 index 0000000..67ad0ac --- /dev/null +++ b/rust/flash.sh @@ -0,0 +1,15 @@ +#!/usr/bin/env bash + +set -euo pipefail + +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" + +"${SCRIPT_DIR}/build_website.sh" + +cargo build --release +espflash flash --monitor \ + --bootloader "${SCRIPT_DIR}/bootloader.bin" \ + --chip esp32c6 \ + --baud 921600 \ + --partition-table "${SCRIPT_DIR}/partitions.csv" \ + target/riscv32imac-unknown-none-elf/release/plant-ctrl2