Skip to content

Commit b0d194c

Browse files
committed
Use official STM32 SDK for stm32 builds
Signed-off-by: Paul Guyot <pguyot@kallisys.net>
1 parent 480c606 commit b0d194c

Some content is hidden

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

66 files changed

+6325
-567
lines changed

.github/workflows/build-and-test-macos.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ on:
1212
- 'src/platforms/emscripten/**'
1313
- 'src/platforms/esp32/**'
1414
- 'src/platforms/rp2/**'
15+
- 'src/platforms/libopencm3/**'
1516
- 'src/platforms/stm32/**'
1617
- 'doc/**'
1718
- 'LICENSES/**'
@@ -22,6 +23,7 @@ on:
2223
- 'src/platforms/emscripten/**'
2324
- 'src/platforms/esp32/**'
2425
- 'src/platforms/rp2/**'
26+
- 'src/platforms/libopencm3/**'
2527
- 'src/platforms/stm32/**'
2628
- 'doc/**'
2729
- 'LICENSES/**'

.github/workflows/build-and-test-on-freebsd.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ on:
1212
- 'src/platforms/emscripten/**'
1313
- 'src/platforms/esp32/**'
1414
- 'src/platforms/rp2/**'
15+
- 'src/platforms/libopencm3/**'
1516
- 'src/platforms/stm32/**'
1617
- 'doc/**'
1718
- 'LICENSES/**'
@@ -22,6 +23,7 @@ on:
2223
- 'src/platforms/emscripten/**'
2324
- 'src/platforms/esp32/**'
2425
- 'src/platforms/rp2/**'
26+
- 'src/platforms/libopencm3/**'
2527
- 'src/platforms/stm32/**'
2628
- 'doc/**'
2729
- 'LICENSES/**'

.github/workflows/build-and-test.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ on:
1212
- 'src/platforms/emscripten/**'
1313
- 'src/platforms/esp32/**'
1414
- 'src/platforms/rp2/**'
15+
- 'src/platforms/libopencm3/**'
1516
- 'src/platforms/stm32/**'
1617
- 'doc/**'
1718
- 'LICENSES/**'
@@ -22,6 +23,7 @@ on:
2223
- 'src/platforms/emscripten/**'
2324
- 'src/platforms/esp32/**'
2425
- 'src/platforms/rp2/**'
26+
- 'src/platforms/libopencm3/**'
2527
- 'src/platforms/stm32/**'
2628
- 'doc/**'
2729
- 'LICENSES/**'

