2020-04-03 12:53 AM
I have a project which uses multiple identical boards and needs them to have slightly different firmware. So I thought that having a folder for each firmware with its own main function in one project will be efficient because all boards will use the same libraries and I won't need to maintain multiple projects at one time.
So is it possible to set up a project with multiple main functions in Cube IDE? If yes, how I can do it?
Solved! Go to Solution.
2020-04-03 03:02 AM
You can create multiple configurations under Project / Build Configurations / Manage. Each configuration has its own set of project settings, so you can e.g. define preprocessor symbols to activate some #ifdef in the code, or exclude entire files or directories from build.
Another way is to create sub-projects within a project. Create the main project without a target, new projects for each configuration inside the main project folder, and additional directories for common code. CubeMX uses this approach to manage dual core MCUs, you might want to create a dummy project for a STM32H745 to see how does it look like.
2020-04-03 03:02 AM
You can create multiple configurations under Project / Build Configurations / Manage. Each configuration has its own set of project settings, so you can e.g. define preprocessor symbols to activate some #ifdef in the code, or exclude entire files or directories from build.
Another way is to create sub-projects within a project. Create the main project without a target, new projects for each configuration inside the main project folder, and additional directories for common code. CubeMX uses this approach to manage dual core MCUs, you might want to create a dummy project for a STM32H745 to see how does it look like.
2020-04-03 04:00 AM
Thanks a lot, I tried the first method, it is working as I desired.