Skip to content

Commit 8a90d44

Browse files
committed
Build related fixed to compile in containers with other compilers.
What's Wrong: * Minor fixes for warning * Name consistency with linker symbols How Was it Fixed (if not obvious): * Used Copilot w/ Claude to identify and fix many issues. * Used Copilot w/ Claude to create many markdown files (with hand-edits) What side effects does this have (could be none): * Minor build issues. Which builds did you run to make sure they build? [X] arm-none-eabi-gcc Cortex M4 [ ] arm-none-eabi-gcc Cortex M7 [ ] (Apple) Native Clang [ ] (Apple) Homebrew GCC [X] (Apple) Homebrew LLVM How Do We Know and Can Show It's Fixed: * N/A Which Unittest Series did you Check? [ ] (Apple) Native Clang [ ] (Apple) Homebrew GCC [X] (Apple) Homebrew LLVM Did this affect any on-target builds? If so which were tested? [ ] STM32F407VE board [ ] STM32H753ZI board
1 parent 59cf583 commit 8a90d44

File tree

58 files changed

+1083
-239
lines changed

Some content is hidden

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

58 files changed

+1083
-239
lines changed

.github/workflows/ci.yml

Lines changed: 137 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,137 @@
1+
name: CI Build
2+
3+
on:
4+
push:
5+
branches: [main, develop]
6+
pull_request:
7+
branches: [main, develop]
8+
workflow_dispatch:
9+
10+
jobs:
11+
build-arm-cortex-m4:
12+
name: Build Cortex-M4 (arm-none-eabi)
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
- name: Install latest CMake
17+
uses: lukka/get-cmake@latest
18+
19+
- name: Install ARM GNU Toolchain
20+
uses: carlosperate/arm-none-eabi-gcc-action@v1
21+
with:
22+
release: "13.2.Rel1"
23+
24+
- name: Install build dependencies
25+
run: |
26+
sudo apt-get update
27+
sudo apt-get install -y ninja-build
28+
29+
- name: Verify ARM toolchain
30+
run: arm-none-eabi-gcc --version
31+
32+
- name: Checkout repository
33+
uses: actions/checkout@v4
34+
with:
35+
submodules: recursive
36+
37+
- name: Configure and Build Cortex-M4
38+
run: cmake --workflow --preset on-target-cortex-m4-gcc-arm-none-eabi
39+
40+
build-arm-cortex-m7:
41+
name: Build Cortex-M7 (arm-none-eabi)
42+
runs-on: ubuntu-latest
43+
44+
steps:
45+
- name: Install latest CMake
46+
uses: lukka/get-cmake@latest
47+
48+
- name: Install ARM GNU Toolchain
49+
uses: carlosperate/arm-none-eabi-gcc-action@v1
50+
with:
51+
release: "13.2.Rel1"
52+
53+
- name: Install build dependencies
54+
run: |
55+
sudo apt-get update
56+
sudo apt-get install -y ninja-build
57+
58+
- name: Verify ARM toolchain
59+
run: arm-none-eabi-gcc --version
60+
61+
- name: Checkout repository
62+
uses: actions/checkout@v4
63+
with:
64+
submodules: recursive
65+
66+
- name: Configure and Build Cortex-M7
67+
run: cmake --workflow --preset on-target-cortex-m7-gcc-arm-none-eabi
68+
69+
build-native-gcc:
70+
name: Build and Test (native GCC)
71+
runs-on: ubuntu-latest
72+
73+
steps:
74+
- name: Install latest CMake
75+
uses: lukka/get-cmake@latest
76+
77+
- name: Install dependencies
78+
run: |
79+
sudo apt-get update
80+
sudo apt-get install -y ninja-build gcc g++
81+
82+
- name: Verify GCC
83+
run: gcc --version
84+
85+
- name: Checkout repository
86+
uses: actions/checkout@v4
87+
with:
88+
submodules: recursive
89+
90+
- name: Configure, Build, and Test
91+
run: cmake --workflow --preset on-host-native-gcc
92+
93+
- name: Upload test results
94+
if: always()
95+
uses: actions/upload-artifact@v4
96+
with:
97+
name: test-results-gcc
98+
path: build/native-gcc/Testing/**/*.xml
99+
if-no-files-found: ignore
100+
101+
build-native-llvm:
102+
name: Build and Test (native LLVM)
103+
runs-on: ubuntu-latest
104+
105+
steps:
106+
- name: Install latest CMake
107+
uses: lukka/get-cmake@latest
108+
109+
- name: Install LLVM toolchain
110+
run: |
111+
wget https://apt.llvm.org/llvm.sh
112+
chmod +x llvm.sh
113+
sudo ./llvm.sh 20
114+
sudo apt-get update
115+
sudo apt-get install -y ninja-build
116+
sudo update-alternatives --install /usr/bin/clang clang /usr/bin/clang-20 100
117+
sudo update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-20 100
118+
sudo update-alternatives --install /usr/bin/lld lld /usr/bin/lld-20 100
119+
120+
- name: Verify LLVM
121+
run: clang --version
122+
123+
- name: Checkout repository
124+
uses: actions/checkout@v4
125+
with:
126+
submodules: recursive
127+
128+
- name: Configure, Build, and Test
129+
run: cmake --workflow --preset on-host-native-llvm
130+
131+
- name: Upload test results
132+
if: always()
133+
uses: actions/upload-artifact@v4
134+
with:
135+
name: test-results-llvm
136+
path: build/native-llvm/Testing/**/*.xml
137+
if-no-files-found: ignore