.github/workflows/codeql-analysis.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ on:
1212
- 'src/platforms/emscripten/**'
1313
- 'src/platforms/esp32/**'
1414
- 'src/platforms/rp2/**'
15+
- 'src/platforms/libopencm3/**'
1516
- 'src/platforms/stm32/**'
1617
- 'libs/**'
1718
- 'doc/**'
@@ -23,6 +24,7 @@ on:
2324
- 'src/platforms/emscripten/**'
2425
- 'src/platforms/esp32/**'
2526
- 'src/platforms/rp2/**'
27+
- 'src/platforms/libopencm3/**'
2628
- 'src/platforms/stm32/**'
2729
- 'libs/**'
2830
- 'doc/**'
Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
#
2+
# Copyright 2022 Paul Guyot <pguyot@kallisys.net>
3+
#
4+
# SPDX-License-Identifier: Apache-2.0 OR LGPL-2.1-or-later
5+
#
6+
7+
name: LibOpenCM3 Build
8+
9+
on:
10+
push:
11+
paths:
12+
- '.github/workflows/libopencm3-build.yaml'
13+
- 'CMakeLists.txt'
14+
- 'CMakeModules/**'
15+
- 'src/platforms/libopencm3/**'
16+
- 'src/libAtomVM/**'
17+
pull_request:
18+
paths:
19+
- '.github/workflows/libopencm3-build.yaml'
20+
- 'CMakeLists.txt'
21+
- 'CMakeModules/**'
22+
- 'src/platforms/libopencm3/**'
23+
- 'src/libAtomVM/**'
24+
25+
concurrency:
26+
group: ${{ github.workflow }}-${{ github.ref != 'refs/heads/main' && github.ref || github.run_id }}
27+
cancel-in-progress: true
28+
29+
jobs:
30+
stm32:
31+
runs-on: ubuntu-24.04
32+
permissions:
33+
actions: read
34+
contents: read
35+
security-events: write
36+
37+
steps:
38+
- uses: actions/cache@v4
39+
id: builddeps-cache
40+
with:
41+
path: |
42+
/home/runner/libopencm3
43+
key: ${{ runner.os }}-build-deps
44+
45+
- uses: erlef/setup-beam@v1
46+
with:
47+
otp-version: "27"
48+
hexpm-mirrors: |
49+
https://builds.hex.pm
50+
https://repo.hex.pm
51+
https://cdn.jsdelivr.net/hex
52+
53+
- name: "apt update"
54+
run: sudo apt update
55+
56+
- name: "Install deps"
57+
run: sudo apt install -y cmake gperf gcc-arm-none-eabi
58+
59+
- name: Checkout and build libopencm3
60+
if: ${{ steps.builddeps-cache.outputs.cache-hit != 'true' }}
61+
working-directory: /home/runner
62+
run: |
63+
set -euo pipefail
64+
cd /home/runner
65+
test -d libopencm3 && rm -fr libopencm3
66+
git clone https://github.com/libopencm3/libopencm3.git -b v0.8.0
67+
cd libopencm3
68+
make
69+
70+
- name: Checkout repo
71+
uses: actions/checkout@v4
72+
73+
- name: "Git config safe.directory for codeql"
74+
run: git config --global --add safe.directory /__w/AtomVM/AtomVM
75+
76+
- name: "Initialize CodeQL"
77+
uses: github/codeql-action/init@v4
78+
with:
79+
languages: 'cpp'
80+
build-mode: manual
81+
queries: +./code-queries/term-to-non-term-func.ql,./code-queries/non-term-to-term-func.ql,./code-queries/mismatched-atom-string-length.ql,./code-queries/mismatched-free-type.ql,./code-queries/term-use-after-gc.ql
82+
83+
- name: Build
84+
shell: bash
85+
working-directory: ./src/platforms/libopencm3/
86+
run: |
87+
set -euo pipefail
88+
mkdir build
89+
cd build
90+
# -DAVM_WARNINGS_ARE_ERRORS=ON
91+
cmake .. -DCMAKE_TOOLCHAIN_FILE=cmake/arm-toolchain.cmake -DLIBOPENCM3_DIR=/home/runner/libopencm3
92+
make -j
93+
94+
- name: "Perform CodeQL Analysis"
95+
uses: github/codeql-action/analyze@v4

.github/workflows/run-tests-with-beam.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ on:
1212
- 'src/platforms/emscripten/**'
1313
- 'src/platforms/esp32/**'
1414
- 'src/platforms/rp2/**'
15+
- 'src/platforms/libopencm3/**'
1516
- 'src/platforms/stm32/**'
1617
- 'doc/**'
1718
- 'LICENSES/**'
@@ -22,6 +23,7 @@ on:
2223
- 'src/platforms/emscripten/**'
2324
- 'src/platforms/esp32/**'
2425
- 'src/platforms/rp2/**'
26+
- 'src/platforms/libopencm3/**'
2527
- 'src/platforms/stm32/**'
2628
- 'doc/**'
2729
- 'LICENSES/**'

.github/workflows/stm32-build.yaml

Lines changed: 15 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#
2-
# Copyright 2022 Paul Guyot <pguyot@kallisys.net>
2+
# Copyright 2026 Paul Guyot <pguyot@kallisys.net>
33
#
44
# SPDX-License-Identifier: Apache-2.0 OR LGPL-2.1-or-later
55
#
@@ -34,14 +34,17 @@ jobs:
3434
contents: read
3535
security-events: write
3636

37-
steps:
38-
- uses: actions/cache@v4
39-
id: builddeps-cache
40-
with:
41-
path: |
42-
/home/runner/libopencm3
43-
key: ${{ runner.os }}-build-deps
37+
strategy:
38+
fail-fast: false
39+
matrix:
40+
device:
41+
- stm32f411ceu6
42+
- stm32h743vit6
43+
- stm32u585ait6q
44+
- stm32wb55rg
45+
- stm32h562rgt6
4446

47+
steps:
4548
- uses: erlef/setup-beam@v1
4649
with:
4750
otp-version: "27"
@@ -54,42 +57,17 @@ jobs:
5457
run: sudo apt update
5558

