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 ?