Raw source code project won't build, CCS, GCC, ARM tm4c123gh6pm

frnyb wrote on Saturday, April 06, 2019:

Hello,
I admit being a newbie in the realm of FreeRTOS, but at this point I have spent many, many hours and I therefore now turn to this forum. I appoligise in advance if I have missed something completely obvious.

I am using Code Composer Studio as IDE, GCC compiler, Tiva C Launchpad development kit with MCU ARM tm4c123gh6pm. (though he MCU is irrelevant as I haven’t tried to flash yet, only build).

FreeRTOS v. 10.2.0

As my FreeRTOS project was bugging a lot, I decided to set up a raw project containing only the FreeRTOS source code, the FreeRTOSConfig.h and my main.c along with all other files created when creating a new project.
I have directories listed as include paths:
FreeRTOS\Source
FreeRTOS\Source\include
FreeRTOS\Source\portable\GCC\ARM_CM4F

When testing functionality of each FreeRTOS module, I get stuck already at task creation. With slight modification I’m using the example code for method xTaskCreate. My main.c:

#include "FreeRTOS.h"
#include "task.h"

/* Task to be created. */
void vTaskCode( void * pvParameters )
{
    /* The parameter value is expected to be 1 as 1 is passed in the
    pvParameters value in the call to xTaskCreate() below.
    configASSERT( ( ( uint32_t ) pvParameters ) == 1 );*/

    for( ;; )
    {
        /* Task code goes here. */
    }
}

/* Function that creates a task. */
int main( void )
{
BaseType_t xReturned;
TaskHandle_t xHandle = NULL;

    /* Create the task, storing the handle. */
    xReturned = xTaskCreate(
                    vTaskCode,       /* Function that implements the task. */
                    "NAME",          /* Text name for the task. */
                    1,      /* Stack size in words, not bytes. */
                    ( void * ) 1,    /* Parameter passed into the task. */
                    tskIDLE_PRIORITY,/* Priority at which the task is created. */
                    &xHandle );      /* Used to pass out the created task's handle. */

    if( xReturned == pdPASS )
    {
        /* The task was created.  Use the task's handle to delete the task. */
        vTaskDelete( xHandle );
    }

    while(1) { }

    return 0;
}

The error I get is similar to the errors I get when testing other FreeRTOS functionality:
undefined reference to ‘vTaskDelete’
undefined reference to ‘xTaskCreate’

I haven’t modified the source code or directory structure at all. I’m completely at loss. Does anybody have any suggestions? Anything would be much appreciated!

rtel wrote on Sunday, April 07, 2019:

This would just seem to indicate that FreeRTOS\Source\tasks.c is not
being built in your project, as that is the file that defines the
function it does not seem to be able to find if the error is at link time.

One thing strange in your post that may be related, but may be not, is
that if you are using Code Compose Studio you should be using the port
files from FreeRTOS\Source\portable\CCS\ARM_CM4F (TI CCS compiler),
whereas you post indicates you are using the
FreeRTOS\Source\portable\GCC\ARM_CM4F (GCC compiler).

frnyb wrote on Sunday, April 07, 2019:

Hello Richard, and thank you alot for your reply! I specifically choose the GNU compiler during project creation as I was taught by my embedded programming professor (I’m not aware of the details behind). I have tried to switch to the CCS compiler and include the appropriate port directory, but with the same result.

The error is at link time, yes. I am in despair as I haven’t modified either the source code or directory structure and I’m positive that the include paths in my project are correct (they are as mentioned in my above post). Do you have any clues about where I should start? It seems like random complexity to me…

Thanks alot!

rtel wrote on Sunday, April 07, 2019:

I didn’t realise you could select GCC with the TI tools.

If you do a clean build, then look at the compiler output (which you
should see in the console window), do you see tasks.c being built?
Easiest way to tell is if you cut an past the whole output into a text
editor then search for “tasks.c”.