Missing functions in MSP430 GCC port

carvalhais wrote on Thursday, August 20, 2009:

Hi folks,

When trying to compile RTOS for MSP430 gcc I get the following error messages:

FreeRTOS\tasks.o: In function `prvIdleTask’:
…/FreeRTOS/tasks.c:1785: undefined reference to `vApplicationIdleHook’
FreeRTOS\tasks.o: In function `prvAllocateTCBAndStack’:
…/FreeRTOS/tasks.c:1931: undefined reference to `pvPortMalloc’
…/FreeRTOS/tasks.c:1938: undefined reference to `pvPortMalloc’
…/FreeRTOS/tasks.c:1943: undefined reference to `vPortFree’
FreeRTOS\tasks.o: In function `prvDeleteTCB’:
…/FreeRTOS/tasks.c:2080: undefined reference to `vPortFree’
…/FreeRTOS/tasks.c:2081: undefined reference to `vPortFree’
FreeRTOS\queue.o: In function `xQueueCreate’:
…/FreeRTOS/queue.c:241: undefined reference to `pvPortMalloc’
…/FreeRTOS/queue.c:248: undefined reference to `pvPortMalloc’
…/FreeRTOS/queue.c:273: undefined reference to `vPortFree’
FreeRTOS\queue.o: In function `vQueueDelete’:
…/FreeRTOS/queue.c:1024: undefined reference to `vPortFree’
FreeRTOS\croutine.o: In function `xCoRoutineCreate’:
…/FreeRTOS/croutine.c:125: undefined reference to `pvPortMalloc’
Build error occurred, build is stopped
Time consumed: 1234  ms.

I´ve looked for pvPortMalloc, and it is prototyped in portables.h, but there isn´t such a function in port.c (where it should be located, at least in theory) or anywhere else. I´ve not looked for the other functions.
I don´t get what I´m missing here, and I don´t believe it is related to my compiler or IDE (using latest mspgcc within eclipse), since I´ve already compiled good code with it.

Any help will be very welcome.

petermeier wrote on Thursday, August 20, 2009:

Hi Andre,
a) Define void vApplicationIdleHook() in your Application to get an idle event from the scheduler. This can also be disabled in the FreeRTOS_Config.h
b) You need to add one of the three heap managers to your project. heap_1…3.c for having memory management. Files are located in FreeRTOS/portable/MemMang
c) For Queue stuff add the queue.h to your include area.

Hope this helps,
Peter

carvalhais wrote on Friday, August 21, 2009:

Thanks Peter,

     I´ve added heap_1.c heap manager, and it worked like a charm. No more complains from the compiler.
     I´ve seen there is a documentation on this on the website (after reading your hints), but I think this should be made more clear on the pages, specially on the "Source Organization" page, since it says that the kernel is composed of only 3 files (4 if co-routines are enabled); this should clearly count as a file, since it is needed for a clean compile. What do you think?
     Maybe I should contact Mr. Richard Barry regarding this. Thank you one more time, best regards,

Andre.