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

HIL: Erase flash on failure #1748

Merged
merged 2 commits into from
Jul 4, 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
5 changes: 5 additions & 0 deletions .github/workflows/hil.yml
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,11 @@ jobs:
path: tests-${{ matrix.target.soc }}

- name: Run Tests
id: run-tests
run: |
export PATH=$PATH:/home/espressif/.cargo/bin
cargo xtask run-elfs ${{ matrix.target.soc }} tests-${{ matrix.target.soc }}

- name: Erase Flash on Failure
if: steps.run-tests.conclusion == 'failure'
run: espflash erase-flash
14 changes: 10 additions & 4 deletions hil-test/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ Some tests will require physical connections, please see the current [configurat
### Running Tests Remotes (ie. On Self-Hosted Runners)
The [`hil.yml`] workflow builds the test suite for all our available targets and executes them.

Our self hosted runners have the following setup:
Our self-hosted runners have the following setup:
- ESP32-C2 (`esp32c2-jtag`):
- Devkit: `ESP8684-DevKitM-1` connected via UART.
- `GPIO2` and `GPIO3` are connected.
Expand Down Expand Up @@ -94,10 +94,10 @@ Our self hosted runners have the following setup:
- `GPIO43 (TX)` and `GPIO45` are connected.
- RPi: Raspbian 12 configured with the following [setup]

[connection_c2]: (https://docs.espressif.com/projects/esp-idf/en/stable/esp32c2/api-guides/jtag-debugging/configure-other-jtag.html#configure-hardware)
[connection_s2]: (https://docs.espressif.com/projects/esp-idf/en/stable/esp32s2/api-guides/jtag-debugging/configure-other-jtag.html#configure-hardware)
[connection_c2]: https://docs.espressif.com/projects/esp-idf/en/stable/esp32c2/api-guides/jtag-debugging/configure-other-jtag.html#configure-hardware
[connection_s2]: https://docs.espressif.com/projects/esp-idf/en/stable/esp32s2/api-guides/jtag-debugging/configure-other-jtag.html#configure-hardware
[`hil.yml`]: https://github.com/esp-rs/esp-hal/blob/main/.github/workflows/hil.yml
[setup]: #vm-setup
[setup]: #rpi-setup

#### RPi Setup
```bash
Expand All @@ -113,6 +113,12 @@ cargo install probe-rs-tools --git https://github.com/probe-rs/probe-rs --rev a6
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
# Install espflash
ARCH=$($HOME/.cargo/bin/rustup show | grep "Default host" | sed -e 's/.* //')
curl -L "https://github.com/esp-rs/espflash/releases/latest/download/espflash-${ARCH}.zip" -o "${HOME}/.cargo/bin/espflash.zip"
unzip "${HOME}/.cargo/bin/espflash.zip" -d "${HOME}/.cargo/bin/"
rm "${HOME}/.cargo/bin/espflash.zip"
chmod u+x "${HOME}/.cargo/bin/espflash"
# Reboot the VM
sudo reboot
```
Expand Down