5659
- name: "Install deps"
57-
run: sudo apt install -y cmake gperf gcc-arm-none-eabi
58-
59-
- name: Checkout and build libopencm3
60-
if: ${{ steps.builddeps-cache.outputs.cache-hit != 'true' }}
61-
working-directory: /home/runner
62-
run: |
63-
set -euo pipefail
64-
cd /home/runner
65-
test -d libopencm3 && rm -fr libopencm3
66-
git clone https://github.com/libopencm3/libopencm3.git -b v0.8.0
67-
cd libopencm3
68-
make
60+
run: sudo apt install -y cmake ninja-build gperf gcc-arm-none-eabi
6961

7062
- name: Checkout repo
7163
uses: actions/checkout@v4
7264

73-
- name: "Git config safe.directory for codeql"
74-
run: git config --global --add safe.directory /__w/AtomVM/AtomVM
75-
76-
- name: "Initialize CodeQL"
77-
uses: github/codeql-action/init@v4
78-
with:
79-
languages: 'cpp'
80-
build-mode: manual
81-
queries: +./code-queries/term-to-non-term-func.ql,./code-queries/non-term-to-term-func.ql,./code-queries/mismatched-atom-string-length.ql,./code-queries/mismatched-free-type.ql,./code-queries/term-use-after-gc.ql
82-
83-
- name: Build
65+
- name: "Build for ${{ matrix.device }}"
8466
shell: bash
8567
working-directory: ./src/platforms/stm32/
8668
run: |
8769
set -euo pipefail
8870
mkdir build
8971
cd build
90-
# -DAVM_WARNINGS_ARE_ERRORS=ON
91-
cmake .. -DCMAKE_TOOLCHAIN_FILE=cmake/arm-toolchain.cmake -DLIBOPENCM3_DIR=/home/runner/libopencm3
92-
make -j
93-
94-
- name: "Perform CodeQL Analysis"
95-
uses: github/codeql-action/analyze@v4
72+
cmake .. -G Ninja -DCMAKE_TOOLCHAIN_FILE=cmake/arm-toolchain.cmake -DDEVICE=${{ matrix.device }}
73+
ninja

README.Md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@ Supported Platforms
1717

1818
* Linux, macOS, FreeBSD, DragonFly ([generic_unix](https://doc.atomvm.org/main/getting-started-guide.html#getting-started-on-the-generic-unix-platform))
1919
* ESP32 SoC (with IDF/FreeRTOS, see [esp32](https://doc.atomvm.org/main/getting-started-guide.html#getting-started-on-the-esp32-platform))
20-
* STM32 MCUs (with LibOpenCM3, see [stm32](https://doc.atomvm.org/main/getting-started-guide.html#getting-started-on-the-stm32-platform))
20+
* STM32 MCUs (with official ST HAL/LL SDK, see [stm32](https://doc.atomvm.org/main/getting-started-guide.html#getting-started-on-the-stm32-platform))
21+
* STM32 MCUs (with LibOpenCM3, see [stm32-libopencm3](https://doc.atomvm.org/main/getting-started-guide.html#getting-started-on-the-stm32-libopencm3-platform))
2122
* Raspberry Pi Pico and Pico 2 (see [rp2](https://doc.atomvm.org/main/getting-started-guide.html#getting-started-on-the-raspberry-pi-pico-platform))
2223
* Browsers and NodeJS with WebAssembly (see [emscripten](https://doc.atomvm.org/main/getting-started-guide.html#getting-started-with-atomvm-webassembly))
2324

@@ -71,6 +72,7 @@ available in the documentation for
7172
[Generic UNIX](https://doc.atomvm.org/main/build-instructions.html) (Linux, MacOS, FreeBSD, DragonFly),
7273
[ESP32](https://doc.atomvm.org/main/build-instructions.html#building-for-esp32),
7374
[STM32](https://doc.atomvm.org/main/build-instructions.html#building-for-stm32),
75+
[STM32 (LibOpenCM3)](https://doc.atomvm.org/main/build-instructions.html#building-for-stm32-libopencm3),
7476
[Raspberry Pi Pico and Pico 2](https://doc.atomvm.org/main/build-instructions.html#building-for-raspberry-pi-pico)
7577
(rp2), and
7678
[WASM](https://doc.atomvm.org/main/build-instructions.html#building-for-nodejs-web) (NodeJS/Web).

0 commit comments

Comments
 (0)