Closed antoinealb closed 4 years ago
Friendly ping @SyrianSpock 👼
Do we plan to merge soon?
Nice, It builds! Does it run on hardware?
Nice, It builds! Does it run on hardware?
It does ! At least tested for the uwb-beacon. Bootloader integration is not yet ported over though.
So, what's the plan? Are we merging this?
Well CI is failing, and only one board is ported to the new build system, so I guess the answer is "not yet".
Current status:
Ok, so the project is still alive :+1:
Yes, it got rebased this weekend, and many commits are still in my home laptop.
I started with can-io in a branch (sould probably wok on this branch though). There I added bootloader config support (without touching the bootloader repo). I’m struggling with version.c generation and linker issues with some missing syscalls.
I can probably write version.c generation. I also had some issues with linker and syscalls but i don't remember how I fixed those. Fortunately, I will have to do it again for master-firmware.
@nuft I included version.c generation on this branch. Please push to another branch as I will often force push here.
@nuft you might want to link lib/chibios-syscall/newlib_syscalls.c in your build, helped a lot for me.
@antoinealb is it possible that you forgot to commit cmake/master.cmake? Or where do you define MCU, board name, compiler flags, etc for master-firmware?
@antoinealb is it possible that you forgot to commit cmake/master.cmake? Or where do you define MCU, board name, compiler flags, etc for master-firmware?
Yes its likely. You can use uwb-beacon.cmake as reference.
you might want to link lib/chibios-syscall/newlib_syscalls.c in your build, helped a lot for me.
yes, it helped. CAN-IO builds now but flash section is overflown. Need to investigate why the binary size blew up.
I managed to reduce the size, however I'm still 20k behind the previous build size.
I also observed that the chibios-syscalls library does not overwrite the default implementation (for example operator delete()
, which ends up calling the newlib implementation.)
This could have something to do with the library order during linking but I'm not sure.
My temporary workaround was to build the sources directly without using the library archive.
Can you try playing with visibility settings ? https://stackoverflow.com/questions/17080869/what-is-the-cmake-equivalent-to-gcc-fvisibility-hidden-when-controlling-the-e
I also built the sources directly for chibios-syscalls, which sucks. Maybe we can use an INTERFACE library for that, will need to dig down in it.
Are we close to a mergeable state? I worry that soon, the code will change a lot and make you redo this PR work
Already part of #273
This is the current status of my work on the CMake integration. It is not really ready to be used, but I wanted to get feedback as early as possible. For now only the UWB beacon is working, and I am expecting to fix the others pretty soon.
I encourage everyone to try it, and see if you like the CMake workflow.
@SyrianSpock, I think you are the most experienced with CMake, so I would be happy to have a review from you on the cmake infra itself.
Summary of the changes:
include
directory for each library. For example the includes for the PID filters live underlib/pid/include/pid
. This avoids having accidental dependencies: it is not impossible to include a header from a non-linked library.Things missing (probably not exhaustive):
Advantages of using cmake:
CMAKE_EXPORT_COMPILE_COMMANDS
to generate Clang's compile command database. This in turn can be used for smart autocompletes, linters, etc.packager
that can be forgotten to run.