Skip to content

Commit f074815

Browse files
committed
Merge branch 'master' into feature/usbtmc_vendor-specific
2 parents 69f6b57 + 29c2af7 commit f074815

File tree

333 files changed

+17362
-7584
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

333 files changed

+17362
-7584
lines changed

.circleci/config.yml

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,12 @@ jobs:
1919
echo "MATRIX_JSON=$MATRIX_JSON"
2020
2121
BUILDSYSTEM_TOOLCHAIN=(
22+
"cmake aarch64-gcc"
2223
"cmake arm-clang"
24+
"cmake arm-gcc"
2325
"cmake esp-idf"
24-
"make aarch64-gcc"
25-
"make arm-gcc"
26-
"make msp430-gcc"
27-
"make riscv-gcc"
28-
"make rx-gcc"
26+
"cmake msp430-gcc"
27+
"cmake riscv-gcc"
2928
)
3029
3130
# only build IAR if not forked PR, since IAR token is not shared
@@ -67,7 +66,7 @@ jobs:
6766
FAMILY_LARGE=$(jq -n --argjson family "$FAMILY" --argjson resource "$RESOURCE_LARGE" '$family | map(select(IN($resource[])))')
6867
FAMILY=$(jq -n --argjson family "$FAMILY" --argjson resource "$RESOURCE_LARGE" '$family | map(select(IN($resource[]) | not))')
6968
70-
if [[ $toolchain == esp-idf ]]; then
69+
if [[ $toolchain == esp-idf || $toolchain == arm-iar ]]; then
7170
gen_build_entry "$build_system" "$toolchain" "$FAMILY" "large"
7271
else
7372
gen_build_entry "$build_system" "$toolchain" "$FAMILY" "medium+"

.github/ISSUE_TEMPLATE/bug_report.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,17 @@ body:
2222
validations:
2323
required: true
2424

25+
- type: input
26+
attributes:
27+
label: Commit SHA
28+
placeholder: e.g 3a042b37da28d0ba1e5593eb1068ca5645d77b56 or version bundled by esp-idf or pico-sdk
29+
validations:
30+
required: true
31+
2532
- type: input
2633
attributes:
2734
label: Board
28-
placeholder: e.g Feather nRF52840 Express
35+
placeholder: e.g Adafruit Feather nRF52840 Express
2936
validations:
3037
required: true
3138

.github/actions/setup_toolchain/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ runs:
1717
if: inputs.toolchain == 'arm-gcc'
1818
uses: carlosperate/arm-none-eabi-gcc-action@v1
1919
with:
20-
release: '13.2.Rel1'
20+
release: '14.2.Rel1'
2121

2222
- name: Pull ESP-IDF docker
2323
if: inputs.toolchain == 'esp-idf'

.github/actions/setup_toolchain/toolchain.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"aarch64-gcc": "https://developer.arm.com/-/media/Files/downloads/gnu-a/10.3-2021.07/binrel/gcc-arm-10.3-2021.07-x86_64-aarch64-none-elf.tar.xz",
33
"arm-clang": "https://github.com/ARM-software/LLVM-embedded-toolchain-for-Arm/releases/download/release-19.1.1/LLVM-ET-Arm-19.1.1-Linux-x86_64.tar.xz",
4-
"arm-gcc": "https://github.com/xpack-dev-tools/arm-none-eabi-gcc-xpack/releases/download/v13.2.1-1.1/xpack-arm-none-eabi-gcc-13.2.1-1.1-linux-x64.tar.gz",
4+
"arm-gcc": "https://github.com/xpack-dev-tools/arm-none-eabi-gcc-xpack/releases/download/v14.2.1-1.1/xpack-arm-none-eabi-gcc-14.2.1-1.1-linux-x64.tar.gz",
55
"msp430-gcc": "http://software-dl.ti.com/msp430/msp430_public_sw/mcu/msp430/MSPGCC/9_2_0_0/export/msp430-gcc-9.2.0.50_linux64.tar.bz2",
66
"riscv-gcc": "https://github.com/xpack-dev-tools/riscv-none-elf-gcc-xpack/releases/download/v13.2.0-2/xpack-riscv-none-elf-gcc-13.2.0-2-linux-x64.tar.gz",
77
"rx-gcc": "https://github.com/hathach/rx_device/releases/download/0.0.1/gcc-8.3.0.202411-GNURX-ELF.run",

.github/workflows/build.yml

