@@ -63,7 +63,7 @@ class Calculator : public Device {
63
63
* switching to DFU mode. It does not apply to the calculator.*/
64
64
2048 , // wTransferSize: Maximum number of bytes that the device can accept per control-write transaction
65
65
0x0100 ),// bcdDFUVersion
66
- m_interfaceDescriptor (
66
+ m_interfaceDescriptor1 (
67
67
0 , // bInterfaceNumber
68
68
k_dfuInterfaceAlternateSetting, // bAlternateSetting
69
69
0 , // bNumEndpoints: Other than endpoint 0
@@ -72,9 +72,20 @@ class Calculator : public Device {
72
72
2 , // bInterfaceProtocol: DFU Mode (not DFU Runtime, which would be 1)
73
73
4 , // iInterface: Index of the Interface string, see m_descriptor
74
74
&m_dfuFunctionalDescriptor),
75
+ m_interfaceDescriptor2 (
76
+ 0 , // bInterfaceNumber
77
+ k_dfuInterfaceAlternateSetting + 1 , // bAlternateSetting
78
+ 0 , // bNumEndpoints: Other than endpoint 0
79
+ 0xFE , // bInterfaceClass: DFU (https://www.usb.org/defined-class-codes)
80
+ 1 , // bInterfaceSubClass: DFU
81
+ 2 , // bInterfaceProtocol: DFU Mode (not DFU Runtime, which would be 1)
82
+ // TODO: Use real descriptor, not required for now as the descriptor isn't
83
+ // used anywhere in DFU firmware, but is only present so NumWorks website work.
84
+ 4 , // iInterface: Index of the Interface string, see m_descriptor
85
+ &m_dfuFunctionalDescriptor),
75
86
m_configurationDescriptor (
76
- 9 + 9 + 9 , // wTotalLength: configuration descriptor + interface descriptor + dfu functional descriptor lengths
77
- 1 , // bNumInterfaces
87
+ 9 + 18 + 18 , // wTotalLength: configuration descriptor + interface descriptor + dfu functional descriptor lengths
88
+ 2 , // bNumInterfaces
78
89
k_bConfigurationValue, // bConfigurationValue
79
90
0 , // iConfiguration: No string descriptor for the configuration
80
91
0x80 , /* bmAttributes:
@@ -83,7 +94,7 @@ class Calculator : public Device {
83
94
* Bit 5: Remote Wakeup (allows the device to wake up the host when the host is in suspend)
84
95
* Bit 4..0: Reserved, set to 0 */
85
96
0x32 , // bMaxPower: half of the Maximum Power Consumption
86
- &m_interfaceDescriptor ),
97
+ &m_interfaceDescriptor1 ),
87
98
m_webUSBPlatformDescriptor (
88
99
k_webUSBVendorCode,
89
100
k_webUSBLandingPageIndex),
@@ -99,6 +110,9 @@ class Calculator : public Device {
99
110
// m_interfaceStringDescriptor("@SRAM/0x20000000/01*256Ke"),
100
111
/* Switch to this descriptor to use dfu-util to write in the SRAM.
101
112
* FIXME Should be an alternate Interface. */
113
+ // Epsilon 25.6.0 descriptors for example
114
+ // @SRAM/0x20000000/01*252Ke
115
+ // @Flash/0x90030000/61*064Kg,64*064Kg
102
116
m_microsoftOSStringDescriptor (k_microsoftOSVendorCode),
103
117
m_workshopURLDescriptor (URLDescriptor::Scheme::HTTPS, " getupsilon.web.app" ),
104
118
m_extendedCompatIdDescriptor (" WINUSB" ),
@@ -141,7 +155,8 @@ class Calculator : public Device {
141
155
// Descriptors
142
156
DeviceDescriptor m_deviceDescriptor;
143
157
DFUFunctionalDescriptor m_dfuFunctionalDescriptor;
144
- InterfaceDescriptor m_interfaceDescriptor;
158
+ InterfaceDescriptor m_interfaceDescriptor1;
159
+ InterfaceDescriptor m_interfaceDescriptor2;
145
160
ConfigurationDescriptor m_configurationDescriptor;
146
161
WebUSBPlatformDescriptor m_webUSBPlatformDescriptor;
147
162
BOSDescriptor m_bosDescriptor;
0 commit comments