Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/bjoernQ/esp32c3-ota-experiment
ESP32-C3 Bare Metal OTA Experiment
https://github.com/bjoernQ/esp32c3-ota-experiment
Last synced: about 1 month ago
JSON representation
ESP32-C3 Bare Metal OTA Experiment
- Host: GitHub
- URL: https://github.com/bjoernQ/esp32c3-ota-experiment
- Owner: bjoernQ
- License: apache-2.0
- Created: 2022-06-01T07:54:40.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2023-07-20T13:49:43.000Z (over 1 year ago)
- Last Synced: 2024-10-30T20:54:01.743Z (about 1 month ago)
- Language: Rust
- Size: 81.1 KB
- Stars: 35
- Watchers: 4
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE-APACHE
Awesome Lists containing this project
- awesome-esp-rust - esp32c3-ota-experiment - ESP32-C3 Bare Metal OTA Experiment. (Projects / `no_std`)
README
# ESP32C3 Bare Metal OTA Experiment
## About
This is an experiment to do an OTA update on ESP32-C3 in bare-metal.
Most things are hard-coded (i.e. the adresses of the ota partition and the ota slots).
## Preparation
First set the ENV variables `SSID` and `PASSWORD` to match the settings of your WiFi access point.
Your PC needs to be connected to the same access point.Set the address of your computer in as ENV variable `HOST_IP`(e.g. "192.168.2.125")
Make sure you have installed [devserver](https://crates.io/crates/devserver)
Change `THIS_VERSION` in `main.rs` to `2`. Compile the application via `cargo build --release`.
Perform these steps
- `esptool --chip esp32c3 elf2image target\riscv32imac-unknown-none-elf\release\esp32c3_ota_experiment`
- `cp target\riscv32imac-unknown-none-elf\release\esp32c3_ota_experiment.bin firmware.bin`Change `THIS_VERSION` in `main.rs` back to `1`.
## Run
Run `devserver --address 192.168.2.125:8080` in a separate terminal (in the project directory). Make sure to replace `192.168.2.125` by the IP of your PC.
To avoid problems run `esptool erase_flash` first. Now run the application via `cargo run --release`
The application should connect to your PC, pick up `current.txt` and see it's own version (1) is below what is available online (2).
Now it will download `firmware.bin` and flash it. After that it will set the OTA partition to use.In this experiment the reset isn't done automatically. Reset the ESP32-C3 and see the new version boot.
The new version will see there is no later version online to flash.## Please Note
Make sure to use the provided bootloader and partition table.
i.e. when flashing manually with espflash use `espflash --bootloader bootloader.bin --partition-table partitions.csv`