AnsweredAssumed Answered

STM32F1, CubeMX and FreeRTOS: undefined reference to pxCurrentTCB and vTaskSwitchContext

Question asked by borgonovo.ivan_sergi on Mar 29, 2016
Latest reply on Apr 12, 2016 by borgonovo.ivan_sergi
Hi,

I'm trying to build an "empty" project generated by CubeMX using FreeRTOS and gcc for STM32F103xB.

I'm using the latest CubeMX (4.14.0) and latest HAL (1.3.1).

I've successfully built projects using CubeMX, HAL, gcc that work, I just get errors when I'm trying to use FreeRTOS.

I've added to the include path (-I)

FreeRTOS/Source/CMSIS_RTOS
FreeRTOS/Source/include
FreeRTOS/Source/porteble/GCC/ARM_CM3

I've included in the build:
FreeRTOS/
FreeRTOS/Source
FreeRTOS/Source/CMSIS_RTOS
FreeRTOS/Source/portable/GCC/ARM_CM3
FreeRTOS/Source/portable/MemMang/heap_4.c

+ all the other stuff needed to make a CubeMX/HAL project works.

but I get

undefined reference to `pxCurrentTCB'    port.c

undefined reference to `vTaskSwitchContext'    port.c

BTW if anyone from ST is listening it would be nice if you didn't include in the main.c template the cmsis_rtos stuff so one would be free to chose to use FreeRTOS directly or not without having to edit main.c every time.

Outcomes