Skip to main content
stcubeteam1
Associate
September 27, 2018
Question

STM32CubeMX for STM32: Is it possible to use/set a Prefix or namespace for all functions/global variables generated by STMCubeMX C-Code Generator?

  • September 27, 2018
  • 4 replies
  • 1177 views

Reason for the question:

We want to generate two different hardware settings (CubeMX projects) into one software program running on a STM32 controller. Then at startup, the controller finds out, which HW configuration it has to use and uses just one of the two available ones to startup/init the system peripherals/hardware.

Thanks for any help.

This topic has been closed for replies.

4 replies

Pavel A.
Super User
September 27, 2018

Make two separate projects, burn them into separate flash areas + small bootloader which will probe hardware and select one variant ?

--pa

Tesla DeLorean
Guru
September 27, 2018

Sounds like a rats nest of a problem better solved by some careful merging.

I'd rather the engineers focus on generating solid test coded.

Tips, Buy me a coffee, or three.. PayPal VenmoUp vote any posts that you find helpful, it shows what's working..
stcubeteam1
Associate
September 30, 2018

Hi Pawel

thanks for the idea. We will look into this in more detail.

We thought there might be a solution using the templates in STM32CubeMX, but it seems that there is no clean solution from the tool itself.

Thanks again.

DHoov.1
Visitor II
February 12, 2023

It's surprising that this is not possible. I have a similar case...a library with a default CubeMX configuration built-in, with the desire to be able to override this by adding a CubeMX project in the application directory.