cancel
Showing results for 
Search instead for 
Did you mean: 

How to support multiple controllers in one project?

TheBigBelarusian
Associate II

Hi all. I have a project in Cubeide for an STM32F429 controller. And at the moment I need to add the existing code for STM32F407. I don't want to create a separate project, but I need to add another controller to the current project and just select the desired configuration. Can you please tell me the best way to organize this moment?

At the moment I'm looking at the configuration side. For example create configurations STM32407_release/debug and STM32429_release/debug

1 ACCEPTED SOLUTION

Accepted Solutions
Pavel A.
Evangelist III

In Eclipse (CubeIDE) indeed you can make several project configurations with very different settings, including different MCUs (with all related defines and includes).

But Cube cannot generate this automatically. You'll have to create two separate projects and combine them manually.

(A pro tip: if something looks like too much hassle, hire someone else to do it ; )

View solution in original post

5 REPLIES 5
Pavel A.
Evangelist III

In Eclipse (CubeIDE) indeed you can make several project configurations with very different settings, including different MCUs (with all related defines and includes).

But Cube cannot generate this automatically. You'll have to create two separate projects and combine them manually.

(A pro tip: if something looks like too much hassle, hire someone else to do it ; )

TheBigBelarusian
Associate II

Thank you very much for your answer. All the same, I stopped at the configurations. Everything turned out to be quite simple. However, not without nuances.

The fact is that if you create a project based on cubeMX, then it is impossible to switch the controller, but if you create a standard c / c ++ project, then everything turned out without problems, the main thing is to set the paths correctly and add all the files.

Keep in mind that the crucial function of embedded IDE is the debugger. Editing text files and (cross) compiling can be done with anything. Awareness of the MCU model in CubeIDE project settings is mainly needed to automate the debugger setup. This distinguishes a "MCU" project from "standard C/C++" project.

TheBigBelarusian
Associate II

Yes, you are absolutely right, that's why I also had to set up profiles for the debugger (where you can set up paths for elf files, as well as select the desired configuration) the only thing is that you also need to add these profiles to the DEBUG FAVORITES section so that the debugger asks which profile to use

Yes, you are absolutely right, that's why I also had to set up profiles for the debugger (where you can set up paths for elf files, as well as select the desired configuration) the only thing is that you also need to add these profiles to the DEBUG FAVORITES section so that the debugger asks which profile to use