Skip to content

Commit

Permalink
Merge pull request #2780 from hathach/bump-pio-usb
Browse files Browse the repository at this point in the history
bump up pio-usb to 0.6.1
  • Loading branch information
hathach authored Aug 28, 2024
2 parents c46adc7 + 0d542a0 commit 669f341
Show file tree
Hide file tree
Showing 6 changed files with 47 additions and 41 deletions.
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
"make arm-gcc"
"make msp430-gcc"
"make riscv-gcc"
# "make rx-gcc" llvm-gcc-renesas.com seems to be down
"make rx-gcc"
"cmake esp-idf"
)
Expand Down
7 changes: 7 additions & 0 deletions .circleci/config2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,13 @@ commands:
unzip ninja-linux.zip -d ~/bin
fi
# rx-gcc is 32-bit binary
if [[ << parameters.toolchain >> == rx-gcc ]]; then
sudo dpkg --add-architecture i386
sudo apt update
sudo apt install libc6:i386 libstdc++6:i386 zlib1g:i386
fi
# Install Pico SDK
if [ << parameters.family >> == "rp2040" ]; then
git clone --depth 1 https://github.com/raspberrypi/pico-sdk.git ~/pico-sdk
Expand Down
58 changes: 26 additions & 32 deletions .github/workflows/hil_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,51 +21,53 @@ env:
HIL_JSON: test/hil/rpi.json

jobs:
# ---------------------------------------
# Build Non Espressif
# ---------------------------------------
build:
if: github.repository_owner == 'hathach'
set-matrix:
runs-on: ubuntu-latest
outputs:
BOARDS_LIST: ${{ steps.parse_hil_json.outputs.BOARDS_LIST }}
json: ${{ steps.set-matrix-json.outputs.matrix }}
steps:
- name: Checkout TinyUSB
uses: actions/checkout@v4

- name: Parse HIL json
id: parse_hil_json
- name: Generate matrix json
id: set-matrix-json
run: |
sudo apt install -y jq
MATRIX_JSON=$(jq -c '{ "arm-gcc": [.boards[] | select(.flasher != "esptool" and .flasher != "openocd_wch") | .name] }' ${{ env.HIL_JSON }})
echo "matrix=$MATRIX_JSON"
echo "matrix=$MATRIX_JSON" >> $GITHUB_OUTPUT
# Non-Espresif boards
BOARDS_LIST=$(jq -r '.boards[] | select(.flasher != "esptool") | "-b " + .name' ${{ env.HIL_JSON }} | tr '\n' ' ')
echo "BOARDS_LIST=$BOARDS_LIST"
echo "BOARDS_LIST=$BOARDS_LIST" >> $GITHUB_ENV
echo "BOARDS_LIST=$BOARDS_LIST" >> $GITHUB_OUTPUT
# ---------------------------------------
# Build arm-gcc
# ---------------------------------------
build:
if: github.repository_owner == 'hathach'
needs: set-matrix
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
board: ${{ fromJSON(needs.set-matrix.outputs.json)['arm-gcc'] }}
steps:
- name: Checkout TinyUSB
uses: actions/checkout@v4

- name: Setup arm-gcc toolchain
uses: ./.github/actions/setup_toolchain
with:
toolchain: 'arm-gcc'

- name: Setup risv-gcc toolchain
uses: ./.github/actions/setup_toolchain
with:
toolchain: 'riscv-gcc'

- name: Get Dependencies
uses: ./.github/actions/get_deps
with:
arg: ${{ env.BOARDS_LIST }}
arg: -b${{ matrix.board }}

- name: Build
run: python tools/build.py $BOARDS_LIST
run: python tools/build.py -b${{ matrix.board }}

- name: Upload Artifacts for Hardware Testing
uses: actions/upload-artifact@v4
with:
name: hil_rpi
name: ${{ matrix.board }}
path: |
cmake-build/cmake-build-*/*/*/*.elf
cmake-build/cmake-build-*/*/*/*.bin
Expand All @@ -76,11 +78,8 @@ jobs:
# ---------------------------------------
hil-rpi:
if: github.repository_owner == 'hathach'
needs:
- build
needs: build
runs-on: [self-hosted, ARM64, rpi, hardware-in-the-loop]
env:
BOARDS_LIST: "${{ needs.build-esp.outputs.BOARDS_LIST }} ${{ needs.build.outputs.BOARDS_LIST }}"
steps:
- name: Clean workspace
run: |
Expand All @@ -107,9 +106,4 @@ jobs:
merge-multiple: true

- name: Test on actual hardware
run: |
echo "BOARDS_LIST=$BOARDS_LIST"
echo "::group::{cmake-build contents}"
tree cmake-build
echo "::endgroup::"
python3 test/hil/hil_test.py $BOARDS_LIST ${{ env.HIL_JSON }}
run: python3 test/hil/hil_test.py ${{ env.HIL_JSON }}
18 changes: 12 additions & 6 deletions test/hil/hil_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@

ENUM_TIMEOUT = 30

STATUS_OK = "\033[32mOK\033[0m"
STATUS_FAILED = "\033[31mFailed\033[0m"
STATUS_SKIPPED = "\033[33mSkipped\033[0m"

# get usb serial by id
def get_serial_dev(id, vendor_str, product_str, ifnum):
Expand Down Expand Up @@ -411,7 +414,7 @@ def test_board(board):
if not os.path.exists(fw_dir):
fw_dir = f'examples/cmake-build-{name}/{test}'
fw_name = f'{fw_dir}/{os.path.basename(test)}'
print(f'{name:30} {test:20} ... ', end='')
print(f'{name:25} {test:30} ... ', end='')

if not os.path.exists(fw_dir):
print('Skip')
Expand All @@ -432,11 +435,11 @@ def test_board(board):
print('OK')
except Exception as e:
err_count += 1
print('Failed')
print(STATUS_FAILED)
print(f' {e}')
else:
err_count += 1
print('Flash failed')
print(f'Flash {STATUS_FAILED}')
return err_count


Expand All @@ -463,10 +466,13 @@ def main():
else:
config_boards = [e for e in config['boards'] if e['name'] in boards]

err_count_list = []
with Pool(processes=os.cpu_count()) as pool:
err_count_list = pool.map(test_board, config_boards)
err_count = sum(err_count_list)
err_count = sum(pool.map(test_board, config_boards))

print()
print("-" * 30)
print(f'Total failed: {err_count}')
print("-" * 30)
sys.exit(err_count)


Expand Down
1 change: 0 additions & 1 deletion test/hil/rpi.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@
"flasher_sn": "E6614103E72C1D2F",
"flasher_args": "-f interface/cmsis-dap.cfg -f target/rp2040.cfg -c \"adapter speed 5000\"",
"tests": {
"skip": ["dual/host_info_to_device_cdc"],
"dual_attached": [{"vid_pid": "1a86_55d4", "serial": "52D2002470"}]
}
},
Expand Down
2 changes: 1 addition & 1 deletion tools/get_deps.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
'144f1eb7ea8c06512e12f12b27383601c0272410',
'kinetis_k kinetis_k32l2 kinetis_kl lpc51 lpc54 lpc55 mcx imxrt'],
'hw/mcu/raspberry_pi/Pico-PIO-USB': ['https://github.com/sekigon-gonnoc/Pico-PIO-USB.git',
'7902e9fa8ed4a271d8d1d5e7e50516c2292b7bc2',
'fe9133fc513b82cc3dc62c67cb51f2339cf29ef7',
'rp2040'],
'hw/mcu/renesas/fsp': ['https://github.com/renesas/fsp.git',
'd52e5a6a59b7c638da860c2bb309b6e78e752ff8',
Expand Down

0 comments on commit 669f341

Please sign in to comment.