update hil test and json (remove troublesome lpc54608), run hil test on ci with IAR build
This commit is contained in:
149
.github/workflows/build_iar.yml
vendored
149
.github/workflows/build_iar.yml
vendored
@@ -32,7 +32,7 @@ jobs:
|
|||||||
# Alphabetical order
|
# Alphabetical order
|
||||||
# Note: bundle multiple families into a matrix since there is only one self-hosted instance can
|
# Note: bundle multiple families into a matrix since there is only one self-hosted instance can
|
||||||
# run IAR build. Too many matrix can hurt due to setup/teardown overhead.
|
# run IAR build. Too many matrix can hurt due to setup/teardown overhead.
|
||||||
- 'stm32f0 stm32f1 stm32f7 stm32g0 stm32g4 stm32h7 stm32l4'
|
- 'stm32f0 stm32f1 stm32f4 stm32f7 stm32g0 stm32g4 stm32h7 stm32l4'
|
||||||
steps:
|
steps:
|
||||||
- name: Clean workspace
|
- name: Clean workspace
|
||||||
run: |
|
run: |
|
||||||
@@ -49,82 +49,85 @@ jobs:
|
|||||||
- name: Build
|
- name: Build
|
||||||
run: python3 tools/build_cmake.py ${{ matrix.family }} -DTOOLCHAIN=iar -DCMAKE_BUILD_TYPE=MinSizeRel
|
run: python3 tools/build_cmake.py ${{ matrix.family }} -DTOOLCHAIN=iar -DCMAKE_BUILD_TYPE=MinSizeRel
|
||||||
|
|
||||||
# Upload binaries for hardware test with self-hosted
|
- name: Test on actual hardware (hardware in the loop)
|
||||||
- name: Prepare stm32l412nucleo Artifacts
|
|
||||||
if: contains(matrix.family, 'stm32l4')
|
|
||||||
working-directory: ${{github.workspace}}/cmake-build/cmake-build-stm32l412nucleo
|
|
||||||
run: |
|
run: |
|
||||||
find device/ -name "*.elf" -exec mv {} ../../ \;
|
python3 tools/hitl_test.py hitl_hfp.json
|
||||||
|
|
||||||
- name: Upload Artifacts for stm32l412nucleo
|
# # Upload binaries for hardware test with self-hosted
|
||||||
if: contains(matrix.family, 'stm32l4') && github.repository_owner == 'hathach'
|
# - name: Prepare stm32l412nucleo Artifacts
|
||||||
uses: actions/upload-artifact@v3
|
# if: contains(matrix.family, 'stm32l4')
|
||||||
with:
|
# working-directory: ${{github.workspace}}/cmake-build/cmake-build-stm32l412nucleo
|
||||||
name: stm32l4
|
# run: |
|
||||||
path: |
|
# find device/ -name "*.elf" -exec mv {} ../../ \;
|
||||||
*.elf
|
#
|
||||||
|
# - name: Upload Artifacts for stm32l412nucleo
|
||||||
|
# if: contains(matrix.family, 'stm32l4') && github.repository_owner == 'hathach'
|
||||||
|
# uses: actions/upload-artifact@v3
|
||||||
|
# with:
|
||||||
|
# name: stm32l4
|
||||||
|
# path: |
|
||||||
|
# *.elf
|
||||||
|
|
||||||
# ---------------------------------------
|
# ---------------------------------------
|
||||||
# Hardware in the loop (HIL)
|
# Hardware in the loop (HIL)
|
||||||
# Current self-hosted instance is running on an EPYC 7232 server hosted by HiFiPhile user
|
# Current self-hosted instance is running on an EPYC 7232 server hosted by HiFiPhile user
|
||||||
# - STM32L412 Nucleo with on-board jlink as ttyACM0
|
|
||||||
# ---------------------------------------
|
# ---------------------------------------
|
||||||
hw-stm32l412nucleo-test:
|
# hw-stm32l412nucleo-test:
|
||||||
needs: cmake
|
# needs: cmake
|
||||||
runs-on: [self-hosted, Linux, X64, hifiphile]
|
# runs-on: [self-hosted, Linux, X64, hifiphile]
|
||||||
|
#
|
||||||
steps:
|
# steps:
|
||||||
- name: Clean workspace
|
# - name: Clean workspace
|
||||||
run: |
|
# run: |
|
||||||
echo "Cleaning up previous run"
|
# echo "Cleaning up previous run"
|
||||||
rm -rf "${{ github.workspace }}"
|
# rm -rf "${{ github.workspace }}"
|
||||||
mkdir -p "${{ github.workspace }}"
|
# mkdir -p "${{ github.workspace }}"
|
||||||
|
#
|
||||||
- name: Download stm32l4 Artifacts
|
# - name: Download stm32l4 Artifacts
|
||||||
uses: actions/download-artifact@v3
|
# uses: actions/download-artifact@v3
|
||||||
with:
|
# with:
|
||||||
name: stm32l4
|
# name: stm32l4
|
||||||
|
#
|
||||||
- name: Create flash.sh
|
# - name: Create flash.sh
|
||||||
run: |
|
# run: |
|
||||||
echo > flash.sh 'echo halt > flash.jlink'
|
# echo > flash.sh 'echo halt > flash.jlink'
|
||||||
echo >> flash.sh 'echo r >> flash.jlink'
|
# echo >> flash.sh 'echo r >> flash.jlink'
|
||||||
echo >> flash.sh 'echo loadfile $1 >> flash.jlink'
|
# echo >> flash.sh 'echo loadfile $1 >> flash.jlink'
|
||||||
echo >> flash.sh 'echo r >> flash.jlink'
|
# echo >> flash.sh 'echo r >> flash.jlink'
|
||||||
echo >> flash.sh 'echo go >> flash.jlink'
|
# echo >> flash.sh 'echo go >> flash.jlink'
|
||||||
echo >> flash.sh 'echo exit >> flash.jlink'
|
# echo >> flash.sh 'echo exit >> flash.jlink'
|
||||||
echo >> flash.sh 'cmdout=$(JLinkExe -USB 774470029 -device stm32l412kb -if swd -JTAGConf -1,-1 -speed auto -NoGui 1 -ExitOnError 1 -CommandFile flash.jlink)'
|
# echo >> flash.sh 'cmdout=$(JLinkExe -USB 774470029 -device stm32l412kb -if swd -JTAGConf -1,-1 -speed auto -NoGui 1 -ExitOnError 1 -CommandFile flash.jlink)'
|
||||||
echo >> flash.sh 'if (( $? )) ; then echo $cmdout ; fi'
|
# echo >> flash.sh 'if (( $? )) ; then echo $cmdout ; fi'
|
||||||
chmod +x flash.sh
|
# chmod +x flash.sh
|
||||||
|
#
|
||||||
- name: Test cdc_dual_ports
|
# - name: Test cdc_dual_ports
|
||||||
run: |
|
# run: |
|
||||||
./flash.sh cdc_dual_ports.elf
|
# ./flash.sh cdc_dual_ports.elf
|
||||||
while (! ([ -e /dev/ttyACM1 ] && [ -e /dev/ttyACM2 ])) && [ $SECONDS -le 10 ]; do :; done
|
# while (! ([ -e /dev/ttyACM1 ] && [ -e /dev/ttyACM2 ])) && [ $SECONDS -le 10 ]; do :; done
|
||||||
test -e /dev/ttyACM1 && echo "ttyACM1 exists"
|
# test -e /dev/ttyACM1 && echo "ttyACM1 exists"
|
||||||
test -e /dev/ttyACM2 && echo "ttyACM2 exists"
|
# test -e /dev/ttyACM2 && echo "ttyACM2 exists"
|
||||||
|
#
|
||||||
# Debian does not auto mount usb drive. skip this test for now
|
# # Debian does not auto mount usb drive. skip this test for now
|
||||||
- name: Test cdc_msc
|
# - name: Test cdc_msc
|
||||||
if: false
|
# if: false
|
||||||
run: |
|
# run: |
|
||||||
./flash.sh cdc_msc.elf
|
# ./flash.sh cdc_msc.elf
|
||||||
readme='/media/pi/TinyUSB MSC/README.TXT'
|
# readme='/media/pi/TinyUSB MSC/README.TXT'
|
||||||
while (! ([ -e /dev/ttyACM1 ] && [ -f "$readme" ])) && [ $SECONDS -le 10 ]; do :; done
|
# while (! ([ -e /dev/ttyACM1 ] && [ -f "$readme" ])) && [ $SECONDS -le 10 ]; do :; done
|
||||||
test -e /dev/ttyACM1 && echo "ttyACM1 exists"
|
# test -e /dev/ttyACM1 && echo "ttyACM1 exists"
|
||||||
test -f "$readme" && echo "$readme exists"
|
# test -f "$readme" && echo "$readme exists"
|
||||||
cat "$readme"
|
# cat "$readme"
|
||||||
|
#
|
||||||
- name: Test dfu
|
# - name: Test dfu
|
||||||
run: |
|
# run: |
|
||||||
./flash.sh dfu.elf
|
# ./flash.sh dfu.elf
|
||||||
while (! (dfu-util -l | grep "Found DFU")) && [ $SECONDS -le 10 ]; do :; done
|
# while (! (dfu-util -l | grep "Found DFU")) && [ $SECONDS -le 10 ]; do :; done
|
||||||
dfu-util -d cafe -a 0 -U dfu0
|
# dfu-util -d cafe -a 0 -U dfu0
|
||||||
dfu-util -d cafe -a 1 -U dfu1
|
# dfu-util -d cafe -a 1 -U dfu1
|
||||||
grep "TinyUSB DFU! - Partition 0" dfu0
|
# grep "TinyUSB DFU! - Partition 0" dfu0
|
||||||
grep "TinyUSB DFU! - Partition 1" dfu1
|
# grep "TinyUSB DFU! - Partition 1" dfu1
|
||||||
|
#
|
||||||
- name: Test dfu_runtime
|
# - name: Test dfu_runtime
|
||||||
run: |
|
# run: |
|
||||||
./flash.sh dfu_runtime.elf
|
# ./flash.sh dfu_runtime.elf
|
||||||
while (! (dfu-util -l | grep "Found Runtime")) && [ $SECONDS -le 10 ]; do :; done
|
# while (! (dfu-util -l | grep "Found Runtime")) && [ $SECONDS -le 10 ]; do :; done
|
||||||
|
1
.idea/cmake.xml
generated
1
.idea/cmake.xml
generated
@@ -52,7 +52,6 @@
|
|||||||
<configuration PROFILE_NAME="ra6m5 PORT0" ENABLED="false" CONFIG_NAME="Debug" GENERATION_OPTIONS="-DBOARD=ra6m5_ek -DLOG=3 -DLOGGER=RTT -DTRACE_ETM=1 -DPORT=0" />
|
<configuration PROFILE_NAME="ra6m5 PORT0" ENABLED="false" CONFIG_NAME="Debug" GENERATION_OPTIONS="-DBOARD=ra6m5_ek -DLOG=3 -DLOGGER=RTT -DTRACE_ETM=1 -DPORT=0" />
|
||||||
<configuration PROFILE_NAME="uno_r4" ENABLED="false" CONFIG_NAME="Debug" GENERATION_OPTIONS="-DBOARD=uno_r4 -DLOG=4 -DLOGGER=RTT" />
|
<configuration PROFILE_NAME="uno_r4" ENABLED="false" CONFIG_NAME="Debug" GENERATION_OPTIONS="-DBOARD=uno_r4 -DLOG=4 -DLOGGER=RTT" />
|
||||||
<configuration PROFILE_NAME="portenta_c33" ENABLED="false" CONFIG_NAME="Debug" GENERATION_OPTIONS="-DBOARD=portenta_c33 -DLOG=3" />
|
<configuration PROFILE_NAME="portenta_c33" ENABLED="false" CONFIG_NAME="Debug" GENERATION_OPTIONS="-DBOARD=portenta_c33 -DLOG=3" />
|
||||||
<configuration PROFILE_NAME="lpc54628 PORT0" ENABLED="true" CONFIG_NAME="Debug" GENERATION_OPTIONS="-DBOARD=lpcxpresso54628 -DLOG=4 -DLOGGER=RTT -DPORT=0" />
|
|
||||||
</configurations>
|
</configurations>
|
||||||
</component>
|
</component>
|
||||||
</project>
|
</project>
|
@@ -17,6 +17,7 @@ family_add_subdirectory(cdc_uac2)
|
|||||||
family_add_subdirectory(dfu)
|
family_add_subdirectory(dfu)
|
||||||
family_add_subdirectory(dfu_runtime)
|
family_add_subdirectory(dfu_runtime)
|
||||||
family_add_subdirectory(dynamic_configuration)
|
family_add_subdirectory(dynamic_configuration)
|
||||||
|
family_add_subdirectory(hid_boot_interface)
|
||||||
family_add_subdirectory(hid_composite)
|
family_add_subdirectory(hid_composite)
|
||||||
family_add_subdirectory(hid_composite_freertos)
|
family_add_subdirectory(hid_composite_freertos)
|
||||||
family_add_subdirectory(hid_generic_inout)
|
family_add_subdirectory(hid_generic_inout)
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
set(MCU_VARIANT LPC55S69)
|
set(MCU_VARIANT LPC55S69)
|
||||||
set(MCU_CORE LPC55S69_cm33_core0)
|
set(MCU_CORE LPC55S69_cm33_core0)
|
||||||
|
|
||||||
set(JLINK_DEVICE LPC55S69)
|
set(JLINK_DEVICE LPC55S69_M33_0)
|
||||||
set(PYOCD_TARGET LPC55S69)
|
set(PYOCD_TARGET LPC55S69)
|
||||||
set(NXPLINK_DEVICE LPC55S69:LPCXpresso55S69)
|
set(NXPLINK_DEVICE LPC55S69:LPCXpresso55S69)
|
||||||
|
|
||||||
|
@@ -1,92 +1,18 @@
|
|||||||
{
|
{
|
||||||
"devices": [
|
"boards": [
|
||||||
{
|
{
|
||||||
|
"name": "stm32l412nucleo",
|
||||||
"uid": "41003B000E504E5457323020",
|
"uid": "41003B000E504E5457323020",
|
||||||
"debugger": "jlink",
|
"debugger": "jlink",
|
||||||
"debugger_sn": "774470029",
|
"debugger_sn": "774470029",
|
||||||
"device": "STM32L412KB",
|
"cpu": "STM32L412KB"
|
||||||
"tests": [
|
|
||||||
{
|
|
||||||
"name": "cdc_dual_ports",
|
|
||||||
"firmware": "examples/device/cdc_dual_ports/_build/stm32l412nucleo/cdc_dual_ports.elf"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "cdc_msc",
|
|
||||||
"firmware": "examples/device/cdc_msc/_build/stm32l412nucleo/cdc_msc.elf"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "dfu",
|
|
||||||
"firmware": "examples/device/dfu/_build/stm32l412nucleo/dfu.elf"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "dfu_runtime",
|
|
||||||
"firmware": "examples/device/dfu_runtime/_build/stm32l412nucleo/dfu_runtime.elf"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "hid_boot_interface",
|
|
||||||
"firmware": "examples/device/hid_boot_interface/_build/stm32l412nucleo/hid_boot_interface.elf"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "board_test",
|
|
||||||
"firmware": "examples/device/board_test/_build/stm32l412nucleo/board_test.elf"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
"name": "stm32f746disco",
|
||||||
"uid": "210041000C51343237303334",
|
"uid": "210041000C51343237303334",
|
||||||
"debugger": "jlink",
|
"debugger": "jlink",
|
||||||
"debugger_sn": "770935966",
|
"debugger_sn": "770935966",
|
||||||
"device": "STM32F746NG",
|
"cpu": "STM32F746NG"
|
||||||
"tests": [
|
|
||||||
{
|
|
||||||
"name": "cdc_dual_ports",
|
|
||||||
"firmware": "examples/device/cdc_dual_ports/_build/stm32f746disco/cdc_dual_ports.elf"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "cdc_msc",
|
|
||||||
"firmware": "examples/device/cdc_msc/_build/stm32f746disco/cdc_msc.elf"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "dfu",
|
|
||||||
"firmware": "examples/device/dfu/_build/stm32f746disco/dfu.elf"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "dfu_runtime",
|
|
||||||
"firmware": "examples/device/dfu_runtime/_build/stm32f746disco/dfu_runtime.elf"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "hid_boot_interface",
|
|
||||||
"firmware": "examples/device/hid_boot_interface/_build/stm32f746disco/hid_boot_interface.elf"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "board_test",
|
|
||||||
"firmware": "examples/device/board_test/_build/stm32f746disco/board_test.elf"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"uid": "0123456789ABCDEF",
|
|
||||||
"debugger": "jlink",
|
|
||||||
"debugger_sn": "727600775",
|
|
||||||
"device": "LPC54608J512",
|
|
||||||
"tests": [
|
|
||||||
{
|
|
||||||
"name": "cdc_dual_ports",
|
|
||||||
"firmware": "examples/device/cdc_dual_ports/_build/lpcxpresso54628/cdc_dual_ports.elf"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "dfu",
|
|
||||||
"firmware": "examples/device/dfu/_build/lpcxpresso54628/dfu.elf"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "dfu_runtime",
|
|
||||||
"firmware": "examples/device/dfu_runtime/_build/lpcxpresso54628/dfu_runtime.elf"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "board_test",
|
|
||||||
"firmware": "examples/device/board_test/_build/lpcxpresso54628/board_test.elf"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
@@ -32,6 +32,21 @@ import serial
|
|||||||
import subprocess
|
import subprocess
|
||||||
import json
|
import json
|
||||||
|
|
||||||
|
|
||||||
|
def get_serial_dev(id, product, ifnum):
|
||||||
|
# get usb serial by id
|
||||||
|
return f'/dev/serial/by-id/usb-TinyUSB_{product}_{id}-if{ifnum:02d}'
|
||||||
|
|
||||||
|
|
||||||
|
def get_disk_dev(id, lun):
|
||||||
|
# get usb disk by id
|
||||||
|
return f'/dev/disk/by-id/usb-TinyUSB_Mass_Storage_{id}-0:{lun}'
|
||||||
|
|
||||||
|
|
||||||
|
def get_hid_dev(id, product, event):
|
||||||
|
return f'/dev/input/by-id/usb-TinyUSB_{product}_{id}-{event}'
|
||||||
|
|
||||||
|
|
||||||
def flash_jlink(sn, dev, firmware):
|
def flash_jlink(sn, dev, firmware):
|
||||||
script = ['halt', 'r', f'loadfile {firmware}', 'r', 'go', 'exit']
|
script = ['halt', 'r', f'loadfile {firmware}', 'r', 'go', 'exit']
|
||||||
f = open('flash.jlink', 'w')
|
f = open('flash.jlink', 'w')
|
||||||
@@ -43,9 +58,15 @@ def flash_jlink(sn, dev, firmware):
|
|||||||
os.remove('flash.jlink')
|
os.remove('flash.jlink')
|
||||||
assert ret.returncode == 0, 'Flash failed\n' + stdout
|
assert ret.returncode == 0, 'Flash failed\n' + stdout
|
||||||
|
|
||||||
|
|
||||||
|
def test_board_test(id):
|
||||||
|
# Dummy test
|
||||||
|
pass
|
||||||
|
|
||||||
def test_cdc_dual_ports(id):
|
def test_cdc_dual_ports(id):
|
||||||
port1 = f'/dev/ttyUSB_{id[-8:]}.00'
|
port1 = get_serial_dev(id, "TinyUSB_Device", 0)
|
||||||
port2 = f'/dev/ttyUSB_{id[-8:]}.02'
|
port2 = get_serial_dev(id, "TinyUSB_Device", 2)
|
||||||
|
|
||||||
# Wait device enum
|
# Wait device enum
|
||||||
timeout = 10
|
timeout = 10
|
||||||
while timeout:
|
while timeout:
|
||||||
@@ -75,10 +96,9 @@ def test_cdc_dual_ports(id):
|
|||||||
assert ser1.read(100) == str2.lower(), 'Port1 wrong data'
|
assert ser1.read(100) == str2.lower(), 'Port1 wrong data'
|
||||||
assert ser2.read(100) == str2.upper(), 'Port2 wrong data'
|
assert ser2.read(100) == str2.upper(), 'Port2 wrong data'
|
||||||
|
|
||||||
print('cdc_dual_ports test done')
|
|
||||||
|
|
||||||
def test_cdc_msc(id):
|
def test_cdc_msc(id):
|
||||||
port = f'/dev/ttyUSB_{id[-8:]}.00'
|
port = get_serial_dev(id, "TinyUSB_Device", 0)
|
||||||
file = f'/media/blkUSB_{id[-8:]}.02/README.TXT'
|
file = f'/media/blkUSB_{id[-8:]}.02/README.TXT'
|
||||||
# Wait device enum
|
# Wait device enum
|
||||||
timeout = 10
|
timeout = 10
|
||||||
@@ -110,7 +130,6 @@ If you find any bugs or get any questions, feel free to file an\r\n\
|
|||||||
issue at github.com/hathach/tinyusb"
|
issue at github.com/hathach/tinyusb"
|
||||||
|
|
||||||
assert data == readme, 'MSC wrong data'
|
assert data == readme, 'MSC wrong data'
|
||||||
print('cdc_msc test done')
|
|
||||||
|
|
||||||
def test_dfu(id):
|
def test_dfu(id):
|
||||||
# Wait device enum
|
# Wait device enum
|
||||||
@@ -150,7 +169,6 @@ def test_dfu(id):
|
|||||||
os.remove('dfu0')
|
os.remove('dfu0')
|
||||||
os.remove('dfu1')
|
os.remove('dfu1')
|
||||||
|
|
||||||
print('dfu test done')
|
|
||||||
|
|
||||||
def test_dfu_runtime(id):
|
def test_dfu_runtime(id):
|
||||||
# Wait device enum
|
# Wait device enum
|
||||||
@@ -166,12 +184,11 @@ def test_dfu_runtime(id):
|
|||||||
|
|
||||||
assert timeout, 'Device not available'
|
assert timeout, 'Device not available'
|
||||||
|
|
||||||
print('dfu_runtime test done')
|
|
||||||
|
|
||||||
def test_hid_boot_interface(id):
|
def test_hid_boot_interface(id):
|
||||||
kbd = f'/dev/input/by-id/usb-TinyUSB_TinyUSB_Device_{id}-event-kbd'
|
kbd = get_hid_dev(id, 'TinyUSB_Device', 'event-kbd')
|
||||||
mouse1 = f'/dev/input/by-id/usb-TinyUSB_TinyUSB_Device_{id}-if01-event-mouse'
|
mouse1 = get_hid_dev(id, 'TinyUSB_Device', 'if01-event-mouse')
|
||||||
mouse2 = f'/dev/input/by-id/usb-TinyUSB_TinyUSB_Device_{id}-if01-mouse'
|
mouse2 = get_hid_dev(id, 'TinyUSB_Device', 'if01-mouse')
|
||||||
# Wait device enum
|
# Wait device enum
|
||||||
timeout = 10
|
timeout = 10
|
||||||
while timeout:
|
while timeout:
|
||||||
@@ -182,11 +199,6 @@ def test_hid_boot_interface(id):
|
|||||||
|
|
||||||
assert timeout, 'Device not available'
|
assert timeout, 'Device not available'
|
||||||
|
|
||||||
print('hid_boot_interface test done')
|
|
||||||
|
|
||||||
def test_board_test(id):
|
|
||||||
# Dummy test
|
|
||||||
pass
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
if len(sys.argv) != 2:
|
if len(sys.argv) != 2:
|
||||||
@@ -197,12 +209,42 @@ if __name__ == '__main__':
|
|||||||
with open(f'{os.path.dirname(__file__)}/{sys.argv[1]}') as f:
|
with open(f'{os.path.dirname(__file__)}/{sys.argv[1]}') as f:
|
||||||
config = json.load(f)
|
config = json.load(f)
|
||||||
|
|
||||||
for device in config['devices']:
|
# all possible tests, board_test is last to disable board's usb
|
||||||
print(f"Testing device:{device['device']}")
|
all_tests = [
|
||||||
for test in device['tests']:
|
'cdc_dual_ports', 'cdc_msc', 'dfu', 'dfu_runtime', 'hid_boot_interface', 'board_test'
|
||||||
if device['debugger'].lower() == 'jlink':
|
]
|
||||||
flash_jlink(device['debugger_sn'], device['device'], test['firmware'])
|
|
||||||
|
for board in config['boards']:
|
||||||
|
print(f'Testing board:{board["name"]}')
|
||||||
|
|
||||||
|
# default to all tests
|
||||||
|
if 'tests' in board:
|
||||||
|
test_list = board['tests']
|
||||||
|
else:
|
||||||
|
test_list = all_tests
|
||||||
|
|
||||||
|
# remove skip_tests
|
||||||
|
if 'tests_skip' in board:
|
||||||
|
for skip in board['tests_skip']:
|
||||||
|
if skip in test_list:
|
||||||
|
test_list.remove(skip)
|
||||||
|
|
||||||
|
for test in test_list:
|
||||||
|
mk_elf = f'examples/device/{test}/_build/{board["name"]}/{test}.elf'
|
||||||
|
cmake_elf = f'cmake-build/cmake-build-{board["name"]}/device/{test}/{test}.elf'
|
||||||
|
if os.path.isfile(cmake_elf):
|
||||||
|
elf = cmake_elf
|
||||||
|
elif os.path.isfile(mk_elf):
|
||||||
|
elf = mk_elf
|
||||||
|
else:
|
||||||
|
print(f'Cannot find firmware file for {test}')
|
||||||
|
sys.exit(-1)
|
||||||
|
|
||||||
|
if board['debugger'].lower() == 'jlink':
|
||||||
|
flash_jlink(board['debugger_sn'], board['cpu'], elf)
|
||||||
else:
|
else:
|
||||||
# ToDo
|
# ToDo
|
||||||
pass
|
pass
|
||||||
locals()[f'test_{test["name"]}'](device['uid'])
|
print(f' {test} ...', end='')
|
||||||
|
locals()[f'test_{test}'](board['uid'])
|
||||||
|
print('OK')
|
||||||
|
Reference in New Issue
Block a user