cancel
Showing results for 
Search instead for 
Did you mean: 

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

Posted on March 29, 2016 at 19:33

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.

#stm32f1 #cubemx #freertos #gcc
10 REPLIES 10
Posted on April 12, 2016 at 11:12

[DETAILS]

The assembly and nm, ar section:

https://gcc.gnu.org/wiki/LinkTimeOptimizationFAQ

https://gcc.gnu.org/gcc-4.9/changes.html