Preemptive task switch not working ?

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

  • Preemptive task switch not working ?

    STM32F103E, embOS 3.88b, CMSIS. IAR 6.5
    I was porting an existing non-RTOS app to use embos and came across a problem with preemption. Most of the original superloop code was untouched, I just moved it into the lowest pri task. Two new tasks were created with higher numerical priorities. The app appears to hang as soon as OS_Start is called, and the higher pri tasks don't show enough of a run count. One shows "1" and the other "0". If one breaks execution in the debugger, it can be seen that the old superloop is executing, and all three tasks show in the task window as "ready".
    It should be mentioned that the old superloop, now lowest pri task, does not make any OS calls except OS_GetTime(). If I insert a OS_Delay(1) in the main loop of the lowest pri task, then the high pri tasks run normally. I was expecting that the lowest pri task would not be running unless the higher pri tasks were waiting. Have I missed something obvious ?
    George
  • Hello George,

    without having your code it's hard to know what could go wrong.
    In general the task with the highest priority which is ready to run will be executed.
    Could you please contact our support directly?
    Maybe it's possible to send us your project?

    Best regards,
    Til
    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.