[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 1,174 times
  • Hi,

    The FreeRTOS interface in SystemView 2.28 fixes this problem.
    It was caused by calling pvPortMalloc() from _cbSendTaskList() which could possibly be called within interrupts.

    Best regards
    Joahnnes
    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.
  • 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
    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.
  • Thank you, Johannes for answering my question and looking into it :)
    I very much appreciate it!
    I commented out the assertion to fix my hang ;)


    do you plan to also plan to provide a FreeRTOS patch for Cortex-M3 parts? Currently, I can only find one for M4F.
  • 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
    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.