USB monitor daemon updates

git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@5579 42af7a65-404d-4744-a932-0658087f49c3
This commit is contained in:
patacongo 2013-01-29 13:30:10 +00:00
parent ad430fc198
commit 9b5d4a7b46
7 changed files with 126 additions and 48 deletions

56
Kconfig
View File

@ -297,27 +297,21 @@ config DEBUG
---help---
Enables built-in debug features. Selecting this option will (1) Enable
debug assertions in the code, (2) enable extended parameter testing in
many functions, and (3) enable support for debug output. Note that enabling
this option by itself does not produce debug output. Debug output must
also be selected on a subsystem-by-subsystem basis.
many functions, and (3) enable support for debug output to the SYSLOG.
Note that enabling this option by itself does not produce debug output.
Debug output must also be selected on a subsystem-by-subsystem basis.
if DEBUG
config DEBUG_VERBOSE
bool "Enable Debug Verbose Output"
default n
---help---
Enables verbose debug output (assuming debug output is enabled). As a
general rule, when DEBUG is enabled only errors will be reported in the debug
output. But if you also enable DEBUG_VERBOSE, then very chatty (and
often annoying) output will be generated. This means there are two levels
of debug output: errors-only and everything.
config SYSLOG_ENABLE
bool "Enable Debug Controls"
default n
---help---
Support an interface called syslog_enable to dynamically enable or
disable debug output.
Enables verbose debug output (assuming debug featurses are enabled).
As a general rule, when DEBUG is enabled only errors will be
reported in the debug SYSLOG output. But if you also enable
DEBUG_VERBOSE, then very chatty (and often annoying) output will be
generated. This means there are two levels of debug output:
errors-only and everything.
comment "Subsystem Debug Options"
@ -325,58 +319,58 @@ config DEBUG_MM
bool "Enable Memory Manager Debug Output"
default n
---help---
Enable memory management debug output (disabled by default)
Enable memory management debug SYSLOG output (disabled by default)
config DEBUG_SCHED
bool "Enable Scheduler Debug Output"
default n
---help---
Enable OS debug output (disabled by default)
Enable OS debug SYSLOG output (disabled by default)
config DEBUG_PAGING
bool "Enable Demand Paging Debug Output"
default n
depends on PAGING
---help---
Enable demand paging debug output (disabled by default)
Enable demand paging debug SYSLOG output (disabled by default)
config DEBUG_NET
bool "Enable Network Debug Output"
default n
depends on NET
---help---
Enable network debug output (disabled by default)
Enable network debug SYSLOG output (disabled by default)
config DEBUG_USB
bool "Enable USB Debug Output"
default n
depends on USBDEV || USBHOST
---help---
Enable usb debug output (disabled by default)
Enable usb debug SYSLOG output (disabled by default)
config DEBUG_FS
bool "Enable File System Debug Output"
default n
---help---
Enable file system debug output (disabled by default)
Enable file system debug SYSLOG output (disabled by default)
config DEBUG_LIB
bool "Enable C Library Debug Output"
default n
---help---
Enable C library debug output (disabled by default)
Enable C library debug SYSLOG output (disabled by default)
config DEBUG_BINFMT
bool "Enable Binary Loader Debug Output"
default n
---help---
Enable binary loader debug output (disabled by default)
Enable binary loader debug SYSLOG output (disabled by default)
config DEBUG_GRAPHICS
bool "Enable Graphics Debug Output"
default n
---help---
Enable NX graphics debug output (disabled by default)
Enable NX graphics debug SYSLOG output (disabled by default)
comment "Driver Debug Options"
@ -385,21 +379,21 @@ config DEBUG_LCD
default n
depends on LCD
---help---
Enable low level debug output from the LCD driver (disabled by default)
Enable low level debug SYSLOG output from the LCD driver (disabled by default)
config DEBUG_INPUT
bool "Enable Input Device Debug Output"
default n
depends on INPUT
---help---
Enable low level debug output from the input device drivers such as
Enable low level debug SYSLOG output from the input device drivers such as
mice and touchscreens (disabled by default)
config DEBUG_ANALOG
bool "Enable Analog Device Debug Output"
default n
---help---
Enable low level debug output from the analog device drivers such as
Enable low level debug SYSLOG output from the analog device drivers such as
A/D and D/A converters (disabled by default)
config DEBUG_I2C
@ -407,27 +401,27 @@ config DEBUG_I2C
default n
depends on I2C
---help---
Enable I2C driver debug output (disabled by default)
Enable I2C driver debug SYSLOG output (disabled by default)
config DEBUG_SPI
bool "Enable SPI Debug Output"
default n
depends on SPI
---help---
Enable I2C driver debug output (disabled by default)
Enable I2C driver debug SYSLOG output (disabled by default)
config DEBUG_DMA
bool "Enable DMA Debug Output"
default n
---help---
Enable DMA-releated debug output (disabled by default)
Enable DMA-releated debug SYSLOG output (disabled by default)
config DEBUG_WATCHDOG
bool "Enable Watchdog Timer Debug Output"
default n
depends on WATCHDOG
---help---
Enable watchdog timer debug output (disabled by default)
Enable watchdog timer debug SYSLOG output (disabled by default)
endif

