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
  • Are they still out of office? I have already looked at these links and tried out to no avail

  • Yes, this is clean project just unzipped into a folder name Susheel1_ble_app_hrs_freertos instead of SmartWatch as it seems like there are some files added into your project which has the folder name Susheel1_ble_app_hrs_freertos  hardcoded.

    The error 'solution is already loaded' seems to be a bit confusing. The solution is not loaded anywhere else. There is no other SES instance on my PC other than this one which is reporting an error. After I click OK, then it loads the previous project I was debugging which is ble_app_beacon. 

    This is very strange because I cannot find any other thread which has similar issues on devzone. Seems like a project compatibility issue from Segger side within OS versions. 

  • Can we try this one? It may not make a difference but I just tested it again on my machine, and it works ok. At least I'm able to open the solution and build it fine.

    You could try the existing NRF's programs (ble_uart etc) but I'm mostly concerned about my own project regarding integrating SystemView. 

    Project 4.zip

  • The problem was caused for me from this changes in your .emProject file

      <configuration Name="Common" gcc_cplusplus_language_standard="c++11" />
      <import file_name="../../../../../peripheral/uart/pca10056/blank/ses/uart_pca10056.emProject" />
      <import file_name="../../../../../peripheral/twi_sensor/pca10056/blank/ses/twi_sensor_pca10056.emProject" />
      <import file_name="../../../../Susheel1_ble_app_hrs_freertos/pca10056/s140/ses/ble_app_hrs_freertos_pca10056_s140.emProject" />
      <import file_name="../../../../../ble_peripheral/ble_app_uart/pca10056/s140/ses/ble_app_uart_pca10056_s140.emProject" />
      <import file_name="../../../../../peripheral/blinky_freertos/pca10056/blank/ses/blinky_FreeRTOS_pca10056.emProject" />
    

    I am now able to open the project but after that I have not managed to compile your cpp/hpp files with the project settings you sent. There must be some other dependency that is resolved in your system that makes SES resolve cpp linkage. 

  • Good to know you can at least open the project.

    Do you think it's too much an effort to investigate the main issue regarding now being able to get the program to compile after integrating the patch? I have also opened a ticket for Segger but so far no response.

  • Looks like you are away now but hoping you get to see this once you're back. Appreciate your time.

    Just to reiterate, the following are among the set of errors with <#include "SEGGER_SYSVIEW_FreeRTOS.h"> included.

    FreeRTOS/app_timer_freertos.o: in function `app_timer_start':
    1> /Users/Projects/BLE/nRF5_SDK_17.0.2_d674dde/components/libraries/timer/app_timer_freertos.c:194: undefined reference to `SEGGER_SYSVIEW_RecordExitISRToScheduler'
    1> /Applications/SEGGER Embedded Studio for ARM 5.42/gcc/arm-none-eabi/bin/ld: /Users/Projects/BLE/nRF5_SDK_17.0.2_d674dde/components/libraries/timer/app_timer_freertos.c:194: undefined reference to `SEGGER_SYSVIEW_RecordExitISR'
    1> /Applications/SEGGER Embedded Studio for ARM 5.42/gcc/arm-none-eabi/bin/ld: Output/Release/Obj/Init template - FreeRTOS/app_timer_freertos.o: in function `app_timer_stop':
    1> /Usershu/Projects/BLE/nRF5_SDK_17.0.2_d674dde/components/libraries/timer/app_timer_freertos.c:230: undefined reference to `SEGGER_SYSVIEW_RecordExitISRToScheduler'
    1> /Applications/SEGGER Embedded Studio for ARM 5.42/gcc/arm-none-eabi/bin/ld: /Users/Projects/BLE/nRF5_SDK_17.0.2_d674dde/components/libraries/timer/app_timer_freertos.c:230: undefined reference to `SEGGER_SYSVIEW_RecordExitISR'
    1> /Applications/SEGGER Embedded Studio for ARM 5.42/gcc/arm-none-eabi/bin/ld: Output/Release/Obj/Init template - FreeRTOS/port_cmsis_systick.o: in function `RTC1_IRQHandler':
    ...

    I looked into portmacro_cmsis.h, and it doesn't seem as if it references the SEGGER_SYSVIEW_FreeRTOS.h that has a declaration of traceISR_EXIT

    #define portEND_SWITCHING_ISR( xSwitchRequired ) { if ( (xSwitchRequired) != pdFALSE ) { traceISR_EXIT_TO_SCHEDULER(); portYIELD(); } else { traceISR_EXIT(); } }
    #define portYIELD_FROM_ISR( x ) portEND_SWITCHING_ISR( x )

    and I took portmacro_cmsis.h from the patch files ZIP linked in the description. Could you please confirm as to whether that's the case?

    In regards to the following errors, I'm not quite sure.




    The following preprocessor is in SEGGER_SYSVIEW_FreeRTOS.h which includes <SEGGER_SYSVIEW.h> that defines SEGGER_SYSVIEW_RecordU32x4

     #define traceQUEUE_SEND( pxQueue )   SEGGER_SYSVIEW_RecordU32x4(apiID_OFFSET + apiID_XQUEUEGENERICSEND, SEGGER_SYSVIEW_ShrinkId((U32)pxQueue), (U32)pvItemToQueue, xTicksToWait, xCopyPosition)

    Seems strange to me as to why it would not recognize.

    Would it be possible for you to check my project? I shall really be grateful!

Reply
  • Looks like you are away now but hoping you get to see this once you're back. Appreciate your time.

    Just to reiterate, the following are among the set of errors with <#include "SEGGER_SYSVIEW_FreeRTOS.h"> included.

    FreeRTOS/app_timer_freertos.o: in function `app_timer_start':
    1> /Users/Projects/BLE/nRF5_SDK_17.0.2_d674dde/components/libraries/timer/app_timer_freertos.c:194: undefined reference to `SEGGER_SYSVIEW_RecordExitISRToScheduler'
    1> /Applications/SEGGER Embedded Studio for ARM 5.42/gcc/arm-none-eabi/bin/ld: /Users/Projects/BLE/nRF5_SDK_17.0.2_d674dde/components/libraries/timer/app_timer_freertos.c:194: undefined reference to `SEGGER_SYSVIEW_RecordExitISR'
    1> /Applications/SEGGER Embedded Studio for ARM 5.42/gcc/arm-none-eabi/bin/ld: Output/Release/Obj/Init template - FreeRTOS/app_timer_freertos.o: in function `app_timer_stop':
    1> /Usershu/Projects/BLE/nRF5_SDK_17.0.2_d674dde/components/libraries/timer/app_timer_freertos.c:230: undefined reference to `SEGGER_SYSVIEW_RecordExitISRToScheduler'
    1> /Applications/SEGGER Embedded Studio for ARM 5.42/gcc/arm-none-eabi/bin/ld: /Users/Projects/BLE/nRF5_SDK_17.0.2_d674dde/components/libraries/timer/app_timer_freertos.c:230: undefined reference to `SEGGER_SYSVIEW_RecordExitISR'
    1> /Applications/SEGGER Embedded Studio for ARM 5.42/gcc/arm-none-eabi/bin/ld: Output/Release/Obj/Init template - FreeRTOS/port_cmsis_systick.o: in function `RTC1_IRQHandler':
    ...

    I looked into portmacro_cmsis.h, and it doesn't seem as if it references the SEGGER_SYSVIEW_FreeRTOS.h that has a declaration of traceISR_EXIT

    #define portEND_SWITCHING_ISR( xSwitchRequired ) { if ( (xSwitchRequired) != pdFALSE ) { traceISR_EXIT_TO_SCHEDULER(); portYIELD(); } else { traceISR_EXIT(); } }
    #define portYIELD_FROM_ISR( x ) portEND_SWITCHING_ISR( x )

    and I took portmacro_cmsis.h from the patch files ZIP linked in the description. Could you please confirm as to whether that's the case?

    In regards to the following errors, I'm not quite sure.




    The following preprocessor is in SEGGER_SYSVIEW_FreeRTOS.h which includes <SEGGER_SYSVIEW.h> that defines SEGGER_SYSVIEW_RecordU32x4

     #define traceQUEUE_SEND( pxQueue )   SEGGER_SYSVIEW_RecordU32x4(apiID_OFFSET + apiID_XQUEUEGENERICSEND, SEGGER_SYSVIEW_ShrinkId((U32)pxQueue), (U32)pvItemToQueue, xTicksToWait, xCopyPosition)

    Seems strange to me as to why it would not recognize.

    Would it be possible for you to check my project? I shall really be grateful!

