Total task run time indicated only partially. (Integration of SystemView into sample project with FreeRTOS 8.2.2 and SEGGER patched FreeRTOS 8.2.3)

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

  • Total task run time indicated only partially. (Integration of SystemView into sample project with FreeRTOS 8.2.2 and SEGGER patched FreeRTOS 8.2.3)

    Hello Segger Team

    I managed to integrate SystemView /RTT into our STM32L476 FreeRTOS (originally 8.2.2) project.

    With FreeRTOS 8.2.2
    • the scheduling time was never visible
    With FreeRTOS 8.2.3 patched with the SEGGER patch file
    • the scheduling times get shown (traced)
    • the "Run Task" event was traced several times after each other (interrupted with with some queue, task notification events) but without swapping out of the task. It seems to me, that due to that, the total task run time in the graph are shown only partially

    • What does the Segger patch add to FreeRTOS?
    • What is missing / not working when a vanilla FreeRTOS version is used?
    • How can partial task time indication be fixed?
    Kind Regards
    Roman
    Files
  • Hello Roman,

    It seems like you do not record interrupts and therefore it looks like the tasks are switched from one task to another.
    xTaskGenericNotifyFromISR should be called in an ISR.

    The patch adds the macros to record interrupts as well as task blocking events.

    Did you make sure you did all modifications from the patch file?
    If you do not use the GCC Cortex-M4 port, you might also have to manually patch it, according to the changes in portable/GCC/ARM_CM4F/port.c and portable/GCC/ARM_CM4F/portmacro.h

    Best regards
    Johannes
    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.
  • Hello Johannes

    The RVDS port files were not patched, hence the systick interrupt was not visible.
    Now that I have the files patched, systick interrupt is shown in the log and graph.
    I furthermore added some manual entries into the ISRs which are also nicely logged and shown.

    But I still have some points in the log, where the task is reported to run twice without swapping out.



    I would expect to miss another event.
    Do you have an idea what that could be?

    Kind Regards

    Roman
    Files
  • Hello Johannes

    Finally I found the reason for the only partially shown task times.

    The code tries to force a task switch but returns to the same task.

    C Source Code

    1. /* Force a task switch here. */
    2. #if configUSE_TRACE_FACILITY && !defined( USE_PERCIPIO_TRACEALYZER )
    3. SEGGER_SYSVIEW_RecordU32( 444, 0x12 );
    4. #endif
    5. taskYIELD();


    Hence as a further improvement of the SystemView tool, I would suggest to
    • show the different partial task execution times when moving the mouse over that section and not only the first
    • add a "task run" marker (what ever that might look like) at that position
    Thanks for your support so far.
    Despite all my suggestions I am very pleased with the tool.
    We will switch to the Segger tracer and augment that with a number of J-Link for continuous logging.


    Kind Regards

    Roman
    Files