I come from a world of Cmake and wanted to give PlatformIO a try, so please bare with me. I want to port over my current build setup and am pretty much stuck as neither SCons nor the PlatformIO magic is familiar to me.
My Cmake build currently does something like this:
- Build bootloader binary from source using bootloader linker-file
- Generate a source file which embeds the bootloader binary into a dedicated memory region and add it to the application target sources
- Build application binary from source using application linker-file
This setup should be as reusable as possible, so I was hoping to somehow get it working as a library. I figured out how to build the application using my own linker file, but I’m stuck at adding a custom build target for the bootloader executable. I’m pretty sure the advanced scripting feature can be used for that, but I don’t know how.
How would you setup a build like this?