Lines changed: 148 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ on:
88
- 'examples/**'
99
- 'lib/**'
1010
- 'hw/**'
11-
- 'tools/get_deps.py'
1211
- 'tools/build.py'
12+
- 'tools/get_deps.py'
1313
- '.github/actions/**'
1414
- '.github/workflows/build.yml'
1515
- '.github/workflows/build_util.yml'
@@ -21,8 +21,9 @@ on:
2121
- 'examples/**'
2222
- 'lib/**'
2323
- 'hw/**'
24-
- 'tools/get_deps.py'
24+
- 'test/hil/**'
2525
- 'tools/build.py'
26+
- 'tools/get_deps.py'
2627
- '.github/actions/**'
2728
- '.github/workflows/build.yml'
2829
- '.github/workflows/build_util.yml'
@@ -31,45 +32,57 @@ concurrency:
3132
group: ${{ github.workflow }}-${{ github.ref }}
3233
cancel-in-progress: true
3334

35+
env:
36+
HIL_JSON: test/hil/tinyusb.json
37+
3438
jobs:
3539
set-matrix:
3640
runs-on: ubuntu-latest
3741
outputs:
3842
json: ${{ steps.set-matrix-json.outputs.matrix }}
43+
hil_json: ${{ steps.set-matrix-json.outputs.hil_matrix }}
3944
steps:
4045
- name: Checkout TinyUSB
4146
uses: actions/checkout@v4
4247

4348
- name: Generate matrix json
4449
id: set-matrix-json
4550
run: |
51+
# build matrix
4652
MATRIX_JSON=$(python .github/workflows/ci_set_matrix.py)
4753
echo "matrix=$MATRIX_JSON"
4854
echo "matrix=$MATRIX_JSON" >> $GITHUB_OUTPUT
55+
# hil matrix
56+
HIL_MATRIX_JSON=$(python test/hil/hil_ci_set_matrix.py ${{ env.HIL_JSON }})
57+
echo "hil_matrix=$HIL_MATRIX_JSON"
58+
echo "hil_matrix=$HIL_MATRIX_JSON" >> $GITHUB_OUTPUT
4959
5060
# ---------------------------------------
51-
# Build CMake
61+
# Build CMake: only build on push with one-per-family.
62+
# Full built is done by CircleCI in PR
5263
# ---------------------------------------
5364
cmake:
65+
if: github.event_name == 'push'
5466
needs: set-matrix
5567
uses: ./.github/workflows/build_util.yml
5668
strategy:
5769
fail-fast: false
5870
matrix:
5971
toolchain:
60-
# - 'arm-clang' is built by circle-ci in PR
6172
- 'aarch64-gcc'
73+
#- 'arm-clang'
6274
- 'arm-gcc'
75+
- 'esp-idf'
6376
- 'msp430-gcc'
6477
- 'riscv-gcc'
6578
with:
6679
build-system: 'cmake'
6780
toolchain: ${{ matrix.toolchain }}
6881
build-args: ${{ toJSON(fromJSON(needs.set-matrix.outputs.json)[matrix.toolchain]) }}
69-
one-per-family: ${{ github.event_name == 'push' }}
82+
one-per-family: true
7083

7184
# ---------------------------------------
72-
# Build Make (built by circle-ci in PR, only build on push here)
85+
# Build Make: only build on push with one-per-family
7386
# ---------------------------------------
7487
make:
7588
if: github.event_name == 'push'
@@ -79,36 +92,18 @@ jobs:
7992
fail-fast: false
8093
matrix:
8194
toolchain:
82-
# 'arm-clang'
83-
- 'arm-gcc'
8495
- 'aarch64-gcc'
96+
#- 'arm-clang'
97+
- 'arm-gcc'
8598
- 'msp430-gcc'
8699
- 'riscv-gcc'
87100
- 'rx-gcc'
88-
- 'esp-idf'
89101
with:
90102
build-system: 'make'
91103
toolchain: ${{ matrix.toolchain }}
92104
build-args: ${{ toJSON(fromJSON(needs.set-matrix.outputs.json)[matrix.toolchain]) }}
93105
one-per-family: true
94106

95-
# ---------------------------------------
96-
# Build Make on Windows/MacOS
97-
# ---------------------------------------
98-
make-os:
99-
if: github.event_name == 'pull_request'
100-
uses: ./.github/workflows/build_util.yml
101-
strategy:
102-
fail-fast: false
103-
matrix:
104-
os: [windows-latest, macos-latest]
105-
with:
106-
os: ${{ matrix.os }}
107-
build-system: 'make'
108-
toolchain: 'arm-gcc'
109-
build-args: '["stm32h7"]'
110-
one-per-family: true
111-
112107
# ---------------------------------------
113108
# Build IAR
114109
# Since IAR Token secret is not passed to forked PR, only build non-forked PR with make.
@@ -131,6 +126,23 @@ jobs:
131126
build-args: ${{ toJSON(fromJSON(needs.set-matrix.outputs.json)['arm-iar']) }}
132127
one-per-family: true
133128

