This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Porting from RTX to CMSIS-OS version

Hi guys,
I'm migrating my code written for RTX to the CMSIS-OS version of the RTX. The main difference with the RTX version is the RTOS start. The RTX uses:

os_sys_init();

while CMSIS-OS version uses:

osKernelStart();

The difference between these two is that the osKernelStart returns to main(), while os_sys_init() does not. With osKernelStart the main() would exit, going into a while(1) loop, wasting CPU resources. How do you get past this problem? With RTX it was simple, create an init task which starts all other tasks and then os_delete_self().

Thanks and best regards,
George

Parents
  • Hi George,
    there is a bigger difference than that. In the CMSIS-RTOS variant main is already a fully functional thread. A call to osKernelStart(); is not necessary.
    Just create all your threads using osThreadCreate in main directly. Then you can either continue using main as a thread or remove it from the thread list using:

    osThreadTerminate(osThreadGetId ());
    

    Regards,
    Matthias

Reply
  • Hi George,
    there is a bigger difference than that. In the CMSIS-RTOS variant main is already a fully functional thread. A call to osKernelStart(); is not necessary.
    Just create all your threads using osThreadCreate in main directly. Then you can either continue using main as a thread or remove it from the thread list using:

    osThreadTerminate(osThreadGetId ());
    

    Regards,
    Matthias

Children
No data