Skip to content

Commit 3a99e1e

Browse files
[CDC]: Do not claim AT-protocol in CDC interface descriptor
The CDC code presents itself as a virtual serial port. However, it also sets the "bFunctionProtocol" value to 1, which means it supports AT-commands, which is not actually the case. This might cause problems with some software, such as ModemManager. Originally, ModemManager would be very liberal with probing serial devices, using a blacklist to prevent probing non-modems such as Arduinos. Since version 1.7.990, it has supported a "strict" mode where it tries to be more restrained in what devices it probes. For CDC ACM devices, this means it will only probe devices that claim to support AT-commands. However, it also stopped applying the blacklist (intending to eventually remove the blacklist), meaning it would end up probing these serial ports. This new strict policy is not the upstream default, but is enabled in Debian (since Buster) and Ubuntu (since bionic 18.04.2). Later versions of ModemManager make an exception for single-port Serial devices making this less of a problem, but best to also fix the descriptor. For the equivalent change in the Arduino AVR core, see: arduino/ArduinoCore-avr#92
1 parent 0ff0a2a commit 3a99e1e

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Diff for: cores/arduino/stm32/usb/cdc/usbd_cdc.c

+3-3
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ __ALIGN_BEGIN uint8_t USBD_CDC_CfgHSDesc[USB_CDC_CONFIG_DESC_SIZ] __ALIGN_END =
190190
0x01, /* bNumEndpoints: One endpoints used */
191191
0x02, /* bInterfaceClass: Communication Interface Class */
192192
0x02, /* bInterfaceSubClass: Abstract Control Model */
193-
0x01, /* bInterfaceProtocol: Common AT commands */
193+
0x00, /* bInterfaceProtocol: No specific protocol */
194194
0x00, /* iInterface: */
195195

196196
/*Header Functional Descriptor*/
@@ -285,7 +285,7 @@ __ALIGN_BEGIN uint8_t USBD_CDC_CfgFSDesc[USB_CDC_CONFIG_DESC_SIZ] __ALIGN_END =
285285
0x01, /* bNumEndpoints: One endpoints used */
286286
0x02, /* bInterfaceClass: Communication Interface Class */
287287
0x02, /* bInterfaceSubClass: Abstract Control Model */
288-
0x01, /* bInterfaceProtocol: Common AT commands */
288+
0x00, /* bInterfaceProtocol: No specific protocol */
289289
0x00, /* iInterface: */
290290

291291
/*Header Functional Descriptor*/
@@ -375,7 +375,7 @@ __ALIGN_BEGIN uint8_t USBD_CDC_OtherSpeedCfgDesc[USB_CDC_CONFIG_DESC_SIZ] __ALIG
375375
0x01, /* bNumEndpoints: One endpoints used */
376376
0x02, /* bInterfaceClass: Communication Interface Class */
377377
0x02, /* bInterfaceSubClass: Abstract Control Model */
378-
0x01, /* bInterfaceProtocol: Common AT commands */
378+
0x00, /* bInterfaceProtocol: No specific protocol */
379379
0x00, /* iInterface: */
380380

381381
/*Header Functional Descriptor*/

0 commit comments

Comments
 (0)