summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2009-10-31 02:32:46 +0000
committerpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2009-10-31 02:32:46 +0000
commitc296a52043a28c35e44edeb1bf53b59ec41ac526 (patch)
tree78050b0253f0b312ab43d25089119b1138272a67
parentf7c00ad3071c61271c97b35f15cd0dee53063697 (diff)
downloadnuttx-c296a52043a28c35e44edeb1bf53b59ec41ac526.tar.gz
nuttx-c296a52043a28c35e44edeb1bf53b59ec41ac526.tar.bz2
nuttx-c296a52043a28c35e44edeb1bf53b59ec41ac526.zip
Fix size of BTABLE
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@2199 42af7a65-404d-4744-a932-0658087f49c3
-rw-r--r--nuttx/arch/arm/src/stm32/stm32_usbdev.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/nuttx/arch/arm/src/stm32/stm32_usbdev.c b/nuttx/arch/arm/src/stm32/stm32_usbdev.c
index c62c4277e..bf49b6665 100644
--- a/nuttx/arch/arm/src/stm32/stm32_usbdev.c
+++ b/nuttx/arch/arm/src/stm32/stm32_usbdev.c
@@ -124,14 +124,15 @@
#define STM32_EP0MAXPACKET STM32_MAXPACKET_SIZE
-/* Buffer description table. We assume that USB has excluse use of the buffer
- * table. The buffer table is positioned at the beginning of the 512-byte
+/* Buffer descriptor table. We assume that USB has exclusive use of CAN/USB
+ * memory. The buffer table is positioned at the beginning of the 512-byte
* CAN/USB memory. We will use the first STM32_NENDPOINTS*4 words for the buffer
- * table.
+ * table. That is exactly 64 bytes, leaving 7*64 bytes for endpoint buffers.
*/
-#define STM32_BTABLE_ADDRESS (0x00)
-#define STM32_BTABLE_SIZE (0x18)
+#define STM32_BTABLE_ADDRESS (0x00) /* Start at the beginning of USB/CAN RAM */
+#define STM32_DESC_SIZE (8) /* Each descriptor is 4*2=8 bytes in size */
+#define STM32_BTABLE_SIZE (STM32_NENDPOINTS*STM32_DESC_SIZE)
/* Buffer layout. Assume that all buffers are 64-bytes (maxpacketsize), then
* we have space for only 7 buffers; endpoint 0 will require two buffers, leaving