Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cycle USB port power before each test run #1997

Merged
merged 1 commit into from
Aug 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 27 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,6 +186,27 @@ jobs:
with:
name: xtask-${{ matrix.target.host }}

- name: Cycle USB ports
run: |
export PATH=$PATH:/home/espressif/.cargo/bin
for i in {1..10}; do
# Disable all used hubs
for hub in ${{ matrix.target.hubs }}; do
sudo uhubctl -a off -l $hub
done

# Enable all used hubs
for hub in ${{ matrix.target.hubs }}; do
sudo uhubctl -a on -l $hub
done

sleep 0.5

if probe-rs list | grep -q "\[0\]:"; then
break
fi
done

- name: Run Tests
id: run-tests
run: |
Expand Down
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