Skip to content

Commit 32e46e6

Browse files
committed
update from dev branch
1 parent 59f0a26 commit 32e46e6

Some content is hidden

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

51 files changed

+2486
-825
lines changed

.editorconfig

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,8 @@ root = true
44
charset = utf-8
55
end_of_line = lf
66
insert_final_newline = true
7+
8+
[*.md]
9+
charset = utf-8-bom
10+
end_of_line = lf
11+
insert_final_newline = true
Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
name: wolfboot CMake (.config)
2+
on:
3+
push:
4+
branches: [ '*' ]
5+
pull_request:
6+
branches: [ '*' ]
7+
jobs:
8+
wolfboot_dot_config_test:
9+
runs-on: ubuntu-latest
10+
timeout-minutes: 15
11+
12+
steps:
13+
- uses: actions/checkout@v4
14+
with:
15+
submodules: true
16+
17+
- name: Workaround for sources.list
18+
run: |
19+
# Replace sources
20+
21+
set -euxo pipefail
22+
23+
# Peek (what repos are active now)
24+
apt-cache policy
25+
grep -RInE '^(deb|Types|URIs)' /etc/apt || true
26+
27+
# Enable nullglob so *.list/*.sources that don't exist don't break sed
28+
shopt -s nullglob
29+
30+
echo "Replace sources.list (legacy)"
31+
sudo sed -i \
32+
-e "s|https\?://azure\.archive\.ubuntu\.com/ubuntu/?|http://mirror.arizona.edu/ubuntu/|g" \
33+
/etc/apt/sources.list || true
34+
35+
echo "Replace sources.list.d/*.list (legacy)"
36+
for f in /etc/apt/sources.list.d/*.list; do
37+
sudo sed -i \
38+
-e "s|https\?://azure\.archive\.ubuntu\.com/ubuntu/?|http://mirror.arizona.edu/ubuntu/|g" \
39+
"$f"
40+
done
41+
42+
echo "Replace sources.list.d/*.sources (deb822)"
43+
for f in /etc/apt/sources.list.d/*.sources; do
44+
sudo sed -i \
45+
-e "s|https\?://azure\.archive\.ubuntu\.com/ubuntu/?|http://mirror.arizona.edu/ubuntu/|g" \
46+
-e "s|https\?://azure\.archive\.ubuntu\.com|http://mirror.arizona.edu|g" \
47+
"$f"
48+
done
49+
50+
echo "Fix /etc/apt/apt-mirrors.txt (used by URIs: mirror+file:...)"
51+
if grep -qE '^[[:space:]]*https?://azure\.archive\.ubuntu\.com/ubuntu/?' /etc/apt/apt-mirrors.txt; then
52+
# Replace azure with our mirror (idempotent)
53+
sudo sed -i 's|https\?://azure\.archive\.ubuntu\.com/ubuntu/|http://mirror.arizona.edu/ubuntu/|g' /etc/apt/apt-mirrors.txt
54+
fi
55+
56+
# Peek (verify changes)
57+
grep -RIn "azure.archive.ubuntu.com" /etc/apt || true
58+
grep -RInE '^(deb|Types|URIs)' /etc/apt || true
59+
echo "--- apt-mirrors.txt ---"
60+
cat /etc/apt/apt-mirrors.txt || true
61+
62+
63+
- name: Install requirements
64+
run: |
65+
# Run system updates and install toolchain
66+
sudo apt-get update
67+
sudo apt-get install -y gcc-arm-none-eabi gcc-powerpc-linux-gnu cmake
68+
69+
- name: Run dot-config examples
70+
run: |
71+
# Sample .config cmake test
72+
73+
set -euo pipefail
74+
75+
LOG_FILE="run.log"
76+
KEYWORD="Config mode: dot"
77+
echo "Saving output to $LOG_FILE"
78+
79+
echo "Fetch stm32h7 example .config"
80+
cp ./config/examples/stm32h7.config ./.config
81+
ls .config
82+
cat .config
83+
echo ""
84+
85+
echo "Clean"
86+
rm -rf ./build-stm32h7
87+
88+
# Here we should see the .config file values read and displayed:
89+
cmake -S . -B build-stm32h7 \
90+
-DUSE_DOT_CONFIG=ON \
91+
-DWOLFBOOT_TARGET=stm32h7 2>&1 | tee "$LOG_FILE"
92+
93+
# Config dot-config mode
94+
if grep -q -- "$KEYWORD" "$LOG_FILE"; then
95+
echo "Keyword found: $KEYWORD"
96+
else
97+
echo "Keyword not found: $KEYWORD" >&2
98+
exit 1
99+
fi
100+
101+
# Sample build
102+
cmake --build build-stm32h7 -j

.github/workflows/test-build-cmake-mac.yml

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,11 @@ jobs:
1212
runs-on: macos-14
1313
timeout-minutes: 20
1414

15+
strategy:
16+
fail-fast: false
17+
matrix:
18+
target: [stm32l4, stm32h7, stm32c0, stm32g0]
19+
1520
env:
1621
HOMEBREW_NO_AUTO_UPDATE: "1" # avoid updating taps during install
1722
HOMEBREW_NO_ANALYTICS: "1"
@@ -83,9 +88,9 @@ jobs:
8388
# -DBUILD_TEST_APPS=ON \
8489
# -DCMAKE_TOOLCHAIN_FILE=cmake/toolchain_arm-none-eabi.cmake
8590
86-
- name: Presets
91+
- name: Cmake Configure & Build Preset (${{ matrix.target }})
8792
run: |
88-
rm -rf ./build-stm32l4
93+
rm -rf ./build-${{ matrix.target }}
8994
90-
cmake --preset stm32l4
91-
cmake --build --preset stm32l4
95+
cmake --preset ${{ matrix.target }}
96+
cmake --build --preset ${{ matrix.target }}

.github/workflows/test-build-cmake-script.yml

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
name: Wolfboot CMake Script
1+
name: wolfboot CMake Script
22
on:
33
push:
44
branches: [ '*' ]
55
pull_request:
66
branches: [ '*' ]
77
jobs:
8-
cmake_automated_test:
8+
wolfboot_build_script_test:
99
runs-on: ubuntu-latest
1010
timeout-minutes: 15
1111

@@ -65,8 +65,12 @@ jobs:
6565
sudo apt-get update
6666
sudo apt-get install -y gcc-arm-none-eabi gcc-powerpc-linux-gnu cmake
6767
68-
- name: Run wolfbuild script
68+
- name: Run wolfboot_build script
6969
run: |
7070
rm -rf ./build
71-
./wolfbuild.sh --CLEAN "linux-stm32l4"
72-
./wolfbuild.sh --target "linux-stm32l4"
71+
72+
./tools/scripts/wolfboot_build.sh --CLEAN "stm32l4"
73+
./tools/scripts/wolfboot_build.sh --target "stm32l4"
74+
75+
./tools/scripts/wolfboot_build.sh --CLEAN "stm32g0"
76+
./tools/scripts/wolfboot_build.sh --target "stm32g0"

.github/workflows/test-build-cmake-windows.yml

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,12 @@ on:
66
pull_request:
77
branches: [ "*" ]
88

9+
permissions:
10+
contents: read
11+
912
jobs:
1013
windows-cmake:
11-
name: Build on Windows (CMake + Ninja)
14+
name: Build on Windows
1215
runs-on: windows-latest
1316
timeout-minutes: 20
1417

@@ -18,31 +21,46 @@ jobs:
1821
target:
1922
- stm32l4
2023
- stm32h7
24+
- stm32g0
2125
include:
2226
# Optional per-target cache variables you might want to pass later.
2327
# Keep empty for now to avoid guessing addresses.
2428
- target: stm32l4
2529
extra_cache: ""
2630
- target: stm32h7
2731
extra_cache: ""
32+
- target: stm32g0
33+
extra_cache: ""
2834

2935
steps:
3036
- name: Checkout (with submodules)
3137
uses: actions/checkout@v4
3238
with:
3339
submodules: true
3440

41+
# Lock down network/runner
42+
# See https://github.com/step-security/harden-runner/releases
43+
- uses: step-security/harden-runner@f4a75cfd619ee5ce8d5b864b0d183aff3c69b55a
44+
with:
45+
egress-policy: block
46+
allowed-endpoints: >
47+
developer.arm.com,
48+
armkeil.blob.core.windows.net,
49+
github.com, objects.githubusercontent.com, api.github.com
50+
3551
# ARM GCC toolchain (adds the bin dir to PATH)
3652
- name: Set up ARM none-eabi GCC 14.x
3753
uses: carlosperate/arm-none-eabi-gcc-action@v1
3854
with:
39-
version: "14.2.Rel1" # <-- use 'release', not 'version'
55+
release: "14.2.Rel1" # <-- use 'release', not 'version'
4056
path-env-var: ARM_NONE_EABI_GCC_PATH
4157

4258
# CMake + Ninja are preinstalled on windows-latest, but verify & print versions
4359
- name: Tool versions
4460
shell: bash
4561
run: |
62+
# Show some key toolchain versions
63+
4664
echo "Compiler versions:"
4765
arm-none-eabi-gcc --version
4866
echo
@@ -55,45 +73,27 @@ jobs:
5573
echo "MSVC (via vswhere):"
5674
cmd.exe /c "\"%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe\" -latest -products * -requires Microsoft.Component.MSBuild -property installationVersion"
5775
58-
- name: Build via cmd inline
59-
shell: cmd
60-
run: |
61-
if exist build-windows-stm32l4 rmdir /s /q build-windows-stm32l4
62-
cmake --preset windows-stm32l4
63-
cmake --build --preset windows-stm32l4 --parallel %NUMBER_OF_PROCESSORS%
64-
65-
- name: Build via batch (cmd)
66-
shell: cmd
76+
- name: List Presets
77+
shell: bash
6778
run: |
68-
:: # Call my_test.bat
79+
# Check available presets in CMakePresets.json
6980
70-
call my_test.bat
81+
cmake -S . -B build-list --list-presets=configure
7182
72-
- name: Configure (CMake + Ninja)
83+
- name: Configure Preset "${{ matrix.target }}"
7384
shell: bash
7485
run: |
7586
# cmake runs in git bash
7687
77-
BUILD_DIR="build-${{ matrix.target }}"
78-
cmake -S . -B "$BUILD_DIR" -G Ninja \
79-
-DCMAKE_TOOLCHAIN_FILE=cmake/toolchain_arm-none-eabi.cmake \
80-
-DWOLFBOOT_CONFIG_MODE=preset \
81-
-DWOLFBOOT_TARGET=${{ matrix.target }} \
82-
-DBUILD_TEST_APPS=ON \
83-
-DWOLFBOOT_PARTITION_BOOT_ADDRESS=0x8020000 \
84-
-DWOLFBOOT_SECTOR_SIZE=0x20000 \
85-
-DWOLFBOOT_PARTITION_SIZE=0xD0000 \
86-
-DWOLFBOOT_PARTITION_UPDATE_ADDRESS=0x80F0000 \
87-
-DWOLFBOOT_PARTITION_SWAP_ADDRESS=0x81C0000 \
88-
${{ matrix.extra_cache }}
89-
echo "Configured: $BUILD_DIR"
90-
91-
- name: Build
88+
cmake --preset "${{ matrix.target }}"
89+
echo "Configured: ${{ matrix.target }}"
90+
91+
- name: Build "${{ matrix.target }}"
9292
shell: bash
9393
run: |
9494
# cmake runs in git bash
9595
BUILD_DIR="build-${{ matrix.target }}"
96-
cmake --build "$BUILD_DIR" --parallel
96+
cmake --build "build-${{ matrix.target }}" --parallel
9797
9898
# Optional: show interesting artifacts
9999
- name: List build outputs

.github/workflows/test-build-cmake.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,5 +111,5 @@ jobs:
111111
- name: Run wolfbuild script
112112
run: |
113113
rm -rf ./build
114-
./wolfbuild.sh --CLEAN "linux-stm32l4"
115-
./wolfbuild.sh --target "linux-stm32l4"
114+
./tools/scripts/wolfboot_build.sh --CLEAN "stm32l4"
115+
./tools/scripts/wolfboot_build.sh --target "stm32l4"

.gitignore

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,9 @@ IDE/IAR/Release
144144
build/
145145
CMakeFiles/
146146
CMakeCache.txt
147+
# User specific presets should never be included.
148+
# See docs: https://cmake.org/cmake/help/latest/manual/cmake-presets.7.html
149+
/**/CMakeUserPresets.json
147150

