cancel
Showing results for 
Search instead for 
Did you mean: 

CubeMX and C++

EStei.3
Associate III

Hi all,
once again I stumble across CubeMX being so inflexible in its code generation.
I use CubeMX to generate initialization code but I'm also using C++ and that's where CubeMX has major downsides.
For example it is still not possible to tell CubeMX to generate the MX_XXX_Init function calls anywhere but in main.
Further more an option to add a simple pointer to all HandleTypeDefs which is free to use would help a lot.
From my experience STM HAL drivers are actually working pretty much ok but sometimes the are based on assumptions that a either flawed or don't apply in the project context.
Hence you have to write your own driver.
Just a simple pointer so I can pass additional information together with the handle struct would make life much easier especially when trying to implement a driver as C++ class.

To any ST employee reading this:
Are there any plans to make CubeMX more flexible?

To all users of CubeMX:
What would you really like ST to change in CubeMX?

BR

3 REPLIES 3

@EStei.3 wrote:

 it is still not possible to tell CubeMX to generate the MX_XXX_Init function calls anywhere but in main.


But you can tell it not to generate them at all.

Edit: https://community.st.com/t5/stm32cubemx-mcus/how-to-have-cubemx-configure-a-peripheral-but-not-enable-it/td-p/761643 

 


@EStei.3 wrote:

Just a simple pointer so I can pass additional information together with the handle struct would make life much easier especially when trying to implement a driver as C++ class.


Recent discussion about that:

https://community.st.com/t5/stm32-mcus-embedded-software/user-defined-context-in-hal-callbacks/m-p/783093

 


@Andrew Neil wrote:
But you can tell it not to generate them at all.

Yeah, both options are not really useful.

 


@Andrew Neil wrote:
Recent discussion about that:
https://community.st.com/t5/stm32-mcus-embedded-software/user-defined-context-in-hal-callbacks/m-p/783093

 

 Thanks, couldn't find that one!

Pavel A.
Evangelist III

>To all users of CubeMX:
>What would you really like ST to change in CubeMX?

Power it up with some AI engine already ))) And a cloud based workspace, like on Github, so we won't struggle with linux versions and updates.  But this isn't going to be free?

 so inflexible

Other words for it are stable, classic, minimalist, old & proven... 

Are there any plans to make CubeMX more flexible?

Just note that any added option will require more testing. Willing to sponsor this?