mirror of
https://github.com/esp-rs/esp-hal.git
synced 2025-10-03 07:05:19 +00:00
Enable S3 HIL (#1338)
* feat: Add HIL support for S3 * ci: Add dummy s3 job * test: Filter interrupt test for Xtensa devices * ci: Install Xtensa toolchain
This commit is contained in:
parent
586744070b
commit
1a5ca65eed
32
.github/workflows/ci.yml
vendored
32
.github/workflows/ci.yml
vendored
@ -307,21 +307,41 @@ jobs:
|
|||||||
- name: rustfmt (examples)
|
- name: rustfmt (examples)
|
||||||
run: cargo fmt --all --manifest-path=examples/Cargo.toml -- --check
|
run: cargo fmt --all --manifest-path=examples/Cargo.toml -- --check
|
||||||
|
|
||||||
riscv-hil:
|
hil:
|
||||||
name: HIL Test | ${{ matrix.soc }}
|
name: HIL Test | ${{ matrix.target.soc }}
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
soc: [esp32c3, esp32c6, esp32h2]
|
target:
|
||||||
|
# RISC-V devices:
|
||||||
|
- soc: esp32c3
|
||||||
|
rust-target: riscv32imc-unknown-none-elf
|
||||||
|
- soc: esp32c6
|
||||||
|
rust-target: riscv32imac-unknown-none-elf
|
||||||
|
- soc: esp32h2
|
||||||
|
rust-target: riscv32imac-unknown-none-elf
|
||||||
|
# Xtensa devices:
|
||||||
|
- soc: esp32s3
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- uses: dtolnay/rust-toolchain@v1
|
# Install the Rust toolchain for RISC-V devices:
|
||||||
|
|
||||||
|
- if: ${{ !contains(fromJson('["esp32", "esp32s2", "esp32s3"]'), matrix.target.soc) }}
|
||||||
|
uses: dtolnay/rust-toolchain@v1
|
||||||
with:
|
with:
|
||||||
target: riscv32imc-unknown-none-elf,riscv32imac-unknown-none-elf,riscv32imafc-unknown-none-elf
|
target: ${{ matrix.target.rust-target }}
|
||||||
toolchain: nightly
|
toolchain: nightly
|
||||||
components: rust-src
|
components: rust-src
|
||||||
|
# Install the Rust toolchain for Xtensa devices:
|
||||||
|
- if: contains(fromJson('["esp32", "esp32s2", "esp32s3"]'), matrix.target.soc)
|
||||||
|
uses: esp-rs/xtensa-toolchain@v1.5
|
||||||
|
with:
|
||||||
|
buildtargets: ${{ matrix.target.soc }}
|
||||||
|
default: true
|
||||||
|
ldproxy: false
|
||||||
|
|
||||||
- uses: Swatinem/rust-cache@v2
|
- uses: Swatinem/rust-cache@v2
|
||||||
- run: cargo xtask build-examples hil-test ${{ matrix.soc }}
|
- run: cargo xtask build-examples hil-test ${{ matrix.target.soc }}
|
||||||
|
21
.github/workflows/hil.yml
vendored
21
.github/workflows/hil.yml
vendored
@ -17,8 +17,7 @@ env:
|
|||||||
CARGO_TERM_COLOR: always
|
CARGO_TERM_COLOR: always
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
# Test RISC-V targets:
|
hil:
|
||||||
riscv-hil:
|
|
||||||
name: HIL Test | ${{ matrix.target.soc }}
|
name: HIL Test | ${{ matrix.target.soc }}
|
||||||
runs-on:
|
runs-on:
|
||||||
labels: [self-hosted, "${{ matrix.target.runner }}"]
|
labels: [self-hosted, "${{ matrix.target.runner }}"]
|
||||||
@ -26,6 +25,7 @@ jobs:
|
|||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
target:
|
target:
|
||||||
|
# RISC-V devices:
|
||||||
- soc: esp32c3
|
- soc: esp32c3
|
||||||
runner: rustboard
|
runner: rustboard
|
||||||
rust-target: riscv32imc-unknown-none-elf
|
rust-target: riscv32imc-unknown-none-elf
|
||||||
@ -35,6 +35,9 @@ jobs:
|
|||||||
- soc: esp32h2
|
- soc: esp32h2
|
||||||
runner: esp32h2-usb
|
runner: esp32h2-usb
|
||||||
rust-target: riscv32imac-unknown-none-elf
|
rust-target: riscv32imac-unknown-none-elf
|
||||||
|
# Xtensa devices:
|
||||||
|
- soc: esp32s3
|
||||||
|
runner: esp32s3-usb
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
if: github.event_name != 'workflow_dispatch'
|
if: github.event_name != 'workflow_dispatch'
|
||||||
@ -45,14 +48,20 @@ jobs:
|
|||||||
repository: ${{ github.event.inputs.repository }}
|
repository: ${{ github.event.inputs.repository }}
|
||||||
ref: ${{ github.event.inputs.branch }}
|
ref: ${{ github.event.inputs.branch }}
|
||||||
|
|
||||||
- uses: dtolnay/rust-toolchain@v1
|
# Install the Rust toolchain for RISC-V devices:
|
||||||
|
- if: ${{ !contains(fromJson('["esp32", "esp32s2", "esp32s3"]'), matrix.target.soc) }}
|
||||||
|
uses: dtolnay/rust-toolchain@v1
|
||||||
with:
|
with:
|
||||||
target: ${{ matrix.target.rust-target }}
|
target: ${{ matrix.target.rust-target }}
|
||||||
toolchain: nightly
|
toolchain: nightly
|
||||||
components: rust-src
|
components: rust-src
|
||||||
|
# Install the Rust toolchain for Xtensa devices:
|
||||||
|
- if: contains(fromJson('["esp32", "esp32s2", "esp32s3"]'), matrix.target.soc)
|
||||||
|
uses: esp-rs/xtensa-toolchain@v1.5
|
||||||
|
with:
|
||||||
|
buildtargets: ${{ matrix.target.soc }}
|
||||||
|
default: true
|
||||||
|
ldproxy: false
|
||||||
|
|
||||||
- name: Run tests
|
- name: Run tests
|
||||||
run: cargo xtask run-tests ${{ matrix.target.soc }}
|
run: cargo xtask run-tests ${{ matrix.target.soc }}
|
||||||
|
|
||||||
# Test Xtensa targets:
|
|
||||||
# TODO: Add jobs for Xtensa once supported by `probe-rs`
|
|
||||||
|
@ -70,6 +70,10 @@ Our Virtual Machines have the following setup:
|
|||||||
- Devkit: `ESP32-H2-DevKitM-1` connected via USB-Serial-JTAG (`USB` port).
|
- Devkit: `ESP32-H2-DevKitM-1` connected via USB-Serial-JTAG (`USB` port).
|
||||||
- `GPIO2` and `GPIO4` are connected.
|
- `GPIO2` and `GPIO4` are connected.
|
||||||
- VM: Ubuntu 20.04.5 configured with the following [setup](#vm-setup)
|
- VM: Ubuntu 20.04.5 configured with the following [setup](#vm-setup)
|
||||||
|
- ESP32-S3 (`esp32s3-usb`):
|
||||||
|
- Devkit: `ESP32-S3-DevKitC-1` connected via USB-Serial-JTAG.
|
||||||
|
- `GPIO2` and `GPIO4` are connected.
|
||||||
|
- VM: Ubuntu 22.04.4 configured with the following [setup](#vm-setup)
|
||||||
|
|
||||||
[`hil.yml`]: https://github.com/esp-rs/esp-hal/blob/main/.github/workflows/hil.yml
|
[`hil.yml`]: https://github.com/esp-rs/esp-hal/blob/main/.github/workflows/hil.yml
|
||||||
|
|
||||||
@ -87,7 +91,7 @@ cargo install probe-rs --git=https://github.com/probe-rs/probe-rs --rev=ddd59fa
|
|||||||
wget -O - https://probe.rs/files/69-probe-rs.rules | sudo tee /etc/udev/rules.d/69-probe-rs.rules > /dev/null
|
wget -O - https://probe.rs/files/69-probe-rs.rules | sudo tee /etc/udev/rules.d/69-probe-rs.rules > /dev/null
|
||||||
# Add the user to plugdev group
|
# Add the user to plugdev group
|
||||||
sudo usermod -a -G plugdev $USER
|
sudo usermod -a -G plugdev $USER
|
||||||
# Reboot the
|
# Reboot the VM
|
||||||
sudo reboot
|
sudo reboot
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -151,6 +151,8 @@ mod tests {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
|
// TODO: See https://github.com/esp-rs/esp-hal/issues/1413
|
||||||
|
#[cfg(not(any(feature = "esp32", feature = "esp32s2", feature = "esp32s3")))]
|
||||||
fn test_gpio_interrupt(mut ctx: Context) {
|
fn test_gpio_interrupt(mut ctx: Context) {
|
||||||
critical_section::with(|cs| {
|
critical_section::with(|cs| {
|
||||||
*COUNTER.borrow_ref_mut(cs) = 0;
|
*COUNTER.borrow_ref_mut(cs) = 0;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user