Ticket #298 (closed defect: fixed)
u-boot i2c read error causes dfu-util requiring 2 calls to run
| Reported by: | mickey@… | Owned by: | buglog@… |
|---|---|---|---|
| Priority: | high | Milestone: | |
| Component: | u-boot | Version: | unspecified |
| Severity: | normal | Keywords: | |
| Cc: | buglog@… | Blocked By: | |
| Blocking: | Estimated Completion (week): | ||
| HasPatchForReview: | PatchReviewResult: | ||
| Reproducible: |
Description
It looks like the dfu-util needs to have an increased timeout for checking for
the device after changing modes / resetting bus. Please see the following
(reproducable) output:
mickey@allanon:/tmp/moko$ dfu-util -d 0x1457:0x5119 -a 5 -R -D
openmoko-devel-image-fic-gta01-20070321132058.rootfs.jffs2
dfu-util - (C) 2007 by OpenMoko? Inc.
This program is Free Software and has ABSOLUTELY NO WARRANTY
Opening USB Device 0x1457:0x5119...
Claiming USB DFU Runtime Interface...
Determining device status: state = appIDLE, status = 0
Device really in Runtime Mode, send DFU detach request...
Resetting USB...
not at least 2 device changes found ?!?
Lost device after RESET?
mickey@allanon:/tmp/moko$ dfu-util -d 0x1457:0x5119 -a 5 -R -D
openmoko-devel-image-fic-gta01-20070321132058.rootfs.jffs2
dfu-util - (C) 2007 by OpenMoko? Inc.
This program is Free Software and has ABSOLUTELY NO WARRANTY
Opening USB Device 0x1457:0x5119...
Found Runtime: [0x1457:0x5119] devnum=10, cfg=0, intf=0, alt=5, name="rootfs"
Claiming USB DFU Interface...
Setting Alternate Setting ...
Determining device status: state = dfuIDLE, status = 0
dfuIDLE, continuing
Transfer Size = 0x1000
bytes_per_hash=518062
Starting download: [##########
Change History
comment:2 Changed 6 years ago by philippedeswert@…
spelling issue also pointed out in #335 (with patch)
comment:3 Changed 6 years ago by stefan@…
Interesting is the u-boot output during the fail:
DFU: Switching to DFU Mode
DEVICE_CONFIGURED: 1
Enabling automatic fast charge
I2c read: failed 4
I don't had the problem with u-boot-moko5. Must be introduced in 6 or 7. Still
using the dfu-util pre compiled binary from devirginator.
comment:4 Changed 6 years ago by stefan@…
trunk/src/host/dfu-util/src/main.c:516
if (usb_find_devices() < 2)
If this function is in place num_devs is 0 (519)
if (num_devs == 0) {
fprintf(stderr, "Lost device after RESET?\n");
exit(1);
}
If you comment out the line above it passes until 546.
n = find_dfu_if(dif->dev, &alt_by_name, alt_name);
if (!n) {
fprintf(stderr, "No such Alternate Setting: \"%s\"\n", alt_name);
exit(1);
}
Not sure yet why usb_find_devices() is involved here.
comment:5 Changed 6 years ago by laforge@…
- Component changed from Host Software to u-boot
- Summary changed from dfu-util always needs 2 calls to run to u-boot i2c read error causes dfu-util requiring 2 calls to run
hm, this is actually a u-boot issue. On my Bv4 (don't have other revisions with
me while travelling) using svn patchset 1737, I cannot reproduce the problem at
all, since the i2c read error is gone.
I think this is timing related. when there is some i2c bus problem, the neo1973
doesn't re-enumerate fast enough on the bus for dfu-util to handle it.
Will try to get hold of a Bv3 and retry.

I can confirm the issue:
fille@monster:~/mydev/openmoko/build/tmp/deploy/images$ sudo ./dfu-util -a 5 -R
-D openmoko-devel-image-fic-gta01.jffs2
dfu-util - (C) 2007 by OpenMoko? Inc.
This program is Free Software and has ABSOLUTELY NO WARRANTY
Opening USB Device 0x0000:0x0000...
Claiming USB DFU Runtime Interface...
Determining device status: state = appIDLE, status = 0
Device really in Runtime Mode, send DFU detach request...
Resetting USB...
not at least 2 device changes found ?!?
Lost device after RESET?
fille@monster:~/mydev/openmoko/build/tmp/deploy/images$ sudo ./dfu-util -a 5 -R
-D openmoko-devel-image-fic-gta01.jffs2
dfu-util - (C) 2007 by OpenMoko? Inc.
This program is Free Software and has ABSOLUTELY NO WARRANTY
Opening USB Device 0x0000:0x0000...
Found Runtime: [0x1457:0x5119] devnum=107, cfg=0, intf=0, alt=5, name="rootfs"
Claiming USB DFU Interface...
Setting Alternate Setting ...
Determining device status: state = dfuIDLE, status = 0
dfuIDLE, continuing
Transfer Size = 0x1000
bytes_per_hash=526254
Starting download: ################################################## finished!
state(2) = dfuIDLE, status(0) = No error condition is present
Done!
Resetting USB to swithc back to runtime mode
Also correct the spelling mistake while you are at it :-)
U-boot version is
u-boot-gta01v3-r2_44ba464b99001f8bd1c456a1e9d59726252f707a_1503.bin if that
helps pinpointing the problem