MQX 4.2 RTCS TCP/IP Crash

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

MQX 4.2 RTCS TCP/IP Crash

Jump to solution
694 Views
josephchen
Contributor III

Hello,

     I have found that if I suddenly disconnect the Internet while downloading files through FTP, it will just hang there. If I force to restart my FTP downloading task, TCPIP task will crash in unhandled interrupt. Has anyone encountered the similar issue?

Joseph Chen

Labels (1)
0 Kudos
1 Solution
372 Views
Carlos_Musich
NXP Employee
NXP Employee

Hi Joseph,

what happens here is that if the timeout expires TCP/IP task is removed from ready queue and is sent to Timeout queue, then the scheduler is called to check for other tasks and TCP/IP task will never come back form timeout state.

You can work around this in different ways. I think a good option is to have another task that is checking the Ethernet link is up. You can do this with the following function:

ipcfg_get_link_active(BSP_DEFAULT_ENET_DEVICE);

Then if the link is broken you need to wait until time out expires and if the link is still broken you keep monitoring the link until it is up. Then you can move TCP/IP task to ready state as follows:

_task_ready(_task_get_td(_task_get_id_from_name("TCP/IP")));

I hope this helps.

Regards,

Carlos

View solution in original post

1 Reply
373 Views
Carlos_Musich
NXP Employee
NXP Employee

Hi Joseph,

what happens here is that if the timeout expires TCP/IP task is removed from ready queue and is sent to Timeout queue, then the scheduler is called to check for other tasks and TCP/IP task will never come back form timeout state.

You can work around this in different ways. I think a good option is to have another task that is checking the Ethernet link is up. You can do this with the following function:

ipcfg_get_link_active(BSP_DEFAULT_ENET_DEVICE);

Then if the link is broken you need to wait until time out expires and if the link is still broken you keep monitoring the link until it is up. Then you can move TCP/IP task to ready state as follows:

_task_ready(_task_get_td(_task_get_id_from_name("TCP/IP")));

I hope this helps.

Regards,

Carlos