[SOLVED/OR] SystemView causes assertion with FreeRTOS

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

  • [SOLVED/OR] SystemView causes assertion with FreeRTOS

    Hi,

    i'm using SystemView 2.26 and FreeRTOS 8.2.1 on an STM32F429.

    As soon as I start the SystemViewer application on the host and connect to the target, my system gets stuck in a runtime assertion.
    If i disable this assertion, I can use SystemViewer. What is the problem here?

    I have attached a screenshot showing the stack trace during the assertion.
    Images
    • assert.png

      279.09 kB, 1,920×1,019, viewed 498 times
  • Thank you for providing the call stack.


    The problem is, when SystemViewer is started it requests the tasklist.
    The request is handled by the next SystemView event, which is in most cases the SysTick event.

    Unfortunately it looks like uxTaskGetSystemState() cannot be called from within an ISR,
    since it calls taskENTER_CRITICAL internally, which asserts if it is called from within an ISR.

    Currently the only workaround is to not stop in configASSERT or to remove the assertion from vPortEnterCritical.

    We will work on a better solution to prevent the assertion, which will be part of the next version of SystemView.

    Best regards
    Johannes
  • Hi,

    SystemView V2.30 includes a changed FreeRTOS interface for SystemView,
    which does not cause the assertion.

    We will probably add the changes for other ports, too. Currently this has to be done manually.

    With the GCC CM4F port as a reference it shouldn't be a big deal.

    In general it is:
    Add traceISR_ENTER(); at the beginning of xPortSysTickHandler
    Add traceISR_EXIT_TO_SCHEDULER(); when xPortSysTickHandler causes a context switch
    Add traceISR_EXIT(); when xPortSysTickHandler returns to normal execution

    Do the same for the portEND_SWITCHING_ISR macro.

    Best regards
    Johannes