How to organise nested projects with shared code and binary image encapsulation ?
Hi, I have a challenge about IDE configuration and build steps to make a clean new project.
The context is the following : I have a device including 2 micro-controller, 1x STM32F303 and 1x STM32F101. The F303 communicates with the serial bootloader input of the F101 through an isolation barrier as safety requirement. The goal is to bootload the F303 using STM32Cubeprogrammer and let it update the F101 at next power on.
What I need is to create a project that allows to debug both uC (ideally at the same time). So far its easy. But I also need to include the image of the F101 uC inside the image of the F303 uC to allow the update mechanism mentionned above. This should ideally by transparent for the devs once configured to avoid human errors : building the F303 project should trigger a build of the F101 as pre-build step before building the F303 image that include it.
I feel like I need to have either a master project including both or a nested project. Attached the structure I obtained trying both options. Arrows represent folder links to the shared part of the code. Any advice on one or another is welcome.
My main question so far is :
1) How can I configure the main project to build the nested one(s) ? I know about prebuild steps but would like to make sure of what command line I should use to guarantee the same build as clicking on "Build" manually, taking nested project(s) properties and configuration into account.
Follow up question would be :
2) How should I then embed the subproject binary image in the main one ? Should I have a look in the linker syntax or is there an easier way ?
Thanks a lot for your insights. ;)