FreeRTOS usage just like single thread infinite loop application

vamshig51 wrote on Thursday, July 18, 2019:


Currently I have an application running as bare-metal in an infinite main loop, I would like to migrate this to FreeRTOS with a single task.

I am least bothered about power management, and dont want idle task to execute, here is my plan

  1. config FreeRTOS as co-operative
  2. Create a single task (task_main) in infinite loop, as task to execute the functionality as my old bare-metal in an infinite loop
  3. And this task never yeilds

Doing so will make my RTOS application same as equivalent bare-metal app in an infinite loop ??
Do I have to worry about anything ? my task_main to have all the CPU resources

In feature I would like to use the benefits of RTOS, but for now it has to replicate a bare-metal app in infinite loop.

Please give your inputs

rtel wrote on Thursday, July 18, 2019:

Sounds viable. If you want to keep preemption enabled then just run the
task at priority 1, if it never yields then it will prevent the idle
task from running. Then you can have additional tasks running above
priority 1 too - but they would have to be written to block to ensure
the priority 1 task (you infinite loop) got some processing time.

vamshig51 wrote on Friday, July 19, 2019:

Thanks Richard, its helpful.