docs.rs failed to build esp-hal-ota-0.5.7
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
Visit the last successful build:
esp-hal-ota-0.5.1
esp-hal-ota
OTA for esp-hal (no-std).
Limitations
I cannot test if it works properly on esp32s2,esp32c2,esp32c6 and esp32h2. But esp32s3, esp32c3 and esp32 are working perfectly fine.
Features
- Obviously OTA updates
- Dynamic partitions reading (so no macros, no reading from partitions.csv) - fully automatic
- Checking currently booted partition (using some pointer magic from ESP-IDF)
- CRC32 verification
Getting started
- Create
partitions.csvfile in project root (copypartitions.csv.templatefile) - In your project edit
./.cargo/config.tomlfile and append--partition-table ./partitions.csvto therunnerattribute - Optionally append
--erase-parts otadatato./cargo/config.tomlto fix some ota issues
[]
= "espflash flash --monitor --partition-table ./partitions.csv --erase-parts otadata"
Example
To see real-world example look at ./examples and ./simple-ota-server dirs.
let flash_size = 1234; // get it from OTA server
let target_crc = 65436743; // get it from OTA server
let mut ota = new.unwrap;
ota.ota_begin;
let mut buf = ;
loop
Running example
- You can compile your .bin file using esp-flash
This will generate .bin file from build file for chip.
Todo
- Fully working library
- Simple example
- Better errors
- Other esp32's (like esp32c3, esp32s2, etc..)
- Rollbacks
Resources
- https://github.com/esp-rs/espflash (this led me to esp-idf-part)
- https://github.com/esp-rs/esp-idf-part
- https://github.com/espressif/esp-idf/blob/master/docs/en/api-reference/system/ota.rst (especially Python API)
- https://github.com/python/cpython/blob/main/Modules/binascii.c (internal_crc32)
- https://github.com/espressif/esp-idf/blob/master/components/app_update/esp_ota_ops.c#L552 (esp get current partition (paddr))
- https://github.com/bjoernQ/esp32c3-ota-experiment (i've only seen this after first experiments, so haven't looked at it yet)