Lots of incompatible macro redefinitions when integrating SystemView and RTT into our FreeRTOS template project (solved)

This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

  • Lots of incompatible macro redefinitions when integrating SystemView and RTT into our FreeRTOS template project (solved)

    Hello all

    I get about 34 of such warnings when compiling our template project with the SEGGER System View:
    ..\src\lib\os\seggerSystemView\Sample\OS\SEGGER_SYSVIEW_FreeRTOS.h(198):
    warning: #47-D: incompatible redefinition of macro
    "traceTASK_NOTIFY_TAKE" (declared at line 625 of
    "..\src\lib\os\freertos\include\FreeRTOS.h")
    #define
    traceTASK_NOTIFY_TAKE()
    SEGGER_SYSVIEW_RecordU32x2(apiID_OFFSET + apiID_ULTASKNOTIFYTAKE,
    xClearCountOnExit, xTicksToWait)
    Since FreeRTOS.h initially defines all those marcos when they are not defined yet

    C Source Code

    1. #ifndef traceTASK_NOTIFY_TAKE
    2. #define traceTASK_NOTIFY_TAKE()
    3. #endif


    and FreeRTOS.h is included before SEGGER_SYSVIEW_FreeRTOS.h in SEGGER_SYSVIEW_FreeRTOS.c

    C Source Code

    1. File : SEGGER_SYSVIEW_FreeRTOS.c
    2. Purpose : Interface between FreeRTOS and SystemView.
    3. Revision: $Rev: 3734 $
    4. */
    5. #include "FreeRTOS.h"
    6. #include "task.h"
    7. #include "SEGGER_SYSVIEW.h"
    8. #include "SEGGER_SYSVIEW_FreeRTOS.h"
    9. #include "string.h" // Required for memset


    the warnings are logical to me. But how was that thought to work without warnings? (Another vendor of a trace tool simply places a #undef <macro> before there defines)

    C Source Code

    1. #undef traceTASK_NOTIFY_TAKE
    2. #define traceTASK_NOTIFY_TAKE() TracerXYZTaskNotifyTake()



    Was probably able to answer it myself: I do have it working now. The SEGGER_SYSVIEW_FREE_RTOS.h file needs to be included into the FreeRTOSConfig.h file.

    - It is compiling now without error/warning messages.
    - It is now working against FreeRTOS 8.2.2 but not showing any scheduler times
    - It is now working against the patched FreeRTOS 8.2.3, with some side effect that Task Run is shown in the log several times after each other without swapping out of it. This leads to strange time span indications in the graph.



    Kind Regards

    Roman

    The post was edited 3 times, last by Roman ().