feat: ceedling cross compile

This commit is contained in:
cscherr 2025-07-11 10:39:53 +02:00
parent e8d26dd1a4
commit bad5730a8d
Signed by: cscherrNT
GPG key ID: 8E2B45BC51A27EA7
2 changed files with 37 additions and 16 deletions

View file

@ -3,3 +3,18 @@
This subproject contains all C Code for the benchmarking. It is built with
[ceedling](https://www.throwtheswitch.org/ceedling), a more modern build tool
for C projects that also integrates well with the Unity framework.
## Compiler
To compile for STM32, you need to crosscompile
```
# apt install binutils-arm-none-eabi gcc-arm-none-eabi
```
Then, use your tool with an `arm-none-eabi-` prefix: `arm-none-eabi-gcc`. This
project has been configured to use `arm-none-eabi-gcc` to compile modules and to
"link" the object files into a static library with `arm-none-eabi-ar`.
The unit tests will be compiled with `gcc` to be ran on the host computer, not
on the STM32.

View file

@ -340,7 +340,7 @@
# TOOLCHAIN CONFIGURATION
################################################################
#:tools:
:tools:
# Ceedling defaults to using gcc for compiling, linking, etc.
# As [:tools] is blank, gcc will be used (so long as it's in your system path)
# See documentation to configure a given toolchain for use
@ -380,20 +380,26 @@
# :arguments: []
# :name:
# :optional: FALSE
# :release_compiler:
# :executable:
# :arguments: []
# :name:
# :optional: FALSE
# :release_linker:
# :executable:
# :arguments: []
# :name:
# :optional: FALSE
:release_compiler:
:executable: arm-none-eabi-gcc
:arguments:
- "-g"
- "-Wall"
- "-c"
- "${1}"
- "-o"
- "${2}"
:optional: FALSE
:release_linker:
:executable: arm-none-eabi-ar
:arguments:
- "-rcs"
- "${2}"
- "${1}"
:optional: FALSE
# :release_assembler:
# :executable:
# :arguments: []
# :name:
# :executable: arm-none-eabi-as
# :arguments: ["$@"]
# :optional: FALSE
# :release_dependencies_generator:
# :executable: