2024-06-26 06:24 AM
Hi guys,
I'm stuck in the following issue. In my STM32 project I'm using FreeRTOS which I have enabled using CubeMX. In my project tree I have the following files:
At the same time I have included the following paths:
When I check the file with the error and try to find the referenece the header file is found and opened normally. All the .c files are in place as you can see.
Do you know what could be the issue?
2024-06-26 06:32 AM
"undefined reference" is a linker error.
It means that you have omitted to provide a definition of that function - either as source code, or as a pre-built binary library.
Probably, you have #included a header which just declares that function (ie, just provides a prototype) - hence the compiler is happy - but haven't added the necessary source or pre-built binary library to your project - so the link fails.
@Lyap94 wrote:All the .c files are in place as you can see.
So which of them contains a definition of osDelay and/or osThreadSuspend and/or osSemaphoreAcquire ?
2024-06-26 06:35 AM
Hi Andrew Neil,
Thanks for the fast reply!
The file cmsis_os2.c includes the definition of all the functions that seem to be undefined. It's in Middlewares/Third_Party/FreeRTOS/Source/CMSIS_RTOS_V2.
2024-06-26 06:40 AM
@Lyap94 wrote:The file cmsis_os2.c includes the definition of all the functions that seem to be undefined.
You screenshot is a bit low-res to see clearly, but it looks like that file has errors:
So maybe it wasn't (successfully) built ?
2024-06-26 06:47 AM
You are right. There are two files that have errors:
- cmsis_os2.c --> SemaphoreHandle_t and QueueHandle_t could not be resolved
- semphr.h --> Where typedef QueueHandle_t SemaphoreHandle_t; is defined
The problem starts there I think because the QueueHandle_t cannot be resolved. It is defined in queue.h which is also included...