View File

@ -1258,7 +1258,36 @@ Where <subdir> is one of the following:
times before NSH starts. The logic does this to prevent sending USB data
before there is anything on the host side listening for USB serial input.
9. USB OTG FS Host Support. The following changes will enable support for
9. Here is an alternative USB console configuration. The following
configuration will also create a NSH USB console but this version
will use /dev/console. Instead, it will use the normal /dev/ttyACM0
USB serial device for the console:
CONFIG_STM32_OTGFS=y : STM32 OTG FS support
CONFIG_USART2_SERIAL_CONSOLE=y : Keep the USART2 console
CONFIG_DEV_CONSOLE=y : /dev/console exists (but NSH won't use it)
CONFIG_USBDEV=y : USB device support must be enabled
CONFIG_CDCACM=y : The CDC/ACM driver must be built
CONFIG_CDCACM_CONSOLE=n : Don't use the CDC/ACM USB console.
CONFIG_NSH_USBCONSOLE=y : Instead use some other USB device for the console
The particular USB device that is used is:
CONFIG_NSH_USBCONDEV="/dev/ttyACM0"
The advantage of this configuration is only that it is easier to
bet working. This alternative does has some side effects:
- When any other device other than /dev/console is used for a user
interface, linefeeds (\n) will not be expanded to carriage return /
linefeeds (\r\n). You will need to set your terminal program to account
for this.
- /dev/console still exists and still refers to the serial port. So
you can still use certain kinds of debug output (see include/debug.h, all
of the interfaces based on lowsyslog will work in this configuration).
10. USB OTG FS Host Support. The following changes will enable support for
a USB host on the STM32F4Discovery, including support for a mass storage
class driver:
@ -1497,10 +1526,29 @@ Where <subdir> is one of the following:
CONFIG_SYSLOG_CHAR=y : Use a character device for system logging
CONFIG_SYSLOG_DEVPATH="/dev/ttyS0" : UART2 will be /dev/ttyS0
Debug, however, is not enable so in the default configuration nothing
should appear on UART2 unless you enable some debug output.
However, there is nothing to generate SYLOG output in the default
configuration so nothing should appear on UART2 unless you enable
some debug output or enable the USB monitor.
4. By default, this project assumes that you are *NOT* using the DFU
4. Enabling USB monitor SYSLOG output. If tracing is enabled, the USB
device will save encoded trace output in in-memory buffer; if the
USB monitor is enabled, that trace buffer will be periodically
emptied and dumped to the system loggin device (UART2 in this
configuraion):
CONFIG_USBDEV_TRACE=y : Enable USB trace feature
CONFIG_USBDEV_TRACE_NRECORDS=128 : Buffer 128 records in memory
CONFIG_SYSTEM_USBMONITOR=y : Start the USB monitor daemon
CONFIG_SYSTEM_USBMONITOR_STACKSIZE=2048 : USB monitor daemon stack size
CONFIG_SYSTEM_USBMONITOR_PRIORITY=50 : USB monitor daemon priority
CONFIG_NSH_USBDEV_TRACEINIT=y : Enable TRACE output
CONFIG_NSH_USBDEV_TRACECLASS=y
CONFIG_NSH_USBDEV_TRACETRANSFERS=y
CONFIG_NSH_USBDEV_TRACECONTROLLER=y
CONFIG_NSH_USBDEV_TRACEINTERRUPTS=y
5. By default, this project assumes that you are *NOT* using the DFU
bootloader.
Using the Prolifics PL2303 Emulation

View File

@ -50,6 +50,10 @@
# include <nuttx/mmcsd.h>
#endif
#ifdef CONFIG_SYSTEM_USBMONITOR
# include <apps/usbmonitor.h>
#endif
#ifdef CONFIG_STM32_OTGFS
# include "stm32_usbhost.h"
#endif
@ -63,20 +67,23 @@
/* Configuration ************************************************************/
#define HAVE_USBDEV 1
#define HAVE_USBHOST 1
#define HAVE_USBDEV 1
#define HAVE_USBHOST 1
#define HAVE_USBMONITOR 1
/* Can't support USB host or device features if USB OTG FS is not enabled */
#ifndef CONFIG_STM32_OTGFS
# undef HAVE_USBDEV
# undef HAVE_USBHOST
# undef HAVE_USBMONITOR
#endif
/* Can't support USB device is USB device is not enabled */
#ifndef CONFIG_USBDEV
# undef HAVE_USBDEV
# undef HAVE_USBMONITOR
#endif
/* Can't support USB host is USB host is not enabled */
@ -85,6 +92,12 @@
# undef HAVE_USBHOST
#endif
/* Check if we should enable the USB monitor before starting NSH */
#if !defined(CONFIG_USBDEV_TRACE) || !defined(CONFIG_SYSTEM_USBMONITOR)
# undef HAVE_USBMONITOR
#endif
/* Debug ********************************************************************/
#ifdef CONFIG_CPP_HAVE_VARARGS
@ -115,9 +128,11 @@
int nsh_archinitialize(void)
{
#ifdef HAVE_USBHOST
#if defined(HAVE_USBHOST) || defined(HAVE_USBMONITOR)
int ret;
#endif
#ifdef HAVE_USBHOST
/* Initialize USB host operation. stm32_usbhost_initialize() starts a thread
* will monitor for USB connection and disconnection events.
*/
@ -130,5 +145,15 @@ int nsh_archinitialize(void)
}
#endif
#ifdef HAVE_USBMONITOR
/* Start the USB Monitor */
ret = usbmonitor_start(0, NULL);
if (ret != OK)
{
message("nsh_archinitialize: Start USB monitor: %d\n", ret);
}
#endif
return OK;
}

