diff --git a/Documentation/NuttxPortingGuide.html b/Documentation/NuttxPortingGuide.html index 9fda53426cc..20f6778ca8f 100644 --- a/Documentation/NuttxPortingGuide.html +++ b/Documentation/NuttxPortingGuide.html @@ -4816,10 +4816,13 @@ build Default 4.
  • - CONFIG_CDCSER_VENDORID and CONFIG_CDCSER_VENDORSTR: The vendor ID code/string. Default 0x03eb and "NuttX" + CONFIG_CDCSER_VENDORID and CONFIG_CDCSER_VENDORSTR: The vendor ID code/string. Default 0x0525 and "NuttX," + 0x0525 is the Netchip vendor and should not be used in any products. + This default VID was selected for compatibility with the Linux CDC ACM default VID.
  • - CONFIG_CDCSER_PRODUCTID and CONFIG_CDCSER_PRODUCTSTR: The product ID code/string. Default 0x204b and "CDC/ACM Serial" + CONFIG_CDCSER_PRODUCTID and CONFIG_CDCSER_PRODUCTSTR: The product ID code/string. Default 0xa4a7 and "CDC/ACM Serial" + 0xa4a7 was selected for compatibility with the Linux CDC ACM default PID.
  • CONFIG_CDCSER_RXBUFSIZE and CONFIG_CDCSER_TXBUFSIZE: Size of the serial receive/transmit buffers. Default 256. diff --git a/configs/README.txt b/configs/README.txt index 8958ee874af..0ea753b6a8f 100644 --- a/configs/README.txt +++ b/configs/README.txt @@ -982,9 +982,14 @@ defconfig -- This is a configuration file similar to the Linux CONFIG_CDCSER_NWRREQS includes write requests used for both the interrupt and bulk IN endpoints. Default 4. CONFIG_CDCSER_VENDORID and CONFIG_CDCSER_VENDORSTR - The vendor ID code/string. Default 0x03eb and "NuttX" + The vendor ID code/string. Default 0x0525 and "NuttX" + 0x0525 is the Netchip vendor and should not be used in any + products. This default VID was selected for compatibility with + the Linux CDC ACM default VID. CONFIG_CDCSER_PRODUCTID and CONFIG_CDCSER_PRODUCTSTR - The product ID code/string. Default 0x204b and "CDC/ACM Serial" + The product ID code/string. Default 0xa4a7 and "CDC/ACM Serial" + 0xa4a7 was selected for compatibility with the Linux CDC ACM + default PID. CONFIG_CDCSER_RXBUFSIZE and CONFIG_CDCSER_TXBUFSIZE Size of the serial receive/transmit buffers. Default 256. diff --git a/configs/stm3210e-eval/usbserial/defconfig b/configs/stm3210e-eval/usbserial/defconfig index a23ef58f777..228c70b2036 100755 --- a/configs/stm3210e-eval/usbserial/defconfig +++ b/configs/stm3210e-eval/usbserial/defconfig @@ -706,9 +706,14 @@ CONFIG_USBSER_TXBUFSIZE=512 # The number of write/read requests that can be in flight. # Default 256. # CONFIG_CDCSER_VENDORID and CONFIG_CDCSER_VENDORSTR -# The vendor ID code/string. Default 0x03eb and "NuttX" +# The vendor ID code/string. Default 0x0525 and "NuttX" +# 0x0525 is the Netchip vendor and should not be used in any +# products. This default VID was selected for compatibility with +# the Linux CDC ACM default VID. # CONFIG_CDCSER_PRODUCTID and CONFIG_CDCSER_PRODUCTSTR -# The product ID code/string. Default 0x204b and "CDC/ACM Serial" +# The product ID code/string. Default 0xara7 and "CDC/ACM Serial" +# 0xa4a7 was selected for compatibility with the Linux CDC ACM +# default PID. # CONFIG_CDCSER_RXBUFSIZE and CONFIG_CDCSER_TXBUFSIZE # Size of the serial receive/transmit buffers. Default 256. # diff --git a/drivers/usbdev/cdc_serial.c b/drivers/usbdev/cdc_serial.c index bab4e395183..a4b549d27ea 100644 --- a/drivers/usbdev/cdc_serial.c +++ b/drivers/usbdev/cdc_serial.c @@ -338,13 +338,16 @@ static const struct usb_devdesc_s g_devdesc = CDC_SUBCLASS_NONE, /* subclass */ CDC_PROTO_NONE, /* protocol */ CONFIG_CDCSER_EP0MAXPACKET, /* maxpacketsize */ - { LSBYTE(CONFIG_CDCSER_VENDORID), /* vendor */ + { + LSBYTE(CONFIG_CDCSER_VENDORID), /* vendor */ MSBYTE(CONFIG_CDCSER_VENDORID) }, - { LSBYTE(CONFIG_CDCSER_PRODUCTID), /* product */ + { + LSBYTE(CONFIG_CDCSER_PRODUCTID), /* product */ MSBYTE(CONFIG_CDCSER_PRODUCTID) }, - { LSBYTE(CDCSER_VERSIONNO), /* device */ + { + LSBYTE(CDCSER_VERSIONNO), /* device */ MSBYTE(CDCSER_VERSIONNO) }, CDCSER_MANUFACTURERSTRID, /* imfgr */ @@ -550,7 +553,10 @@ static const struct usb_qualdesc_s g_qualdesc = { USB_SIZEOF_QUALDESC, /* len */ USB_DESC_TYPE_DEVICEQUALIFIER, /* type */ - {LSBYTE(0x0200), MSBYTE(0x0200) }, /* USB */ + { /* usb */ + LSBYTE(0x0200), + MSBYTE(0x0200) + }, USB_CLASS_VENDOR_SPEC, /* class */ 0, /* subclass */ 0, /* protocol */ @@ -733,6 +739,9 @@ static inline int usbclass_recvpacket(FAR struct usbser_dev_s *priv, uint16_t nexthead; uint16_t nbytes = 0; + uvdbg("head=%d tail=%d nrdq=%d reqlen=%d\n", + priv->serdev.recv.head, priv->serdev.recv.tail, priv->nrdq, reqlen); + /* Get the next head index. During the time that RX interrupts are disabled, the * the serial driver will be extracting data from the circular buffer and modifying * recv.tail. During this time, we should avoid modifying recv.head; Instead we will diff --git a/include/nuttx/usb/cdc_serial.h b/include/nuttx/usb/cdc_serial.h index 92ae62b20ee..8a975666a39 100644 --- a/include/nuttx/usb/cdc_serial.h +++ b/include/nuttx/usb/cdc_serial.h @@ -84,9 +84,14 @@ * CONFIG_CDCSER_NWRREQS includes write requests used for both the * interrupt and bulk IN endpoints. Default 4. * CONFIG_CDCSER_VENDORID and CONFIG_CDCSER_VENDORSTR - * The vendor ID code/string. Default 0x03eb and "NuttX" + * The vendor ID code/string. Default 0x0525 and "NuttX" + * 0x0525 is the Netchip vendor and should not be used in any + * products. This default VID was selected for compatibility with + * the Linux CDC ACM default VID. * CONFIG_CDCSER_PRODUCTID and CONFIG_CDCSER_PRODUCTSTR - * The product ID code/string. Default 0x204b and "CDC/ACM Serial" + * The product ID code/string. Default 0xa4a7 and "CDC/ACM Serial" + * 0xa4a7 was selected for compatibility with the Linux CDC ACM + * default PID. * CONFIG_CDCSER_RXBUFSIZE and CONFIG_CDCSER_TXBUFSIZE * Size of the serial receive/transmit buffers. Default 256. */ @@ -171,14 +176,16 @@ # define CONFIG_CDCSER_TXBUFSIZE 256 #endif -/* Vendor and product IDs and strings */ +/* Vendor and product IDs and strings. The default is the Linux Netchip + * CDC ACM VID and PID. + */ #ifndef CONFIG_CDCSER_VENDORID -# define CONFIG_CDCSER_VENDORID 0x03eb +# define CONFIG_CDCSER_VENDORID 0x0525 #endif #ifndef CONFIG_CDCSER_PRODUCTID -# define CONFIG_CDCSER_PRODUCTID 0x204b +# define CONFIG_CDCSER_PRODUCTID 0xa4a7 #endif #ifndef CONFIG_CDCSER_VENDORSTR @@ -186,7 +193,7 @@ #endif #ifndef CONFIG_CDCSER_PRODUCTSTR -# define CONFIG_CDCSER_PRODUCTSTR "USBdev Serial" +# define CONFIG_CDCSER_PRODUCTSTR "CDC ACM Serial" #endif #undef CONFIG_CDCSER_SERIALSTR