diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7825ffb2f..28b67b3b4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -307,21 +307,41 @@ jobs: - name: rustfmt (examples) run: cargo fmt --all --manifest-path=examples/Cargo.toml -- --check - riscv-hil: - name: HIL Test | ${{ matrix.soc }} + hil: + name: HIL Test | ${{ matrix.target.soc }} runs-on: ubuntu-latest strategy: fail-fast: false 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: - 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: - target: riscv32imc-unknown-none-elf,riscv32imac-unknown-none-elf,riscv32imafc-unknown-none-elf + target: ${{ matrix.target.rust-target }} toolchain: nightly 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 - - run: cargo xtask build-examples hil-test ${{ matrix.soc }} + - run: cargo xtask build-examples hil-test ${{ matrix.target.soc }} diff --git a/.github/workflows/hil.yml b/.github/workflows/hil.yml index c4665f313..01e7ab8ca 100644 --- a/.github/workflows/hil.yml +++ b/.github/workflows/hil.yml @@ -17,8 +17,7 @@ env: CARGO_TERM_COLOR: always jobs: - # Test RISC-V targets: - riscv-hil: + hil: name: HIL Test | ${{ matrix.target.soc }} runs-on: labels: [self-hosted, "${{ matrix.target.runner }}"] @@ -26,6 +25,7 @@ jobs: fail-fast: false matrix: target: + # RISC-V devices: - soc: esp32c3 runner: rustboard rust-target: riscv32imc-unknown-none-elf @@ -35,6 +35,9 @@ jobs: - soc: esp32h2 runner: esp32h2-usb rust-target: riscv32imac-unknown-none-elf + # Xtensa devices: + - soc: esp32s3 + runner: esp32s3-usb steps: - uses: actions/checkout@v4 if: github.event_name != 'workflow_dispatch' @@ -45,14 +48,20 @@ jobs: repository: ${{ github.event.inputs.repository }} 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: target: ${{ matrix.target.rust-target }} toolchain: nightly 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 run: cargo xtask run-tests ${{ matrix.target.soc }} - - # Test Xtensa targets: - # TODO: Add jobs for Xtensa once supported by `probe-rs` diff --git a/hil-test/README.md b/hil-test/README.md index f194076d5..994c04308 100644 --- a/hil-test/README.md +++ b/hil-test/README.md @@ -70,6 +70,10 @@ Our Virtual Machines have the following setup: - Devkit: `ESP32-H2-DevKitM-1` connected via USB-Serial-JTAG (`USB` port). - `GPIO2` and `GPIO4` are connected. - 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 @@ -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 # Add the user to plugdev group sudo usermod -a -G plugdev $USER -# Reboot the +# Reboot the VM sudo reboot ``` diff --git a/hil-test/tests/gpio.rs b/hil-test/tests/gpio.rs index 8e70dc1c5..80d1641be 100644 --- a/hil-test/tests/gpio.rs +++ b/hil-test/tests/gpio.rs @@ -151,6 +151,8 @@ mod tests { } #[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) { critical_section::with(|cs| { *COUNTER.borrow_ref_mut(cs) = 0;