.github/workflows/deploy-docs.yml

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
name: Deploy Documentation
2+
3+
on:
4+
push:
5+
branches: [main]
6+
workflow_dispatch:
7+
8+
permissions:
9+
contents: read
10+
pages: write
11+
id-token: write
12+
13+
concurrency:
14+
group: "pages"
15+
cancel-in-progress: false
16+
17+
jobs:
18+
build-docs:
19+
name: Build Doxygen Documentation
20+
runs-on: ubuntu-latest
21+
22+
steps:
23+
- name: Checkout repository
24+
uses: actions/checkout@v4
25+
with:
26+
submodules: recursive
27+
28+
- name: Install latest CMake
29+
uses: lukka/get-cmake@latest
30+
31+
- name: Install dependencies
32+
run: |
33+
sudo apt-get update
34+
sudo apt-get install -y doxygen graphviz dia mscgen plantuml
35+
36+
- name: Configure and Build with Documentation
37+
run: |
38+
mkdir -p build/documentation
39+
doxygen documentation/Doxyfile
40+
41+
- name: Setup Pages
42+
uses: actions/configure-pages@v4
43+
44+
- name: Upload artifact
45+
uses: actions/upload-pages-artifact@v3
46+
with:
47+
path: "build/documentation/html"
48+
49+
deploy:
50+
name: Deploy to GitHub Pages
51+
environment:
52+
name: github-pages
53+
url: ${{ steps.deployment.outputs.page_url }}
54+
runs-on: ubuntu-latest
55+
needs: build-docs
56+
57+
steps:
58+
- name: Deploy to GitHub Pages
59+
id: deployment
60+
uses: actions/deploy-pages@v4

.gitmodules

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
[submodule "doxygen-awesome-css"]
2-
path = documentation/doxygen-awesome-css
1+
[submodule "third-party/doxygen-awesome-css"]
2+
path = third-party/doxygen-awesome-css
33
url = https://github.com/jothepro/doxygen-awesome-css.git

CMakeLists.txt

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,3 @@ foreach(test IN LISTS LOCAL_UNITTESTS)
114114
add_subdirectory(${EMBEDDED_SUPERLOOP_PROJECT_ROOT}/modules/${test}/tests)
115115
endif()
116116
endforeach()
117-
118-
# This should be added *after* all the modules, boards and applications
119-
add_doxygen_target()

CMakePresets.json

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -171,28 +171,16 @@
171171
{
172172
"name": "build-native-gcc",
173173
"inherits": "build-common",
174-
"targets": [
175-
"all",
176-
"docs"
177-
],
178174
"configurePreset": "native-gcc"
179175
},
180176
{
181177
"name": "build-native-clang",
182178
"inherits": "build-common",
183-
"targets": [
184-
"all",
185-
"docs"
186-
],
187179
"configurePreset": "native-clang"
188180
},
189181
{
190182
"name": "build-native-llvm",
191183
"inherits": "build-common",
192-
"targets": [
193-
"all",
194-
"docs"
195-
],
196184
"configurePreset": "native-llvm"
197185
}
198186
],

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -271,13 +271,13 @@ These should be moved to the chip specific vendor area for per-mcu builds.
271271
272272
Currently it's challenging to get the MPU related entries for size/log2(size) and start/end address to resolve correctly. Some of those are still defined as `std::uintptr_t` types with fixed 32 addresses at the moment. This will be removed in the future.
273273
274-
Additionally one of the only allowed macros are the `LINKER_SYMBOL` macros which are used to help define link-time values in `<linker.hpp>` like `__vector_table_start` and others. These are used the MPU code to help narrow the range of specific regions to exactly where they are in memory and in the startup code to help zero out `__ccm_beg` to `__ccm_end` and other ranges. Ultimately these just need to be byte pointers but in order to use them in low level code without casting oddly the macro does this:
274+
Additionally one of the only allowed macros are the `LINKER_SYMBOL` macros which are used to help define link-time values in `<linker.hpp>` like `__vector_table_start` and others. These are used the MPU code to help narrow the range of specific regions to exactly where they are in memory and in the startup code to help zero out `__ccm_start` to `__ccm_limit` and other ranges. Ultimately these just need to be byte pointers but in order to use them in low level code without casting oddly the macro does this:
275275
276276
```c++
277277
#define LINKER_TYPED_SYMBOL(symbol, type) extern type symbol[]
278278
#define LINKER_SYMBOL(symbol) LINKER_TYPED_SYMBOL(symbol, std::uint32_t)
279-
LINKER_SYMBOL(__sram_beg);
280-
LINKER_SYMBOL(__sram_end);
279+
LINKER_SYMBOL(__sram_start);
280+
LINKER_SYMBOL(__sram_limit);
281281
```
282282
283283
Sadly we also have to communicate _sizes_ this way too from the Linker and that's done using the _same_ mechanism.