View File

@ -422,7 +422,7 @@ CONFIG_CDCACM_TXBUFSIZE=256
CONFIG_CDCACM_VENDORID=0x0525
CONFIG_CDCACM_PRODUCTID=0xa4a7
CONFIG_CDCACM_VENDORSTR="NuttX"
CONFIG_CDCACM_PRODUCTSTR="USBdev Serial"
CONFIG_CDCACM_PRODUCTSTR="CDC/ACM Serial"
# CONFIG_USBMSC is not set
# CONFIG_USBHOST is not set
# CONFIG_WIRELESS is not set

View File

@ -148,7 +148,7 @@ config COMPOSITE_VERSIONNO
endif
menuconfig PL2303
bool "Emulates the Prolific PL2303 serial/USB converter"
bool "Prolific PL2303 serial/USB converter emulation"
default n
---help---
This logic emulates the Prolific PL2303 serial/USB converter
@ -216,7 +216,7 @@ config PL2303_VENDORSTR
config PL2303_PRODUCTSTR
string "Product string"
default "USBdev Serial"
default "PL2303 Emulation"
endif
menuconfig CDCACM
@ -380,7 +380,7 @@ config CDCACM_VENDORSTR
config CDCACM_PRODUCTSTR
string "Product string"
default "USBdev Serial"
default "CDC/ACM Serial"
endif
menuconfig USBMSC
@ -495,8 +495,8 @@ config USBMSC_PRODUCTID
default 0x00
config USBMSC_PRODUCTSTR
string "Mass stroage product string"
default "Mass stroage"
string "Mass storage product string"
default "Mass Storage"
config USBMSC_VERSIONNO
hex "USB MSC Version Number"

View File

@ -18,11 +18,22 @@ source fs/binfs/Kconfig
comment "System Logging"
config SYSLOG
bool "System logging"
config SYSLOG_ENABLE
bool "Enable SYSLOG Controls"
default n
---help---
Enables generic system logging features.
Support an interface called syslog_enable to dynamically enable or
disable SYSLOG output. Default: SYSLOG output is always enabled.
config SYSLOG
bool "Advanced SYSLOG features"
default n
---help---
Enables generic system logging features. NOTE: This setting is not
required to enable system logging. If this feature is not enable
system logging will still be available and will log to the system
console (like printf()). This setting is required to enable
customization of the basic system loggin capability.
if SYSLOG

View File

@ -242,7 +242,7 @@ static FAR const struct nx_fontpackage_s *g_fontpackages[] =
* Name: nxf_getglyphset
*
* Description:
* Return information about the font set containtined he selected
* Return information about the font set contained in the selected
* character encoding.
*
* Input Parameters: