[SOLVED] Should I see the scheduler event after a taskYield?

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

  • [SOLVED] Should I see the scheduler event after a taskYield?

    I am learning FreeRTOS and SystemView. I have a very simple project with two tasks, both with the same priority. My SysTick period is 1ms. Every 1ms I see a SysTick event followed by a Scheduler event. My two tasks transmit a few bytes out a UART and then call taskYield. What I see on SystemView are sequences like this....

    Scenario 1
    SysTick, Scheduler, Task1, SysTick, Scheduler, Task2, SysTick, Scheduler

    and I often see this....

    Scenario 2
    SysTick, Scheduler, Task1, Task2, SysTick, Scheduler

    Here is a screenshot that shows both scenarios...

    (Ignore the red comments on this screenshot)

    I understand the 1st scenario but not the 2nd. In the 2nd scenario, I understand that the taskYield in Task1 caused the scheduler to perform a context switch. But in SystemView I don't see any scheduler event. Or in other words, where the comment says "Did not work like your system", an arrow points to the end of a Task. Why was there no scheduler event at that point?
  • Hello,

    Thank you for your inquiry.
    In some cases no scheduler event will be logged by the target device as it is not implemented in the particular RTOS instrumentation.
    This can lead to the picture you see above where you see taskswitches "without" scheduler calls. However you can be sure the scheduler was executed at this point.
    Should you also want to record such scheduler events you would need to expand the instrumentation of the RTOS source.
    Please understand that we can't assist you with this as it would be out of scope of regular forum tips.

    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.