multiple definition of `SysTick_Handler'
Hello,
I created a new project in STM32CubeIDE for my STM32MP157A by using STM32CubeMX. In it I enabled UART and FreeRTOS on CMSIS-RTOSv2 and that's all. I use the auto generated code.
Then I wanted to use TraceAlyzer on top of FreeRTOS however, upon including
#include "trcRecorder.h"In the FreeRTOSConfig.h I got a strange error:
/Middlewares/Third_Party/FreeRTOS/Source/CMSIS_RTOS_V2/cmsis_os2.c:154: multiple definition of `SysTick_Handler'; ./Core/Src/stm32mp1xx_it.o:
./CM4/Core/Src/stm32mp1xx_it.c:160: first defined hereThe SysTick_Handler is defined in both files, here are the implementations if it may help:
in cmsis_os2.c :
/*
SysTick handler implementation that also clears overflow flag.
*/
void SysTick_Handler (void) {
/* Clear overflow flag */
SysTick->CTRL;
if (xTaskGetSchedulerState() != taskSCHEDULER_NOT_STARTED) {
/* Call tick handler */
xPortSysTickHandler();
}
}
#endif /* SysTick */In stm32mp1xx_it.c :
/**
* @brief This function handles System tick timer.
*/
void SysTick_Handler(void)
{
/* USER CODE BEGIN SysTick_IRQn 0 */
/* USER CODE END SysTick_IRQn 0 */
HAL_IncTick();
#if (INCLUDE_xTaskGetSchedulerState == 1 )
if (xTaskGetSchedulerState() != taskSCHEDULER_NOT_STARTED)
{
#endif /* INCLUDE_xTaskGetSchedulerState */
xPortSysTickHandler();
#if (INCLUDE_xTaskGetSchedulerState == 1 )
}
#endif /* INCLUDE_xTaskGetSchedulerState */
/* USER CODE BEGIN SysTick_IRQn 1 */
/* USER CODE END SysTick_IRQn 1 */
}Which one is the correct implementation? Do I lack a configuration in STM32CubeMX ?
It's strange that the error arise when I include the trcRecorder.h file.
Thank you for your help.
Best regards
