Skip to main content
R Piacenzia
Associate II
January 28, 2019
Question

STM32CubeMX generated MX_TIMx_Init() functions

  • January 28, 2019
  • 1 reply
  • 1116 views

Hi.

I have the latest STM32CubeMX with a STM32L433 project.

I have selected in CubeMX Advanced Settings to use "LL" drivers for TIM1 & TIM2, and the option to "Not Generated Function Call" for these timers.

As expected, In the auto generated main() there is no call to functions "MX_TIM1_Init()" and "MX_TIM2_Init()", but the functions are still automatically being defined in main.c. I can manually remove the init functions, but they are added back.

How can CubeMX be configured to not include these function definitions?

Thanks.

This topic has been closed for replies.

1 reply

alister
Senior III
February 4, 2019

They'd be convenient if you wanted them, and they'd be dead-code and eliminated if you don't.

Check your linker map file. If they're not there, they're being eliminated already and you problem's solved. If not, enable dead-code elimination in your linker settings.

Regards

Alister