AnsweredAssumed Answered

What does _mqx_exit() do?

Question asked by martinpi on Jan 21, 2013
Latest reply on Feb 7, 2013 by martinpi

Hi everybody,

 

I am trying to start some code after mqx has finished.

In other words, I want mqx to terminate and continue execution from a predefined address in RAM (where I loaded some code).

 

I modified the bsp and psp so that _mqx_exit is enabled.

Then I modified mqx_main.c like this:

 

int main
   (
      void
   )
{ /* Body */

   extern const MQX_INITIALIZATION_STRUCT MQX_init_struct;

   /* Start MQX */
   _mqx( (MQX_INITIALIZATION_STRUCT_PTR) &MQX_init_struct );
  
   // mqx has terminated and is ready to run the loaded program
   (*pFuncPointer)();
  
   return 0;

} /* Endbody */

where pFuncPointer holds the address of the code to be run.

I do not expect this "function" to return.

 

In the debugger (CodeWarrior), I see that a brakpoint at pFuncPointer ist reached, but when I continue execution I stop in the idle task again and again.

I expected _mqx_exit to stop all tasks.

What do I need to do so I have only the code at pFuncPointer running?

 

Thanks and regards,

Martin

Outcomes