2018-12-06 05:02 AM
Hello
An F4 project with a timer in output compare mode generates in main.c a call to HAL_TIM_MspPostInit(&htim1);
This function is implemented in stm32f4xx_hal_msp.c but is declared in main.c file.
If I change main.c to main.cpp. It does not link.
My opinion is that CubeMx should generate a stm32f4xx_hal_msp.h file containing the public functions declarations within an extern "C". Something like this :
#ifndef STM32F4XX_HAL_MSP_H_
#define STM32F4XX_HAL_MSP_H_
#ifdef __cplusplus
extern "C" {
#endif
void HAL_TIM_MspPostInit(TIM_HandleTypeDef* htim);
#ifdef __cplusplus
}
#endif
#endif /* STM32F4XX_HAL_MSP_H_ */
The main.c file should include it.
My 2 cents.
Julien
2018-12-07 05:28 AM
Hi @Julien D_Oevillers ,
Your feedback is forwarded internally. We will answer you ASAP.
Khouloud.
2018-12-07 06:58 AM
Hi @Julien D_Oevillers
Thanks for the Feedback, we will take your request into consideration in a next release