7 years, 1 month ago.

mbed with stm32cubemx, HAL_TIM_MspPostInit, multiply defined or undefined symbol

I am trying to use some code generated by cubemx when I use the init code generated in mbed main I get an undefined symbol for void HAL_TIM_MspPostInit(TIM_HandleTypeDef *htim);

This is declared at the top of the generated cubemx main.c file and is called by one of the inits but is implemented in stm32f7xx_hal_msp.c . There isn't an include for this file in cubemx main. When I try to do the same in mbed main I get an undefined symbol. When I add an include for stm32f7xx_hal_msp.c I get a multiply defined error.

How do I use void HAL_TIM_MspPostInit(TIM_HandleTypeDef *htim); ?

1 Answer

7 years ago.

David,

check the differences between the origina stm32f4xx_hal_conf.h file and the one you created. Many #define's are commented by default in the smt32cube generated file. The file used by mbed, has no commented lines.

Before updating mbed-dev files I use a merging tool (i.e. WinMerge in Windows) and check the differences between files before updating them.

hope it helped.

This was a multiple post due to my misbehaving mouse. The other thread answered it. https://developer.mbed.org/questions/77535/mbed-with-stm32cubemx-HAL_TIM_MspPostIni/

If you know anything about serial on stm32 and why some st boards don't reinitialise the uart correctly after changing baud etc. please look at this post about MODSERIAL https://developer.mbed.org/questions/70478/Porting-MODSERIAL-to-Nucleo-L476RG/#answer12480

posted by David Fisher 04 May 2017