How to support multiple STM targets in a project
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2019-08-06 04:57 PM
Hello,
From time to time it is good to be able to target multiple STM devices for a project. In our case we are evaluating a number of chipsets and have eval boards for the various chips. What I want to do is to be able to generate a project which will build for each of the targets.
Firstly I cannot figure out how to change the target MCU from the project settings dialog. It seems that the MCU field is not editable. How can I change the target once the project has been generated? (Or do I need to regenerate from the .ioc file each time?)
Thank you,
Michael Uman
- Labels:
-
STM32CubeIDE
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2019-08-07 01:46 AM
For now you can't change MCU once a project has been generated.
We're working on a solution for this that will support multiple devices for a project but it has not yet been released.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2019-08-07 09:50 AM
Hello Markus,
Thank you for the prompt reply. Im looking forward to seeing that feature in future releases of the STM32CubeIDE tool.
Michael Uman
Lead Software Engineer
Wunder-Bar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-08-12 06:19 AM
Do you already have any feedback about this feature? I was searching to have the same code, but for two diferrent MCU, that is possible?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-10-25 01:30 PM
Up!
I need to build my project for different processors (different memory sizes, IO).
Here is a thread about changing the target from the IDEs:
which referts to https://www.st.com/resource/en/user_manual/dm00104712-stm32cubemx-for-stm32-configuration-and-initialization-c-code-generation-stmicroelectronics.pdf , page 287 .
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-10-25 02:49 PM
@Markus GIRDLAND​ Perhaps, a way to merge several CubeIDE projects for different MCUs into one with several configurations?
Assign target MCU per configuration, for debugging ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-10-26 04:18 AM
If it would be possible from CubeMX point of view it's probably something we could implement in CubeIDE as well. We are relying heavily on the CubeMX part in CubeIDE for all project generation. For CDT projects, for example, we have more control and it's possible to change target.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-10-26 01:58 PM
What I imagine is like, you create two CubeMX projects (or somehow clone a project for a different target).
Then generate a CDT project for each [with code].
Then somehow merge these CDT projects so that each source project becomes a configuration in the merged project.
Just thinking aloud...
I have a real customer with such Eclipse project: several configurations for various MCUs, and I'm adding a config for STM32 manually.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-10-26 03:49 PM
Supported in Eclipse from day dot. Nothing to do with STM32CubeIDE.
- Create projects for each product and processor
- Create build configurations for each way you build the project
- Organise your source code apart from the project directories, and able to be built many ways
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-10-27 03:25 AM
CubeMX does allow switching MCU to a certain extent, assuming you run the tool stand-alone. Inside CubeIDE this is not possible. Read more about what is possible and the limitations here:
https://community.st.com/s/article/mcu1-to-mcu2-migration-option-within-stm32cubeide
But as @Markus GIRDLAND​ and @alister​ points out, the CDT projects which are native Eclipse/CDT projects, does not care about MCU selection. CDT projects can be seen as MCU/core agnostic.
In the CDT projects each build configuration can target a different MCU. This is what you are looking for (use CubeIDe 1.7.0 and later for some bug fixes).
The issue however is that these projects are without ioc-file. Not managed by CubeMX, and completely empty (you don't get startup code, linker script, HAL, not even empty main.c). You certainly have to copy some files from STM32Cube firmware packages and/or your legacy projects to turn a CDT project into something useful.
How can we combine the best of two worlds, that is: CubeMX code generation + CDT project individual core per build config support?
- Let your real production project be a CDT project allowing to build/debug artifacts targeting different MCUs.
- Use the CubeMX generated projects mainly as sandboxes to play with device configurations and gain confidence.
- Then manually copy across files and build settings from CubeMX project to the respective build configuration of the CDT projects as your development progresses.
- We could imagine also creating links for certain resources from the CubeMX projects into the corresponding build configuration of the CDT project!
- But I think there is a high risk that CubeIDE would get out of sync with the file system when CubeMX deletes resources as a result of disabling some middleware or similar use case...
Would be highly interesting to get customer feedback as to how they manage building projects targeting multiple MCUs using CubeMX and/or CubeIDE.
I am pretty sure there are creative solutions out there... :)
![](/skins/images/9117C6B72C9F598A212AA17633C1CC28/responsive_peak/images/icon_anonymous_message.png)