This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Undefined reference to SEGGER_SYSVIEW APIs upon integrating the patches

Been having trouble integrating systemview for tracing FreeRTOS application. I came across this thread, and even tried replacing the files with what's inside the PatchedFiles.zip folder, and I see there's an #include "SEGGER_SYSVIEW_FreeRTOS.h" inside FreeRTOSConfig.h, but upon compiling I start seeing a bunch of undefined reference errors including undefined reference to SEGGER_SYSVIEW_RecordVoid'`
Looks like traceTASK functions are invoked but it can't seem to find the reference. Anything obvious that I haven't figured out?
Parents Reply Children
  • I am really sorry, Not sure what happened but the main.c file did not include the change i did.

    Basically you need to call "    SEGGER_SYSVIEW_Conf();" in the main.c very early. This will initialize the RTT control block properly in a way that systemview can search for it. Can you please check if it works for you with that addition of line in your main.c and also you need to have .SEGGER_SYSVIEW_Config_FreeRTOS.c file in your project which I see missing.

    Reattaching my changes,

    4478.ble_app_hrs_freertos.zip

  • It is working for  me here. with my project

    I can't compile your project as I have some issue with multi C++ compilers mixed up in my settings. I will have to solve that issue another time

  • Thanks. I was able to get yours to work but having trouble with my project.

    SEGGER_SYSVIEW_Conf() is undefined, but I don't see you included a header file in main that references it in the attached project.


    Also when I compile with the following line uncommented out, I still see a bunch of undefined reference errros.

    #include "SEGGER_SYSVIEW_FreeRTOS.h" 


    I have included the following paths in the preprocessor:

    SeggerFiles

    SeggerFiles/Config

    SeggerFiles/SEGGER/Syscalls

    SeggerFiles/SEGGER/

  • I couldn't find any of your project attachment in this thread. But the project attachment you did on another thread "smartwatch", I couldn't compile that at all because of my own C++ compiler issues. But the point is that this should work. Just some minor technicalities that you need to patch i guess.

  • SmartWatch 3.ziphere it is. 

    uncommenting out #include "SEGGER_SYSVIEW_FreeRTOS.h" in FreeRTOSConfig.h file results in a bunch of errors:

    `ulTaskNotifyTake':
    1> /Users/user/Projects/BLE/nRF5_SDK_17.0.2_d674dde/external/freertos/source/tasks.c:4481: undefined reference to `SEGGER_SYSVIEW_RecordU32x2'
    1> /Applications/SEGGER Embedded Studio for ARM 5.42/gcc/arm-none-eabi/bin/ld: Output/Release/Obj/Init template - FreeRTOS/tasks.o: in function `vTaskNotifyGiveFromISR':
    1> /Users/userhu/Projects/BLE/nRF5_SDK_17.0.2_d674dde/external/freertos/source/tasks.c:4859: undefined reference to `SEGGER_SYSVIEW_ShrinkId'

    e....


    it looks to me certain segger files aren't recognized hence the complaint about undefined references to the APIs. And as mentioned, the segger files are already included in the project via preprocessor. You can confirm by looking at the attached project

Related