129+
# ---------------------------------------
130+
# Build Make on Windows/MacOS
131+
# ---------------------------------------
132+
make-os:
133+
if: github.event_name == 'pull_request'
134+
uses: ./.github/workflows/build_util.yml
135+
strategy:
136+
fail-fast: false
137+
matrix:
138+
os: [windows-latest, macos-latest]
139+
with:
140+
os: ${{ matrix.os }}
141+
build-system: 'make'
142+
toolchain: 'arm-gcc'
143+
build-args: '["stm32h7"]'
144+
one-per-family: true
145+
134146
# ---------------------------------------
135147
# Zephyr
136148
# ---------------------------------------
@@ -151,3 +163,113 @@ jobs:
151163
run: |
152164
west build -b pca10056 -d examples/device/cdc_msc/build examples/device/cdc_msc -- -DRTOS=zephyr
153165
west build -b pca10056 -d examples/device/msc_dual_lun/build examples/device/msc_dual_lun -- -DRTOS=zephyr
166+
167+
# ---------------------------------------
168+
# Hardware in the loop (HIL)
169+
# Run on PR only (hil-tinyusb), hil-hfp only run on non-forked PR
170+
# ---------------------------------------
171+
hil-build:
172+
if: |
173+
github.repository_owner == 'hathach' &&
174+
(github.event_name == 'pull_request' || github.event_name == 'workflow_dispatch')
175+
needs: set-matrix
176+
uses: ./.github/workflows/build_util.yml
177+
strategy:
178+
fail-fast: false
179+
matrix:
180+
toolchain:
181+
- 'arm-gcc'
182+
- 'esp-idf'
183+
with:
184+
build-system: 'cmake'
185+
toolchain: ${{ matrix.toolchain }}
186+
build-args: ${{ toJSON(fromJSON(needs.set-matrix.outputs.hil_json)[matrix.toolchain]) }}
187+
one-per-family: true
188+
upload-artifacts: true
189+
190+
# ---------------------------------------
191+
# Hardware in the loop (HIL)
192+
# self-hosted on local VM, for attached hardware checkout HIL_JSON
193+
# ---------------------------------------
194+
hil-tinyusb:
195+
if: |
196+
github.repository_owner == 'hathach' &&
197+
(github.event_name == 'pull_request' || github.event_name == 'workflow_dispatch')
198+
needs: hil-build
199+
runs-on: [self-hosted, X64, hathach, hardware-in-the-loop]
200+
steps:
201+
- name: Clean workspace
202+
if: github.run_attempt == '1'
203+
run: |
204+
echo "Cleaning up for the first run"
205+
rm -rf "${{ github.workspace }}"
206+
mkdir -p "${{ github.workspace }}"
207+
208+
- name: Checkout TinyUSB
209+
if: github.run_attempt == '1'
210+
uses: actions/checkout@v4
211+
with:
212+
sparse-checkout: test/hil
213+
214+
- name: Download Artifacts
215+
if: github.run_attempt == '1'
216+
uses: actions/download-artifact@v4
217+
with:
218+
path: cmake-build
219+
merge-multiple: true
220+
221+
- name: Test on actual hardware
222+
run: |
223+
ls cmake-build/
224+
225+
# Skip boards that passed with previous run, file is generated by hil_test.py
226+
SKIP_BOARDS=""
227+
if [ -f ${{ env.HIL_JSON }}.skip ]; then
228+
SKIP_BOARDS=$(cat "${HIL_JSON}.skip")
229+
fi
230+
echo "SKIP_BOARDS=$SKIP_BOARDS"
231+
232+
python3 test/hil/hil_test.py ${{ env.HIL_JSON }} $SKIP_BOARDS
233+
234+
# ---------------------------------------
235+
# Hardware in the loop (HIL)
236+
# self-hosted by HFP, build with IAR toolchain, for attached hardware checkout test/hil/hfp.json
237+
# Since IAR Token secret is not passed to forked PR, only build non-forked PR
238+
# ---------------------------------------
239+
hil-hfp:
240+
if: |
241+
github.repository_owner == 'hathach' &&
242+
github.event.pull_request.head.repo.fork == false &&
243+
(github.event_name == 'pull_request' || github.event_name == 'workflow_dispatch')
244+
runs-on: [self-hosted, Linux, X64, hifiphile]
245+
env:
246+
IAR_LMS_BEARER_TOKEN: ${{ secrets.IAR_LMS_BEARER_TOKEN }}
247+
steps:
248+
- name: Clean workspace
249+
run: |
250+
echo "Cleaning up previous run"
251+
rm -rf "${{ github.workspace }}"3
252+
mkdir -p "${{ github.workspace }}"
253+
254+
- name: Toolchain version
255+
run: |
256+
iccarm --version
257+
258+
- name: Checkout TinyUSB
259+
uses: actions/checkout@v4
260+
261+
- name: Get build boards
262+
run: |
263+
MATRIX_JSON=$(python test/hil/hil_ci_set_matrix.py test/hil/hfp.json)
264+
BUILD_ARGS=$(echo $MATRIX_JSON | jq -r '.["arm-gcc"] | join(" ")')
265+
echo "BUILD_ARGS=$BUILD_ARGS"
266+
echo "BUILD_ARGS=$BUILD_ARGS" >> $GITHUB_ENV
267+
268+
- name: Get Dependencies
269+
run: python3 tools/get_deps.py $BUILD_ARGS
270+
271+
- name: Build
272+
run: python3 tools/build.py -j 4 --toolchain iar $BUILD_ARGS
273+
274+
- name: Test on actual hardware (hardware in the loop)
275+
run: python3 test/hil/hil_test.py hfp.json

