README.txt 9.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270
  1. README
  2. ^^^^^^
  3. README for NuttX port to the mbed.org LPC1768 board (http://mbed.org/)
  4. Contents
  5. ^^^^^^^^
  6. mbed Configuration Options
  7. USB Host Configuration
  8. Configurations
  9. mbed Configuration Options
  10. ^^^^^^^^^^^^^^^^^^^^^^^^^^
  11. CONFIG_ARCH - Identifies the arch/ subdirectory. This should
  12. be set to:
  13. CONFIG_ARCH=arm
  14. CONFIG_ARCH_family - For use in C code:
  15. CONFIG_ARCH_ARM=y
  16. CONFIG_ARCH_architecture - For use in C code:
  17. CONFIG_ARCH_CORTEXM3=y
  18. CONFIG_ARCH_CHIP - Identifies the arch/*/chip subdirectory
  19. CONFIG_ARCH_CHIP=lpc17xx
  20. CONFIG_ARCH_CHIP_name - For use in C code to identify the exact
  21. chip:
  22. CONFIG_ARCH_CHIP_LPC1768=y
  23. CONFIG_ARCH_BOARD - Identifies the configs subdirectory and
  24. hence, the board that supports the particular chip or SoC.
  25. CONFIG_ARCH_BOARD=mbed (for the mbed.org board)
  26. CONFIG_ARCH_BOARD_name - For use in C code
  27. CONFIG_ARCH_BOARD_MBED=y
  28. CONFIG_ARCH_LOOPSPERMSEC - Must be calibrated for correct operation
  29. of delay loops
  30. CONFIG_ENDIAN_BIG - define if big endian (default is little
  31. endian)
  32. CONFIG_RAM_SIZE - Describes the installed DRAM (CPU SRAM in this case):
  33. CONFIG_RAM_SIZE=(32*1024) (32Kb)
  34. There is an additional 32Kb of SRAM in AHB SRAM banks 0 and 1.
  35. CONFIG_RAM_START - The start address of installed DRAM
  36. CONFIG_RAM_START=0x10000000
  37. CONFIG_ARCH_LEDS - Use LEDs to show state. Unique to boards that
  38. have LEDs
  39. CONFIG_ARCH_INTERRUPTSTACK - This architecture supports an interrupt
  40. stack. If defined, this symbol is the size of the interrupt
  41. stack in bytes. If not defined, the user task stacks will be
  42. used during interrupt handling.
  43. CONFIG_ARCH_STACKDUMP - Do stack dumps after assertions
  44. CONFIG_ARCH_LEDS - Use LEDs to show state. Unique to board architecture.
  45. Individual subsystems can be enabled:
  46. CONFIG_LPC17_MAINOSC=y
  47. CONFIG_LPC17_PLL0=y
  48. CONFIG_LPC17_PLL1=n
  49. CONFIG_LPC17_ETHERNET=n
  50. CONFIG_LPC17_USBHOST=n
  51. CONFIG_LPC17_USBOTG=n
  52. CONFIG_LPC17_USBDEV=n
  53. CONFIG_LPC17_UART0=y
  54. CONFIG_LPC17_UART1=n
  55. CONFIG_LPC17_UART2=n
  56. CONFIG_LPC17_UART3=n
  57. CONFIG_LPC17_CAN1=n
  58. CONFIG_LPC17_CAN2=n
  59. CONFIG_LPC17_SPI=n
  60. CONFIG_LPC17_SSP0=n
  61. CONFIG_LPC17_SSP1=n
  62. CONFIG_LPC17_I2C0=n
  63. CONFIG_LPC17_I2C1=n
  64. CONFIG_LPC17_I2S=n
  65. CONFIG_LPC17_TMR0=n
  66. CONFIG_LPC17_TMR1=n
  67. CONFIG_LPC17_TMR2=n
  68. CONFIG_LPC17_TMR3=n
  69. CONFIG_LPC17_RIT=n
  70. CONFIG_LPC17_PWM0=n
  71. CONFIG_LPC17_MCPWM=n
  72. CONFIG_LPC17_QEI=n
  73. CONFIG_LPC17_RTC=n
  74. CONFIG_LPC17_WDT=n
  75. CONFIG_LPC17_ADC=n
  76. CONFIG_LPC17_DAC=n
  77. CONFIG_LPC17_GPDMA=n
  78. CONFIG_LPC17_FLASH=n
  79. LPC17xx specific device driver settings
  80. CONFIG_UARTn_SERIAL_CONSOLE - selects the UARTn for the
  81. console and ttys0 (default is the UART0).
  82. CONFIG_UARTn_RXBUFSIZE - Characters are buffered as received.
  83. This specific the size of the receive buffer
  84. CONFIG_UARTn_TXBUFSIZE - Characters are buffered before
  85. being sent. This specific the size of the transmit buffer
  86. CONFIG_UARTn_BAUD - The configure BAUD of the UART. Must be
  87. CONFIG_UARTn_BITS - The number of bits. Must be either 7 or 8.
  88. CONFIG_UARTn_PARTIY - 0=no parity, 1=odd parity, 2=even parity
  89. CONFIG_UARTn_2STOP - Two stop bits
  90. LPC17xx specific CAN device driver settings. These settings all
  91. require CONFIG_CAN:
  92. CONFIG_CAN_EXTID - Enables support for the 29-bit extended ID. Default
  93. Standard 11-bit IDs.
  94. CONFIG_LPC17_CAN1_BAUD - CAN1 BAUD rate. Required if CONFIG_LPC17_CAN1
  95. is defined.
  96. CONFIG_LPC17_CAN2_BAUD - CAN1 BAUD rate. Required if CONFIG_LPC17_CAN2
  97. is defined.
  98. CONFIG_LPC17_CAN1_DIVISOR - CAN1 is clocked at CCLK divided by this
  99. number. (the CCLK frequency is divided by this number to get the CAN
  100. clock). Options = {1,2,4,6}. Default: 4.
  101. CONFIG_LPC17_CAN2_DIVISOR - CAN2 is clocked at CCLK divided by this
  102. number. (the CCLK frequency is divided by this number to get the CAN
  103. clock). Options = {1,2,4,6}. Default: 4.
  104. CONFIG_LPC17_CAN_TSEG1 - The number of CAN time quanta in segment 1.
  105. Default: 6
  106. CONFIG_LPC17_CAN_TSEG2 = the number of CAN time quanta in segment 2.
  107. Default: 7
  108. LPC17xx specific PHY/Ethernet device driver settings. These setting
  109. also require CONFIG_NET and CONFIG_LPC17_ETHERNET.
  110. CONFIG_ETH0_PHY_KS8721 - Selects Micrel KS8721 PHY
  111. CONFIG_LPC17_PHY_AUTONEG - Enable auto-negotion
  112. CONFIG_LPC17_PHY_SPEED100 - Select 100Mbit vs. 10Mbit speed.
  113. CONFIG_LPC17_PHY_FDUPLEX - Select full (vs. half) duplex
  114. CONFIG_LPC17_EMACRAM_SIZE - Size of EMAC RAM. Default: 16Kb
  115. CONFIG_LPC17_ETH_NTXDESC - Configured number of Tx descriptors. Default: 18
  116. CONFIG_LPC17_ETH_NRXDESC - Configured number of Rx descriptors. Default: 18
  117. CONFIG_LPC17_ETH_WOL - Enable Wake-up on Lan (not fully implemented).
  118. CONFIG_NET_REGDEBUG - Enabled low level register debug. Also needs
  119. CONFIG_DEBUG_FEATURES.
  120. CONFIG_NET_DUMPPACKET - Dump all received and transmitted packets.
  121. Also needs CONFIG_DEBUG_FEATURES.
  122. CONFIG_LPC17_ETH_HASH - Enable receipt of near-perfect match frames.
  123. CONFIG_LPC17_MULTICAST - Enable receipt of multicast (and unicast) frames.
  124. Automatically set if CONFIG_NET_MCASTGROUP is selected.
  125. LPC17xx USB Device Configuration
  126. CONFIG_LPC17_USBDEV_FRAME_INTERRUPT
  127. Handle USB Start-Of-Frame events.
  128. Enable reading SOF from interrupt handler vs. simply reading on demand.
  129. Probably a bad idea... Unless there is some issue with sampling the SOF
  130. from hardware asynchronously.
  131. CONFIG_LPC17_USBDEV_EPFAST_INTERRUPT
  132. Enable high priority interrupts. I have no idea why you might want to
  133. do that
  134. CONFIG_LPC17_USBDEV_NDMADESCRIPTORS
  135. Number of DMA descriptors to allocate in SRAM.
  136. CONFIG_LPC17_USBDEV_DMA
  137. Enable lpc17xx-specific DMA support
  138. CONFIG_LPC17_USBDEV_NOVBUS
  139. Define if the hardware implementation does not support the VBUS signal
  140. CONFIG_LPC17_USBDEV_NOLED
  141. Define if the hardware implementation does not support the LED output
  142. LPC17xx USB Host Configuration
  143. CONFIG_LPC17_OHCIRAM_SIZE
  144. Total size of OHCI RAM (in AHB SRAM Bank 1)
  145. CONFIG_LP17_USBHOST_NEDS
  146. Number of endpoint descriptors
  147. CONFIG_LP17_USBHOST_NTDS
  148. Number of transfer descriptors
  149. CONFIG_LPC17_USBHOST_TDBUFFERS
  150. Number of transfer descriptor buffers
  151. CONFIG_LPC17_USBHOST_TDBUFSIZE
  152. Size of one transfer descriptor buffer
  153. CONFIG_LPC17_USBHOST_IOBUFSIZE
  154. Size of one end-user I/O buffer. This can be zero if the
  155. application can guarantee that all end-user I/O buffers
  156. reside in AHB SRAM.
  157. USB Host Configuration
  158. ^^^^^^^^^^^^^^^^^^^^^^
  159. The mbed board can be easily modified to support a USB host interface
  160. (Remember to add 2 resistors of 15K to D+ and D- pins).
  161. The NuttShell (NSH) mbed can also be modified in order to support USB
  162. host operations. To make these modifications, do the following:
  163. 1. First configure to build the NSH configuration from the top-level
  164. NuttX directory:
  165. ./configure mbed/nsh
  166. 2. Then edit the top-level .config file to enable USB host. Make the
  167. following changes using 'make menuconfig':
  168. System Type -> LPC17xx Peripheral Support
  169. CONFIG_LPC17_USBHOST=y : USB host controller driver support
  170. Device Drivers -> USB Host Driver Support
  171. CONFIG_USBHOST=y : USB host support
  172. CONFIG_USBHOST_ISOC_DISABLE=y : Not needed
  173. CONFIG_USBHOST_MSC=y : Mass storage class support
  174. Library Routines
  175. CONFIG_SCHED_WORKQUEUE=y : Enable worker thread
  176. When this change is made, NSH should be extended to support USB flash
  177. devices. When a FLASH device is inserted, you should see a device
  178. appear in the /dev (pseudo) directory. The device name should be
  179. like /dev/sda, /dev/sdb, etc. The USB mass storage device, is present
  180. it can be mounted from the NSH command line like:
  181. ls /dev
  182. mount -t vfat /dev/sda /mnt/flash
  183. Files on the connect USB flash device should then be accessible under
  184. the mountpoint /mnt/flash.
  185. Configurations
  186. ^^^^^^^^^^^^^^
  187. General
  188. -------
  189. Each mbed configuration is maintained in a sub-directory and can be selected
  190. as follow:
  191. tools/configure.sh mbed/<subdir>
  192. Where <subdir> is one of the mbed subdirectories described in the
  193. following paragraph.
  194. NOTES:
  195. 1. These configurations use the mconf-based configuration tool. To
  196. change any of these configurations using that tool, you should:
  197. a. Build and install the kconfig-mconf tool. See nuttx/README.txt
  198. see additional README.txt files in the NuttX tools repository.
  199. b. Execute 'make menuconfig' in nuttx/ in order to start the
  200. reconfiguration process.
  201. Configuration Sub-directories
  202. -----------------------------
  203. nsh:
  204. Configures the NuttShell (nsh) located at examples/nsh. The
  205. Configuration enables only the serial NSH interfaces. See notes
  206. above for enabling USB host support in this configuration.