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

More build2 #2084

Merged
merged 9 commits into from
May 26, 2023
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
2 changes: 1 addition & 1 deletion .github/workflows/build_aarch64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ jobs:
run: echo >> $GITHUB_PATH `echo ~/cache/toolchain/*/bin`

- name: Get Dependencies
run: python3 tools/get_family_deps.py ${{ matrix.family }}
run: python3 tools/get_deps.py ${{ matrix.family }}

- name: Build
run: python3 tools/build_family.py ${{ matrix.family }}
Expand Down
82 changes: 4 additions & 78 deletions .github/workflows/build_arm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,12 @@ jobs:
family:
# Alphabetical order
- 'broadcom_32bit'
- 'kinetis_k32 kinetis_kl'
- 'lpc11 lpc13 lpc15 lpc17 lpc18'
- 'kinetis_k32l kinetis_kl'
- 'lpc11 lpc13 lpc15 lpc17'
- 'lpc51 lpc54 lpc55'
- 'mm32 msp432e4'
- 'nrf'
- 'ra'
- 'rp2040'
- 'samd11 samd21'
- 'samd51 same5x'
- 'saml2x'
Expand Down Expand Up @@ -77,7 +76,7 @@ jobs:
echo >> $GITHUB_ENV PICO_SDK_PATH=~/pico-sdk

- name: Get Dependencies
run: python3 tools/get_family_deps.py ${{ matrix.family }}
run: python3 tools/get_deps.py ${{ matrix.family }}

- name: Build
run: python3 tools/build_family.py ${{ matrix.family }}
Expand All @@ -91,24 +90,11 @@ jobs:
find ${ex} -name *.map -print -quit | xargs -I % sh -c 'echo "::group::%"; linkermap -v %; echo "::endgroup::"'
done

# Upload binaries for rp2040/stm32l412nucleo hardware test with self-hosted

- name: Prepare rp2040 Artifacts
if: contains(matrix.family, 'rp2040') && github.repository_owner == 'hathach'
run: find examples/ -name "*.elf" -exec mv {} . \;

# Upload binaries for hardware test with self-hosted
- name: Prepare stm32l412nucleo Artifacts
if: contains(matrix.family, 'stm32l4')
run: find examples/ -path "*stm32l412nucleo/*.elf" -exec mv {} . \;

- name: Upload Artifacts for rp2040
if: contains(matrix.family,'rp2040') && github.repository_owner == 'hathach'
uses: actions/upload-artifact@v3
with:
name: rp2040
path: |
*.elf

- name: Upload Artifacts for stm32l412nucleo
if: contains(matrix.family, 'stm32l4') && github.repository_owner == 'hathach'
uses: actions/upload-artifact@v3
Expand All @@ -117,66 +103,6 @@ jobs:
path: |
*.elf

# ---------------------------------------
# Hardware in the loop (HIL)
# Current self-hosted instance is running on an RPI4 with
# - pico + pico-probe connected via USB
# - pico-probe is /dev/ttyACM0
# ---------------------------------------
hw-rp2040-test:
# run only with hathach's commit due to limited resource on RPI4
if: github.repository_owner == 'hathach'
needs: build-arm
runs-on: [self-hosted, Linux, ARM64, rp2040]

steps:
- name: Clean workspace
run: |
echo "Cleaning up previous run"
rm -rf "${{ github.workspace }}"
mkdir -p "${{ github.workspace }}"

- name: Download rp2040 Artifacts
uses: actions/download-artifact@v3
with:
name: rp2040

- name: Create flash.sh
run: |
echo > flash.sh 'cmdout=$(openocd -f "interface/cmsis-dap.cfg" -f "target/rp2040.cfg" -c "adapter speed 5000" -c "program $1 reset exit")'
echo >> flash.sh 'if (( $? )) ; then echo $cmdout ; fi'
chmod +x flash.sh

- name: Test cdc_dual_ports
run: |
./flash.sh cdc_dual_ports.elf
while (! ([ -e /dev/ttyACM1 ] && [ -e /dev/ttyACM2 ])) && [ $SECONDS -le 10 ]; 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 10 ]; 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 10 ]; 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 10 ]; do :; done

# ---------------------------------------
# Hardware in the loop (HIL)
# Current self-hosted instance is running on an EPYC 7232 server hosted by HiFiPhile user
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build_iar.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ jobs:
uses: actions/checkout@v3

- name: Get Dependencies
run: python3 tools/get_family_deps.py ${{ matrix.family }}
run: python3 tools/get_deps.py ${{ matrix.family }}

- name: Build
run: python3 tools/build_family.py ${{ matrix.family }} CC=iccarm
2 changes: 1 addition & 1 deletion .github/workflows/build_msp430.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ jobs:
run: echo >> $GITHUB_PATH `echo ~/cache/toolchain/*/bin`

