2024-05-04 01:40 AM - edited 2024-05-04 01:41 AM
This Error occures when compling code
13:39:46 **** Incremental Build of configuration Debug for project 15_04_24_RTOS_TEST ****
make -j4 all
arm-none-eabi-gcc -o "15_04_24_RTOS_TEST.elf" @"objects.list" -mcpu=cortex-m4 -T"D:\STM32 RTOS\15_04_24_RTOS_TEST\STM32F411CEUX_FLASH.ld" --specs=nosys.specs -Wl,-Map="15_04_24_RTOS_TEST.map" -Wl,--gc-sections -static --specs=nano.specs -mfpu=fpv4-sp-d16 -mfloat-abi=hard -mthumb -u _printf_float -u _scanf_float -Wl,--start-group -lc -lm -Wl,--end-group
C:/ST/STM32CubeIDE_1.14.1/STM32CubeIDE/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.11.3.rel1.win32_1.1.100.202309141235/tools/bin/../lib/gcc/arm-none-eabi/11.3.1/../../../../arm-none-eabi/bin/ld.exe: ./Core/Src/main.o: in function `vApplicationGetIdleTaskMemory':
D:/STM32 RTOS/15_04_24_RTOS_TEST/Debug/../Core/Src/freertos.c:123: multiple definition of `vApplicationGetIdleTaskMemory'; ./Core/Src/freertos.o:D:/STM32 RTOS/15_04_24_RTOS_TEST/Debug/../Core/Src/freertos.c:123: first defined here
C:/ST/STM32CubeIDE_1.14.1/STM32CubeIDE/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.11.3.rel1.win32_1.1.100.202309141235/tools/bin/../lib/gcc/arm-none-eabi/11.3.1/../../../../arm-none-eabi/bin/ld.exe: ./Middlewares/Third_Party/FreeRTOS/Source/timers.o: in function `xTimerCreateTimerTask':
D:/STM32 RTOS/15_04_24_RTOS_TEST/Debug/../Middlewares/Third_Party/FreeRTOS/Source/timers.c:245: undefined reference to `vApplicationGetTimerTaskMemory'
collect2.exe: error: ld returned 1 exit status
make: *** [makefile:68: 15_04_24_RTOS_TEST.elf] Error 1
"make -j4 all" terminated with exit code 2. Build might be incomplete.
13:39:47 Build Failed. 3 errors, 0 warnings. (took 709ms)
freertos.c
void vApplicationGetIdleTaskMemory( StaticTask_t **ppxIdleTaskTCBBuffer, StackType_t **ppxIdleTaskStackBuffer, uint32_t *pulIdleTaskStackSize )
{
*ppxIdleTaskTCBBuffer = &xIdleTaskTCBBuffer;
*ppxIdleTaskStackBuffer = &xIdleStack[0];
*pulIdleTaskStackSize = configMINIMAL_STACK_SIZE;
/* place for user code */
}
timers.c
if( xTimerQueue != NULL )
{
#if( configSUPPORT_STATIC_ALLOCATION == 1 )
{
StaticTask_t *pxTimerTaskTCBBuffer = NULL;
StackType_t *pxTimerTaskStackBuffer = NULL;
uint32_t ulTimerTaskStackSize;
vApplicationGetTimerTaskMemory( &pxTimerTaskTCBBuffer, &pxTimerTaskStackBuffer, &ulTimerTaskStackSize );
xTimerTaskHandle = xTaskCreateStatic( prvTimerTask,
configTIMER_SERVICE_TASK_NAME,
ulTimerTaskStackSize,
NULL,
( ( UBaseType_t ) configTIMER_TASK_PRIORITY ) | portPRIVILEGE_BIT,
pxTimerTaskStackBuffer,
pxTimerTaskTCBBuffer );
if( xTimerTaskHandle != NULL )
{
xReturn = pdPASS;
}
}
2024-05-04 07:39 AM
Hello,
How did you generate the code? With CubeMx?
2024-05-04 12:26 PM
Complaining you have two instances of the function, or source for it, check your project trees.
Where it lacks for a definition/prototype, make sure you're including a .H that does so in the source file that's USING it.
2024-05-06 07:33 AM
Hi @Kai_Satone
it seems that you are setting the configKERNEL_PROVIDED_STATIC_MEMORY to 1 in your FreeRTOSConfig.h file
if it is the case then please unset it. It is clearly stated in FreeRTOS comments below.
regards
Haithem.