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
Solved! Go to Solution.
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
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