148151
# Stage 1
149152
stage1/loader_stage1.ld
@@ -267,3 +270,13 @@ language.settings.xml
267270
/**/build
268271
/**/build-**
269272

273+
/IDE/VisualGDB
274+
/commit_squash.sh
275+
/evars.txt
276+
/evars_non_dev.txt
277+
/gpg_refresh.sh
278+
/IDE/VisualStudio/EmbeddedProject1
279+
/IDE/VisualStudio/wolfboot
280+
/.gitignore.wip
281+
/run.log
282+
/stm32.mak

.vscode/launch.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"request": "launch",
88
"servertype": "openocd",
99
"cwd": "${workspaceFolder:wolfBoot}",
10-
"executable": "${workspaceFolder:wolfBoot}/build-linux-stm32l4/wolfboot.elf",
10+
"executable": "${workspaceFolder:wolfBoot}/build-stm32l4/wolfboot.elf",
1111
"device": "STM32L475VG",
1212
"configFiles": [
1313
"interface/stlink-dap.cfg",

.vscode/tasks.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,22 @@
22
"version": "2.0.0",
33
"tasks": [
44
{
5-
"label": "CMake: Configure (linux-stm32l4)",
5+
"label": "CMake: Configure (stm32l4)",
66
"command": "cmake",
7-
"args": [ "--preset", "linux-stm32l4" ],
7+
"args": [ "--preset", "stm32l4" ],
88
"options": { "cwd": "${workspaceFolder:wolfBoot}" },
99
"problemMatcher": []
1010
},
1111
{
12-
"label": "CMake: Build (linux-stm32l4)",
12+
"label": "CMake: Build (stm32l4)",
1313
"command": "cmake",
14-
"args": [ "--build", "--preset", "linux-stm32l4" ],
14+
"args": [ "--build", "--preset", "stm32l4" ],
1515
"options": { "cwd": "${workspaceFolder:wolfBoot}" },
1616
"group": "build",
1717
"problemMatcher": "$gcc"
1818
},
1919
{
20-
"label": "OpenOCD: Flash wolfBoot (linux-stm32l4)",
20+
"label": "OpenOCD: Flash wolfBoot (stm32l4)",
2121
"type": "shell",
2222
"command": "openocd",
2323
"args": [
@@ -26,7 +26,7 @@
2626
"-f",
2727
"target/stm32l4x.cfg",
2828
"-c",
29-
"program ${workspaceFolder:wolfBoot}/build-linux-stm32l4/wolfboot.elf verify reset exit"
29+
"program ${workspaceFolder:wolfBoot}/build-stm32l4/wolfboot.elf verify reset exit"
3030
],
3131
"options": { "cwd": "${workspaceFolder:wolfBoot}" },
3232
"problemMatcher": []

0 commit comments

Comments
 (0)