Skip to content
This repository has been archived by the owner on Nov 14, 2024. It is now read-only.

Commit

Permalink
Add support for ESP3232-H2 (#96)
Browse files Browse the repository at this point in the history
* build: Update hal versions

* feat: Add support for ESP32-H2

* docs: Update advanced prompt documentation
  • Loading branch information
SergioGasquez authored Jul 5, 2023
1 parent 2ac3e37 commit 4280469
Show file tree
Hide file tree
Showing 5 changed files with 48 additions and 35 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
strategy:
fail-fast: false
matrix:
board: ["esp32", "esp32s2", "esp32s3", "esp32c2", "esp32c3", "esp32c6"]
board: ["esp32", "esp32c2", "esp32c3", "esp32c6", "esp32h2", "esp32s2", "esp32s3"]
alloc: ["true", "false"]
action:
- command: build
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci_docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
strategy:
fail-fast: false
matrix:
board: ["esp32", "esp32s2", "esp32s3", "esp32c2", "esp32c3", "esp32c6"]
board: ["esp32", "esp32c2", "esp32c3", "esp32c6", "esp32h2", "esp32s2", "esp32s3"]
steps:
- uses: actions/checkout@v3
with:
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ cargo generate -a esp-rs/esp-template
After running the command, there will be a few prompts:
- `Project Name`: Name of the crate.
- `Which MCU to target?`: SoC model.
- `Use template default values?`: Skips the rest of the prompts and uses their default value. If false, you will be prompted with:
- `Configure advanced template options?`: If `false`, skips the rest of the prompts and uses their default value. If `true`, you will be prompted with:
- `Enable allocations via the esp-alloc crate?`: Adds [`esp-alloc`] dependency, and initializes the heap.
- `Configure project to support Wokwi simulation with Wokwi VS Code extension?`: Adds support for Wokwi simulation using [VS Code Wokwi extension].
- `Configure project to use Dev Containers (VS Code and GitHub Codespaces)?`: Adds support for:
Expand Down
2 changes: 1 addition & 1 deletion cargo-generate.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ pre = ["pre-script.rhai"]
[placeholders.mcu]
type = "string"
prompt = "Which MCU to target?"
choices = ["esp32", "esp32c2", "esp32c3", "esp32c6", "esp32s2", "esp32s3"]
choices = ["esp32", "esp32c2", "esp32c3", "esp32c6", "esp32h2", "esp32s2", "esp32s3"]
default = "esp32"

[placeholders.advanced]
Expand Down
75 changes: 44 additions & 31 deletions pre-script.rhai
Original file line number Diff line number Diff line change
Expand Up @@ -9,36 +9,10 @@ let targets = #{
rust_target: "xtensa-esp32-none-elf",
atomic_emulation: "none",
gcc_target: "xtensa-esp32-elf",
hal_version: "0.12.0",
hal_version: "0.13.0",
wokwi_board: "board-esp32-devkit-v1",
},
esp32s2: #{
arch: "xtensa",
has_swd: false,
has_tg1: true,
sys_peripheral: "SYSTEM",
rct_peripheral: "RTC_CNTL",
toolchain: "esp",
rust_target: "xtensa-esp32s2-none-elf",
atomic_emulation: "esp32s2",
gcc_target: "xtensa-esp32s2-elf",
hal_version: "0.9.0",
wokwi_board: "board-esp32-s2-devkitm-1",
},
esp32s3: #{
arch: "xtensa",
has_swd: false,
has_tg1: true,
sys_peripheral: "SYSTEM",
rct_peripheral: "RTC_CNTL",
toolchain: "esp",
rust_target: "xtensa-esp32s3-none-elf",
atomic_emulation: "none",
gcc_target: "xtensa-esp32s3-elf",
hal_version: "0.9.0",
wokwi_board: "board-esp32-s3-devkitc-1",
},
esp32c2: #{
esp32c2: #{
arch: "riscv",
has_swd: true,
has_tg1: false,
Expand All @@ -48,7 +22,7 @@ let targets = #{
rust_target: "riscv32imc-unknown-none-elf",
atomic_emulation: "riscv",
gcc_target: "riscv32-esp-elf",
hal_version: "0.7.0",
hal_version: "0.8.0",
wokwi_board: "",
},
esp32c3: #{
Expand All @@ -61,7 +35,7 @@ let targets = #{
rust_target: "riscv32imc-unknown-none-elf",
atomic_emulation: "riscv",
gcc_target: "riscv32-esp-elf",
hal_version: "0.9.0",
hal_version: "0.10.0",
wokwi_board: "board-esp32-c3-devkitm-1",
},
esp32c6: #{
Expand All @@ -74,9 +48,48 @@ let targets = #{
rust_target: "riscv32imac-unknown-none-elf",
atomic_emulation: "none",
gcc_target: "riscv32-esp-elf",
hal_version: "0.2.0",
hal_version: "0.3.0",
wokwi_board: "board-esp32-c6-devkitc-1",
},
esp32h2: #{
arch: "riscv",
has_swd: true,
has_tg1: true,
sys_peripheral: "PCR",
rct_peripheral: "LP_CLKRST",
toolchain: "nightly",
rust_target: "riscv32imac-unknown-none-elf",
atomic_emulation: "none",
gcc_target: "riscv32-esp-elf",
hal_version: "0.1.0",
wokwi_board: "",
},
esp32s2: #{
arch: "xtensa",
has_swd: false,
has_tg1: true,
sys_peripheral: "SYSTEM",
rct_peripheral: "RTC_CNTL",
toolchain: "esp",
rust_target: "xtensa-esp32s2-none-elf",
atomic_emulation: "esp32s2",
gcc_target: "xtensa-esp32s2-elf",
hal_version: "0.10.0",
wokwi_board: "board-esp32-s2-devkitm-1",
},
esp32s3: #{
arch: "xtensa",
has_swd: false,
has_tg1: true,
sys_peripheral: "SYSTEM",
rct_peripheral: "RTC_CNTL",
toolchain: "esp",
rust_target: "xtensa-esp32s3-none-elf",
atomic_emulation: "none",
gcc_target: "xtensa-esp32s3-elf",
hal_version: "0.10.0",
wokwi_board: "board-esp32-s3-devkitc-1",
},
};

let target = variable::get("mcu");
Expand Down

0 comments on commit 4280469

Please sign in to comment.