Dan K

Freescale Kinetis SDK FreeRTOS utility files missing

Discussion created by Dan K on Jul 7, 2015
Latest reply on Jul 7, 2015 by Erich Styger

Using the Freescale Kinetis Software Development Kit (Kinetis SDK 1.2.0), when attempting to display the information about the FreeRTOS tasks used by calling the "vTaskList()" function after enabling the "configUSE_TRACE_FACILITY" flag in "FreeRTOSConfig.h", compile errors are generated in "tasks.c" because "Utility.h" is not found. Related to that are missing functions: "Utility_strcat()", "Utility_chcat()", and "Utility_strcatNum32u()".


In comparing the Kinetis-supplied "tasks.c" to the latest "tasks.c" from the FreeRTOS web site, this appears to be due to Freescale modification to that file (by EST). It appears that the Kinetis SDK 1.2.0 is missing the "Utility.h" and "Utility.c" files for the FreeRTOS support.


I was able to make it work by implementing the missing functions as follows:


void Utility_strcat(uint8_t * dest, uint32_t bufSize, const unsigned char * src)


    strncat((char *)dest, (const char *)src, bufSize);



void Utility_chcat(uint8_t * dest, uint32_t bufSize, unsigned char src)


    char buf[2] = {src, 0};


    strncat((char *)dest, buf, sizeof(buf));



void Utility_strcatNum32u(uint8_t * dest, uint32_t bufSize, uint32_t src)


    char buf[10];


    sprintf(buf, "%ld", src);

    strncat((char *)dest, buf, sizeof(buf));



with the following example output results:

-> tasks


------------ ------- -------- ------- -----

CmdLine         R       2       44      2

IDLE            R       0       176     4

LED             B       1       38      1

CDCproc         B       3       28      3

Tmr Svc         B       17      369     5

('R'=ready, 'B'=blocked, 'S'=suspended, 'D'=deleted)