Skip to contentSkip to conversation

dfu, usb: set usb descriptor to values defined in dfu spec 1.1

PATCH New Heiko Schocher 3 participants 8 messages Sep 4, 2014 – Sep 9, 2014 USB

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 dfu, usb: set usb descriptor to values defined in dfu spec 1.1

set bDeviceClass, bDeviceSubClass and bcdUSB to the values defined in dfu spec 1.1 chapter 4.2.1 found here:

http://www.usb.org/developers/devclass_docs/DFU_1.1.pdf

Cc Lukasz Majewski <[email protected]>
Cc Marek Vasut <[email protected]>
Cc Roger Meier <[email protected]>

---

before this patch, "dfu-util -l" showed:

Bus 002 Device 114: ID 0908:02c5 Siemens AG Device Descriptor:
bLength 18
bDescriptorType 1
bcdUSB 2.00

  bDeviceClass            2 Communications
  bDeviceSubClass         2 Abstract (modem)
  bDeviceProtocol         0 None

bMaxPacketSize0 64
idVendor 0x0908 Siemens AG
idProduct 0x02c5
bcdDevice 0.00
iManufacturer 1 Siemens AG

with this patch:

Bus 002 Device 089: ID 0908:02c5 Siemens AG Device Descriptor:
bLength 18
bDescriptorType 1
bcdUSB 1.10

  bDeviceClass            0 (Defined at Interface level)
  bDeviceSubClass         0
  bDeviceProtocol         0

bMaxPacketSize0 64
idVendor 0x0908 Siemens AG
idProduct 0x02c5
bcdDevice 0.00
iManufacturer 1 Siemens AG
iProduct 2 USB download gadget

which fits for "bcdUSB", "bDeviceClass" and "bDeviceSubClass" with the DFU spezifikation.

---
 drivers/usb/gadget/f_dfu.c | 5 +++--
 drivers/usb/gadget/g_dnl.c | 6 +++---
 2 files changed, 6 insertions(+), 5 deletions(-)
