Skip to content

Commit 4d88f14

Browse files
author
IngHK
committed
Merge remote-tracking branch 'remotes/hathach/master' into HostLogsFixes
2 parents b8881a3 + 338ff2d commit 4d88f14

File tree

358 files changed

+16548
-4106
lines changed

Some content is hidden

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

358 files changed

+16548
-4106
lines changed

.github/workflows/build_aarch64.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ jobs:
7373
run: python3 tools/get_deps.py ${{ matrix.family }}
7474

7575
- name: Build
76-
run: python3 tools/build_family.py ${{ matrix.family }}
76+
run: python3 tools/build_make.py ${{ matrix.family }}
7777

7878
- name: Linker Map
7979
run: |

.github/workflows/build_arm.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ jobs:
6666
run: python3 tools/get_deps.py ${{ matrix.family }}
6767

6868
- name: Build
69-
run: python3 tools/build_family.py ${{ matrix.family }}
69+
run: python3 tools/build_make.py ${{ matrix.family }}
7070

7171
- name: Linker Map
7272
run: |

.github/workflows/build_esp.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ jobs:
3232
# ESP32-S2
3333
- 'espressif_kaluga_1'
3434
# ESP32-S3
35-
- 'espressif_s3_devkitm'
35+
- 'espressif_s3_devkitc'
3636

3737
steps:
3838
- name: Setup Python

.github/workflows/build_msp430.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ jobs:
7171
run: python3 tools/get_deps.py ${{ matrix.family }}
7272

7373
- name: Build
74-
run: python3 tools/build_family.py ${{ matrix.family }}
74+
run: python3 tools/build_make.py ${{ matrix.family }}
7575

7676
- name: Linker Map
7777
run: |

.github/workflows/build_renesas.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ jobs:
7171
run: python3 tools/get_deps.py ${{ matrix.family }}
7272

7373
- name: Build
74-
run: python3 tools/build_family.py ${{ matrix.family }}
74+
run: python3 tools/build_make.py ${{ matrix.family }}
7575

7676
- name: Linker Map
7777
run: |

.github/workflows/build_riscv.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ jobs:
7272
run: python3 tools/get_deps.py ${{ matrix.family }}
7373

7474
- name: Build
75-
run: python3 tools/build_family.py ${{ matrix.family }}
75+
run: python3 tools/build_make.py ${{ matrix.family }}
7676

7777
- name: Linker Map
7878
run: |

.github/workflows/build_win_mac.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,4 +51,4 @@ jobs:
5151
run: python3 tools/get_deps.py stm32f4
5252

5353
- name: Build
54-
run: python3 tools/build_family.py stm32f4 stm32f411disco
54+
run: python3 tools/build_make.py stm32f4 stm32f411disco

.github/workflows/cmake_arm.yml

Lines changed: 10 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -105,15 +105,14 @@ jobs:
105105
106106
# ---------------------------------------
107107
# Hardware in the loop (HIL)
108-
# Current self-hosted instance is running on an RPI4 with
109-
# - pico + pico-probe connected via USB
110-
# - pico-probe is /dev/ttyACM0
108+
# Current self-hosted instance is running on an RPI4.
109+
# For attached hardware checkout hil_pi4.json
111110
# ---------------------------------------
112111
hw-rp2040-test:
113112
# run only with hathach's commit due to limited resource on RPI4
114113
if: github.repository_owner == 'hathach'
115114
needs: build-arm
116-
runs-on: [self-hosted, Linux, ARM64, rp2040]
115+
runs-on: [self-hosted, rp2040, hardware-in-the-loop]
117116

118117
steps:
119118
- name: Clean workspace
@@ -122,43 +121,16 @@ jobs:
122121
rm -rf "${{ github.workspace }}"
123122
mkdir -p "${{ github.workspace }}"
124123
124+
- name: Checkout test/hil
125+
uses: actions/checkout@v3
126+
with:
127+
sparse-checkout: test/hil
128+
125129
- name: Download rp2040 Artifacts
126130
uses: actions/download-artifact@v3
127131
with:
128132
name: rp2040
129133

