Wip_list causing watchdog reset

Hi Everyone

I am having trouble with the wip_list function when trying to read files from an ftp server. I can open a channel to the server, and download a file from it, but when I try to read the file list, I get a watchdog reset. I have worked out that it occurs in the wip_read function, and I can not figure out what is causing it.

Here is the code i use to open the ftp connection to the server:

FtpCnxCh = wip_FTPCreateOpts((ascii *) FTP_STR_HOSTNAME,
			(wip_eventHandler_f) FTPCnxHandler,
			NULL,
			WIP_COPT_USER, FTP_STR_USERNAME,
			WIP_COPT_PASSWORD, FTP_STR_PASSWORD,
			WIP_COPT_PASSIVE, TRUE,
			WIP_COPT_TYPE, FTP_TYPE,
			WIP_COPT_PEER_PORT, 21,
			WIP_COPT_END);

Once I get the WIP_CEV_OPEN event, I try to read the file listing:

FptFileList = wip_list(Ev->channel, NULL, FTPListHandler, Ev->channel);

I wait for the WIP_CEV_READ event in the FTPListHandler, and then try and read the list:

nread = wip_read(Ev->channel, buffer, sizeof(buffer));

I never get passed this line of code. Traces are shown below.

10/10/21,02:40:25:581 ADL 6 FTP control channel created: 403726072
10/10/21,02:40:28:252 ADL 6 WIP_CEV_OPEN -> Control channel
10/10/21,02:40:28:253 ADL 6 List channel opened: 403727192
10/10/21,02:40:28:928 ADL 6 WIP_CEV_OPEN-> List channel
10/10/21,02:40:37:248 ADL 6 WIP_CEV_READ -> List channel
10/10/21,02:40:37:253 ADL 1 Binary header at 00260000
10/10/21,02:40:37:275 ADL 1 ADL_INIT_REBOOT_FROM_EXCEPTION
10/10/21,02:40:37:355 SYS 1 OAT Task index : 0
10/10/21,02:40:37:358 SYS 1 Watch dog reset. Tsk 30

I have tried everything! If anybody has any ideas, please let me know.

Thanks!

Hi
Try reading the value returned by wip_read.This might indicate what the problem is.
And in the wip_list event handler make sure you do a wip_close in case an error is encountered.

Thanks for the response

The watchdog reset is occurring in the wip_read function, and the WMP is resetting before the function returns!!!

Are you sure it’s a watchdog reset? It could be a stack overflow. Make sure you’ve allocated enough stack (wm_apmCustomStackSize). I now set it to 65536 (was at 1024 and would reset frequently).