Hi Martin,
I’m very new and green with Codewarrior and RTOS so generating an open memory map is not even something I understand.
I did stumble on something that seems to have fixed my problem. Maybe you can tell what is going on by knowing what I did to fix it.
I’m using the M52235EVB.
I was defining my tasks like this:
const TASK_TEMPLATE_STRUCT MQX_template_list[] =
{
/* Task Index, Function, Stack, Priority, Name, Attributes, Param, Time Slice */
{ 1, main_task, 2000, 20, "Main", MQX_AUTO_START_TASK, 0, 0 },
{ 2, udp_CntrlPort_RX_task, 2000, 10, "Udp_ControlPort_RX_task", 0, 0, 0 },
{ 3, Heartbeat_task, 2000, 19, "Heartbeat", 0, 0, 0 },
{ 4, QSPI_service_task, 2000, 15, "QSPI_service", 0, 0, 0 },
{ 5, udp_send_packet_task, 2000, 16, "Udp_send_packet", 0, 0, 0 },
{ 6, udp_TestPort_RX_task, 2000, 10, "Udp_TestPort_RX_task", 0, 0, 0 },
};
I noticed that I could not call any functions from tasks, or other tasks would never run. Everything would compile, but tasks weren’t all running correctly. Then I changed the stack sizes:
const TASK_TEMPLATE_STRUCT MQX_template_list[] =
{
/* Task Index, Function, Stack, Priority, Name, Attributes, Param, Time Slice */
{ 1, main_task, 500, 20, "Main", MQX_AUTO_START_TASK, 0, 0 },
{ 2, udp_CntrlPort_RX_task, 500, 10, "Udp_ControlPort_RX_task", 0, 0, 0 },
{ 3, Heartbeat_task, 500, 19, "Heartbeat", 0, 0, 0 },
{ 4, QSPI_service_task, 500, 15, "QSPI_service", 0, 0, 0 },
{ 5, udp_send_packet_task, 500, 16, "Udp_send_packet", 0, 0, 0 },
{ 6, udp_TestPort_RX_task, 500, 10, "Udp_TestPort_RX_task", 0, 0, 0 },
};
And now everything works, I can create the structure array in global memory and give it a size of 10 and call functions from my tasks and everything seems to be happy now.
Can you explain this to me more? I don’t really understand what drives the stack size requirement for each task and what the limits are and how that effects things.
Thanks,
Chris Stuart
Show Systems Development
Design & Engineering
Walt Disney World
christopher.stuart@disney.com<mailto:christopher.stuart@disney.com>
Office: (407) 938-1570
Cell: (407) 902-8134