130-
- name: Create flash.sh
131-
run: |
132-
echo > flash.sh 'cmdout=$(openocd -f "interface/cmsis-dap.cfg" -f "target/rp2040.cfg" -c "adapter speed 5000" -c "program $1 reset exit")'
133-
echo >> flash.sh 'if (( $? )) ; then echo $cmdout ; fi'
134-
chmod +x flash.sh
135-
136-
- name: Test cdc_dual_ports
137-
run: |
138-
./flash.sh cdc_dual_ports.elf
139-
while (! ([ -e /dev/ttyACM1 ] && [ -e /dev/ttyACM2 ])) && [ $SECONDS -le 10 ]; do :; done
140-
test -e /dev/ttyACM1 && echo "ttyACM1 exists"
141-
test -e /dev/ttyACM2 && echo "ttyACM2 exists"
142-
143-
- name: Test cdc_msc
144-
run: |
145-
./flash.sh cdc_msc.elf
146-
readme='/media/pi/TinyUSB MSC/README.TXT'
147-
while (! ([ -e /dev/ttyACM1 ] && [ -f "$readme" ])) && [ $SECONDS -le 10 ]; do :; done
148-
test -e /dev/ttyACM1 && echo "ttyACM1 exists"
149-
test -f "$readme" && echo "$readme exists"
150-
cat "$readme"
151-
152-
- name: Test dfu
153-
run: |
154-
./flash.sh dfu.elf
155-
while (! (dfu-util -l | grep "Found DFU")) && [ $SECONDS -le 10 ]; do :; done
156-
dfu-util -d cafe -a 0 -U dfu0
157-
dfu-util -d cafe -a 1 -U dfu1
158-
grep "TinyUSB DFU! - Partition 0" dfu0
159-
grep "TinyUSB DFU! - Partition 1" dfu1
160-
161-
- name: Test dfu_runtime
134+
- name: Test on actual hardware (hardware in the loop)
162135
run: |
163-
./flash.sh dfu_runtime.elf
164-
while (! (dfu-util -l | grep "Found Runtime")) && [ $SECONDS -le 10 ]; do :; done
136+
python3 test/hil/hil_test.py hil_pi4.json
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#!/usr/bin/env bash
2+
3+
FAMILY=stm32l4
4+
python3 tools/get_deps.py $FAMILY
5+
python3 tools/build_make.py $FAMILY

.github/workflows/codeql.yml

