Ticket #2348 (new defect)

Opened 8 years ago

Last modified 8 years ago

dfu-util shows only one partition

Reported by: gravis Owned by: openmoko-devel
Priority: normal Milestone:
Component: host utilities Version:
Severity: normal Keywords:
Cc: Blocked By:
Blocking: Estimated Completion (week):
HasPatchForReview: no PatchReviewResult:
Reproducible:

Description

This bug could be related only to my OM. Every time I run dfu-util (ubuntu 10.04, ubuntu 10.04 x64, windows xp with dfu-util for windows) in NOR boot menu I can see only one partition:

Found Runtime: [0x1d50:0x5119] devnum=1, cfg=0, intf=2, alt=0, name="USB Device Firmware Upgrade"

Which is not named rootfs but acts like rootfs. I guess my OM doesn't switch to DFU mode during dfu-util -l (it should, right?), and stays in runtime mode (?)

After flashing rootfs (OM shows DFU mode, configured device 1 etc..) dfu-util shows this partition as :

Found Runtime: [0x1d50:0x5119] devnum=2, cfg=0, intf=0, alt=0, name="rootfs"

This time seems ok (notice intf changed to 0), but still - where are my kernel / u-boot partitions ? Can't flash them if dfu-util doesn't recognise them.

my printenv + lsmod + lsusb + dmesg : http://pastebin.pl/26214 (should I attach here?)

MY other thoughts: Could it be host kernel related or latest uhci_usb ? I will try to confirm this bug on other distros cuz hard to say now is it host related or my OM related.

PS. I've flashed Qi bootloader some time ago (~1 year) and shr-u rootfs recently. But didn't checked what partitions were available just before flashing rootfs.

Attachments

usbcapt (340 bytes) - added by gravis 8 years ago.
usb wireshark capture
usbcapt3 (962 bytes) - added by lindi 8 years ago.
pcap dump of usb traffic under 2.6.32

Change History

comment:1 Changed 8 years ago by gravis

Also tested dfu-util 0.0+r4880-1 (ubuntu repo).. same issue..

comment:2 Changed 8 years ago by lindi

Thank you for reporting a bug. Please capture the usb traffic using wireshark to a pcap file and attach it here.

Also, if you can boot your phone. Please the following commands and add their output to the bug report:

strings /dev/mtdblock0 | grep U-Boot | head -n1
strings /dev/mtdblock1 | grep
U-Boot | head -n1

comment:3 Changed 8 years ago by lindi

Sorry, wiki markup in a bug tracking system confused me again, the commands were

strings /dev/mtdblock0 | grep ^U-Boot | head -n1
strings /dev/mtdblock1 | grep ^U-Boot | head -n1

comment:4 Changed 8 years ago by boudewijn

I just encountered the same problem. I haven't figured out how to add comment in trac yet, and I have not been able to get Wireshark to logging either.

My findings so far:
# dfu-util -l
dfu-util - (C) 2007-2008 by OpenMoko? Inc.
This program is Free Software and has ABSOLUTELY NO WARRANTY
Found DFU: [0x1d50:0x5119] devnum=10, cfg=0, intf=0, alt=6, name="rootfs"

On some points different from your example, the symptoms are similar.

Maybe related:

  • booting from uboot does not work anymore since opkg-update about a month back
  • booting via Qi and then the top-button gives me a working environment BUT only since I reflashed the rootfs tonight; for about a month, the screen would not wake up after booting.

Once I find some time I'll run the proposed test on the phone and try some more with Wireshark: there did not seem to be related traffic on any of the USB-interfaces when running dfu-util to flash the kernel or backup the rootfs (while in uboot, so the IP was not available for backup..)

comment:5 Changed 8 years ago by boudewijn

ok, as it seems, I recently _have_ found how to add comments to Trac (overlooked the comment box, or did not refresh the cache after registering), but I haven't found the edit post button yet ;-)

Changed 8 years ago by gravis

usb wireshark capture

comment:6 Changed 8 years ago by gravis

ok. I've added usb capture during running dfu-util -l

I've realised that frame length of 4th packet is 64bytes (according to header) but seems it was transmitted bigger? See that device name string is longer than captured one..

Would you like me to upload a capture from full connection (from turning device on, then dfu-util -l, then waiting for uboot timeout) ? Or is it enough?

I'll upload those mtdblock strings in a minute..

comment:7 Changed 8 years ago by gravis

OK

