[SOLVED] ​Problems viewing ARM Cortex-M0+ FreeRTOS tasks in System View

  • Hi,


    I'm having some problems trying to view RTOS tasks in System View. First I will list my system configuration

    TARGET:

    Board/MCU - FRDM-KL25Z with ARM Cortex-M0+ core on Kinetis KL25 from NXP;
    Debuuger: OpenSDA with J-link
    RTOS - FreeRTOS 9.0.0;
    System View target sources: v2.52d

    PC HOST:

    OS: Windows 10 Professional
    IDE - Kinetis Design Studio (KDS) from NXP;
    Compiler - GCC/C99;
    System View - v3.32.

    The main project files created in KDS is attached below.

    I have port the System View target sources to my project in KDS. I have patch the FreeRTOS sources from scratch with System View.
    A macro called SEGGER_SYSVIEW_TOOL was used, which I can pass to gcc, when I want to use the system view. So when you don't want to compile
    code related to system view, do not pass this macro. Therefore, all related segger code is between this preprocessor commands:

    Code
    #ifdef SEGGER_SYSVIEW_TOOL
    //system view code
    #endif


    At the beginning of the "FreeRTOSConfig.h" file, it was inserted the header file that contains the "SystemCoreClock" definition (MKL25Z4.h).
    At the end of the "FreeRTOSConfig.h" file is inserted:

    Code
    #include "SEGGER_SYSVIEW_FreeRTOS.h"


    In "FreeRTOSConfig.h" is set:
    "INCLUDE_xTaskGetIdleTaskHandle 1" and "configUSE_TRACE_FACILITY 1".

    To update the tick counts for system view, the SEGGER_SYSVIEW_TickCnt variable is incremented inside xPortSysTickHandler in the port.c file:

    I created the file "SEGGER_SYSVIEW_Config_FreeRTOS_CM0.c" and put in the directory "Segger" of the project. In this file there is an implementation
    of the "SEGGER_SYSVIEW_X_GetTimestamp" function for an ARM Cortex-M0+:


    Code
    U32 SEGGER_SYSVIEW_X_GetTimestamp(void)
    {   
      return SEGGER_SYSVIEW_TickCnt;
    }


    In the main function, It is called the "SEGGER_SYSVIEW_Conf" function to settle everything and start the application.
    The application is formed by two tasks, having 1 second period (myTask) and 2 seconds period (myTask2).
    The system view in PC find the correct parameters of my board, when it is attached to PC when selected "Target->Recordes Configuration" (image 1).

    When the FRDM-KL25Z is attached to PC, I click in the "start recording" and it begins to record (image 2).
    However, some problems appears in the visualization.
    First of all, the time scale and value is wrong. After many seconds periods, the time scale is show in few miliseconds.
    Second, I have to move the cursor in front of the timeline window whenever I want the system view to update the tasks view, which is really annoying.
    Third, there are Tmr Svc and Idle timelines that show nothing. I believe something should be shown in Idle, but not sure with Tmr Svc.
    And finally, is there a way to change the color of tasks on the timeline? This default color is very transparent and similar to each other, which makes analysis difficult.

    What can I do to resolve this problems?

    Thanks in advance!

  • Hello,

    Thank you for your inquiry.
    Could you try using the latest SystemView sources and SystemView version? You seem to have a version mismatch there.

    Additionally here is a Wiki article describing how SystemView should be used on FreeRTOS:
    https://wiki.segger.com/FreeRTOS_with_SystemView

    For more details about troubleshooting see the SystemView reference manual.

    Best regards,
    Nino

    Please read the forum rules before posting.

    Keep in mind, this is *not* a support forum.
    Our engineers will try to answer your questions between their projects if possible but this can be delayed by longer periods of time.
    Should you be entitled to support you can contact us via our support system: https://www.segger.com/ticket/

    Or you can contact us via e-mail.

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!