cancel
Showing results for 
Search instead for 
Did you mean: 

How to have CubeMX configure a peripheral but NOT enable it?

I think it's a common scenario to have (at least some) peripherals which are not enabled until needed?

Or, perhaps, just configured at start-up, but not enabled until actually needed.

eg, an RTC alarm.

But CubeMX doesn't seem to support this:

  • If you don't enable the peripheral/feature, it won't let you configure it;
  • If you do enable it, it will be enabled at startup - no option to leave it til "later"

Or have I missed something/?


(none of the available tags seems appropriate, so 'Bug Report' chosen as least inappropriate. I'm using F0, but this seems to be general Cube MX behaviour - not specific to any series)

1 ACCEPTED SOLUTION

Accepted Solutions
KnarfB
Principal III

STM2CubeMX Project Manager Advanced Settings has "Do not generate function call" options for the various _Init functions. 

hth

KnarfB

 

View solution in original post

3 REPLIES 3
Imen.D
ST Employee

Hello @Andrew Neil ,

Thank you for rising this up.

I escalated your request internally to take a closer look at the problem (via Internal ticket number: 200359).

When your question is answered, please close this topic by clicking "Accept as Solution".
Thanks
Imen
KnarfB
Principal III

STM2CubeMX Project Manager Advanced Settings has "Do not generate function call" options for the various _Init functions. 

hth

KnarfB

 

Ah yes - that's it!

AndrewNeil_0-1736864917888.png

 

Although, in the specific case of the RTC alarm, it still just creates one MX_RTC_Init function - whereas I'd have thought it more likely that you'd want to configure and start the RTC itself separately from setting an alarm?

But that's a different question ...

 

EDIT: New question here: https://community.st.com/t5/stm32cubemx-mcus/configure-rtc-alarm-separately-from-rtc/m-p/761701