Children
  •  Thanks for waiting morpho. Yes I was away for summer holidays and due to very thin staffing here, my activities unfortunately did not get picked up by others. I appreciate your patience.

    morpho said:
    Just to reiterate, the following are among the set of errors with <#include "SEGGER_SYSVIEW_FreeRTOS.h"> included.

    1> /Users/Projects/BLE/nRF5_SDK_17.0.2_d674dde/components/libraries/timer/app_timer_freertos.c:194: undefined reference to `SEGGER_SYSVIEW_RecordExitISRToScheduler'
    This is clearly defined in SmartWatch\pca10056\s140\ses\SeggerFiles\SEGGER\SEGGER_SYSVIEW.c. I do not see that file included in your project. Atleast in the "Project 4.zip" attachment you did which seems the latest.

  • Hope you had a great time.

    I do not see that file included in your project

    which file are you exactly referring to? SEGGER_SYSVIEW.c is in pca10056\s140\ses\SeggerFiles\SEGGER\SEGGER_SYSVIEW.c and SEGGER_SYSVIEW_FreeRTOS.h is in pca10056/s140/ses/SeggerFiles/Sample/FreeRTOSV10/SEGGER_SYSVIEW_FreeRTOS.c

    and both the paths are included in the preprocessor

  • morpho said:

    which file are you exactly referring to? SEGGER_SYSVIEW.c is in pca10056\s140\ses\SeggerFiles\SEGGER\SEGGER_SYSVIEW.c and SEGGER_SYSVIEW_FreeRTOS.h is in pca10056/s140/ses/SeggerFiles/Sample/FreeRTOSV10/SEGGER_SYSVIEW_FreeRTOS.c

    and both the paths are included in the preprocessor

     Your project file ble_app_hrs_freertos_pca10056_s140.emProject does not have this SEGGER_SYSVIEW.c included.

    Having the header file included in preprocessor is OK for the declarations but the definitions that you are missing are in SEGGER_SYSVIEW.c which needs to be added into the project. 

    I added this explicitly in your project as below. Do you see the same file in the project explorer window?

  • Thanks Susheel. I don't see the previous errors now but I see the following



    the only file that references it is SEGGER_SYSVIEW_FreeRTOS.h but I can't seem to find its definition. Can you check on your end too?

  • You have the definition of that in SEGGER_SYSVIEW_FreeRTOS.c which is available in your zipped project folders. Add that one too to the project folder as you did with the SEGGER_SYSVIEW.c

Related