Skip to content

Commit

Permalink
Update to the newly-released crates; use ESP IDF V5.3 (latest stable)…
Browse files Browse the repository at this point in the history
… and V5.2 (previous stable) (#254)

* Update to the newly-released crates; use ESP IDF V5.3 (latest stable) and V5.2 (previous stable)

* Update changelog

* Fix the version numbers

* CRATE_CC_NO_DEFAULTS not necessary anymore, as we enforce it programmatically now
  • Loading branch information
ivmarkov authored Jan 2, 2025
1 parent acfd1e9 commit 8d07929
Show file tree
Hide file tree
Showing 9 changed files with 20 additions and 25 deletions.
8 changes: 2 additions & 6 deletions .github/workflows/ci_cargo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ jobs:
matrix:
target: ["esp32", "esp32c3", "esp32c2", "esp32c6", "esp32h2", "esp32s2", "esp32s3"]
esp-idf:
- version: v5.3
- version: v5.2
- version: v5.1 # only for compairson why no_std build fails on v5.2
# - version: master
steps:
- name: Setup | Rust (RISC-V)
Expand Down Expand Up @@ -69,17 +69,13 @@ jobs:
- uses: actions/checkout@v4
with:
path: /home/runner/work/esp-idf-template/esp-idf-template/github-esp-idf-template
- name: Generate v5.2
if: matrix.esp-idf.version == 'v5.2' || matrix.esp-idf.version == 'v5.1'
- name: Generate
run: cargo generate --path /home/runner/work/esp-idf-template/esp-idf-template/github-esp-idf-template cargo --name ${{ matrix.target }} --vcs none --silent -d mcu=${{ matrix.target }} -d advanced=true -d espidfver=${{ matrix.esp-idf.version }} -d devcontainer=false -d wokwi=false -d ci=false
- name: Build | Fmt Check
if: matrix.esp-idf.version == 'v5.2' && matrix.target == 'esp32c3'
run: cd ${{ matrix.target }}; cargo fmt -- --check
- name: Build | Clippy
if: matrix.esp-idf.version == 'v5.2' || matrix.esp-idf.version == 'v5.1'
run: cd ${{ matrix.target }}; cargo clippy --no-deps -- -Dwarnings
- name: Build | Compile
if: matrix.esp-idf.version == 'v5.2' || matrix.esp-idf.version == 'v5.1'
run: cd ${{ matrix.target }}; cargo build
container-checks:
name: "Container Check: ${{ matrix.target }}"
Expand Down
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Breaking

### Added
- Update the template to the latest-released `esp-idf-svc`
- Update the template to ESP-IDF V5.3 (latest stable)

### Fixed
- Fixed the generated GH CI by making sure `ldproxy`, `cargo fmt`, `cargo clippy` and rust src for `-Zbuild-std` are operational with the nightly toolchain (#253)
2 changes: 1 addition & 1 deletion README-cmake-details.md
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ env:
CARGO_TERM_COLOR: always
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
ESP_TARGET: esp32
ESP_IDF_VERSION: v5.1
ESP_IDF_VERSION: v5.3.2


jobs:
Expand Down
4 changes: 2 additions & 2 deletions README-cmake.md
Original file line number Diff line number Diff line change
Expand Up @@ -145,15 +145,15 @@ When using `idf.py` and CMake driven ESP-IDF projects, you need to [install the
Simple installation for Linux & MacOS:
```sh
git clone https://github.com/espressif/esp-idf
git -C esp-idf checkout release/v5.1
git -C esp-idf checkout release/v5.3
esp-idf/install.sh
. esp-idf/export.sh
```

Simple installation for Windows:
```sh
git clone https://github.com/espressif/esp-idf
git -C esp-idf checkout release/v5.1
git -C esp-idf checkout release/v5.3
esp-idf\install
esp-idf\export
```
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ The command will display a few prompts:
- `Which MCU to target?`: SoC model, e.g. `esp32`, `esp32s2`, `esp32c3` etc.
- `Configure advanced template options?`: If `false`, skips the rest of the prompts and uses their default value. If `true`, you will be prompted with:
- `ESP-IDF Version`: ESP-IDF branch/tag to use. Possible choices:
- [`v4.4`](https://github.com/espressif/esp-idf/releases/tag/v4.4.5): Stable
- [`v5.1`](https://github.com/espressif/esp-idf/releases/tag/v5.1): Stable
- [`v5.3`](https://github.com/espressif/esp-idf/releases/tag/v5.3.2): Stable
- [`v5.2`](https://github.com/espressif/esp-idf/releases/tag/v5.2.3): Stable
- [`master`](https://github.com/espressif/esp-idf/tree/master): **Unstable**. Please do NOT choose the `master` ESP IDF version, unless you
really have a very good reason to. Building against ESP IDF `master` is NOT officially supported, and can break any time.
- `Configure project to support Wokwi simulation with Wokwi VS Code extension?`: Adds support for Wokwi simulation using [VS Code Wokwi extension](https://marketplace.visualstudio.com/items?itemName=wokwi.wokwi-vscode).
Expand Down
12 changes: 5 additions & 7 deletions cargo/.cargo/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,19 @@ target = "{{ rust_target }}"

[target.{{ rust_target }}]
linker = "ldproxy"
runner = "espflash flash --monitor" # Select this runner for espflash v3.x.x
rustflags = [ "--cfg", "espidf_time64"] # Extending time_t for ESP IDF 5: https://github.com/esp-rs/rust/issues/110
runner = "espflash flash --monitor"
rustflags = [ "--cfg", "espidf_time64"]

[unstable]
build-std = ["std", "panic_abort"]

[env]
MCU="{{ mcu }}"
# Note: this variable is not used by the pio builder (`cargo build --features pio`)
{%- if espidfver == "v5.1" %}
ESP_IDF_VERSION = "v5.1.4"
{%- if espidfver == "v5.3" %}
ESP_IDF_VERSION = "v5.3.2"
{% elsif espidfver == "v5.2" %}
ESP_IDF_VERSION = "v5.2.2"
ESP_IDF_VERSION = "v5.2.3"
{% elsif espidfver == "master" %}
ESP_IDF_VERSION = "master"
{% endif %}
# Workaround for https://github.com/esp-rs/esp-idf-template/issues/174
CRATE_CC_NO_DEFAULTS = "1"
5 changes: 2 additions & 3 deletions cargo/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@ experimental = ["esp-idf-svc/experimental"]

[dependencies]
log = "0.4"
esp-idf-svc = { version = "0.49", features = ["critical-section", "embassy-time-driver", "embassy-sync"] }
esp-idf-svc = { version = "0.50", features = ["critical-section", "embassy-time-driver", "embassy-sync"] }

[build-dependencies]
embuild = "0.32.0"
cc = "=1.1.30" # Version "1.1.30" necessary until a new version of `esp-idf-sys` is released
embuild = "0.33"
4 changes: 2 additions & 2 deletions cargo/cargo-generate.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ default = false
[conditional.'advanced'.placeholders.espidfver]
type = "string"
prompt = "ESP-IDF version (master = UNSTABLE)"
choices = ["v5.1", "v5.2", "master"]
default = "v5.2"
choices = ["v5.3", "v5.2", "master"]
default = "v5.3"

[conditional.'advanced'.placeholders.devcontainer]
type = "bool"
Expand Down
4 changes: 2 additions & 2 deletions cmake/components/rust-{{project-name}}/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ experimental = ["esp-idf-svc/experimental"]

[dependencies]
log = "0.4"
esp-idf-svc = { version = "0.49", default-features = false, features = ["std", "native", "critical-section", "embassy-time-driver", "embassy-sync"] }
esp-idf-svc = { version = "0.50", default-features = false, features = ["std", "native", "critical-section", "embassy-time-driver", "embassy-sync"] }

[build-dependencies]
embuild = "0.32.0"
embuild = "0.33"

0 comments on commit 8d07929

Please sign in to comment.