cancel
Showing results for 
Search instead for 
Did you mean: 

STM32CubeMX generated MX_TIMx_Init() functions

R Piacenzia
Associate III

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.

1 REPLY 1
alister
Lead

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