Skip to content

Commit edbea21

Browse files
authored
Merge pull request #3086 from hathach/ci-add-picow-host
Ci add picow host test
2 parents e426c8c + 46d2d41 commit edbea21

File tree

45 files changed

+315
-284
lines changed

Some content is hidden

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

45 files changed

+315
-284
lines changed

.circleci/config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,12 @@ jobs:
2020
2121
BUILDSYSTEM_TOOLCHAIN=(
2222
"cmake arm-clang"
23+
"cmake esp-idf"
2324
"make aarch64-gcc"
2425
"make arm-gcc"
2526
"make msp430-gcc"
2627
"make riscv-gcc"
2728
"make rx-gcc"
28-
"cmake esp-idf"
2929
)
3030
3131
# only build IAR if not forked PR, since IAR token is not shared

.circleci/config2.yml

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,7 @@ commands:
1010
- run:
1111
name: Set toolchain url and key
1212
command: |
13-
TOOLCHAIN_JSON='{
14-
"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",
15-
"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",
16-
"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",
17-
"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",
18-
"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",
19-
"rx-gcc": "https://github.com/hathach/rx_device/releases/download/0.0.1/gcc-8.3.0.202411-GNURX-ELF.run",
20-
"arm-iar": "https://updates.iar.com/FileStore/STANDARD/001/003/322/cxarm-9.60.3.deb"
21-
}'
22-
toolchain_url=$(echo $TOOLCHAIN_JSON | jq -r '.["<< parameters.toolchain >>"]')
23-
13+
toolchain_url=$(jq -r '."<< parameters.toolchain >>"' .github/actions/setup_toolchain/toolchain.json)
2414
# only cache if not a github link
2515
if [[ $toolchain_url != "https://github.com"* ]]; then
2616
echo "<< parameters.toolchain >>-$toolchain_url" > toolchain_key
@@ -121,7 +111,6 @@ commands:
121111
TOOLCHAIN_OPTION="--toolchain clang"
122112
elif [ << parameters.toolchain >> == arm-iar ]; then
123113
TOOLCHAIN_OPTION="--toolchain iar"
124-
echo IAR_LMS_CLOUD_URL=$IAR_LMS_CLOUD_URL
125114
iccarm --version
126115
elif [ << parameters.toolchain >> == arm-gcc ]; then
127116
TOOLCHAIN_OPTION="--toolchain gcc"

.github/actions/setup_toolchain/action.yml

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -28,26 +28,17 @@ runs:
2828
- name: Get Toolchain URL
2929
if: >-
3030
inputs.toolchain != 'arm-gcc' &&
31-
inputs.toolchain != 'arm-iar' &&
3231
inputs.toolchain != 'esp-idf'
3332
id: set-toolchain-url
3433
run: |
35-
TOOLCHAIN_JSON='{
36-
"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",
37-
"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",
38-
"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",
39-
"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",
40-
"rx-gcc": "https://github.com/hathach/rx_device/releases/download/0.0.1/gcc-8.3.0.202411-GNURX-ELF.run"
41-
}'
42-
TOOLCHAIN_URL=$(echo $TOOLCHAIN_JSON | jq -r '.["${{ inputs.toolchain }}"]')
34+
TOOLCHAIN_URL=$(jq -r '."${{ inputs.toolchain }}"' .github/actions/setup_toolchain/toolchain.json)
4335
echo "toolchain_url=$TOOLCHAIN_URL"
4436
echo "toolchain_url=$TOOLCHAIN_URL" >> $GITHUB_OUTPUT
4537
shell: bash
4638

4739
- name: Download Toolchain
4840
if: >-
4941
inputs.toolchain != 'arm-gcc' &&
50-
inputs.toolchain != 'arm-iar' &&
5142
inputs.toolchain != 'esp-idf'
5243
uses: ./.github/actions/setup_toolchain/download
5344
with:

.github/actions/setup_toolchain/download/action.yml

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,17 +23,25 @@ runs:
2323
if: steps.cache-toolchain-download.outputs.cache-hit != 'true'
2424
run: |
2525
mkdir -p ~/cache/${{ inputs.toolchain }}
26-
wget --progress=dot:giga ${{ inputs.toolchain_url }} -O toolchain.tar.gz
26+
2727
if [[ ${{ inputs.toolchain }} == rx-gcc ]]; then
28-
mv toolchain.tar.gz toolchain.run
28+
wget --progress=dot:giga ${{ inputs.toolchain_url }} -O toolchain.run
2929
chmod +x toolchain.run
3030
./toolchain.run -p ~/cache/${{ inputs.toolchain }}/gnurx -y
31+
elif [[ ${{ inputs.toolchain }} == arm-iar ]]; then
32+
wget --progress=dot:giga ${{ inputs.toolchain_url }} -O ~/cache/${{ inputs.toolchain }}/cxarm.deb
3133
else
34+
wget --progress=dot:giga ${{ inputs.toolchain_url }} -O toolchain.tar.gz
3235
tar -C ~/cache/${{ inputs.toolchain }} -xaf toolchain.tar.gz
3336
fi
3437
shell: bash
3538

