Hi Martin,
I tested your theory that perhaps RTCSPCB_alloc(void) may be unable to allocate a PCB and didn't see this happening. To catch this, I modified the MQX ...rtcs\source\tcpip\RTCSPCB_alloc() function slightly to place an ELSE asm(nop); that I could set a breakpoint on (see code insert). Then I rebuilt MQX, recompiled my project with the size of the Tx/Rx buffers shrunk down to the default 4380 bytes (which caused the problem to re-appear). I placed a breakpoint on the asm(nop); statement in the RTCSPCB_alloc() function and let the problem happen. Neither box A or box B hit this breakpoint when the problem occurred.
At this point I have corrected the problem by increasing the size of the MQX Tx and Rx buffers from the default 4380 up to 17520 (4 times larger). Since doing this I haven't seen the problem again. What's your opinion, is this a reasonable solution? I worry about experiencing future problems as traffic increases and message sizes grow. Here's the values I used to init the Ethernet system do these values look reasonable to you?
_RTCSPCB_init = 16; //Default value: 4
_RTCSPCB_grow = 8; //Default value: 2
_RTCSPCB_max = 64; //Default value: 20
_RTCS_msgpool_init = 64; //Default value: 4
_RTCS_msgpool_grow = 32; //Default value: 2
_RTCS_msgpool_max = 320; //Default value: 20
_RTCS_socket_part_init = 12; //Default value: 4
_RTCS_socket_part_grow = 8; //Default value: 2
_RTCS_socket_part_max = 160; //Default value: 20
_RTCSTASK_stacksize = 10000; //Default value: 10000
Thanks a lot for your advice Martin I appreciate it.
Best Regards,
Tim
RTCSPCB_PTR RTCSPCB_alloc(void)
{
RTCS_DATA_PTR RTCS_data_ptr;
RTCSPCB_PTR rtcs_pcb;
RTCS_data_ptr = RTCS_get_data();
rtcs_pcb = RTCS_part_alloc(RTCS_data_ptr->RTCS_PCB_partition);
if(rtcs_pcb != NULL)
{
rtcs_pcb->IP_SUM_PTR = NULL;
_mem_zero(&rtcs_pcb->LINK_OPTIONS, sizeof(rtcs_pcb->LINK_OPTIONS));
} /* Endif */
else
asm(nop); //To allow an error trap
RTCSLOG_PCB_ALLOC(rtcs_pcb);
return(rtcs_pcb);
}