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

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

  • [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:

    Source Code

    1. #ifdef SEGGER_SYSVIEW_TOOL
    2. //system view code
    3. #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:

    Source Code

    1. #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:

    Source Code

    1. void xPortSysTickHandler( void )
    2. {
    3. uint32_t ulPreviousMask;
    4. #ifdef SEGGER_SYSVIEW_TOOL
    5. ++SEGGER_SYSVIEW_TickCnt;
    6. #endif
    7. ulPreviousMask = portSET_INTERRUPT_MASK_FROM_ISR();
    8. {
    9. /* Increment the RTOS tick. */
    10. if( xTaskIncrementTick() != pdFALSE )
    11. {
    12. /* Pend a context switch. */
    13. *(portNVIC_INT_CTRL) = portNVIC_PENDSVSET;
    14. }
    15. }
    16. portCLEAR_INTERRUPT_MASK_FROM_ISR( ulPreviousMask );
    17. }
    Display All
    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+:


    Source Code

    1. U32 SEGGER_SYSVIEW_X_GetTimestamp(void)
    2. {
    3. return SEGGER_SYSVIEW_TickCnt;
    4. }

    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!
    Images
    • Image1.png

      58.14 kB, 412×381, viewed 191 times
    • Image2.png

      84.12 kB, 731×395, viewed 195 times
    Files
  • 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:
    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: segger.com/ticket/

    Or you can contact us via e-mail.