36-
- name: Set Toolchain Path
39+
- name: Setup Toolchain
3740
run: |
38-
echo >> $GITHUB_PATH `echo ~/cache/${{ inputs.toolchain }}/*/bin`
41+
if [[ ${{ inputs.toolchain }} == arm-iar ]]; then
42+
sudo apt-get install -y ~/cache/${{ inputs.toolchain }}/cxarm.deb
43+
echo >> $GITHUB_PATH "/opt/iar/cxarm/arm/bin"
44+
else
45+
echo >> $GITHUB_PATH `echo ~/cache/${{ inputs.toolchain }}/*/bin`
46+
fi
3947
shell: bash
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"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",
3+
"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",
5+
"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",
6+
"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",
7+
"rx-gcc": "https://github.com/hathach/rx_device/releases/download/0.0.1/gcc-8.3.0.202411-GNURX-ELF.run",
8+
"arm-iar": "https://netstorage.iar.com/FileStore/STANDARD/001/003/583/cxarm-9.60.4.deb"
9+
}

.github/workflows/build.yml

Lines changed: 16 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -110,37 +110,25 @@ jobs:
110110
one-per-family: true
111111

112112
# ---------------------------------------
113-
# Build IAR on HFP self-hosted
114-
# Since IAR Token secret is not passed to forked PR, only build on PR from the same repo
113+
# Build IAR
114+
# Since IAR Token secret is not passed to forked PR, only build non-forked PR with make.
115+
# cmake is built by circle-ci. Due to IAR limit capacity, only build oe per family
115116
# ---------------------------------------
116117
arm-iar:
117-
if: github.repository_owner == 'hathach' && github.event_name == 'push'
118+
if: github.event_name == 'pull_request' && github.event.pull_request.head.repo.fork == false
118119
needs: set-matrix
119-
runs-on: [self-hosted, Linux, X64, hifiphile]
120-
env:
121-
BUILD_ARGS: ${{ join(fromJSON(needs.set-matrix.outputs.json)['arm-iar'], ' ') }}
122-
IAR_LMS_CLOUD_URL: ${{ vars.IAR_LMS_CLOUD_URL }}
123-
IAR_LMS_BEARER_TOKEN: ${{ secrets.IAR_LMS_BEARER_TOKEN }}
124-
steps:
125-
- name: Clean workspace
126-
run: |
127-
echo "Cleaning up previous run"
128-
rm -rf "${{ github.workspace }}"
129-
mkdir -p "${{ github.workspace }}"
130-
131-
- name: Toolchain version
132-
run: |
133-
echo IAR_LMS_CLOUD_URL=$IAR_LMS_CLOUD_URL
134-
iccarm --version
135-
136-
- name: Checkout TinyUSB
137-
uses: actions/checkout@v4
138-
139-
- name: Get Dependencies
140-
run: python3 tools/get_deps.py $BUILD_ARGS
141-
142-
- name: Build
143-
run: python3 tools/build.py --one-per-family --toolchain iar $BUILD_ARGS
120+
uses: ./.github/workflows/build_util.yml
121+
secrets: inherit
122+
strategy:
123+
fail-fast: false
124+
matrix:
125+
build-system:
126+
- 'make'
127+
with:
128+
build-system: ${{ matrix.build-system }}
129+
toolchain: 'arm-iar'
130+
build-args: ${{ toJSON(fromJSON(needs.set-matrix.outputs.json)['arm-iar']) }}
131+
one-per-family: true
144132

145133
# ---------------------------------------
146134
# Zephyr

.github/workflows/build_util.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,8 @@ jobs:
5858
shell: bash
5959

6060
- name: Build
61+
env:
62+
IAR_LMS_BEARER_TOKEN: ${{ secrets.IAR_LMS_BEARER_TOKEN }}
6163
run: |
6264
if [ "${{ inputs.toolchain }}" == "esp-idf" ]; then
6365
docker run --rm -v $PWD:/project -w /project espressif/idf:tinyusb python tools/build.py ${{ matrix.arg }}

.github/workflows/hil_test.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -90,13 +90,12 @@ jobs:
9090
# ---------------------------------------
9191
# Hardware in the loop (HIL)
9292
# self-hosted by HFP, build with IAR toolchain, for attached hardware checkout test/hil/hfp.json
93-
# Since IAR Token secret is not passed to forked PR, only build on PR from the same repo
93+
# Since IAR Token secret is not passed to forked PR, only build non-forked PR
9494
# ---------------------------------------
9595
hil-hfp:
9696
if: github.repository_owner == 'hathach' && github.event.pull_request.head.repo.fork == false
9797
runs-on: [self-hosted, Linux, X64, hifiphile]
9898
env:
99-
IAR_LMS_CLOUD_URL: ${{ vars.IAR_LMS_CLOUD_URL }}
10099
IAR_LMS_BEARER_TOKEN: ${{ secrets.IAR_LMS_BEARER_TOKEN }}
101100
steps:
102101
- name: Clean workspace
@@ -107,7 +106,6 @@ jobs:
107106
108107
- name: Toolchain version
109108
run: |
110-
echo IAR_LMS_CLOUD_URL=$IAR_LMS_CLOUD_URL
111109
iccarm --version
112110
113111
- name: Checkout TinyUSB

examples/build_system/make/cpu/cortex-m4.mk

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ else ifeq ($(TOOLCHAIN),clang)
1212
-mfpu=fpv4-sp-d16 \
1313

1414
else ifeq ($(TOOLCHAIN),iar)
15-
CFLAGS += --cpu cortex-m4 --fpu VFPv4
16-
ASFLAGS += --cpu cortex-m4 --fpu VFPv4
15+
CFLAGS += --cpu cortex-m4 --fpu VFPv4-SP
16+
ASFLAGS += --cpu cortex-m4 --fpu VFPv4-SP
1717

1818
else
1919
$(error "TOOLCHAIN is not supported")

0 commit comments

Comments
 (0)