Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add CMake build files #101

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Add CMake build files #101

wants to merge 2 commits into from

Conversation

rhgndf
Copy link
Contributor

@rhgndf rhgndf commented Jan 9, 2025

Allows building with cmake instead, so there is no need to install STM32CubeIDE to build the project. The CMakeLists.txt are generated from creating a STM32 project in STMCube32IDE.

Build commands:

cmake -DCMAKE_TOOLCHAIN_FILE=cubeide-gcc.cmake  -S ./ -B Release -G"Unix Makefiles" -DCMAKE_BUILD_TYPE=Release
make -C Release VERBOSE=1 -j $(nproc)

Replace Release with Debug for debug build.

@das-Iro
Copy link

das-Iro commented Jan 9, 2025

I have tested compiling on macOS 15.2 & Archlinux
Release works 👍 (flashed file from macOS compile and tested audio input to verify function)
Debug seems broken in linking step (both systems, same error)

  • undefined reference to `_sbrk'

Side node to -j will spawn an unlimited amount of jobs which may result in out of memory situations, I recommend -j 8

@skuep
Copy link
Owner

skuep commented Jan 9, 2025

I don't really use the Debug build, but you're right, it shouldn't be broken.

Thanks for the contribution, will take me some time to look at it

@das-Iro
Copy link

das-Iro commented Jan 9, 2025

I don't really use the Debug build, but you're right, it shouldn't be broken.

Neither do I so no hurry.

@rhgndf
Copy link
Contributor Author

rhgndf commented Jan 9, 2025

Same error with Release builds, but it was fixed with:

  • Removing ${RUNTIME_LIBRARY} from CMAKE_C_FLAGS
  • Removing ${RUNTIME_LIBRARY_SYSCALLS} from CMAKE_EXE_LINKER_FLAGS

@rhgndf
Copy link
Contributor Author

rhgndf commented Jan 10, 2025

Side node to -j will spawn an unlimited amount of jobs which may result in out of memory situations, I recommend -j 8

Fixed!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants