April 25, 2018 at 19:54 #20789
I’m working on an STM32 application with a bootloader section. The bootloader and the main application are two projects within the same solution. The bootloader project’s output binary is included as an embedded binary file within the main application’s project. Linker scripts allocate the bootloader and main application to respective flash areas. Jump to main application and remapping vector table is implemented.
None of the above is a problem! It all works fine. The problem is within the build process.
If I build the bootloader project first, and then build the main application, the build completes and a binary file containing the bootloader + main application is generated. If I change something in the bootloader, due to setting the bootloader project as a project dependency of the main application project, it will even build the bootloader first. And I’ve verify that any changes made to the bootloader and automatically rebuilt will be included in the current build; it’s not using an older version of the bootloader binary.
The problem is that when rebuilding the project, it appears to not generate the binary file for the first-built project (bootloader) before starting compilation of the second project (main application). Since the rebuild process will delete the binary files first, the main application build will halt with a linker error before even starting, since the included binary file doesn’t exist yet.
Is there a way to make sure that the compilation of the first project is completely done (with binary file generated) before moving to the build of the second project?April 28, 2018 at 04:04 #20828
Yes, please try referencing the bootloader project via Project Dependencies (not the regular Project References). This should affect the project build order without changing any actual build-related flags.May 16, 2018 at 21:01 #20936
The Project Dependencies was already correctly set up. The bootloader project is already built before the application project. The problem is that the bootloader binary file is not created before compilation of the application project, so the application project build fails.
Stating it again: Project Dependencies is correctly configured, the problem is that the second project starts building before the bootloader binary is created.
Our workaround for the past few months has been to manually build each project in order. This allows the bootloader binary to exist at the time of the main application compile.May 17, 2018 at 20:23 #20944
OK, no problem, if we could reproduce this, we should be able to fix it or suggest a better workaround. Please let us know if you are using MSBuild or GNU Make (if you could send us a sample project demonstrating the issue, it would be the best).
You must be logged in to reply to this topic.