0

For future developers' sake and to seek a better code organization and structure, I need to finish micrium execution and go back to a bare-metal state.

So, how can I pass the OSStart() point?

Bellow, there's some minimal/pseudo code.

while (some_condition)
{
  bare_metal_funtions();
  
  // uC/OS-II initializations
  CPU_Init();
  Mem_Init();
  Math_Init();

  OSInit();

  OSTaskCreateExt(arg_0, arg_1, arg_2, arg_3, arg_4, arg_5, arg_6, arg_7, arg_8);

  OSStart();

  bare_metal_funtions_2();
}
  • 1
    Once you've invoked the `OSStart()` and start the scheduler, it will never return from the OS. But using some tricks depending on your hardware, you can init your system selectively by soft resetting from within the OS tasks and save a flag in nonvolatile memory. When restart from main, you check this flag and direct the program flow either to OS or bare metal section unless you don't need it to be done without resetting the variables. – Kozmotronik Nov 10 '22 at 09:54

0 Answers0