summaryrefslogtreecommitdiff
path: root/.github/workflows
diff options
context:
space:
mode:
authorhathach <[email protected]>2022-11-15 18:10:41 +0700
committerhathach <[email protected]>2022-11-15 18:10:41 +0700
commit931b7182890fb85d697d2073dc353124c4da5d28 (patch)
tree5b02e4b23c776528a2211651e2cbe3a8afbe1cfe /.github/workflows
parent6c6b7ee2bf7df7463cf41bc3cfc919e4d5fee337 (diff)
try running HiFiPhile self-host with stm32l412nucleo
Diffstat (limited to '.github/workflows')
-rw-r--r--.github/workflows/build_arm.yml4
-rw-r--r--.github/workflows/test_hardware.yml82
2 files changed, 84 insertions, 2 deletions
diff --git a/.github/workflows/build_arm.yml b/.github/workflows/build_arm.yml
index 53f73a48f..d47a82173 100644
--- a/.github/workflows/build_arm.yml
+++ b/.github/workflows/build_arm.yml
@@ -163,11 +163,11 @@ jobs:
# - pico + pico-probe connected via USB
# - pico-probe is /dev/ttyACM0
# ---------------------------------------
- hw-test:
+ hw-pi4-test:
# Limit the run to only hathach due to limited resource on RPI4
if: github.repository_owner == 'hathach'
needs: build-arm
- runs-on: [self-hosted, Linux, ARM64]
+ runs-on: [self-hosted, Linux, ARM64, rp2040]
steps:
- name: Clean workspace
diff --git a/.github/workflows/test_hardware.yml b/.github/workflows/test_hardware.yml
new file mode 100644
index 000000000..534a17e6e
--- /dev/null
+++ b/.github/workflows/test_hardware.yml
@@ -0,0 +1,82 @@
+name: Hardware Test
+on:
+ pull_request:
+ push:
+ release:
+ types:
+ - created
+
+# Hardware in the loop (HIL)
+# Current self-hosted instance is running on an EPYC 7232 server hosted by HiFiPhile user
+# - STM32L412 Nucleo with on-board jlink (with 1 ttyACM)
+
+jobs:
+ stm32l412nucleo-test:
+ runs-on: [self-hosted, Linux, X64, hifiphile]
+ steps:
+ - name: Clean workspace
+ run: |
+ echo "Cleaning up previous run"
+ rm -rf "${{ github.workspace }}"
+ mkdir -p "${{ github.workspace }}"
+
+ - name: Checkout TinyUSB
+ uses: actions/checkout@v3
+
+ - name: Get Dependencies and Build
+ run: |
+ git submodule update --init lib/FreeRTOS-Kernel lib/lwip
+ python3 tools/get_dependencies.py stm32l4
+ python3 tools/build_family.py stm32l4
+
+ - name: Pick-up elf files
+ run: |
+ mkdir stm32l412nucleo/
+ find examples/ -path "*stm32l412nucleo/*.elf" -exec mv {} stm32l412nucleo/ \;
+
+ - name: Create flash.sh
+ run: |
+ touch flash.sh
+ chmod +x flash.sh
+ echo > flash.sh 'echo halt > flash.jlink'
+ echo > flash.sh 'echo r >> flash.jlink'
+ echo > flash.sh 'echo loadfile $1 >> flash.jlink'
+ echo > flash.sh 'echo r >> flash.jlink'
+ echo > flash.sh 'echo go >> flash.jlink'
+ echo > flash.sh 'echo exit >> flash.jlink'
+ echo > flash.sh 'JLinkExe -device stm32l412kb -if swd -JTAGConf -1,-1 -speed auto -CommandFile flash.jlink'
+
+ - name: Test cdc_dual_ports
+ run: |
+ ./flash.sh cdc_dual_ports.elf
+ while (! ([ -e /dev/ttyACM1 ] && [ -e /dev/ttyACM2 ])) && [ $SECONDS -le 5 ]; do :; done
+ test -e /dev/ttyACM1 && echo "ttyACM1 exists"
+ test -e /dev/ttyACM2 && echo "ttyACM2 exists"
+
+ - name: Test cdc_msc
+ run: |
+ ./flash.sh cdc_msc.elf
+ readme='/media/pi/TinyUSB MSC/README.TXT'
+ while (! ([ -e /dev/ttyACM1 ] && [ -f "$readme" ])) && [ $SECONDS -le 5 ]; do :; done
+ test -e /dev/ttyACM1 && echo "ttyACM1 exists"
+ test -f "$readme" && echo "$readme exists"
+ cat "$readme"
+
+ - name: Test dfu
+ run: |
+ ./flash.sh dfu.elf
+ while (! (dfu-util -l | grep "Found DFU")) && [ $SECONDS -le 5 ]; do :; done
+ dfu-util -d cafe -a 0 -U dfu0
+ dfu-util -d cafe -a 1 -U dfu1
+ grep "TinyUSB DFU! - Partition 0" dfu0
+ grep "TinyUSB DFU! - Partition 1" dfu1
+
+ - name: Test dfu_runtime
+ run: |
+ ./flash.sh dfu_runtime.elf
+ while (! (dfu-util -l | grep "Found Runtime")) && [ $SECONDS -le 5 ]; do :; done
+
+# - name: Test hid_boot_interface
+# run: |
+# ./flash.sh hid_boot_interface.elf
+# while (! (dfu-util -l | grep "Found Runtime")) && [ $SECONDS -le 5 ]; do :; done