diff options
author | Gregory Nutt <gnutt@nuttx.org> | 2013-09-25 17:23:03 -0600 |
---|---|---|
committer | Gregory Nutt <gnutt@nuttx.org> | 2013-09-25 17:23:03 -0600 |
commit | 54cd9689cccad1949c067f40d500491851799221 (patch) | |
tree | 0413e3c52da1dafc9a3db7671b37ccc12d38c715 /apps/system/usbmsc | |
parent | 55a34548ccc4fc7aa55ad585b007c7d77d8cf937 (diff) | |
download | px4-nuttx-54cd9689cccad1949c067f40d500491851799221.tar.gz px4-nuttx-54cd9689cccad1949c067f40d500491851799221.tar.bz2 px4-nuttx-54cd9689cccad1949c067f40d500491851799221.zip |
Move apps/examples/cdcacm to apps/system/cdcacm
Diffstat (limited to 'apps/system/usbmsc')
-rw-r--r-- | apps/system/usbmsc/Kconfig | 2 | ||||
-rwxr-xr-x | apps/system/usbmsc/README.txt | 76 | ||||
-rw-r--r-- | apps/system/usbmsc/usbmsc.h | 8 |
3 files changed, 81 insertions, 5 deletions
diff --git a/apps/system/usbmsc/Kconfig b/apps/system/usbmsc/Kconfig index d78f8a8ac..7be540e33 100644 --- a/apps/system/usbmsc/Kconfig +++ b/apps/system/usbmsc/Kconfig @@ -6,7 +6,7 @@ config SYSTEM_USBMSC bool "USB mass storage class controls" default n - depends on USBMSC + depends on USBMSC && !KERNEL_BUILD ---help--- Enable the USB mass storage class controls. These controls include: diff --git a/apps/system/usbmsc/README.txt b/apps/system/usbmsc/README.txt new file mode 100755 index 000000000..6734a4ed8 --- /dev/null +++ b/apps/system/usbmsc/README.txt @@ -0,0 +1,76 @@ +system/usbmsc
+^^^^^^^^^^^^^^^
+
+ This add-on registers a block device driver, then exports the block
+ the device using the USB storage class driver. In order to use this
+ add-on, your board-specific logic must provide the function:
+
+ void usbmsc_archinitialize(void);
+
+ This function will be called by the system/usbmsc in order to
+ do the actual registration of the block device drivers. For examples
+ of the implementation of usbmsc_archinitialize() see
+ configs/mcu123-lpc124x/src/up_usbmsc.c or
+ configs/stm3210e-eval/src/usbmsc.c
+
+ Configuration options:
+
+ CONFIG_NSH_BUILTIN_APPS
+ This add-on can be built as two NSH "built-in" commands if this option
+ is selected: 'msconn' will connect the USB mass storage device; 'msdis'
+ will disconnect the USB storage device.
+ CONFIG_SYSTEM_USBMSC_NLUNS
+ Defines the number of logical units (LUNs) exported by the USB storage
+ driver. Each LUN corresponds to one exported block driver (or partition
+ of a block driver). May be 1, 2, or 3. Default is 1.
+ CONFIG_SYSTEM_USBMSC_DEVMINOR1
+ The minor device number of the block driver for the first LUN. For
+ example, N in /dev/mmcsdN. Used for registering the block driver. Default
+ is zero.
+ CONFIG_SYSTEM_USBMSC_DEVPATH1
+ The full path to the registered block driver. Default is "/dev/mmcsd0"
+ CONFIG_SYSTEM_USBMSC_DEVMINOR2 and CONFIG_SYSTEM_USBMSC_DEVPATH2
+ Similar parameters that would have to be provided if CONFIG_SYSTEM_USBMSC_NLUNS
+ is 2 or 3. No defaults.
+ CONFIG_SYSTEM_USBMSC_DEVMINOR3 and CONFIG_SYSTEM_USBMSC_DEVPATH3
+ Similar parameters that would have to be provided if CONFIG_SYSTEM_USBMSC_NLUNS
+ is 3. No defaults.
+ CONFIG_SYSTEM_USBMSC_DEBUGMM
+ Enables some debug tests to check for memory usage and memory leaks.
+
+ If CONFIG_USBDEV_TRACE is enabled (or CONFIG_DEBUG and CONFIG_DEBUG_USB), then
+ the code will also manage the USB trace output. The amount of trace output
+ can be controlled using:
+
+ CONFIG_SYSTEM_USBMSC_TRACEINIT
+ Show initialization events
+ CONFIG_SYSTEM_USBMSC_TRACECLASS
+ Show class driver events
+ CONFIG_SYSTEM_USBMSC_TRACETRANSFERS
+ Show data transfer events
+ CONFIG_SYSTEM_USBMSC_TRACECONTROLLER
+ Show controller events
+ CONFIG_SYSTEM_USBMSC_TRACEINTERRUPTS
+ Show interrupt-related events.
+
+ Error results are always shown in the trace output
+
+ NOTE 1: When built as an NSH add-on command (CONFIG_NSH_BUILTIN_APPS=y),
+ Caution should be used to assure that the SD drive (or other storage device) is
+ not in use when the USB storage device is configured. Specifically, the SD
+ driver should be unmounted like:
+
+ nsh> mount -t vfat /dev/mmcsd0 /mnt/sdcard # Card is mounted in NSH
+ ...
+ nsh> umount /mnd/sdcard # Unmount before connecting USB!!!
+ nsh> msconn # Connect the USB storage device
+ ...
+ nsh> msdis # Disconnect USB storate device
+ nsh> mount -t vfat /dev/mmcsd0 /mnt/sdcard # Restore the mount
+
+ Failure to do this could result in corruption of the SD card format.
+
+ NOTE 2: This add-on used internal USB device driver interfaces. As such,
+ it relies on internal OS interfaces that are not normally available to a
+ user-space program. As a result, this add-on cannot be used if a
+ NuttX is built as a protected, supervisor kernel (CONFIG_NUTTX_KERNEL).
diff --git a/apps/system/usbmsc/usbmsc.h b/apps/system/usbmsc/usbmsc.h index c829473e4..1a0afb9a2 100644 --- a/apps/system/usbmsc/usbmsc.h +++ b/apps/system/usbmsc/usbmsc.h @@ -1,7 +1,7 @@ /**************************************************************************** * system/usbmsc/usbmsc.h * - * Copyright (C) 2008-2009, 2012 Gregory Nutt. All rights reserved. + * Copyright (C) 2008-2009, 2012-2013 Gregory Nutt. All rights reserved. * Author: Gregory Nutt <gnutt@nuttx.org> * * Redistribution and use in source and binary forms, with or without @@ -33,8 +33,8 @@ * ****************************************************************************/ -#ifndef __EXAMPLES_USBSTORAGE_USBMSC_H -#define __EXAMPLES_USBSTORAGE_USBMSC_H +#ifndef __SYSTEM_USBMSC_USBMSC_H +#define __SYSTEM_USBMSC_USBMSC_H /**************************************************************************** * Included Files @@ -177,4 +177,4 @@ extern struct usbmsc_state_s g_usbmsc; extern int usbmsc_archinitialize(void); -#endif /* __EXAMPLES_USBSTORAGE_USBMSC_H */ +#endif /* __SYSTEM_USBMSC_USBMSC_H */ |