From 5faa1bd9cefb4e7a2319faaa5b36da9140aba16a Mon Sep 17 00:00:00 2001 From: patacongo Date: Wed, 29 Feb 2012 21:53:28 +0000 Subject: A little more work (but not much progress) on the PIC32 USB device driver git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@4440 42af7a65-404d-4744-a932-0658087f49c3 --- nuttx/configs/sure-pic32mx/README.txt | 32 ++++++++++++++++++++++---- nuttx/configs/sure-pic32mx/nsh/appconfig | 39 +++++++++++++++++++++----------- nuttx/configs/sure-pic32mx/nsh/defconfig | 39 +++++++++++++++++++++++++++++++- 3 files changed, 92 insertions(+), 18 deletions(-) (limited to 'nuttx/configs') diff --git a/nuttx/configs/sure-pic32mx/README.txt b/nuttx/configs/sure-pic32mx/README.txt index 0c91f3289..dabdd541d 100644 --- a/nuttx/configs/sure-pic32mx/README.txt +++ b/nuttx/configs/sure-pic32mx/README.txt @@ -459,8 +459,32 @@ Where is one of the following: Configures the NuttShell (nsh) located at apps/examples/nsh. The Configuration enables only the serial NSH interface. - The examples/usbterm program can be included as an NSH built-in - function by defined the following in your .config file: + Several USB device configurations can be enabled and included + as NSH built-in built in functions. All require the following + basic setup in your .config to enable USB device support: + + CONFIG_USBEV=y : Enable basic USB device support + CONFIG_PIC32MX_USBDEV=y : Enable PIC32 USB device support - CONFIG_USBEV=y : Enable basic USB device support - CONFIG_PIC32MX_USBDEV=y : Enable PIC32 USB device support + examples/usbterm - This option can be enabled by uncommenting + the following line in the appconfig file: + + CONFIGURED_APPS += examples/usbterm + + And by enabling one of the USB serial devices: + + CONFIG_PL2303=y : Enable the Prolifics PL2303 emulation + CONFIG_CDCACM=y : or the CDC/ACM serial driver (not both) + + examples/cdcacm - The examples/cdcacm program can be included as an + function by uncommenting the following line in the appconfig file: + + CONFIGURED_APPS += examples/cdcacm + + and defining the following in your .config file: + + CONFIG_CDCACM=y : Enable the CDCACM device + + examples/usbstorage - There are some hooks in the appconfig file + to enable the USB mass storage device. However, this device cannot + work until support for the SD card is also incorporated. diff --git a/nuttx/configs/sure-pic32mx/nsh/appconfig b/nuttx/configs/sure-pic32mx/nsh/appconfig index abf0b38a6..2263c5a3e 100644 --- a/nuttx/configs/sure-pic32mx/nsh/appconfig +++ b/nuttx/configs/sure-pic32mx/nsh/appconfig @@ -33,32 +33,45 @@ # ############################################################################ +############################################################################ # Path to example in apps/examples containing the user_start entry point +############################################################################ CONFIGURED_APPS += examples/nsh +############################################################################ # The NSH application library +############################################################################ CONFIGURED_APPS += system/readline CONFIGURED_APPS += nshlib -# Applications configured as an NX built-in commands +############################################################################ +# USB device configurations +############################################################################ -ifeq ($(CONFIG_NET),y) -CONFIGURED_APPS += netutils/uiplib -CONFIGURED_APPS += netutils/resolv -CONFIGURED_APPS += netutils/webclient -CONFIGURED_APPS += netutils/tftpc -endif +ifeq ($(CONFIG_PIC32MX_USBDEV),y) + +# USB Mass Storage Class device configurations -ifeq ($(CONFIG_PWM),y) -CONFIGURED_APPS += examples/pwm +ifeq ($(CONFIG_USBMSC),y) +# Uncomment to enable the examples/usbstorage built-in +# CONFIGURED_APPS += examples/usbstorage endif -ifeq ($(CONFIG_CAN),y) -CONFIGURED_APPS += examples/can +# USB CDC/ACM serial device configurations + +ifeq ($(CONFIG_CDCACM),y) +# Uncomment to enable the examples/cdcacm built-in +# CONFIGURED_APPS += examples/cdcacm +# Uncomment the following to enable the examples/usbterm built-in +# CONFIGURED_APPS += examples/usbterm endif -ifeq ($(CONFIG_PIC32MX_USBDEV),y) -CONFIGURED_APPS += examples/usbterm +# Prolifics PL2303 emulation configurations + +ifeq ($(CONFIG_PL2303),y) +# Uncomment the following to enable the examples/usbterm built-in +# CONFIGURED_APPS += examples/usbterm +endif endif diff --git a/nuttx/configs/sure-pic32mx/nsh/defconfig b/nuttx/configs/sure-pic32mx/nsh/defconfig index f90d09bcc..bd8e9a8b7 100644 --- a/nuttx/configs/sure-pic32mx/nsh/defconfig +++ b/nuttx/configs/sure-pic32mx/nsh/defconfig @@ -225,6 +225,13 @@ CONFIG_UART2_PARITY=0 CONFIG_UART1_2STOP=0 CONFIG_UART2_2STOP=0 +# +# PIC32MX-specific USB device setup +# +CONFIG_PIC32MX_USBDEV_REGDEBUG=n +CONFIG_PIC32MX_USBDEV_BDTDEBUG=n +CONFIG_PIC32MX_USBDEV_PINGPONG=n + # # General build options # @@ -349,7 +356,6 @@ CONFIG_DEBUG_VERBOSE=n CONFIG_DEBUG_SYMBOLS=n CONFIG_DEBUG_SCHED=n CONFIG_DEBUG_USB=n -CONFIG_PIC32MX_USBDEV_REGDEBUG=n CONFIG_HAVE_CXX=n CONFIG_HAVE_CXXINITIALIZE=n @@ -1031,6 +1037,37 @@ CONFIG_EXAMPLES_USBTERM_TRACETRANSFERS=n CONFIG_EXAMPLES_USBTERM_TRACECONTROLLER=n CONFIG_EXAMPLES_USBTERM_TRACEINTERRUPTS=n +# +# Settings for examples/cdcacm +# +# Configuration prequisites: +# +# CONFIG_USBDEV=y : USB device support must be enabled +# CONFIG_CDCACM=y : The CDC/ACM driver must be built +# CONFIG_NSH_BUILTIN_APPS : NSH built-in application support must be enabled +# +# Configuration options specific to this example: +# +# CONFIG_EXAMPLES_CDCACM_DEVMINOR +# The minor number of the CDC/ACM device. +# CONFIG_EXAMPLES_CDCACM_TRACEINIT +# Show initialization events +# CONFIG_EXAMPLES_CDCACM_TRACECLASS +# Show class driver events +# CONFIG_EXAMPLES_CDCACM_TRACETRANSFERS +# Show data transfer events +# CONFIG_EXAMPLES_CDCACM_TRACECONTROLLER +# Show controller events +# CONFIG_EXAMPLES_CDCACM_TRACEINTERRUPTS +# Show interrupt-related events. +# +CONFIG_EXAMPLES_CDCACM_DEVMINOR=0 +CONFIG_EXAMPLES_CDCACM_TRACEINIT=n +CONFIG_EXAMPLES_CDCACM_TRACECLASS=n +CONFIG_EXAMPLES_CDCACM_TRACETRANSFERS=n +CONFIG_EXAMPLES_CDCACM_TRACECONTROLLER=n +CONFIG_EXAMPLES_CDCACM_TRACEINTERRUPTS=n + # # Stack and heap information # -- cgit v1.2.3