.github/workflows/ci_set_matrix.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
"lpc11 lpc13 lpc15": ["arm-gcc", "arm-clang"],
2525
"lpc17 lpc18 lpc40 lpc43": ["arm-gcc", "arm-clang"],
2626
"lpc51 lpc54 lpc55": ["arm-gcc", "arm-clang"],
27-
"max32650 max32666 max32690 max78002": ["arm-gcc"],
27+
"maxim": ["arm-gcc"],
2828
"mcx": ["arm-gcc"],
2929
"mm32": ["arm-gcc"],
3030
"msp430": ["msp430-gcc"],
@@ -40,8 +40,9 @@
4040
"stm32f4": ["arm-gcc", "arm-clang", "arm-iar"],
4141
"stm32f7": ["arm-gcc", "arm-clang", "arm-iar"],
4242
"stm32g0 stm32g4 stm32h5": ["arm-gcc", "arm-clang", "arm-iar"],
43-
"stm32h7": ["arm-gcc", "arm-clang", "arm-iar"],
43+
"stm32h7 stm32h7rs": ["arm-gcc", "arm-clang", "arm-iar"],
4444
"stm32l0 stm32l4": ["arm-gcc", "arm-clang", "arm-iar"],
45+
"stm32n6": ["arm-gcc"],
4546
"stm32u5 stm32wb": ["arm-gcc", "arm-clang", "arm-iar"],
4647
"xmc4000": ["arm-gcc"],
4748
"-bespressif_s2_devkitc": ["esp-idf"],

.github/workflows/codeql.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ jobs:
6666

6767
# Initializes the CodeQL tools for scanning.
6868
- name: Initialize CodeQL
69-
uses: github/codeql-action/init@v2
69+
uses: github/codeql-action/init@v3
7070
with:
7171
languages: ${{ matrix.language }}
7272
# If you wish to specify custom queries, you can do so here or in a config file.
@@ -93,7 +93,7 @@ jobs:
9393
./.github/workflows/codeql-buildscript.sh
9494
9595
- name: Perform CodeQL Analysis
96-
uses: github/codeql-action/analyze@v2
96+
uses: github/codeql-action/analyze@v3
9797
with:
9898
category: "/language:${{matrix.language}}"
9999
upload: false
@@ -124,12 +124,12 @@ jobs:
124124
output: ${{ steps.step1.outputs.sarif-output }}/cpp.sarif
125125

126126
- name: Upload SARIF
127-
uses: github/codeql-action/upload-sarif@v2
127+
uses: github/codeql-action/upload-sarif@v3
128128
with:
129129
sarif_file: ${{ steps.step1.outputs.sarif-output }}
130130
category: "/language:${{matrix.language}}"
131131

132-
- name: Archive CodeQL results
132+
- name: Upload CodeQL results as an artifact
133133
uses: actions/upload-artifact@v4
134134
with:
135135
name: codeql-results

0 commit comments

Comments
 (0)