diff --git a/Documentation/NuttxPortingGuide.html b/Documentation/NuttxPortingGuide.html index 6aa11bc789b0778b33f8e58c4a7f803acadab48e..9fda53426cccaec6ebdb1e3114cca35b1b390413 100644 --- a/Documentation/NuttxPortingGuide.html +++ b/Documentation/NuttxPortingGuide.html @@ -4778,7 +4778,7 @@ build <code>CONFIG_CDCSER</code>: Enable compilation of the USB serial driver </li> <li> - <code>CONFIG_CDCSER_EP0MAXPACKET</code>: Endpoint 0 max packet size. Default 8. + <code>CONFIG_CDCSER_EP0MAXPACKET</code>: Endpoint 0 max packet size. Default 64. </li> <li> <code>CONFIG_CDCSER_EPINTIN</code>: The logical 7-bit address of a hardware endpoint that supports @@ -4788,7 +4788,7 @@ build <code>CONFIG_CDCSER_EPINTIN_FSSIZE</code>: Max package size for the interrupt IN endpoint if full speed mode. Default 64. </li> <li> - <code>CONFIG_CDCSER_EPINTIN_HSSIZE</code>: Max package size for the interrupt IN endpoint if high speed mode. Default 512. + <code>CONFIG_CDCSER_EPINTIN_HSSIZE</code>: Max package size for the interrupt IN endpoint if high speed mode. Default 64. </li> <li> <code>CONFIG_CDCSER_EPBULKOUT</code>: The logical 7-bit address of a hardware endpoint that supports diff --git a/configs/README.txt b/configs/README.txt index b50592b81d48ff5916ab1080dde78bc5855e80f2..8958ee874af269e5e1323ba025ab06b3ef0e725d 100644 --- a/configs/README.txt +++ b/configs/README.txt @@ -949,7 +949,7 @@ defconfig -- This is a configuration file similar to the Linux CONFIG_CDCSER Enable compilation of the USB serial driver CONFIG_CDCSER_EP0MAXPACKET - Endpoint 0 max packet size. Default 8. + Endpoint 0 max packet size. Default 64. CONFIG_CDCSER_EPINTIN The logical 7-bit address of a hardware endpoint that supports interrupt IN operation. Default 2. @@ -958,7 +958,7 @@ defconfig -- This is a configuration file similar to the Linux Default 64. CONFIG_CDCSER_EPINTIN_HSSIZE Max package size for the interrupt IN endpoint if high speed mode. - Default 512. + Default 64. CONFIG_CDCSER_EPBULKOUT The logical 7-bit address of a hardware endpoint that supports bulk OUT operation diff --git a/drivers/usbdev/cdc_serial.c b/drivers/usbdev/cdc_serial.c index 693cdc4bffd042a9b2fa39db90f14c2a4c740b83..d5d5739b2cf57507b896898bf3870806066c4661 100644 --- a/drivers/usbdev/cdc_serial.c +++ b/drivers/usbdev/cdc_serial.c @@ -67,14 +67,14 @@ /* Descriptors ****************************************************************/ /* These settings are not modifiable via the NuttX configuration */ -#define CDC_VERSIONNO 0x010a /* CDC version number 1.10 */ +#define CDC_VERSIONNO 0x0110 /* CDC version number 1.10 (BCD) */ #define CDCSER_CONFIGIDNONE (0) /* Config ID means to return to address mode */ #define CDCSER_INTERFACEID (0) #define CDCSER_ALTINTERFACEID (0) /* Device descriptor values */ -#define CDCSER_VERSIONNO (0x0101) /* Device version number 1.1 */ +#define CDCSER_VERSIONNO (0x0101) /* Device version number 1.1 (BCD) */ #define CDCSER_NCONFIGS (1) /* Number of configurations supported */ /* Configuration descriptor values */ @@ -330,17 +330,23 @@ static const struct usb_devdesc_s g_devdesc = { USB_SIZEOF_DEVDESC, /* len */ USB_DESC_TYPE_DEVICE, /* type */ - {LSBYTE(0x0200), MSBYTE(0x0200)}, /* usb */ + { /* usb */ + LSBYTE(0x0200), + MSBYTE(0x0200) + }, USB_CLASS_CDC, /* class */ CDC_SUBCLASS_NONE, /* subclass */ CDC_PROTO_NONE, /* protocol */ CONFIG_CDCSER_EP0MAXPACKET, /* maxpacketsize */ { LSBYTE(CONFIG_CDCSER_VENDORID), /* vendor */ - MSBYTE(CONFIG_CDCSER_VENDORID) }, + MSBYTE(CONFIG_CDCSER_VENDORID) + }, { LSBYTE(CONFIG_CDCSER_PRODUCTID), /* product */ - MSBYTE(CONFIG_CDCSER_PRODUCTID) }, + MSBYTE(CONFIG_CDCSER_PRODUCTID) + }, { LSBYTE(CDCSER_VERSIONNO), /* device */ - MSBYTE(CDCSER_VERSIONNO) }, + MSBYTE(CDCSER_VERSIONNO) + }, CDCSER_MANUFACTURERSTRID, /* imfgr */ CDCSER_PRODUCTSTRID, /* iproduct */ CDCSER_SERIALSTRID, /* serno */ @@ -458,7 +464,7 @@ static const struct usb_epdesc_s g_epbulkoutdesc = USB_SIZEOF_EPDESC, /* len */ USB_DESC_TYPE_ENDPOINT, /* type */ CDCSER_EPOUTBULK_ADDR, /* addr */ - CDCSER_EPINTIN_ATTR, /* attr */ + CDCSER_EPOUTBULK_ATTR, /* attr */ { LSBYTE(CONFIG_CDCSER_EPBULKOUT_FSSIZE), /* maxpacket (full speed) */ MSBYTE(CONFIG_CDCSER_EPBULKOUT_FSSIZE) @@ -1926,7 +1932,6 @@ static int usbclass_setup(FAR struct usbdev_s *dev, const struct usb_ctrlreq_s * usbclass_ep0incomplete(dev->ep0, ctrlreq); } } - return ret; } diff --git a/include/nuttx/usb/cdc_serial.h b/include/nuttx/usb/cdc_serial.h index 72410a22d254f5d1a24cd4d647a41257bd15ac6e..92ae62b20eec704bc464f990d9b8e0e3675d62b0 100644 --- a/include/nuttx/usb/cdc_serial.h +++ b/include/nuttx/usb/cdc_serial.h @@ -51,7 +51,7 @@ /* CONFIG_CDCSER * Enable compilation of the USB serial driver * CONFIG_CDCSER_EP0MAXPACKET - * Endpoint 0 max packet size. Default 8. + * Endpoint 0 max packet size. Default 64. * CONFIG_CDCSER_EPINTIN * The logical 7-bit address of a hardware endpoint that supports * interrupt IN operation. Default 2. @@ -60,7 +60,7 @@ * Default 64. * CONFIG_CDCSER_EPINTIN_HSSIZE * Max package size for the interrupt IN endpoint if high speed mode. - * Default 512. + * Default 64. * CONFIG_CDCSER_EPBULKOUT * The logical 7-bit address of a hardware endpoint that supports * bulk OUT operation @@ -94,7 +94,7 @@ /* EP0 max packet size */ #ifndef CONFIG_CDCSER_EP0MAXPACKET -# define CONFIG_CDCSER_EP0MAXPACKET 8 +# define CONFIG_CDCSER_EP0MAXPACKET 64 #endif /* Endpoint number and size (in bytes) of the CDC serial device-to-host (IN) @@ -106,11 +106,11 @@ #endif #ifndef CONFIG_CDCSER_EPINTIN_FSSIZE -# define CONFIG_CDCSER_EPINTIN_FSSIZE 8 +# define CONFIG_CDCSER_EPINTIN_FSSIZE 64 #endif #ifndef CONFIG_CDCSER_EPINTIN_HSSIZE -# define CONFIG_CDCSER_EPINTIN_HSSIZE 8 +# define CONFIG_CDCSER_EPINTIN_HSSIZE 64 #endif /* Endpoint number and size (in bytes) of the CDC device-to-host (IN) data