nxp-imx / mfgtools

Freescale/NXP I.MX Chip image deploy tools.
BSD 3-Clause "New" or "Revised" License
523 stars 293 forks source link

Fail Bulk(R):LIBUSB_ERROR_TIMEOUT(2.009s) #391

Open mhadavan opened 9 months ago

mhadavan commented 9 months ago

Based on some other issues reported here #334 , I did a simple test to reproduce a LIBUSB_ERROR_TIMEOUT problem that I have on a board:

SDP: boot -f imx-boot-sd.bin-flash_evk SDPV: delay 1000 SDPV: write -f imx-boot-sd.bin-flash_evk -skipspl SDPV: jump FB[-t 15000]: ucmd sleep 3

The problem here is that I always get Fail Bulk(R):LIBUSB_ERROR_TIMEOUT during the sleep operation.

Is this a bug in uuu or is there some parameters I can change to avoid the error message?

mhadavan commented 9 months ago

After some more investigations and testing, I have found that if I increase the m_Timeout to something big in trans.cpp:: BulkTrans:Read function, I do not get the LIB_ERROR_TIMEOUT message in my test above.

ret = libusb_bulk_transfer( (libusb_device_handle *)m_devhandle, m_ep_in.addr, p, size, &actual_length, 100000 );

Is there any reason for having it at 2000?

nxpfrankli commented 9 months ago

uboot command is sync. Default 2s to run it. BulkTrans:read try to get ucmd's running result. If exceed 2s, it will be timeout.