AnsweredAssumed Answered

K60 RAM allocation issue when adding a thread

Question asked by kfranz on Dec 6, 2011
Latest reply on Dec 8, 2011 by kfranz

I started with the TWR-K60N512_Quick_Start_Demo. I added a thread to TASK_TEMPLATE_STRUCT MQX_template_list:

  { MC_TIME_TASK,  time_task,        800,     12,      "mcTime",         0,                   0,      0 },


Doing this causes MQX to "blow up" and restart when _mqx() calls:

 _mem_zero((pointer)kernel_data, (_mem_size)sizeof(KERNEL_DATA_STRUCT));


Investigation shows that before I add the thread to MQX_template_list, kernel_data is at address 0x1FFF0960-0x1FFF0C80. After I add the thread, kernel_data is at address 0x2000FEF0-0x20010210. There is no RAM past 0x2000FFFF.


Before adding thread:

MQX_init_struct -> START_OF_KERNEL 0x1FFF0960

MQX_init_struct -> END_OF_KERNEL     0x2000FFF0


After adding thread:

MQX_init_struct -> START_OF_KERNEL 0x2000FEF0

MQX_init_struct -> END_OF_KERNEL     0x00000411


What caused MQX_init_struct to have invalid addresses for the START_OF_KERNEL and END_OF_KERNEL?