Lines changed: 137 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,137 @@
1+
# For most projects, this workflow file will not need changing; you simply need
2+
# to commit it to your repository.
3+
#
4+
# You may wish to alter this file to override the set of languages analyzed,
5+
# or to provide custom queries or build logic.
6+
#
7+
# ******** NOTE ********
8+
# We have attempted to detect the languages in your repository. Please check
9+
# the `language` matrix defined below to confirm you have the correct set of
10+
# supported CodeQL languages.
11+
#
12+
name: "CodeQL"
13+
14+
on:
15+
push:
16+
branches: [ 'master' ]
17+
paths:
18+
- 'src/**'
19+
- 'examples/**'
20+
- 'lib/**'
21+
- 'hw/**'
22+
- '.github/workflows/codeql.yml'
23+
pull_request:
24+
branches: [ 'master' ]
25+
paths:
26+
- 'src/**'
27+
- 'examples/**'
28+
- 'lib/**'
29+
- 'hw/**'
30+
- '.github/workflows/codeql.yml'
31+
schedule:
32+
- cron: '0 0 * * *'
33+
34+
jobs:
35+
analyze:
36+
name: Analyze
37+
# Runner size impacts CodeQL analysis time. To learn more, please see:
38+
# - https://gh.io/recommended-hardware-resources-for-running-codeql
39+
# - https://gh.io/supported-runners-and-hardware-resources
40+
# - https://gh.io/using-larger-runners
41+
# Consider using larger runners for possible analysis time improvements.
42+
runs-on: ubuntu-latest
43+
timeout-minutes: 360
44+
permissions:
45+
actions: read
46+
contents: read
47+
security-events: write
48+
49+
strategy:
50+
fail-fast: false
51+
matrix:
52+
language: [ 'c-cpp' ]
53+
# CodeQL supports [ 'c-cpp', 'csharp', 'go', 'java-kotlin', 'javascript-typescript', 'python', 'ruby', 'swift' ]
54+
# Use only 'java-kotlin' to analyze code written in Java, Kotlin or both
55+
# Use only 'javascript-typescript' to analyze code written in JavaScript, TypeScript or both
56+
# Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support
57+
58+
steps:
59+
- name: Checkout repository
60+
uses: actions/checkout@v3
61+
62+
- name: Install ARM GCC
63+
uses: carlosperate/arm-none-eabi-gcc-action@v1
64+
with:
65+
release: '11.2-2022.02'
66+
67+
# Initializes the CodeQL tools for scanning.
68+
- name: Initialize CodeQL
69+
uses: github/codeql-action/init@v2
70+
with:
71+
languages: ${{ matrix.language }}
72+
# If you wish to specify custom queries, you can do so here or in a config file.
73+
# By default, queries listed here will override any specified in a config file.
74+
# Prefix the list here with "+" to use these queries and those in the config file.
75+
76+
# For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
77+
# queries: security-extended,security-and-quality
78+
queries: security-and-quality
79+
80+
81+
# Autobuild attempts to build any compiled languages (C/C++, C#, Go, Java, or Swift).
82+
# If this step fails, then you should remove it and run the build manually (see below)
83+
#- name: Autobuild
84+
# uses: github/codeql-action/autobuild@v2
85+
86+
# ℹ️ Command-line programs to run using the OS shell.
87+
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
88+
89+
# If the Autobuild fails above, remove it and uncomment the following three lines.
90+
# modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.
91+
92+
- run: |
93+
./.github/workflows/codeql-buildscript.sh
94+
95+
- name: Perform CodeQL Analysis
96+
uses: github/codeql-action/analyze@v2
97+
with:
98+
category: "/language:${{matrix.language}}"
99+
upload: false
100+
id: step1
101+
102+
# Filter out rules with low severity or high false positive rate
103+
# Also filter out warnings in third-party code
104+
- name: Filter out unwanted errors and warnings
105+
uses: advanced-security/filter-sarif@v1
106+
with:
107+
patterns: |
108+
-**:cpp/path-injection
109+
-**:cpp/world-writable-file-creation
110+
-**:cpp/poorly-documented-function
111+
-**:cpp/potentially-dangerous-function
112+
-**:cpp/use-of-goto
113+
-**:cpp/integer-multiplication-cast-to-long
114+
-**:cpp/comparison-with-wider-type
115+
-**:cpp/leap-year/*
116+
-**:cpp/ambiguously-signed-bit-field
117+
-**:cpp/suspicious-pointer-scaling
118+
-**:cpp/suspicious-pointer-scaling-void
119+
-**:cpp/unsigned-comparison-zero
120+
-**/third*party/**
121+
-**/3rd*party/**
122+
-**/external/**
123+
input: ${{ steps.step1.outputs.sarif-output }}/cpp.sarif
124+
output: ${{ steps.step1.outputs.sarif-output }}/cpp.sarif
125+
126+
- name: Upload SARIF
127+
uses: github/codeql-action/upload-sarif@v2
128+
with:
129+
sarif_file: ${{ steps.step1.outputs.sarif-output }}
130+
category: "/language:${{matrix.language}}"
131+
132+
- name: Archive CodeQL results
133+
uses: actions/upload-artifact@v3
134+
with:
135+
name: codeql-results
136+
path: ${{ steps.step1.outputs.sarif-output }}
137+
retention-days: 5

0 commit comments

Comments
 (0)