_task_ready() doesn't working on MQX Lite

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

_task_ready() doesn't working on MQX Lite

跳至解决方案
864 次查看
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

标记 (3)
0 项奖励
回复
1 解答
614 次查看
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 项奖励
回复
2 回复数
615 次查看
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 项奖励
回复
614 次查看
wendersonolivei
Contributor IV

Thanks for help!

Have a great day,

0 项奖励
回复