_task_ready() doesn't working on MQX Lite

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

_task_ready() doesn't working on MQX Lite

Jump to solution
953 Views
wendersonolivei
Contributor IV

Hi all !

I'm learning about MQX Lite, but it's really hard due to lack of documentation about that.

Recently, I had a problem with "task switch". Basicly, I'm running into a task_1 and this call a _task_block(); .Right after that, my task_2 (with same priority) becomes active and runs a _task_ready function to make task_1 be ready again.

But, when I call _task_ready, my microcontroller seems like have lost itself, and what I see in debug window is the firmware paused on  PE_DEBUGHALT();

There is the code of two tasks:

void read_task(uint32_t task_init_data)

{

  for(;;)

  {

  _task_block();

  }

}

void write_task(uint32_t task_init_data)

{

  for(;;)

  {

       _task_ready(read_task); //Try to make "read_task" ready

  }

}

> I'm running this on FRDM - KL25Z

Can anyone help me? Thanks

Tags (3)
0 Kudos
Reply
1 Solution
703 Views
danielchen
NXP TechSupport
NXP TechSupport

Hi

The prototype is

void _task_ready (pointer td);

td is pointer to the task descriptor of the task to be made ready.

you can use

TD_STRUCT_PTR td_ptr = _task_get_id(tid);

_task_ready(td_ptr);

You can check the Freescale MQX Lite RTOS reference manual and user guide for more details.

C:\Freescale\CW MCU v10.6\MCU\Help\PDF\


Have a great day,
Daniel

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

View solution in original post

0 Kudos
Reply
2 Replies
704 Views
danielchen
NXP TechSupport
NXP TechSupport

Hi

The prototype is

void _task_ready (pointer td);

td is pointer to the task descriptor of the task to be made ready.

you can use

TD_STRUCT_PTR td_ptr = _task_get_id(tid);

_task_ready(td_ptr);

You can check the Freescale MQX Lite RTOS reference manual and user guide for more details.

C:\Freescale\CW MCU v10.6\MCU\Help\PDF\


Have a great day,
Daniel

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos
Reply
703 Views
wendersonolivei
Contributor IV

Thanks for help!

Have a great day,

0 Kudos
Reply