aboutsummaryrefslogtreecommitdiff
path: root/nuttx
diff options
context:
space:
mode:
authorpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2013-01-29 17:42:58 +0000
committerpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2013-01-29 17:42:58 +0000
commitfb94bc1258c9fe4e78fe0d5515f6a6131a8d1e65 (patch)
tree81bc038356e0e42da3ae837e47097ed0d8ebd2f4 /nuttx
parent2946cb47a8d70406a85c37f2d210e539c240a22b (diff)
downloadpx4-firmware-fb94bc1258c9fe4e78fe0d5515f6a6131a8d1e65.tar.gz
px4-firmware-fb94bc1258c9fe4e78fe0d5515f6a6131a8d1e65.tar.bz2
px4-firmware-fb94bc1258c9fe4e78fe0d5515f6a6131a8d1e65.zip
The USB monitor now works with the stm32f4discover/nsh configuration (but not with the usbnsh configuration)
git-svn-id: http://svn.code.sf.net/p/nuttx/code/trunk@5580 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx')
-rw-r--r--nuttx/configs/stm32f4discovery/README.txt42
-rw-r--r--nuttx/fs/fs_syslog.c2
-rw-r--r--nuttx/libc/stdio/lib_syslogstream.c1
3 files changed, 29 insertions, 16 deletions
diff --git a/nuttx/configs/stm32f4discovery/README.txt b/nuttx/configs/stm32f4discovery/README.txt
index 41207fafa..25a770012 100644
--- a/nuttx/configs/stm32f4discovery/README.txt
+++ b/nuttx/configs/stm32f4discovery/README.txt
@@ -1287,19 +1287,29 @@ Where <subdir> is one of the following:
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).
+ - But don't enable USB debug output! Since USB is console is used for
+ USB debug output and you are using a USB console, there will be
+ infinite loops and deadlocks: Debug output generates USB debug
+ output which generatates USB debug output, etc. If you want USB
+ debug output, you should consider enabling USB trace
+ (CONFIG_USBDEV_TRACE) and perhaps the USB monitor (CONFIG_SYSTEM_USBMONITOR).
+
+ See the usbnsh configuration below for more information on configuring
+ USB trace output and the USB monitor.
+
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:
-
- CONFIG_USBDEV=n - Make sure tht USB device support is disabled
- CONFIG_USBHOST=y - Enable USB host support
- CONFIG_STM32_OTGFS=y - Enable the STM32 USB OTG FS block
- CONFIG_STM32_SYSCFG=y - Needed for all USB OTF FS support
- CONFIG_SCHED_WORKQUEUE=y - Worker thread support is required for the mass
+
+ CONFIG_USBDEV=n : Make sure tht USB device support is disabled
+ CONFIG_USBHOST=y : Enable USB host support
+ CONFIG_STM32_OTGFS=y : Enable the STM32 USB OTG FS block
+ CONFIG_STM32_SYSCFG=y : Needed for all USB OTF FS support
+ CONFIG_SCHED_WORKQUEUE=y : Worker thread support is required for the mass
storage class driver.
- CONFIG_NSH_ARCHINIT=y - Architecture specific USB initialization
+ CONFIG_NSH_ARCHINIT=y : Architecture specific USB initialization
is needed for NSH
- CONFIG_FS_FAT=y - Needed by the USB host mass storage class.
+ CONFIG_FS_FAT=y : Needed by the USB host mass storage class.
With those changes, you can use NSH with a FLASH pen driver as shown
belong. Here NSH is started with nothing in the USB host slot:
@@ -1466,7 +1476,6 @@ Where <subdir> is one of the following:
STANDBY mode. This used of the RTC alarm could conflict with other uses of
the RTC alarm in your application.
-
posix_spawn:
------------
This configuration directory, performs a simple test os the posix_spawn
@@ -1538,15 +1547,18 @@ Where <subdir> is one of the following:
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_NSH_USBDEV_TRACE=n : No builtin tracing from NSH
+ CONFIG_NSH_ARCHINIT=y : Automatically start the USB monitor
+ CONFIG_SYSTEM_USBMONITOR=y : Enable the USB monitor daemon
CONFIG_SYSTEM_USBMONITOR_STACKSIZE=2048 : USB monitor daemon stack size
CONFIG_SYSTEM_USBMONITOR_PRIORITY=50 : USB monitor daemon priority
+ CONFIG_SYSTEM_USBMONITOR_INTERVAL=2 : Dump trace data every 2 seconds
- 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
+ CONFIG_SYSTEM_USBMONITOR_TRACEINIT=y : Enable TRACE output
+ CONFIG_SYSTEM_USBMONITOR_TRACECLASS=y
+ CONFIG_SYSTEM_USBMONITOR_TRACETRANSFERS=y
+ CONFIG_SYSTEM_USBMONITOR_TRACECONTROLLER=y
+ CONFIG_SYSTEM_USBMONITOR_TRACEINTERRUPTS=y
5. By default, this project assumes that you are *NOT* using the DFU
bootloader.
diff --git a/nuttx/fs/fs_syslog.c b/nuttx/fs/fs_syslog.c
index 779263a3c..d9ad29e0f 100644
--- a/nuttx/fs/fs_syslog.c
+++ b/nuttx/fs/fs_syslog.c
@@ -168,8 +168,10 @@ static inline int syslog_takesem(void)
static inline void syslog_givesem(void)
{
+#ifdef CONFIG_DEBUG
pid_t me = getpid();
DEBUGASSERT(g_sysdev.sl_holder == me);
+#endif
/* Relinquish the semaphore */
diff --git a/nuttx/libc/stdio/lib_syslogstream.c b/nuttx/libc/stdio/lib_syslogstream.c
index 121227d3c..e29c5ca3d 100644
--- a/nuttx/libc/stdio/lib_syslogstream.c
+++ b/nuttx/libc/stdio/lib_syslogstream.c
@@ -63,7 +63,6 @@
static void syslogstream_putc(FAR struct lib_outstream_s *this, int ch)
{
- int errcode;
int ret;
/* Try writing until the write was successful or until an irrecoverable