drivers/usb/gadget/f_dfu.c +3 -2
index 9128add..9429e50 100644
@@ -83,8 +83,9 @@ static struct usb_descriptor_header *dfu_runtime_descs[] = {
 static const struct usb_qualifier_descriptor dev_qualifier = {
 	.bLength =		sizeof dev_qualifier,
 	.bDescriptorType =	USB_DT_DEVICE_QUALIFIER,
-	.bcdUSB =		__constant_cpu_to_le16(0x0200),
-	.bDeviceClass =		USB_CLASS_VENDOR_SPEC,
+	.bcdUSB =		__constant_cpu_to_le16(0x0110),
+	.bDeviceClass =		USB_CLASS_PER_INTERFACE,
+	.bDeviceSubClass =	0x00,
 	.bNumConfigurations =	1,
 };
 
drivers/usb/gadget/g_dnl.c +3 -3
index dd95afe..bcca965 100644
@@ -57,9 +57,9 @@ static struct usb_device_descriptor device_desc = {
 	.bLength = sizeof device_desc,
 	.bDescriptorType = USB_DT_DEVICE,
 
-	.bcdUSB = __constant_cpu_to_le16(0x0200),
-	.bDeviceClass = USB_CLASS_COMM,
-	.bDeviceSubClass = 0x02, /*0x02:CDC-modem , 0x00:CDC-serial*/
+	.bcdUSB = __constant_cpu_to_le16(0x0110),
+	.bDeviceClass = USB_CLASS_PER_INTERFACE,
+	.bDeviceSubClass = 0x00, /*0x02:CDC-modem , 0x00:CDC-serial*/
 
 	.idVendor = __constant_cpu_to_le16(CONFIG_G_DNL_VENDOR_NUM),
 	.idProduct = __constant_cpu_to_le16(CONFIG_G_DNL_PRODUCT_NUM),
Signature · 1 line
1.8.3.1
#1 lore raw

PATCH 1/1 dfu, usb: set usb descriptor to values defined in dfu spec 1.1

On Thursday, September 04, 2014 at 12:21:40 PM, Heiko Schocher wrote:

Hi Heiko,

I'll just rant a bit, but please wait until Lukasz does a proper runthrough.

Quoted 4 lines

set bDeviceClass, bDeviceSubClass and bcdUSB to the values defined in dfu spec 1.1 chapter 4.2.1 found here:

http://www.usb.org/developers/devclass_docs/DFU_1.1.pdf

This URL gives me a website with:
"
Resource not found.
Please check the URL and try again.
"

Quoted 40 lines
Cc Lukasz Majewski <[email protected]>
Cc Marek Vasut <[email protected]>
Cc Roger Meier <[email protected]>

---

before this patch, "dfu-util -l" showed:

Bus 002 Device 114: ID 0908:02c5 Siemens AG Device Descriptor:
bLength 18
bDescriptorType 1
bcdUSB 2.00

  bDeviceClass            2 Communications
  bDeviceSubClass         2 Abstract (modem)
  bDeviceProtocol         0 None

bMaxPacketSize0 64
idVendor 0x0908 Siemens AG
idProduct 0x02c5
bcdDevice 0.00
iManufacturer 1 Siemens AG

with this patch:

Bus 002 Device 089: ID 0908:02c5 Siemens AG Device Descriptor:
bLength 18
bDescriptorType 1
bcdUSB 1.10

  bDeviceClass            0 (Defined at Interface level)
  bDeviceSubClass         0
  bDeviceProtocol         0

bMaxPacketSize0 64
idVendor 0x0908 Siemens AG
idProduct 0x02c5
bcdDevice 0.00
iManufacturer 1 Siemens AG
iProduct 2 USB download gadget

Quoted 2 lines

which fits for "bcdUSB", "bDeviceClass" and "bDeviceSubClass" with the DFU spezifikation.

This patch doesn't seem fully right, let me explain below please.

Quoted 10 lines
---
 drivers/usb/gadget/f_dfu.c | 5 +++--
 drivers/usb/gadget/g_dnl.c | 6 +++---
 2 files changed, 6 insertions(+), 5 deletions(-)
drivers/usb/gadget/f_dfu.c +0 -0
index 9128add..9429e50 100644

drivers/usb/gadget/f_dfu.c static struct usb_descriptor_header *dfu_runtime_descs[] · line 86

Quoted 6 lines
drivers/usb/gadget/f_dfu.c +1 -2
@@ -83,8 +83,9 @@ static struct usb_descriptor_header *dfu_runtime_descs[]
 = { static const struct usb_qualifier_descriptor dev_qualifier = {
 	.bLength =		sizeof dev_qualifier,
 	.bDescriptorType =	USB_DT_DEVICE_QUALIFIER,
-	.bcdUSB =		__constant_cpu_to_le16(0x0200),
-	.bDeviceClass =		USB_CLASS_VENDOR_SPEC,
+	.bcdUSB =		__constant_cpu_to_le16(0x0110),

See [1] and look for first and second instance of 'bcdUsb' there please. Quote of the second one:

'
The bcdUSB field reports the highest version of USB the device supports. The value is in binary coded decimal with a format of 0xJJMN where JJ is the major version number, M is the minor version number and N is the sub minor version number. e.g. USB 2.0 is reported as 0x0200, USB 1.1 as 0x0110 and USB 1.0 as 0x0100.
'

So this should be configured dynamically based on what the highest mode the controller supports is, no?

drivers/usb/gadget/f_dfu.c static struct usb_descriptor_header *dfu_runtime_descs[] · line 87

Quoted 1 line
drivers/usb/gadget/f_dfu.c +1 -0
+	.bDeviceClass =		USB_CLASS_PER_INTERFACE,

This might be OK.

drivers/usb/gadget/f_dfu.c static struct usb_descriptor_header *dfu_runtime_descs[] = { · line 88

Quoted 1 line
drivers/usb/gadget/f_dfu.c +1 -0
+	.bDeviceSubClass =	0x00,

But this is not, the device definitelly isn't CDC-serial.

[...]

[1] http://www.beyondlogic.org/usbnutshell/usb5.shtml

#2 lore raw

PATCH 1/1 dfu, usb: set usb descriptor to values defined in dfu spec 1.1

Hello Marek,

Am 05.09.2014 00:42, schrieb Marek Vasut:

Quoted 9 lines · Heiko Schocher

Hi Heiko,

I'll just rant a bit, but please wait until Lukasz does a proper runthrough.

Quoted 3 lines

set bDeviceClass, bDeviceSubClass and bcdUSB to the values defined in dfu spec 1.1 chapter 4.2.1 found here:

Quoted 7 lines
Quoted 1 line

http://www.usb.org/developers/devclass_docs/DFU_1.1.pdf

This URL gives me a website with:
"
Resource not found.
Please check the URL and try again.
"

:-( Maybe it is deleted currently there?
Hmm.. there is a search field if you open the above URL ... and if you type DFU and press search, you get:

DFU
File Format: PDF/Adobe Acrobat
Aug 5, 2004 ... USB Device Firmware Upgrade Specification, Revision 1.1. 2. Intellectual Property Disclaimer. THIS SPECIFICATION IS PROVIDED ?AS IS? ... www.usb.org/developers/devclass_docs/DFU_1.1.pdf

This is exactly the above link ...

This link is also referenced from openmoko:

http://wiki.openmoko.org/wiki/USB_DFU_-_The_USB_Device_Firmware_Upgrade_standard

Quoted 73 lines
Quoted 40 lines
Cc Lukasz Majewski<[email protected]>
Cc Marek Vasut<[email protected]>
Cc Roger Meier<[email protected]>

---

before this patch, "dfu-util -l" showed:

Bus 002 Device 114: ID 0908:02c5 Siemens AG
Device Descriptor:
bLength 18
bDescriptorType 1
bcdUSB 2.00

   bDeviceClass            2 Communications
   bDeviceSubClass         2 Abstract (modem)
   bDeviceProtocol         0 None

bMaxPacketSize0 64
idVendor 0x0908 Siemens AG
idProduct 0x02c5
bcdDevice 0.00
iManufacturer 1 Siemens AG

with this patch:

Bus 002 Device 089: ID 0908:02c5 Siemens AG
Device Descriptor:
bLength 18
bDescriptorType 1
bcdUSB 1.10

   bDeviceClass            0 (Defined at Interface level)
   bDeviceSubClass         0
   bDeviceProtocol         0

bMaxPacketSize0 64
idVendor 0x0908 Siemens AG
idProduct 0x02c5
bcdDevice 0.00
iManufacturer 1 Siemens AG
iProduct 2 USB download gadget

Quoted 2 lines

which fits for "bcdUSB", "bDeviceClass" and "bDeviceSubClass" with the DFU spezifikation.

This patch doesn't seem fully right, let me explain below please.

Quoted 10 lines
---
  drivers/usb/gadget/f_dfu.c | 5 +++--
  drivers/usb/gadget/g_dnl.c | 6 +++---
  2 files changed, 6 insertions(+), 5 deletions(-)
drivers/usb/gadget/f_dfu.c +0 -0
index 9128add..9429e50 100644

drivers/usb/gadget/f_dfu.c static struct usb_descriptor_header *dfu_runtime_descs[] · line 86

Quoted 6 lines
drivers/usb/gadget/f_dfu.c +1 -2
@@ -83,8 +83,9 @@ static struct usb_descriptor_header *dfu_runtime_descs[]
 = { static const struct usb_qualifier_descriptor dev_qualifier = {
  	.bLength =		sizeof dev_qualifier,
  	.bDescriptorType =	USB_DT_DEVICE_QUALIFIER,
-	.bcdUSB =		__constant_cpu_to_le16(0x0200),
-	.bDeviceClass =		USB_CLASS_VENDOR_SPEC,
+	.bcdUSB =		__constant_cpu_to_le16(0x0110),

See [1] and look for first and second instance of 'bcdUsb' there please. Quote of the second one:

'
The bcdUSB field reports the highest version of USB the device supports. The value is in binary coded decimal with a format of 0xJJMN where JJ is the major version number, M is the minor version number and N is the sub minor version number. e.g. USB 2.0 is reported as 0x0200, USB 1.1 as 0x0110 and USB 1.0 as 0x0100.
'

Quoted 2 lines

So this should be configured dynamically based on what the highest mode the controller supports is, no?

Good question ... the DFU 1.1 spezification says in chapter 4.2.1 DFU Mode Device Descriptor:

bcdUSB = 0100 USB specification release number in binary coded decimal.
(which seems wrong, as the spez is version 1.1, see [2])
bDeviceClass = 0
bDeviceSubClass = 0

... ?

I discussed this change with Lukasz, see:

[2] http://lists.denx.de/pipermail/u-boot/2014-August/186918.html

Quoted 5 lines

drivers/usb/gadget/f_dfu.c static struct usb_descriptor_header *dfu_runtime_descs[] · line 87

Quoted 2 lines
drivers/usb/gadget/f_dfu.c +1 -0
+	.bDeviceClass =		USB_CLASS_PER_INTERFACE,

This might be OK.

Quoted 7 lines

drivers/usb/gadget/f_dfu.c static struct usb_descriptor_header *dfu_runtime_descs[] = { · line 88

Quoted 1 line
drivers/usb/gadget/f_dfu.c +1 -0
+	.bDeviceSubClass =	0x00,

But this is not, the device definitelly isn't CDC-serial.

[...]

[1] http://www.beyondlogic.org/usbnutshell/usb5.shtml

bye,
Heiko

Signature · 2 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
#3 lore raw

PATCH 1/1 dfu, usb: set usb descriptor to values defined in dfu spec 1.1

Hi Heiko,

Quoted 32 lines

Hello Marek,

Am 05.09.2014 00:42, schrieb Marek Vasut:

Quoted 11 lines

On Thursday, September 04, 2014 at 12:21:40 PM, Heiko Schocher wrote:

Hi Heiko,

I'll just rant a bit, but please wait until Lukasz does a proper runthrough.

Quoted 3 lines

set bDeviceClass, bDeviceSubClass and bcdUSB to the values defined in dfu spec 1.1 chapter 4.2.1 found here:

Quoted 7 lines
Quoted 1 line

http://www.usb.org/developers/devclass_docs/DFU_1.1.pdf

This URL gives me a website with:
"
Resource not found.
Please check the URL and try again.
"

:-( Maybe it is deleted currently there?
Hmm.. there is a search field if you open the above URL ... and if you type DFU and press search, you get:

DFU
File Format: PDF/Adobe Acrobat
Aug 5, 2004 ... USB Device Firmware Upgrade Specification, Revision 1.1. 2. Intellectual Property Disclaimer. THIS SPECIFICATION IS PROVIDED ?AS IS? ... www.usb.org/developers/devclass_docs/DFU_1.1.pdf

Quoted 5 lines

This is exactly the above link ...

This link is also referenced from openmoko:

http://wiki.openmoko.org/wiki/USB_DFU_-_The_USB_Device_Firmware_Upgrade_standard

I can confirm that the original link is dead. Maybe we can add above information to the commit message?

Quoted 86 lines
Quoted 75 lines
Quoted 41 lines
Cc Lukasz Majewski<[email protected]>
Cc Marek Vasut<[email protected]>
Cc Roger Meier<[email protected]>

---

before this patch, "dfu-util -l" showed:

Bus 002 Device 114: ID 0908:02c5 Siemens AG
Device Descriptor:
bLength 18
bDescriptorType 1
bcdUSB 2.00

   bDeviceClass            2 Communications
   bDeviceSubClass         2 Abstract (modem)
   bDeviceProtocol         0 None

bMaxPacketSize0 64
idVendor 0x0908 Siemens AG
idProduct 0x02c5
bcdDevice 0.00
iManufacturer 1 Siemens AG

with this patch:

Bus 002 Device 089: ID 0908:02c5 Siemens AG
Device Descriptor:
bLength 18
bDescriptorType 1
bcdUSB 1.10

   bDeviceClass            0 (Defined at Interface level)
   bDeviceSubClass         0
   bDeviceProtocol         0

bMaxPacketSize0 64
idVendor 0x0908 Siemens AG
idProduct 0x02c5
bcdDevice 0.00
iManufacturer 1 Siemens AG
iProduct 2 USB download gadget

Quoted 2 lines

which fits for "bcdUSB", "bDeviceClass" and "bDeviceSubClass" with the DFU spezifikation.

This patch doesn't seem fully right, let me explain below please.

Quoted 14 lines
---
  drivers/usb/gadget/f_dfu.c | 5 +++--
  drivers/usb/gadget/g_dnl.c | 6 +++---
  2 files changed, 6 insertions(+), 5 deletions(-)
(quoted diff) +0 -0

b/drivers/usb/gadget/f_dfu.c index 9128add..9429e50 100644

drivers/usb/gadget/f_dfu.c +0 -0
@@ -83,8 +83,9 @@ static struct usb_descriptor_header
 *dfu_runtime_descs[] = { static const struct

usb_qualifier_descriptor dev_qualifier = { .bLength
= sizeof dev_qualifier, .bDescriptorType =
USB_DT_DEVICE_QUALIFIER,

drivers/usb/gadget/f_dfu.c static struct usb_descriptor_header *dfu_runtime_descs[] = { · line 86

Quoted 3 lines
drivers/usb/gadget/f_dfu.c +1 -2
-	.bcdUSB =		__constant_cpu_to_le16(0x0200),
-	.bDeviceClass =		USB_CLASS_VENDOR_SPEC,
+	.bcdUSB =		__constant_cpu_to_le16(0x0110),

See [1] and look for first and second instance of 'bcdUsb' there please. Quote of the second one:

'
The bcdUSB field reports the highest version of USB the device supports. The value is in binary coded decimal with a format of 0xJJMN where JJ is the major version number, M is the minor version number and N is the sub minor version number. e.g. USB 2.0 is reported as 0x0200, USB 1.1 as 0x0110 and USB 1.0 as 0x0100. '

Quoted 2 lines

So this should be configured dynamically based on what the highest mode the controller supports is, no?

Good question ... the DFU 1.1 spezification says in chapter 4.2.1 DFU Mode Device Descriptor:

bcdUSB = 0100 USB specification release number in binary coded decimal. (which seems wrong, as the spez is version 1.1, see [2]) bDeviceClass = 0
bDeviceSubClass = 0

Quoted 6 lines

... ?

I discussed this change with Lukasz, see:

[2] http://lists.denx.de/pipermail/u-boot/2014-August/186918.html

I'm more than happy to announce that you both may be right :-).

In the DFU 1.1 spec the point 4.2.1 describes the DFU MODE DEVICE DESCRIPTOR.

According to information from point 4.- "Enumeration Phase":

"It is very important to note that the device exposes two distinct and independent descriptor sets, one each at the appropriate time:
- Run-time descriptor (the one from [1] pointed out by Marek)
- DFU mode descriptor (the one from 4.2.1. - fixed by Heiko)

It seems to me that the first descriptor is defined at g_dnl.c and the second, which I guess should be changed, at f_dfu.c

However, to be 100% sure I need to examine this with USB analizer. I'm going to setup it today or on Monday.

Quoted 15 lines
Quoted 5 lines

drivers/usb/gadget/f_dfu.c

Quoted 2 lines
drivers/usb/gadget/f_dfu.c +1 -0
+	.bDeviceClass =		USB_CLASS_PER_INTERFACE,

This might be OK.

Quoted 7 lines

drivers/usb/gadget/f_dfu.c static struct usb_descriptor_header *dfu_runtime_descs[] = { · line 88

Quoted 1 line
drivers/usb/gadget/f_dfu.c +1 -0
+	.bDeviceSubClass =	0x00,

But this is not, the device definitelly isn't CDC-serial.

[...]

[1] http://www.beyondlogic.org/usbnutshell/usb5.shtml

bye,
Heiko

Signature · 5 lines
Best regards,

Lukasz Majewski

Samsung R&D Institute Poland (SRPOL) | Linux Platform Group
#4 lore raw

PATCH 1/1 dfu, usb: set usb descriptor to values defined in dfu spec 1.1

Hello Lukasz,

Am 05.09.2014 09:53, schrieb Lukasz Majewski:

Quoted 34 lines

Hi Heiko,

Quoted 32 lines

Hello Marek,

Am 05.09.2014 00:42, schrieb Marek Vasut:

Quoted 11 lines

On Thursday, September 04, 2014 at 12:21:40 PM, Heiko Schocher wrote:

Hi Heiko,

I'll just rant a bit, but please wait until Lukasz does a proper runthrough.

Quoted 3 lines

set bDeviceClass, bDeviceSubClass and bcdUSB to the values defined in dfu spec 1.1 chapter 4.2.1 found here:

Quoted 7 lines
Quoted 1 line

http://www.usb.org/developers/devclass_docs/DFU_1.1.pdf

This URL gives me a website with:
"
Resource not found.
Please check the URL and try again.
"

:-( Maybe it is deleted currently there?
Hmm.. there is a search field if you open the above URL ... and if you type DFU and press search, you get:

DFU
File Format: PDF/Adobe Acrobat
Aug 5, 2004 ... USB Device Firmware Upgrade Specification, Revision 1.1. 2. Intellectual Property Disclaimer. THIS SPECIFICATION IS PROVIDED ?AS IS? ... www.usb.org/developers/devclass_docs/DFU_1.1.pdf

Quoted 8 lines
Quoted 5 lines

This is exactly the above link ...

This link is also referenced from openmoko:

http://wiki.openmoko.org/wiki/USB_DFU_-_The_USB_Device_Firmware_Upgrade_standard

I can confirm that the original link is dead. Maybe we can add above information to the commit message?

Hmm.. better would be to add a correct new link... do you have an idea, where we can find this document now?

Quoted 85 lines
Quoted 85 lines
Quoted 74 lines
Quoted 40 lines
Cc Lukasz Majewski<[email protected]>
Cc Marek Vasut<[email protected]>
Cc Roger Meier<[email protected]>

---

before this patch, "dfu-util -l" showed:

Bus 002 Device 114: ID 0908:02c5 Siemens AG
Device Descriptor:
bLength 18
bDescriptorType 1
bcdUSB 2.00
bDeviceClass 2 Communications
bDeviceSubClass 2 Abstract (modem)
bDeviceProtocol 0 None
bMaxPacketSize0 64
idVendor 0x0908 Siemens AG
idProduct 0x02c5
bcdDevice 0.00
iManufacturer 1 Siemens AG

with this patch:

Bus 002 Device 089: ID 0908:02c5 Siemens AG
Device Descriptor:
bLength 18
bDescriptorType 1
bcdUSB 1.10
bDeviceClass 0 (Defined at Interface level)
bDeviceSubClass 0
bDeviceProtocol 0
bMaxPacketSize0 64
idVendor 0x0908 Siemens AG
idProduct 0x02c5
bcdDevice 0.00
iManufacturer 1 Siemens AG
iProduct 2 USB download gadget

Quoted 2 lines

which fits for "bcdUSB", "bDeviceClass" and "bDeviceSubClass" with the DFU spezifikation.

This patch doesn't seem fully right, let me explain below please.

Quoted 14 lines
---
   drivers/usb/gadget/f_dfu.c | 5 +++--
   drivers/usb/gadget/g_dnl.c | 6 +++---
   2 files changed, 6 insertions(+), 5 deletions(-)
(quoted diff) +0 -0

b/drivers/usb/gadget/f_dfu.c index 9128add..9429e50 100644

drivers/usb/gadget/f_dfu.c +0 -0
@@ -83,8 +83,9 @@ static struct usb_descriptor_header
 *dfu_runtime_descs[] = { static const struct

usb_qualifier_descriptor dev_qualifier = { .bLength
= sizeof dev_qualifier, .bDescriptorType =
USB_DT_DEVICE_QUALIFIER,

drivers/usb/gadget/f_dfu.c static struct usb_descriptor_header *dfu_runtime_descs[] = { · line 86

Quoted 3 lines
drivers/usb/gadget/f_dfu.c +1 -2
-	.bcdUSB =		__constant_cpu_to_le16(0x0200),
-	.bDeviceClass =		USB_CLASS_VENDOR_SPEC,
+	.bcdUSB =		__constant_cpu_to_le16(0x0110),

See [1] and look for first and second instance of 'bcdUsb' there please. Quote of the second one:

'
The bcdUSB field reports the highest version of USB the device supports. The value is in binary coded decimal with a format of 0xJJMN where JJ is the major version number, M is the minor version number and N is the sub minor version number. e.g. USB 2.0 is reported as 0x0200, USB 1.1 as 0x0110 and USB 1.0 as 0x0100. '

Quoted 2 lines

So this should be configured dynamically based on what the highest mode the controller supports is, no?

Good question ... the DFU 1.1 spezification says in chapter 4.2.1 DFU Mode Device Descriptor:

bcdUSB = 0100 USB specification release number in binary coded decimal. (which seems wrong, as the spez is version 1.1, see [2]) bDeviceClass = 0
bDeviceSubClass = 0

Quoted 8 lines
Quoted 6 lines

... ?

I discussed this change with Lukasz, see:

[2] http://lists.denx.de/pipermail/u-boot/2014-August/186918.html

I'm more than happy to announce that you both may be right :-).

;-)

Quoted 5 lines

In the DFU 1.1 spec the point 4.2.1 describes the DFU MODE DEVICE DESCRIPTOR.

According to information from point 4.- "Enumeration Phase":

Quoted 7 lines

"It is very important to note that the device exposes two distinct and independent descriptor sets, one each at the appropriate time:
- Run-time descriptor (the one from [1] pointed out by Marek)
- DFU mode descriptor (the one from 4.2.1. - fixed by Heiko)

It seems to me that the first descriptor is defined at g_dnl.c and the second, which I guess should be changed, at f_dfu.c

Ah, I fixed both ...

Quoted 2 lines

However, to be 100% sure I need to examine this with USB analizer. I'm going to setup it today or on Monday.

Oh, that would be great, thanks!

bye,
Heiko

Quoted 18 lines
Quoted 16 lines
Quoted 6 lines

drivers/usb/gadget/f_dfu.c

Quoted 3 lines
drivers/usb/gadget/f_dfu.c +1 -0
+	.bDeviceClass =		USB_CLASS_PER_INTERFACE,

This might be OK.

Quoted 7 lines

drivers/usb/gadget/f_dfu.c static struct usb_descriptor_header *dfu_runtime_descs[] = { · line 88

Quoted 1 line
drivers/usb/gadget/f_dfu.c +1 -0
+	.bDeviceSubClass =	0x00,

But this is not, the device definitelly isn't CDC-serial.

[...]

[1] http://www.beyondlogic.org/usbnutshell/usb5.shtml

bye,
Heiko

Signature · 2 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
#5 lore raw

PATCH 1/1 dfu, usb: set usb descriptor to values defined in dfu spec 1.1

On Friday, September 05, 2014 at 10:11:23 AM, Heiko Schocher wrote:

[...]

Quoted 13 lines
Quoted 5 lines

In the DFU 1.1 spec the point 4.2.1 describes the DFU MODE DEVICE DESCRIPTOR.

According to information from point 4.- "Enumeration Phase":

Quoted 7 lines

"It is very important to note that the device exposes two distinct and independent descriptor sets, one each at the appropriate time:
- Run-time descriptor (the one from [1] pointed out by Marek)
- DFU mode descriptor (the one from 4.2.1. - fixed by Heiko)

It seems to me that the first descriptor is defined at g_dnl.c and the second, which I guess should be changed, at f_dfu.c

Quoted 6 lines

Ah, I fixed both ...

Quoted 2 lines

However, to be 100% sure I need to examine this with USB analizer. I'm going to setup it today or on Monday.

Oh, that would be great, thanks!

Thanks to both of you!

Best regards,
Marek Vasut

#6 lore raw

PATCH 1/1 dfu, usb: set usb descriptor to values defined in dfu spec 1.1

In reply to Marek Vasut

Hello Marek,

Am 05.09.2014 00:42, schrieb Marek Vasut:

Quoted 9 lines · Heiko Schocher

Hi Heiko,

I'll just rant a bit, but please wait until Lukasz does a proper runthrough.

Quoted 3 lines

set bDeviceClass, bDeviceSubClass and bcdUSB to the values defined in dfu spec 1.1 chapter 4.2.1 found here:

Quoted 7 lines
Quoted 1 line

http://www.usb.org/developers/devclass_docs/DFU_1.1.pdf

This URL gives me a website with:
"
Resource not found.
Please check the URL and try again.
"

Ah! Here the correct link:

http://www.usb.org/developers/docs/devclass_docs/DFU_1.1.pdf

I change this for v2.

bye,
Heiko

Signature · 2 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
#7 lore raw

PATCH 1/1 dfu, usb: set usb descriptor to values defined in dfu spec 1.1

Quoted 21 lines · Heiko Schocher

Hello Marek,

Am 05.09.2014 00:42, schrieb Marek Vasut:

Quoted 10 lines · Heiko Schocher

Hi Heiko,

I'll just rant a bit, but please wait until Lukasz does a proper runthrough.

Quoted 3 lines

set bDeviceClass, bDeviceSubClass and bcdUSB to the values defined in dfu spec 1.1 chapter 4.2.1 found here:

Quoted 7 lines
Quoted 1 line

http://www.usb.org/developers/devclass_docs/DFU_1.1.pdf

This URL gives me a website with:
"
Resource not found.
Please check the URL and try again.
"

Quoted 5 lines

Ah! Here the correct link:

http://www.usb.org/developers/docs/devclass_docs/DFU_1.1.pdf

I change this for v2.

Cool, thank you! :)

Best regards,
Marek Vasut