diff --git a/Documentation/NuttxPortingGuide.html b/Documentation/NuttxPortingGuide.html
index 56c56d53d60..091afedba95 100644
--- a/Documentation/NuttxPortingGuide.html
+++ b/Documentation/NuttxPortingGuide.html
@@ -16,7 +16,7 @@
by
Gregory Nutt
- Last Update: October 1, 2008
+ Last Update: October 9, 2008
Table of Contents
@@ -1627,7 +1627,8 @@ The system can be re-made subsequently by just typing make.
-USB device controller driver
+USB Device-Side Support
+USB Device Controller Driver
-
CONFIG_USBDEV: Enables USB device support
@@ -1652,6 +1653,31 @@ The system can be re-made subsequently by just typing make.
+USB Serial Device Class Driver
+
+ -
+
CONFIG_USBSER_EPINTIN: The logical 7-bit address of a hardware endpoint that supports interrupt IN operation
+
+ -
+
CONFIG_USBSER_EPBULKOUT: The logical 7-bit address of a hardware endpoint that supports bulk OUT operation
+
+ -
+
CONFIG_USBSER_EPBULKIN: The logical 7-bit address of a hardware endpoint that supports bulk IN operation
+
+ -
+
CONFIG_USBSER_NWRREQS and CONFIG_USBSER_NRDREQS: The number of write/read requests that can be in flight
+
+ -
+
CONFIG_USBSER_VENDORID and CONFIG_USBSER_VENDORSTR: The vendor ID code/string
+
+ -
+
CONFIG_USBSER_PRODUCTID and CONFIG_USBSER_PRODUCTSTR: The product ID code/string
+
+ -
+
CONFIG_USBSER_RXBUFSIZE and CONFIG_USBSER_TXBUFSIZE: Size of the serial receive/transmit buffers
+
+
+
Stack and heap information
diff --git a/configs/README.txt b/configs/README.txt
index c7f557d652a..1b81cfb10a7 100644
--- a/configs/README.txt
+++ b/configs/README.txt
@@ -302,6 +302,25 @@ defconfig -- This is a configuration file similar to the Linux
CONFIG_USBDEV_TRACE - Enables USB tracing for debug
CONFIG_USBDEV_TRACE_NRECORDS - Number of trace entries to remember
+ USB serial device class driver
+ CONFIG_USBSER_EPINTIN
+ The logical 7-bit address of a hardware endpoint that supports
+ interrupt IN operation
+ CONFIG_USBSER_EPBULKOUT
+ The logical 7-bit address of a hardware endpoint that supports
+ bulk OUT operation
+ CONFIG_USBSER_EPBULKIN
+ The logical 7-bit address of a hardware endpoint that supports
+ bulk IN operation
+ CONFIG_USBSER_NWRREQS and CONFIG_USBSER_NRDREQS
+ The number of write/read requests that can be in flight
+ CONFIG_USBSER_VENDORID and CONFIG_USBSER_VENDORSTR
+ The vendor ID code/string
+ CONFIG_USBSER_PRODUCTID and CONFIG_USBSER_PRODUCTSTR
+ The product ID code/string
+ CONFIG_USBSER_RXBUFSIZE and CONFIG_USBSER_TXBUFSIZE
+ Size of the serial receive/transmit buffers
+
Stack and heap information
CONFIG_BOOT_FROM_FLASH - Some configurations support XIP
diff --git a/configs/mcu123-lpc214x/nsh/defconfig b/configs/mcu123-lpc214x/nsh/defconfig
index 266577649e7..11a9b1acc72 100644
--- a/configs/mcu123-lpc214x/nsh/defconfig
+++ b/configs/mcu123-lpc214x/nsh/defconfig
@@ -384,8 +384,15 @@ CONFIG_LPC214X_USBDEV_DMAINTMASK=0
#
# USB Serial Device Configuration
#
-# CONFIG_USBSER_EPOUT and CONFIG_USBSER_EPIN
-# Logical endoint addresses
+# CONFIG_USBSER_EPINTIN
+# The logical 7-bit address of a hardware endpoint that supports
+# interrupt IN operation
+# CONFIG_USBSER_EPBULKOUT
+# The logical 7-bit address of a hardware endpoint that supports
+# bulk OUT operation
+# CONFIG_USBSER_EPBULKIN
+# The logical 7-bit address of a hardware endpoint that supports
+# bulk IN operation
# CONFIG_USBSER_NWRREQS and CONFIG_USBSER_NRDREQS
# The number of write/read requests that can be in flight
# CONFIG_USBSER_VENDORID and CONFIG_USBSER_VENDORSTR
@@ -394,8 +401,9 @@ CONFIG_LPC214X_USBDEV_DMAINTMASK=0
# The product ID code/string
# CONFIG_USBSER_RXBUFSIZE and CONFIG_USBSER_TXBUFSIZE
# Size of the serial receive/transmit buffers
-CONFIG_USBSER_EPOUT=1
-CONFIG_USBSER_EPIN=2
+CONFIG_USBSER_EPINTIN=1
+CONFIG_USBSER_EPBULKOUT=2
+CONFIG_USBSER_EPBULKIN=5
CONFIG_USBSER_NWRREQS=4
CONFIG_USBSER_NRDREQS=4
CONFIG_USBSER_VENDORID=0x067b
diff --git a/configs/mcu123-lpc214x/ostest/defconfig b/configs/mcu123-lpc214x/ostest/defconfig
index f0fe2f49af4..3dfac1fb54b 100644
--- a/configs/mcu123-lpc214x/ostest/defconfig
+++ b/configs/mcu123-lpc214x/ostest/defconfig
@@ -384,9 +384,16 @@ CONFIG_LPC214X_USBDEV_DMAINTMASK=0
#
# USB Serial Device Configuration
#
-# CONFIG_USBSER_EPOUT and CONFIG_USBSER_EPIN
-# Logical endoint addresses
-# CONFIG_USBSER_NWRREQS and CONFIG_USBSER_NRDREQS
+# CONFIG_USBSER_EPINTIN
+# The logical 7-bit address of a hardware endpoint that supports
+# interrupt IN operation
+# CONFIG_USBSER_EPBULKOUT
+# The logical 7-bit address of a hardware endpoint that supports
+# bulk OUT operation
+# CONFIG_USBSER_EPBULKIN
+# The logical 7-bit address of a hardware endpoint that supports
+# bulk IN operation
+# # CONFIG_USBSER_NWRREQS and CONFIG_USBSER_NRDREQS
# The number of write/read requests that can be in flight
# CONFIG_USBSER_VENDORID and CONFIG_USBSER_VENDORSTR
# The vendor ID code/string
@@ -394,8 +401,9 @@ CONFIG_LPC214X_USBDEV_DMAINTMASK=0
# The product ID code/string
# CONFIG_USBSER_RXBUFSIZE and CONFIG_USBSER_TXBUFSIZE
# Size of the serial receive/transmit buffers
-CONFIG_USBSER_EPOUT=1
-CONFIG_USBSER_EPIN=2
+CONFIG_USBSER_EPINTIN=1
+CONFIG_USBSER_EPBULKOUT=2
+CONFIG_USBSER_EPBULKIN=5
CONFIG_USBSER_NWRREQS=4
CONFIG_USBSER_NRDREQS=4
CONFIG_USBSER_VENDORID=0x067b
diff --git a/configs/mcu123-lpc214x/usbserial/defconfig b/configs/mcu123-lpc214x/usbserial/defconfig
index df434376bd2..a93bf6e9659 100644
--- a/configs/mcu123-lpc214x/usbserial/defconfig
+++ b/configs/mcu123-lpc214x/usbserial/defconfig
@@ -385,9 +385,16 @@ CONFIG_LPC214X_USBDEV_DMAINTMASK=0
#
# USB Serial Device Configuration
#
-# CONFIG_USBSER_EPOUT and CONFIG_USBSER_EPIN
-# Logical endoint addresses
-# CONFIG_USBSER_NWRREQS and CONFIG_USBSER_NRDREQS
+# CONFIG_USBSER_EPINTIN
+# The logical 7-bit address of a hardware endpoint that supports
+# interrupt IN operation
+# CONFIG_USBSER_EPBULKOUT
+# The logical 7-bit address of a hardware endpoint that supports
+# bulk OUT operation
+# CONFIG_USBSER_EPBULKIN
+# The logical 7-bit address of a hardware endpoint that supports
+# bulk IN operation
+# # CONFIG_USBSER_NWRREQS and CONFIG_USBSER_NRDREQS
# The number of write/read requests that can be in flight
# CONFIG_USBSER_VENDORID and CONFIG_USBSER_VENDORSTR
# The vendor ID code/string
@@ -395,8 +402,9 @@ CONFIG_LPC214X_USBDEV_DMAINTMASK=0
# The product ID code/string
# CONFIG_USBSER_RXBUFSIZE and CONFIG_USBSER_TXBUFSIZE
# Size of the serial receive/transmit buffers
-CONFIG_USBSER_EPOUT=1
-CONFIG_USBSER_EPIN=2
+CONFIG_USBSER_EPINTIN=1
+CONFIG_USBSER_EPBULKOUT=2
+CONFIG_USBSER_EPBULKIN=5
CONFIG_USBSER_NWRREQS=4
CONFIG_USBSER_NRDREQS=4
CONFIG_USBSER_VENDORID=0x067b
diff --git a/configs/ntosd-dm320/nettest/defconfig b/configs/ntosd-dm320/nettest/defconfig
index 934b6d6d897..e94fed2d1c4 100644
--- a/configs/ntosd-dm320/nettest/defconfig
+++ b/configs/ntosd-dm320/nettest/defconfig
@@ -361,8 +361,15 @@ CONFIG_DM320_USBDEV_DMA=n
#
# USB Serial Device Configuration
#
-# CONFIG_USBSER_EPOUT and CONFIG_USBSER_EPIN
-# Logical endoint addresses
+# CONFIG_USBSER_EPINTIN
+# The logical 7-bit address of a hardware endpoint that supports
+# interrupt IN operation
+# CONFIG_USBSER_EPBULKOUT
+# The logical 7-bit address of a hardware endpoint that supports
+# bulk OUT operation
+# CONFIG_USBSER_EPBULKIN
+# The logical 7-bit address of a hardware endpoint that supports
+# bulk IN operation
# CONFIG_USBSER_NWRREQS and CONFIG_USBSER_NRDREQS
# The number of write/read requests that can be in flight
# CONFIG_USBSER_VENDORID and CONFIG_USBSER_VENDORSTR
@@ -371,8 +378,9 @@ CONFIG_DM320_USBDEV_DMA=n
# The product ID code/string
# CONFIG_USBSER_RXBUFSIZE and CONFIG_USBSER_TXBUFSIZE
# Size of the serial receive/transmit buffers
-CONFIG_USBSER_EPOUT=1
-CONFIG_USBSER_EPIN=2
+CONFIG_USBSER_EPINTIN=3
+CONFIG_USBSER_EPBULKOUT=2
+CONFIG_USBSER_EPBULKIN=1
CONFIG_USBSER_NWRREQS=4
CONFIG_USBSER_NRDREQS=4
CONFIG_USBSER_VENDORID=0x067b
diff --git a/configs/ntosd-dm320/nsh/defconfig b/configs/ntosd-dm320/nsh/defconfig
index bfe69b341e4..f1188ff87ef 100644
--- a/configs/ntosd-dm320/nsh/defconfig
+++ b/configs/ntosd-dm320/nsh/defconfig
@@ -369,8 +369,15 @@ CONFIG_DM320_USBDEV_DMA=n
#
# USB Serial Device Configuration
#
-# CONFIG_USBSER_EPOUT and CONFIG_USBSER_EPIN
-# Logical endoint addresses
+# CONFIG_USBSER_EPINTIN
+# The logical 7-bit address of a hardware endpoint that supports
+# interrupt IN operation
+# CONFIG_USBSER_EPBULKOUT
+# The logical 7-bit address of a hardware endpoint that supports
+# bulk OUT operation
+# CONFIG_USBSER_EPBULKIN
+# The logical 7-bit address of a hardware endpoint that supports
+# bulk IN operation
# CONFIG_USBSER_NWRREQS and CONFIG_USBSER_NRDREQS
# The number of write/read requests that can be in flight
# CONFIG_USBSER_VENDORID and CONFIG_USBSER_VENDORSTR
@@ -379,8 +386,9 @@ CONFIG_DM320_USBDEV_DMA=n
# The product ID code/string
# CONFIG_USBSER_RXBUFSIZE and CONFIG_USBSER_TXBUFSIZE
# Size of the serial receive/transmit buffers
-CONFIG_USBSER_EPOUT=1
-CONFIG_USBSER_EPIN=2
+CONFIG_USBSER_EPINTIN=3
+CONFIG_USBSER_EPBULKOUT=2
+CONFIG_USBSER_EPBULKIN=1
CONFIG_USBSER_NWRREQS=4
CONFIG_USBSER_NRDREQS=4
CONFIG_USBSER_VENDORID=0x067b
diff --git a/configs/ntosd-dm320/ostest/defconfig b/configs/ntosd-dm320/ostest/defconfig
index b50367d0df9..701a3ae503c 100644
--- a/configs/ntosd-dm320/ostest/defconfig
+++ b/configs/ntosd-dm320/ostest/defconfig
@@ -361,8 +361,15 @@ CONFIG_DM320_USBDEV_DMA=n
#
# USB Serial Device Configuration
#
-# CONFIG_USBSER_EPOUT and CONFIG_USBSER_EPIN
-# Logical endoint addresses
+# CONFIG_USBSER_EPINTIN
+# The logical 7-bit address of a hardware endpoint that supports
+# interrupt IN operation
+# CONFIG_USBSER_EPBULKOUT
+# The logical 7-bit address of a hardware endpoint that supports
+# bulk OUT operation
+# CONFIG_USBSER_EPBULKIN
+# The logical 7-bit address of a hardware endpoint that supports
+# bulk IN operation
# CONFIG_USBSER_NWRREQS and CONFIG_USBSER_NRDREQS
# The number of write/read requests that can be in flight
# CONFIG_USBSER_VENDORID and CONFIG_USBSER_VENDORSTR
@@ -371,8 +378,9 @@ CONFIG_DM320_USBDEV_DMA=n
# The product ID code/string
# CONFIG_USBSER_RXBUFSIZE and CONFIG_USBSER_TXBUFSIZE
# Size of the serial receive/transmit buffers
-CONFIG_USBSER_EPOUT=1
-CONFIG_USBSER_EPIN=2
+CONFIG_USBSER_EPINTIN=3
+CONFIG_USBSER_EPBULKOUT=2
+CONFIG_USBSER_EPBULKIN=1
CONFIG_USBSER_NWRREQS=4
CONFIG_USBSER_NRDREQS=4
CONFIG_USBSER_VENDORID=0x067b
diff --git a/configs/ntosd-dm320/udp/defconfig b/configs/ntosd-dm320/udp/defconfig
index d90659a4d48..1e93eda4685 100644
--- a/configs/ntosd-dm320/udp/defconfig
+++ b/configs/ntosd-dm320/udp/defconfig
@@ -361,8 +361,15 @@ CONFIG_DM320_USBDEV_DMA=n
#
# USB Serial Device Configuration
#
-# CONFIG_USBSER_EPOUT and CONFIG_USBSER_EPIN
-# Logical endoint addresses
+# CONFIG_USBSER_EPINTIN
+# The logical 7-bit address of a hardware endpoint that supports
+# interrupt IN operation
+# CONFIG_USBSER_EPBULKOUT
+# The logical 7-bit address of a hardware endpoint that supports
+# bulk OUT operation
+# CONFIG_USBSER_EPBULKIN
+# The logical 7-bit address of a hardware endpoint that supports
+# bulk IN operation
# CONFIG_USBSER_NWRREQS and CONFIG_USBSER_NRDREQS
# The number of write/read requests that can be in flight
# CONFIG_USBSER_VENDORID and CONFIG_USBSER_VENDORSTR
@@ -371,8 +378,9 @@ CONFIG_DM320_USBDEV_DMA=n
# The product ID code/string
# CONFIG_USBSER_RXBUFSIZE and CONFIG_USBSER_TXBUFSIZE
# Size of the serial receive/transmit buffers
-CONFIG_USBSER_EPOUT=1
-CONFIG_USBSER_EPIN=2
+CONFIG_USBSER_EPINTIN=3
+CONFIG_USBSER_EPBULKOUT=2
+CONFIG_USBSER_EPBULKIN=1
CONFIG_USBSER_NWRREQS=4
CONFIG_USBSER_NRDREQS=4
CONFIG_USBSER_VENDORID=0x067b
diff --git a/configs/ntosd-dm320/uip/defconfig b/configs/ntosd-dm320/uip/defconfig
index b69b86749de..c3b7fc42143 100644
--- a/configs/ntosd-dm320/uip/defconfig
+++ b/configs/ntosd-dm320/uip/defconfig
@@ -361,8 +361,15 @@ CONFIG_DM320_USBDEV_DMA=n
#
# USB Serial Device Configuration
#
-# CONFIG_USBSER_EPOUT and CONFIG_USBSER_EPIN
-# Logical endoint addresses
+# CONFIG_USBSER_EPINTIN
+# The logical 7-bit address of a hardware endpoint that supports
+# interrupt IN operation
+# CONFIG_USBSER_EPBULKOUT
+# The logical 7-bit address of a hardware endpoint that supports
+# bulk OUT operation
+# CONFIG_USBSER_EPBULKIN
+# The logical 7-bit address of a hardware endpoint that supports
+# bulk IN operation
# CONFIG_USBSER_NWRREQS and CONFIG_USBSER_NRDREQS
# The number of write/read requests that can be in flight
# CONFIG_USBSER_VENDORID and CONFIG_USBSER_VENDORSTR
@@ -371,8 +378,9 @@ CONFIG_DM320_USBDEV_DMA=n
# The product ID code/string
# CONFIG_USBSER_RXBUFSIZE and CONFIG_USBSER_TXBUFSIZE
# Size of the serial receive/transmit buffers
-CONFIG_USBSER_EPOUT=1
-CONFIG_USBSER_EPIN=2
+CONFIG_USBSER_EPINTIN=3
+CONFIG_USBSER_EPBULKOUT=2
+CONFIG_USBSER_EPBULKIN=1
CONFIG_USBSER_NWRREQS=4
CONFIG_USBSER_NRDREQS=4
CONFIG_USBSER_VENDORID=0x067b
diff --git a/drivers/usbdev/usbdev_serial.c b/drivers/usbdev/usbdev_serial.c
index 8a3e6ca3501..b24b95db635 100644
--- a/drivers/usbdev/usbdev_serial.c
+++ b/drivers/usbdev/usbdev_serial.c
@@ -83,12 +83,19 @@
/* Logical endpoint numbers / max packet sizes */
-#ifndef CONFIG_USBSER_EPIN
-# define CONFIG_USBSER_EPIN 2
+#ifndef CONFIG_USBSER_EPINTIN
+# warning "EPINTIN not defined in the configuration"
+# define CONFIG_USBSER_EPINTIN 1
#endif
-#ifndef CONFIG_USBSER_EPOUT
-# define CONFIG_USBSER_EPOUT 1
+#ifndef CONFIG_USBSER_EPBULKOUT
+# warning "EPBULKOUT not defined in the configuration"
+# define CONFIG_USBSER_EPBULKOUT 2
+#endif
+
+#ifndef CONFIG_USBSER_EPBULKIN
+# warning "EPBULKIN not defined in the configuration"
+# define CONFIG_USBSER_EPBULKIN 3
#endif
#ifndef CONFIG_USBSER_EP0MAXPACKET
@@ -148,12 +155,14 @@
/* Endpoint configuration */
-#define USBSER_EPINTIN_ADDR (USB_DIR_IN|1)
+#define USBSER_EPINTIN_ADDR (USB_DIR_IN|CONFIG_USBSER_EPINTIN)
#define USBSER_EPINTIN_ATTR (USB_EP_ATTR_XFER_INT)
#define USBSER_EPINTIN_MXPACKET (10)
-#define USBSER_EPOUTBULK_ADDR (2)
+
+#define USBSER_EPOUTBULK_ADDR (CONFIG_USBSER_EPBULKOUT)
#define USBSER_EPOUTBULK_ATTR (USB_EP_ATTR_XFER_BULK)
-#define USBSER_EPINBULK_ADDR (USB_DIR_IN|3)
+
+#define USBSER_EPINBULK_ADDR (USB_DIR_IN|CONFIG_USBSER_EPBULKIN)
#define USBSER_EPINBULK_ATTR (USB_EP_ATTR_XFER_BULK)
/* Vender specific control requests */
@@ -1210,7 +1219,7 @@ static int usbclass_bind(FAR struct usbdev_s *dev, FAR struct usbdevclass_driver
/* Pre-allocate the IN interrupt endpoint */
- priv->epintin = DEV_ALLOCEP(dev, 0, TRUE, USB_EP_ATTR_XFER_INT);
+ priv->epintin = DEV_ALLOCEP(dev, USBSER_EPINTIN_ADDR, TRUE, USB_EP_ATTR_XFER_INT);
if (!priv->epintin)
{
usbtrace(TRACE_CLSERROR(USBSER_TRACEERR_EPINTINALLOCFAIL), 0);
@@ -1221,7 +1230,7 @@ static int usbclass_bind(FAR struct usbdev_s *dev, FAR struct usbdevclass_driver
/* Pre-allocate the IN bulk endpoint */
- priv->epbulkin = DEV_ALLOCEP(dev, 0, TRUE, USB_EP_ATTR_XFER_BULK);
+ priv->epbulkin = DEV_ALLOCEP(dev, USBSER_EPINBULK_ADDR, TRUE, USB_EP_ATTR_XFER_BULK);
if (!priv->epbulkin)
{
usbtrace(TRACE_CLSERROR(USBSER_TRACEERR_EPBULKINALLOCFAIL), 0);
@@ -1232,7 +1241,7 @@ static int usbclass_bind(FAR struct usbdev_s *dev, FAR struct usbdevclass_driver
/* Pre-allocate the OUT bulk endpoint */
- priv->epbulkout = DEV_ALLOCEP(dev, 0, FALSE, USB_EP_ATTR_XFER_BULK);
+ priv->epbulkout = DEV_ALLOCEP(dev, USBSER_EPOUTBULK_ADDR, FALSE, USB_EP_ATTR_XFER_BULK);
if (!priv->epbulkout)
{
usbtrace(TRACE_CLSERROR(USBSER_TRACEERR_EPBULKOUTALLOCFAIL), 0);