From ab4f3c85975a773c71767878bea17278fe9c6732 Mon Sep 17 00:00:00 2001 From: Frederick Vollbrecht Date: Mon, 5 Feb 2024 08:16:17 +0100 Subject: [PATCH] make cargo espflash work by adding a partition.csv (#375) * make cargo espflash work by adding a partition.csv * add p4 as an option --- README.md | 20 +++++++++++++------- espflash.toml | 1 + partitions.csv | 5 +++++ 3 files changed, 19 insertions(+), 7 deletions(-) create mode 100644 espflash.toml create mode 100644 partitions.csv diff --git a/README.md b/README.md index 37ebfcd98..bf7ba186a 100644 --- a/README.md +++ b/README.md @@ -26,15 +26,21 @@ Follow the [Prerequisites](https://github.com/esp-rs/esp-idf-template#prerequisi The examples could be built and flashed conveniently with [`cargo-espflash`](https://github.com/esp-rs/espflash/). To run e.g. the `ledc_simple` on an e.g. ESP32-C3: (Swap the Rust target and example name with the target corresponding for your ESP32 MCU and with the example you would like to build) -with `cargo-espflash` V2+: -``` -$ ESP_IDF_VERSION=release/v4.4 cargo espflash flash --target riscv32imc-esp-espidf --example ledc_simple --monitor +with `cargo-espflash`: +```sh +$ MCU=esp32c3 cargo espflash flash --target riscv32imc-esp-espidf --example ledc_simple --monitor ``` -with older `cargo-espflash`: -``` -$ ESP_IDF_VERSION=release/v4.4 cargo espflash --target riscv32imc-esp-espidf --example ledc_simple --monitor /dev/ttyUSB0 -``` +| MCU | "--target" | +| --- | ------ | +| esp32c2 | riscv32imc-esp-espidf | +| esp32c3| riscv32imc-esp-espidf | +| esp32c6| riscv32imac-esp-espidf | +| esp32h2 | riscv32imac-esp-espidf | +| esp32p4 | riscv32imafc-esp-espidf | +| esp32 | xtensa-esp32-espidf | +| esp32s2 | xtensa-esp32s2-espidf | +| esp32s3 | xtensa-esp32s3-espidf | In order to run the examples on other chips you will most likely need to adapt at least the used pins. diff --git a/espflash.toml b/espflash.toml new file mode 100644 index 000000000..d22b92e77 --- /dev/null +++ b/espflash.toml @@ -0,0 +1 @@ +partition_table = "partitions.csv" diff --git a/partitions.csv b/partitions.csv new file mode 100644 index 000000000..924878bc2 --- /dev/null +++ b/partitions.csv @@ -0,0 +1,5 @@ +# Name, Type, SubType, Offset, Size, Flags +# Note: if you have increased the bootloader size, make sure to update the offsets to avoid overlap +nvs, data, nvs, , 0x6000, +phy_init, data, phy, , 0x1000, +factory, app, factory, , 3M, \ No newline at end of file