applications/test-debug/source/DebugTest.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ DebugTest::DebugTest()
1616
bool DebugTest::Execute() {
1717
if (one_time_) {
1818
uint32_t frequency = cortex::semihosting::TickFrequency();
19-
jarnax::print("Host Tick Freq=%lu\r\n", frequency);
19+
jarnax::print("Host Tick Freq=%" PRIu32 "\r\n", frequency);
2020
auto clock = cortex::semihosting::Clock();
2121
jarnax::print("Host Clock=%f\r\n", static_cast<double>(clock.value()));
2222
auto secs = cortex::semihosting::Time();

applications/test-i2c/source/I2CTest.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,17 +53,17 @@ core::Status I2CTest::TransactionCycle(std::uint8_t command) {
5353
assertion(not i2c_buffer_.IsEmpty());
5454
if (i2c_transaction_.address.small.read == 1) {
5555
jarnax::print(
56-
"I2C Transaction buffer size: %zu received desired: %u, actual %u\r\n",
56+
"I2C Transaction buffer size: %" PRIz " received desired: %" PRIz ", actual %" PRIz "\r\n",
5757
i2c_buffer_.capacity(),
5858
i2c_transaction_.desired_count,
5959
i2c_transaction_.actual_count
6060
);
6161
auto read_span = i2c_buffer_.as_span().subspan(0, i2c_transaction_.actual_count);
6262
for (std::size_t i = 0; i < read_span.count(); i++) {
63-
jarnax::print("Buffer[%zu]: %02X\r\n", i, read_span[i]);
63+
jarnax::print("Buffer[%" PRIz "]: %02X\r\n", i, read_span[i]);
6464
}
6565
} else {
66-
// jarnax::print("I2C Transaction buffer size: %zu wrote %u\r\n", i2c_buffer_.count(), i2c_transaction_.actual_count);
66+
// jarnax::print("I2C Transaction buffer size: %" PRIz " wrote %u\r\n", i2c_buffer_.count(), i2c_transaction_.actual_count);
6767
}
6868
// this will move it back to the Uninitialized state
6969
core::Status status = i2c_transaction_.GetStatus();

applications/test-spi/include/SPITest.hpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@
1010
#include "jarnax/Loopable.hpp"
1111
#include "jarnax/Ticker.hpp"
1212
#include "jarnax/Timer.hpp"
13-
#include "jarnax/i2c/Driver.hpp"
14-
#include "ssd1306.hpp"
1513

1614
using jarnax::Loopable;
1715
using jarnax::LoopInfo;

applications/test-spi/source/SPITest.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ core::Status SPITest::TransactionCycle(std::uint8_t address, size_t count) {
6464
assertion(not spi_buffer_.IsEmpty());
6565
if (spi_transaction_.received_size > 0) {
6666
jarnax::print(
67-
"SPI Transaction buffer size: %zu send/t: %u/%u receive/d %u/%u\r\n",
67+
"SPI Transaction buffer size: %" PRIz " send/t: %" PRIz " / %" PRIz " receive/d %" PRIz " / %" PRIz "\r\n",
6868
spi_buffer_.capacity(),
6969
spi_transaction_.send_size,
7070
spi_transaction_.sent_size,
@@ -73,10 +73,10 @@ core::Status SPITest::TransactionCycle(std::uint8_t address, size_t count) {
7373
);
7474
auto read_span = spi_buffer_.as_span().subspan(0, spi_transaction_.sent_size + spi_transaction_.received_size);
7575
for (std::size_t i = 0; i < read_span.count(); i++) {
76-
jarnax::print("Buffer[%zu]: 0x%x\r\n", i, read_span[i]);
76+
jarnax::print("Buffer[%" PRIz "]: 0x%x\r\n", i, read_span[i]);
7777
}
7878
} else {
79-
// jarnax::print("spi Transaction buffer size: %zu wrote %u\r\n", spi_buffer_.count(), spi_transaction_.actual_count);
79+
// jarnax::print("spi Transaction buffer size: %" PRIz " wrote %" PRIz "\r\n", spi_buffer_.count(), spi_transaction_.actual_count);
8080
}
8181
// this will move it back to the Uninitialized state
8282
core::Status status = spi_transaction_.GetStatus();

0 commit comments

Comments
 (0)