rockchip-linux / rkdeveloptool

GNU General Public License v2.0
159 stars 91 forks source link

USB issue: "Downloading bootloader..." and not further progress #49

Closed cmuellner closed 4 years ago

cmuellner commented 4 years ago

I'm having issues to use rkdeveloptool on a machine with the following characteristics:

The issue manifests by not being able to download the loader.bin to the SoC, that is in USB-Loader-Mode and that successfully enumerated on the host machine. Not being able in this context means, that all I see is "Downloading bootloader..." and not further process.

strace tells me the following:

write(1, "Downloading bootloader...\r\n", 27Downloading bootloader...
) = 27
ioctl(11, USBDEVFS_SUBMITURB, 0x55e1f8a25b70) = 0
read(8, "\1", 1)                        = 1
poll([{fd=8, events=POLLIN}, {fd=10, events=POLLIN}, {fd=11, events=POLLOUT}], 3, 60000) = 1 ([{fd=11, revents=POLLOUT}])
ioctl(11, USBDEVFS_REAPURBNDELAY, 0x7ffc5dbb9dd0) = 0
ioctl(11, USBDEVFS_REAPURBNDELAY, 0x7ffc5dbb9dd0) = -1 EAGAIN (Resource temporarily unavailable)
ioctl(11, USBDEVFS_SUBMITURB, 0x55e1f8a26d60) = 0
poll([{fd=8, events=POLLIN}, {fd=10, events=POLLIN}, {fd=11, events=POLLOUT}], 3, 60000) = 1 ([{fd=11, revents=POLLOUT}])
ioctl(11, USBDEVFS_REAPURBNDELAY, 0x7ffc5dbb9dd0) = 0
ioctl(11, USBDEVFS_REAPURBNDELAY, 0x7ffc5dbb9dd0) = -1 EAGAIN (Resource temporarily unavailable)
ioctl(11, USBDEVFS_SUBMITURB, 0x55e1f8a37360) = 0
poll([{fd=8, events=POLLIN}, {fd=10, events=POLLIN}, {fd=11, events=POLLOUT}], 3, 60000) = 1 ([{fd=11, revents=POLLOUT}])
ioctl(11, USBDEVFS_REAPURBNDELAY, 0x7ffc5dbb9dd0) = 0
ioctl(11, USBDEVFS_REAPURBNDELAY, 0x7ffc5dbb9dd0) = -1 EAGAIN (Resource temporarily unavailable)
clock_nanosleep(CLOCK_REALTIME, 0, {tv_sec=0, tv_nsec=1000000}, NULL) = 0
mmap(NULL, 155648, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f7d4e278000
mmap(NULL, 155648, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f7d4d474000
ioctl(11, USBDEVFS_SUBMITURB, 0x55e1f8a24ff0) = 0
poll([{fd=8, events=POLLIN}, {fd=10, events=POLLIN}, {fd=11, events=POLLOUT}], 3, 60000) = ? ERESTART_RESTARTBLOCK (Interrupted by signal)
--- SIGWINCH {si_signo=SIGWINCH, si_code=SI_KERNEL} ---
restart_syscall(<... resuming interrupted poll ...>) = 0
poll([{fd=8, events=POLLIN}, {fd=10, events=POLLIN}, {fd=11, events=POLLOUT}], 3, 60000) = 0 (Timeout)
poll([{fd=8, events=POLLIN}, {fd=10, events=POLLIN}, {fd=11, events=POLLOUT}], 3, 60000) = 0 (Timeout)
poll([{fd=8, events=POLLIN}, {fd=10, events=POLLIN}, {fd=11, events=POLLOUT}], 3, 60000) = 0 (Timeout)
poll([{fd=8, events=POLLIN}, {fd=10, events=POLLIN}, {fd=11, events=POLLOUT}], 3, 60000

Further notes:

Questions:

CC: @nullr0ute @mmind @keveryang

shineseth commented 4 years ago

you can change CMD_TIMEOUT from 0 into 5.calling function of libusb will return after 5 seconds. but i don't get the key point about stalling.please send the log under the log directory for go further analyze.

cmuellner commented 4 years ago

This turned out to be a production issue with the tested boards. Things are working fine after replacing the boards. Sorry for the noise.