check my greps here (second one gave me nothing so I've grepped with more greedy rule)

http://pastebin.pl/26298

comment:8 Changed 8 years ago by lindi

Thank you for all the information you provided. I can reproduce your problem with dfu-util 0.0+r4880-1 from debian unstable and dfu-util 0.0+r4067-3.1 from debian stable. Both were run under linux 2.6.32-amd64-lindi2.

The output was

$ sudo dfu-util -l
dfu-util - (C) 2007 by OpenMoko Inc.
This program is Free Software and has ABSOLUTELY NO WARRANTY

Found Runtime: [0x1d50:0x5119] devnum=8, cfg=0, intf=2, alt=0, name="USB Device Firmware Upgrade"

lsusb -vvv shows

Bus 007 Device 011: ID 1d50:5119 OpenMoko, Inc. 
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               1.10
  bDeviceClass            2 Communications
  bDeviceSubClass         0 
  bDeviceProtocol         0 
  bMaxPacketSize0        16
  idVendor           0x1d50 OpenMoko, Inc.
  idProduct          0x5119 
  bcdDevice            0.00
  iManufacturer           1 OpenMoko, Inc
  iProduct                2 Neo1973 Bootloader U-Boot 1.3.2-moko12
  iSerial                 3 0000000
  bNumConfigurations      2
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength           85
    bNumInterfaces          3
    bConfigurationValue     1
    iConfiguration          4 TTY via USB
    bmAttributes         0x80
      (Bus Powered)
    MaxPower              500mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           1
      bInterfaceClass         2 Communications
      bInterfaceSubClass      2 Abstract (modem)
      bInterfaceProtocol      1 AT-commands (v.25ter)
      iInterface              6 Control Interface
      CDC Header:
        bcdCDC               0.6e
      CDC Call Management:
        bmCapabilities       0x00
        bDataInterface          1
      CDC ACM:
        bmCapabilities       0x00
      CDC Union:
        bMasterInterface        0
        bSlaveInterface         1 
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x81  EP 1 IN
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0010  1x 16 bytes
        bInterval             255
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        1
      bAlternateSetting       0
      bNumEndpoints           2
      bInterfaceClass        10 CDC Data
      bInterfaceSubClass      0 Unused
      bInterfaceProtocol      0 
      iInterface              5 Bulk Data Interface
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x02  EP 2 OUT
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0010  1x 16 bytes
        bInterval             255
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x83  EP 3 IN
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0010  1x 16 bytes
        bInterval             255
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        2
      bAlternateSetting       0
      bNumEndpoints           0
      bInterfaceClass       254 Application Specific Interface
      bInterfaceSubClass      1 Device Firmware Update
      bInterfaceProtocol      1 
      iInterface              7 USB Device Firmware Upgrade
      ** UNRECOGNIZED:  09 21 07 00 ff 00 10 00 01
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength           67
    bNumInterfaces          2
    bConfigurationValue     2
    iConfiguration          4 TTY via USB
    bmAttributes         0x80
      (Bus Powered)
    MaxPower              100mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           1
      bInterfaceClass         2 Communications
      bInterfaceSubClass      2 Abstract (modem)
      bInterfaceProtocol      1 AT-commands (v.25ter)
      iInterface              6 Control Interface
      CDC Header:
        bcdCDC               0.6e
      CDC Call Management:
        bmCapabilities       0x00
        bDataInterface          1
      CDC ACM:
        bmCapabilities       0x00
      CDC Union:
        bMasterInterface        0
        bSlaveInterface         1 
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x81  EP 1 IN
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0010  1x 16 bytes
        bInterval             255
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        1
      bAlternateSetting       0
      bNumEndpoints           2
      bInterfaceClass        10 CDC Data
      bInterfaceSubClass      0 Unused
      bInterfaceProtocol      0 
      iInterface              5 Bulk Data Interface
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x02  EP 2 OUT
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0010  1x 16 bytes
        bInterval             255
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x83  EP 3 IN
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0010  1x 16 bytes
        bInterval             255
Device Status:     0x0001
  Self Powered

That ' UNRECOGNIZED: 09 21 07 00 ff 00 10 00 01' looks bad!

Changed 8 years ago by lindi

pcap dump of usb traffic under 2.6.32

comment:9 Changed 8 years ago by gravis

instead of that UNRECOGNIZED line I have :

      Device Firmware Upgrade Interface Descriptor:
        bLength                             9
        bDescriptorType                    33
        bmAttributes                        7
          Will Not Detach
          Manifestation Tolerant
          Upload Supported
          Download Supported
        wDetachTimeout                  65280 milliseconds
        wTransferSize                    4096 bytes
        bcdDFUVersion                   0.01

Seems it's rather host problem than OM.. good to hear that ;)

comment:10 Changed 8 years ago by lindi

gravis, what kernel do you have on host?

comment:11 Changed 8 years ago by gravis

Linux gravis 2.6.32-23-generic #37-Ubuntu SMP Fri Jun 11 08:03:28 UTC 2010 x86_64 GNU/Linux

comment:12 Changed 8 years ago by gravis

I've checked same machine with previous kernel : 2.6.31-15 same issue..
but it's mainly the same kernel.

comment:13 Changed 8 years ago by lindi

This also happens with 2.6.26-2-486 kernel of debian stable. I am bit puzzled. How did this ever work?

$ sudo dfu-util -l
dfu-util - (C) 2007 by OpenMoko Inc.
This program is Free Software and has ABSOLUTELY NO WARRANTY

Found Runtime: [0x1d50:0x5119] devnum=71, cfg=0, intf=2, alt=0, name="USB Device Firmware Upgrade"
Bus 002 Device 071: ID 1d50:5119 OpenMoko, Inc. 
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               1.10
  bDeviceClass            2 Communications
  bDeviceSubClass         0 
  bDeviceProtocol         0 
  bMaxPacketSize0        16
  idVendor           0x1d50 OpenMoko, Inc.
  idProduct          0x5119 
  bcdDevice            0.00
  iManufacturer           1 OpenMoko, Inc
  iProduct                2 Neo1973 Bootloader U-Boot 1.3.2-moko12
  iSerial                 3 0000000
  bNumConfigurations      2
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength           85
    bNumInterfaces          3
    bConfigurationValue     1
    iConfiguration          4 TTY via USB
    bmAttributes         0x80
      (Bus Powered)
    MaxPower              500mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           1
      bInterfaceClass         2 Communications
      bInterfaceSubClass      2 Abstract (modem)
      bInterfaceProtocol      1 AT-commands (v.25ter)
      iInterface              6 Control Interface
      CDC Header:
        bcdCDC               0.6e
      CDC Call Management:
        bmCapabilities       0x00
        bDataInterface          1
      CDC ACM:
        bmCapabilities       0x00
      CDC Union:
        bMasterInterface        0
        bSlaveInterface         1 
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x81  EP 1 IN
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0010  1x 16 bytes
        bInterval             255
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        1
      bAlternateSetting       0
      bNumEndpoints           2
      bInterfaceClass        10 CDC Data
      bInterfaceSubClass      0 Unused
      bInterfaceProtocol      0 
      iInterface              5 Bulk Data Interface
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x02  EP 2 OUT
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0010  1x 16 bytes
        bInterval             255
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x83  EP 3 IN
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0010  1x 16 bytes
        bInterval             255
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        2
      bAlternateSetting       0
      bNumEndpoints           0
      bInterfaceClass       254 Application Specific Interface
      bInterfaceSubClass      1 Device Firmware Update
      bInterfaceProtocol      1 
      iInterface              7 USB Device Firmware Upgrade
      ** UNRECOGNIZED:  09 21 07 00 ff 00 10 00 01
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength           67
    bNumInterfaces          2
    bConfigurationValue     2
    iConfiguration          4 TTY via USB
    bmAttributes         0x80
      (Bus Powered)
    MaxPower              100mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           1
      bInterfaceClass         2 Communications
      bInterfaceSubClass      2 Abstract (modem)
      bInterfaceProtocol      1 AT-commands (v.25ter)
      iInterface              6 Control Interface
      CDC Header:
        bcdCDC               0.6e
      CDC Call Management:
        bmCapabilities       0x00
        bDataInterface          1
      CDC ACM:
        bmCapabilities       0x00
      CDC Union:
        bMasterInterface        0
        bSlaveInterface         1 
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x81  EP 1 IN
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0010  1x 16 bytes
        bInterval             255
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        1
      bAlternateSetting       0
      bNumEndpoints           2
      bInterfaceClass        10 CDC Data
      bInterfaceSubClass      0 Unused
      bInterfaceProtocol      0 
      iInterface              5 Bulk Data Interface
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x02  EP 2 OUT
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0010  1x 16 bytes
        bInterval             255
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x83  EP 3 IN
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0010  1x 16 bytes
        bInterval             255
Device Status:     0x0001
  Self Powered

comment:14 Changed 8 years ago by gravis

When I was updating that Qi bootloader ~1 year ago I remember I saw all the partitions. Since then I didn't touched uboot / kernel partitions at all. Just rootfs recently.

Which distro/kernel is confirmed working with dfu-util (showing all partitions)? Wandering where to chroot..

comment:15 Changed 8 years ago by gravis

With the kernel 2.6.32-24 it started to working.. but differently?

Ok I know how all those things work now.

Found Runtime: [0x1d50:0x5119] devnum=1, cfg=0, intf=2, alt=0, name="USB Device Firmware Upgrade"

See that intf=2 and cfg=0 ? Now compare this to my lsusb output.

This means that output was taken from first configuration (bConfigurationValue 1), third interface (bInterfaceNumber 2), interface is named "USB Device Firmware Upgrade"

But in fact, when OM is flashed it shows

Found Runtime: [0x1d50:0x5119] devnum=2, cfg=0, intf=0, alt=0, name="rootfs"

Which is first configuration (bConfigurationValue 1), first interface (bInterfaceNumber 0), which is AT-commands (v.25ter) Control Interface.

So different protocol is used to list partitions (UDF), and different one to flash them (AT terminal upload (?)).

Once we force dfu-util to use interface 0 it will show all the partitions (coming from AT query, rather than innacurate DFU).

so

dfu-util --intf 0 -l

should shows correct partitions and all flashing commands should have --intf 0 option.

the problem is dfu-util ignores --intf 0 during listing..

but during flashing it works like a charm!

Conclusion:

always use --intf 0 when flashing with dfu-util.

[solved]

comment:16 Changed 8 years ago by gravis

.. am I right with all those thoughts ?

Note: See TracTickets for help on using tickets.