Reasonable timeout in Mass storage class MS_Host_SendReceiveData

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

Reasonable timeout in Mass storage class MS_Host_SendReceiveData

869 Views
ssudhir
Contributor II

Hi

Mass Storage Class  ehci.c file has a function called MS_Host_SendReceiveData. This has a forever loop at  - while(!Pipe_IsStatusOK(portnum)). So far we never had an issue but last two days the system gets caught in this forever loop. Without compromising normal operation, we would like add some timeout. Instead of waiting forever to get OK message, return with an error. What would be the reasonable timeout?

Thanks

0 Kudos
7 Replies

771 Views
Alexis_A
NXP TechSupport
NXP TechSupport

Hi,

First of all sorry for the late replay.

There isn't an specific time for this, as far as I see, sometimes is used 3000 ms or 5000 ms, but this will be depending of your application.

The think that I found strange is that the code is getting stuck, which version of LPCOpen are you using and which MCU?

Best Regards,

Alexis Andalon

0 Kudos

771 Views
ssudhir
Contributor II

Thanks for the reply.

We are using LPC4357 and LPCopen2.20.

Regards

0 Kudos

771 Views
Alexis_A
NXP TechSupport
NXP TechSupport

Hi S_S,

The last LPCOpen version is the 3.02, could you try using this version?

You can found it here:

https://www.nxp.com/design/microcontrollers-developer-resources/lpcopen-libraries-and-examples/lpcop...

Let me know if this helps you.

Best Regards,

Alexis Andalon

0 Kudos

771 Views
ssudhir
Contributor II

Which version of LPCopen has more stable USB mass storage device drive?

0 Kudos

771 Views
ssudhir
Contributor II

In your LPCopen USB mass storage host device driver there are many assert_status_Ok call is there. Looks like it puts the system in forever loop. Was this Assert_Status_OK for debug purposes?

0 Kudos

771 Views
ssudhir
Contributor II

That structure is used to write 8 bits at a time, that is not the one creating forever loop. Please let us know what is teh reasonable timeout. Don't want system to hang in forever loop.

We also need to know what is causing this forever loop?

Thanks

0 Kudos

771 Views
ssudhir
Contributor II

In  USB_Pipe_Data_t  structure PipeHandle is a uint32_t. In pipe.c  - HcdOpenPipe function takes pointer to PipeHandle and passes this pointer to PipehandleCreate function which internally treats that as pointer to a structure. So far the code was working most likely that address accidentally free. Did you have any fix for this?

Thanks

0 Kudos