Skip to content

Commit

Permalink
Use uhubctl to disable and enable usb ports
Browse files Browse the repository at this point in the history
  • Loading branch information
bugadani committed Aug 26, 2024
1 parent b4ccb35 commit 31a7367
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 7 deletions.
25 changes: 19 additions & 6 deletions .github/workflows/hil.yml
Original file line number Diff line number Diff line change
Expand Up @@ -153,29 +153,29 @@ jobs:
# RISC-V devices:
- soc: esp32c2
runner: esp32c2-jtag
usb: USB2
host: aarch64
hubs: [1, 3]
- soc: esp32c3
runner: esp32c3-usb
usb: ACM0
host: armv7
hubs: [1-1]
- soc: esp32c6
runner: esp32c6-usb
usb: ACM0
host: armv7
hubs: [1-1]
- soc: esp32h2
runner: esp32h2-usb
usb: USB0
host: armv7
hubs: [1-1]
# Xtensa devices:
- soc: esp32s2
runner: esp32s2-jtag
usb: USB1
host: armv7
hubs: [1-1]
- soc: esp32s3
runner: esp32s3-usb
usb: USB0
host: armv7
hubs: [1-1]
steps:
- uses: actions/download-artifact@v4
with:
Expand All @@ -186,9 +186,22 @@ jobs:
with:
name: xtask-${{ matrix.target.host }}

- name: Enable USB ports
run: |
for hub in ${{ matrix.target.hubs }}; do
sudo uhubctl -a on -l $hub
done
- name: Run Tests
id: run-tests
run: |
export PATH=$PATH:/home/espressif/.cargo/bin
chmod +x xtask
./xtask run-elfs ${{ matrix.target.soc }} tests-${{ matrix.target.soc }}
- name: Disable USB ports
if: ${{ always() }}
run: |
for hub in ${{ matrix.target.hubs }}; do
sudo uhubctl -a off -l $hub
done
2 changes: 1 addition & 1 deletion hil-test/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- --default-t
# Source the current shell:
. "$HOME/.cargo/env"
# Install dependencies
sudo apt install -y pkg-config libudev-dev
sudo apt install -y pkg-config libudev-dev uhubctl
# Install probe-rs
cargo install probe-rs-tools --git https://github.com/probe-rs/probe-rs --rev 9bde591 --force
# Add the udev rules
Expand Down

0 comments on commit 31a7367

Please sign in to comment.