integrate msp430 to build cmake

This commit is contained in:
hathach 2024-04-23 12:38:55 +07:00
parent a42e34701f
commit 16e099a9f9
No known key found for this signature in database
GPG Key ID: 26FAB84F615C3C52
2 changed files with 59 additions and 86 deletions

View File

@ -1,4 +1,4 @@
name: CMake ARM
name: Build CMake
on:
workflow_dispatch:
@ -10,7 +10,7 @@ on:
- 'hw/**'
- 'test/hil/**'
- 'tools/get_deps.py'
- '.github/workflows/cmake_arm.yml'
- '.github/workflows/build_cmake.yml'
pull_request:
branches: [ master ]
paths:
@ -20,7 +20,7 @@ on:
- 'hw/**'
- 'test/hil/**'
- 'tools/get_deps.py'
- '.github/workflows/cmake_arm.yml'
- '.github/workflows/build_cmake.yml'
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
@ -156,6 +156,14 @@ jobs:
- name: Checkout TinyUSB
uses: actions/checkout@v4
- name: Checkout pico-sdk for rp2040
if: matrix.family == 'rp2040'
uses: actions/checkout@v4
with:
repository: raspberrypi/pico-sdk
ref: develop
path: pico-sdk
- name: Set Toolchain URL
run: echo >> $GITHUB_ENV TOOLCHAIN_URL=https://github.com/ARM-software/LLVM-embedded-toolchain-for-Arm/releases/download/release-17.0.1/LLVMEmbeddedToolchainForArm-17.0.1-Linux-x86_64.tar.xz
@ -173,19 +181,9 @@ jobs:
wget --progress=dot:mega $TOOLCHAIN_URL -O toolchain.tar.xz
tar -C ~/cache/toolchain -xaf toolchain.tar.xz
- name: Set Toolchain Path
run: echo >> $GITHUB_PATH `echo ~/cache/toolchain/*/bin`
- name: Checkout pico-sdk for rp2040
if: matrix.family == 'rp2040'
uses: actions/checkout@v4
with:
repository: raspberrypi/pico-sdk
ref: develop
path: pico-sdk
- name: Get Dependencies
- name: Prepare to build
run: |
echo >> $GITHUB_PATH `echo ~/cache/toolchain/*/bin`
sudo apt install -y ninja-build
python3 tools/get_deps.py ${{ matrix.family }}
@ -194,6 +192,52 @@ jobs:
env:
PICO_SDK_PATH: ${{ github.workspace }}/pico-sdk
# ---------------------------------------
# Build ARM with Clang
# ---------------------------------------
msp430-gcc:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
family:
# Alphabetical order
- 'msp430'
steps:
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.x'
- name: Checkout TinyUSB
uses: actions/checkout@v4
- name: Set Toolchain URL
run: echo >> $GITHUB_ENV TOOLCHAIN_URL=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
- name: Cache Toolchain
uses: actions/cache@v3
id: cache-toolchain
with:
path: ~/cache/
key: ${{ runner.os }}-24-04-17-${{ env.TOOLCHAIN_URL }}
- name: Install Toolchain
if: steps.cache-toolchain.outputs.cache-hit != 'true'
run: |
mkdir -p ~/cache/toolchain
wget --progress=dot:mega $TOOLCHAIN_URL -O toolchain.tar.bz2
tar -C ~/cache/toolchain -xaf toolchain.tar.bz2
- name: Prepare to build
run: |
echo >> $GITHUB_PATH `echo ~/cache/toolchain/*/bin`
sudo apt install -y ninja-build
python3 tools/get_deps.py ${{ matrix.family }}
- name: Build
run: python tools/build_cmake.py ${{ matrix.family }} -DCMAKE_BUILD_TYPE=MinSizeRel
# ---------------------------------------
# Hardware in the loop (HIL)
# Current self-hosted instance is running on an RPI4. For attached hardware checkout hil_pi4.json

View File

@ -1,71 +0,0 @@
name: Build MSP430
on:
workflow_dispatch:
push:
paths:
- 'src/**'
- 'examples/**'
- 'lib/**'
- 'hw/**'
- 'tools/get_deps.py'
- '.github/workflows/build_msp430.yml'
pull_request:
branches: [ master ]
paths:
- 'src/**'
- 'examples/**'
- 'lib/**'
- 'hw/**'
- 'tools/get_deps.py'
- '.github/workflows/build_msp430.yml'
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
build-msp430:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
family:
# Alphabetical order
- 'msp430'
steps:
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.x'
- name: Checkout TinyUSB
uses: actions/checkout@v4
- name: Set Toolchain URL
run: echo >> $GITHUB_ENV TOOLCHAIN_URL=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
- name: Cache Toolchain
uses: actions/cache@v3
id: cache-toolchain
with:
path: ~/cache/
key: ${{ runner.os }}-21-03-04-${{ env.TOOLCHAIN_URL }}
- name: Install Toolchain
if: steps.cache-toolchain.outputs.cache-hit != 'true'
run: |
mkdir -p ~/cache/toolchain
wget --progress=dot:mega $TOOLCHAIN_URL -O toolchain.tar.bz2
tar -C ~/cache/toolchain -xaf toolchain.tar.bz2
- name: Set Toolchain Path
run: |
echo >> $GITHUB_PATH `echo ~/cache/toolchain/*/bin`
sudo apt install -y ninja-build
- name: Build
run: |
python3 tools/get_deps.py ${{ matrix.family }}
python tools/build_cmake.py ${{ matrix.family }} -DCMAKE_BUILD_TYPE=MinSizeRel