- name: Get Dependencies
run: python3 tools/get_family_deps.py ${{ matrix.family }}
run: python3 tools/get_deps.py ${{ matrix.family }}

- name: Build
run: python3 tools/build_family.py ${{ matrix.family }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build_renesas.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ jobs:
run: echo >> $GITHUB_PATH `echo ~/cache/toolchain/*/bin`

- name: Get Dependencies
run: python3 tools/get_family_deps.py ${{ matrix.family }}
run: python3 tools/get_deps.py ${{ matrix.family }}

- name: Build
run: python3 tools/build_family.py ${{ matrix.family }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build_riscv.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ jobs:
run: echo >> $GITHUB_PATH `echo ~/cache/toolchain/*/bin`

- name: Get Dependencies
run: python3 tools/get_family_deps.py ${{ matrix.family }}
run: python3 tools/get_deps.py ${{ matrix.family }}

- name: Build
run: python3 tools/build_family.py ${{ matrix.family }}
Expand Down
96 changes: 93 additions & 3 deletions .github/workflows/cmake_arm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,11 @@ jobs:
fail-fast: false
matrix:
family:
# Alphabetical order
- 'mcx'
- 'imxrt'
# Alphabetical order
- 'lpc18'
- 'mcx'
- 'imxrt'
- 'rp2040'
steps:
- name: Setup Python
uses: actions/setup-python@v4
Expand All @@ -52,8 +54,96 @@ jobs:
- name: Checkout TinyUSB
uses: actions/checkout@v3

- name: Checkout pico-sdk for rp2040
if: matrix.family == 'rp2040'
uses: actions/checkout@v3
with:
repository: raspberrypi/pico-sdk
ref: develop
path: pico-sdk

- name: Get Dependencies
run: python3 tools/get_deps.py ${{ matrix.family }}

- name: Build
run: python tools/build_cmake.py ${{ matrix.family }}
env:
# for rp2040, there is no harm if defined for other families
PICO_SDK_PATH: ${{ github.workspace }}/pico-sdk

# Upload binaries for hardware test with self-hosted
- name: Prepare rp2040 Artifacts
if: contains(matrix.family, 'rp2040') && github.repository_owner == 'hathach'
working-directory: ${{github.workspace}}/cmake-build-ci-raspberry_pi_pico
run: |
find device/ -name "*.elf" -exec mv {} ../ \;
# find host/ -name "*.elf" -exec mv {} ../ \;
# find dual/ -name "*.elf" -exec mv {} ../ \;

- name: Upload Artifacts for rp2040
if: contains(matrix.family,'rp2040') && github.repository_owner == 'hathach'
uses: actions/upload-artifact@v3
with:
name: rp2040
path: |
*.elf

# ---------------------------------------
# Hardware in the loop (HIL)
# Current self-hosted instance is running on an RPI4 with
# - pico + pico-probe connected via USB
# - pico-probe is /dev/ttyACM0
# ---------------------------------------
hw-rp2040-test:
# run only with hathach's commit due to limited resource on RPI4
if: github.repository_owner == 'hathach'
needs: build-arm
runs-on: [self-hosted, Linux, ARM64, rp2040]

steps:
- name: Clean workspace
run: |
echo "Cleaning up previous run"
rm -rf "${{ github.workspace }}"
mkdir -p "${{ github.workspace }}"

- name: Download rp2040 Artifacts
uses: actions/download-artifact@v3
with:
name: rp2040

- name: Create flash.sh
run: |
echo > flash.sh 'cmdout=$(openocd -f "interface/cmsis-dap.cfg" -f "target/rp2040.cfg" -c "adapter speed 5000" -c "program $1 reset exit")'
echo >> flash.sh 'if (( $? )) ; then echo $cmdout ; fi'
chmod +x flash.sh

- name: Test cdc_dual_ports
run: |
./flash.sh cdc_dual_ports.elf
while (! ([ -e /dev/ttyACM1 ] && [ -e /dev/ttyACM2 ])) && [ $SECONDS -le 10 ]; 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 10 ]; 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 10 ]; 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 10 ]; do :; done
7 changes: 1 addition & 6 deletions examples/device/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,7 @@ family_add_subdirectory(hid_generic_inout)
family_add_subdirectory(hid_multiple_interface)
family_add_subdirectory(midi_test)
family_add_subdirectory(msc_dual_lun)

# FIXME temp skip net_lwip_webserver for imxrt for now
if (NOT ${FAMILY} STREQUAL "imxrt" AND NOT ${FAMILY} STREQUAL "mcx")
family_add_subdirectory(net_lwip_webserver)
endif()

family_add_subdirectory(net_lwip_webserver)
family_add_subdirectory(uac2_headset)
family_add_subdirectory(usbtmc)
family_add_subdirectory(video_capture)
Expand Down
Loading