MQX3.8 (CW10.3b) not passing variables when creating tasks

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

MQX3.8 (CW10.3b) not passing variables when creating tasks

ソリューションへジャンプ
1,273件の閲覧回数
CarlFST60L
Senior Contributor II

Hi,

I have ported code from MQX3.7 CW10.2 to MQX3.8 CW10.3b and had a major problem with this simple concept that has worked from MQX3.3 to MQX3.7

Start a thread / task using this template:

{ 17,           ETHRC_Task,    0x0800,  7,  "ETHRC_Task",  0},

In main thread, using 123 as an exmaple:

ETHRC_Task_ID = _task_create(0 ,_task_get_template_index("ETHRC_Task"), 123);

void ETHRC_Task(uint_32 ETH0_RC_Start_Value)

{

  printf("\nHello world from ETH0_RC, ETH0_RC_Start_Value = %u\n", ETH0_RC_Start_Value);

  fflush(stdout);

  _task_abort(MQX_NULL_TASK_ID);

}

Output:

Hello world from ETH0_RC, ETH0_RC_Start_Value = 0

I have tested this twice on code that has worked for years and is out in production... I didn't see anything in the release notes and it 100% was working on MQX3.3 to MQX3.7,.

0 件の賞賛
返信
1 解決策
1,077件の閲覧回数
c0170
Senior Contributor III

Hello Carl,

I created small application with MQX 3.8.1 on Kinetis K40 and parameter is passed and shown value matches the one I set. I even checked the parameter through _task_get_parameter(); I have experienced problem with function parameter but that was related to MQX auto start task.

/* code */

#define HELLO_TASK 5

void hello_task(uint_32);

void another_task(uint_32);

const TASK_TEMPLATE_STRUCT  MQX_template_list[] =

{

    /* Task Index,   Function,   Stack,  Priority, Name,     Attributes,          Param, Time Slice */

    { HELLO_TASK,   hello_task, 1500,   8,        "hello",  MQX_AUTO_START_TASK, 0,     0 },

    { 6,   another_task, 1500,   8,        "another",  0, 0,     0 },

    { 0 }

};

void another_task(uint_32 a)

{

  uint_32 parameter;

       

  printf("\nHello world from another task, parameter value = %u\n", a);

  parameter = _task_get_parameter();

  printf("\nParameter value another task: %d\n", parameter);

  fflush(stdout);

  _task_block();  

}

void hello_task

(

uint_32 initial_data

)

  uint_32 task_id;

  uint_32 parameter;

  

  task_id =  _task_create(0, 6, 255);

parameter = _task_get_parameter_for(task_id);

printf("\nParameter value from main: %d\n", parameter);
fflush(stdout);

_task_block();

}


Regards,

MartinK


元の投稿で解決策を見る

0 件の賞賛
返信
3 返答(返信)
1,077件の閲覧回数
Luis_Garabo
NXP TechSupport
NXP TechSupport

Hi Carl,

It is worth to mention that MQX is not tested in CW 10.3 beta version. MQX 3.x versions are not ment to be ported to latest CW versions unless the releases are before the MQX versions. I believe it would be supported until MQX 4.0 which I believe will be fully supported in CW 10.3 final release. I strongly recommend to do not use MQX 3.x in CW 10.3 beta version.

I suggest to use MQX 3.8.1 with CW 10.2. This is fully tested and the scenario is supported.

I hope this helps!

Best Regards,

Garabo

1,078件の閲覧回数
c0170
Senior Contributor III

Hello Carl,

I created small application with MQX 3.8.1 on Kinetis K40 and parameter is passed and shown value matches the one I set. I even checked the parameter through _task_get_parameter(); I have experienced problem with function parameter but that was related to MQX auto start task.

/* code */

#define HELLO_TASK 5

void hello_task(uint_32);

void another_task(uint_32);

const TASK_TEMPLATE_STRUCT  MQX_template_list[] =

{

    /* Task Index,   Function,   Stack,  Priority, Name,     Attributes,          Param, Time Slice */

    { HELLO_TASK,   hello_task, 1500,   8,        "hello",  MQX_AUTO_START_TASK, 0,     0 },

    { 6,   another_task, 1500,   8,        "another",  0, 0,     0 },

    { 0 }

};

void another_task(uint_32 a)

{

  uint_32 parameter;

       

  printf("\nHello world from another task, parameter value = %u\n", a);

  parameter = _task_get_parameter();

  printf("\nParameter value another task: %d\n", parameter);

  fflush(stdout);

  _task_block();  

}

void hello_task

(

uint_32 initial_data

)

  uint_32 task_id;

  uint_32 parameter;

  

  task_id =  _task_create(0, 6, 255);

parameter = _task_get_parameter_for(task_id);

printf("\nParameter value from main: %d\n", parameter);
fflush(stdout);

_task_block();

}


Regards,

MartinK


0 件の賞賛
返信
1,077件の閲覧回数
CarlFST60L
Senior Contributor II

Ok so I dont get that result. I will post up a complete project. Though I dont have time now, I ported back to MQX3.7 whcih works fine.

I also discovered RTCS will not work at all, crash's the entire processor. Running the same source in MQX3.7 and its all working again.

I dont have time right now but I will create a project showing these problems if you cant produce them.

These problems are the same in 52259evb and 52259demo projects... RTCS doesnt work, Passing variables in tasks does not work. Everything else appears fine.

0 件の賞賛
返信