summaryrefslogtreecommitdiff
path: root/nuttx/configs/stm32f4discovery
diff options
context:
space:
mode:
authorpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2012-08-29 19:38:53 +0000
committerpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2012-08-29 19:38:53 +0000
commita21218519751fd36fd99c6c1bac28693c7d2a7cc (patch)
treed83ddaac09e30ea0e9277354e7b39547314bc6ff /nuttx/configs/stm32f4discovery
parent4ab6aa6277637cc6f843576f76e69fbaebcc0bd7 (diff)
downloadpx4-nuttx-a21218519751fd36fd99c6c1bac28693c7d2a7cc.tar.gz
px4-nuttx-a21218519751fd36fd99c6c1bac28693c7d2a7cc.tar.bz2
px4-nuttx-a21218519751fd36fd99c6c1bac28693c7d2a7cc.zip
The USB host driver has been verified on the STM32F4Discovery
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@5067 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/configs/stm32f4discovery')
-rwxr-xr-xnuttx/configs/stm32f4discovery/README.txt70
-rw-r--r--nuttx/configs/stm32f4discovery/nsh/defconfig2
-rw-r--r--nuttx/configs/stm32f4discovery/nxlines/defconfig2
-rw-r--r--nuttx/configs/stm32f4discovery/ostest/defconfig2
-rw-r--r--nuttx/configs/stm32f4discovery/pm/defconfig2
5 files changed, 62 insertions, 16 deletions
diff --git a/nuttx/configs/stm32f4discovery/README.txt b/nuttx/configs/stm32f4discovery/README.txt
index c2a269de3..93b8fee03 100755
--- a/nuttx/configs/stm32f4discovery/README.txt
+++ b/nuttx/configs/stm32f4discovery/README.txt
@@ -906,7 +906,7 @@ STM32F4Discovery-specific Configuration Options
want to do that?
CONFIG_STM32_USBHOST_REGDEBUG - Enable very low-level register access
debug. Depends on CONFIG_DEBUG.
- CONFIG_STM32_USBHOST_PKTDUMP - Dump all incoming and outgoing USB
+ CONFIG_STM32_USBHOST_PKTDUMP - Dump all incoming and outgoing USB
packets. Depends on CONFIG_DEBUG.
Configurations
@@ -1066,19 +1066,65 @@ 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 lib_lowprintf will work in this configuration).
- 8. USB OTG FS Device or Host Support
+ 6. 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 - Enable USB device support, OR
- CONFIG_USBHOST - Enable USB host support (but not both)
+ 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
+ is needed for NSH
+ 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:
+
+ NuttShell (NSH) NuttX-x.yy
+ nsh> ls /dev
+ /dev:
+ console
+ null
+ ttyS0
+
+ After inserting the FLASH drive, the /dev/sda appears and can be
+ mounted like this:
+
+ nsh> ls /dev
+ /dev:
+ console
+ null
+ sda
+ ttyS0
+ nsh> mount -t vfat /dev/sda /mnt/stuff
+ nsh> ls /mnt/stuff
+ /mnt/stuff:
+ -rw-rw-rw- 16236 filea.c
+
+ And files on the FLASH can be manipulated to standard interfaces:
+
+ nsh> echo "This is a test" >/mnt/stuff/atest.txt
+ nsh> ls /mnt/stuff
+ /mnt/stuff:
+ -rw-rw-rw- 16236 filea.c
+ -rw-rw-rw- 16 atest.txt
+ nsh> cat /mnt/stuff/atest.txt
+ This is a test
+ nsh> cp /mnt/stuff/filea.c fileb.c
+ nsh> ls /mnt/stuff
+ /mnt/stuff:
+ -rw-rw-rw- 16236 filea.c
+ -rw-rw-rw- 16 atest.txt
+ -rw-rw-rw- 16236 fileb.c
+
+ To prevent data loss, don't forget to un-mount the FLASH drive
+ before removing it:
+
+ nsh> umount /mnt/stuff
- CONFIG_STM32_OTGFS - Enable the STM32 USB OTG FS block
- CONFIG_STM32_SYSCFG - Needed for all USB OTF FS support
-
- CONFIG_SCHED_WORKQUEUE - Worker thread support is required for the mass
- storage class (both host and device).
- CONFIG_NSH_ARCHINIT - Architecture specific USB initialization
- is needed
-
nxlines:
------
An example using the NuttX graphics system (NX). This example focuses on
diff --git a/nuttx/configs/stm32f4discovery/nsh/defconfig b/nuttx/configs/stm32f4discovery/nsh/defconfig
index dede37af1..69d4e717c 100644
--- a/nuttx/configs/stm32f4discovery/nsh/defconfig
+++ b/nuttx/configs/stm32f4discovery/nsh/defconfig
@@ -488,7 +488,7 @@ CONFIG_FDCLONE_DISABLE=n
CONFIG_FDCLONE_STDIO=n
CONFIG_SDCLONE_DISABLE=y
CONFIG_SCHED_WORKQUEUE=n
-CONFIG_SCHED_WORKPRIORITY=50
+CONFIG_SCHED_WORKPRIORITY=192
CONFIG_SCHED_WORKPERIOD=50000
CONFIG_SCHED_WORKSTACKSIZE=1024
CONFIG_SIG_SIGWORK=4
diff --git a/nuttx/configs/stm32f4discovery/nxlines/defconfig b/nuttx/configs/stm32f4discovery/nxlines/defconfig
index 5bcfeec82..0e006f4a5 100644
--- a/nuttx/configs/stm32f4discovery/nxlines/defconfig
+++ b/nuttx/configs/stm32f4discovery/nxlines/defconfig
@@ -488,7 +488,7 @@ CONFIG_FDCLONE_DISABLE=n
CONFIG_FDCLONE_STDIO=n
CONFIG_SDCLONE_DISABLE=y
CONFIG_SCHED_WORKQUEUE=n
-CONFIG_SCHED_WORKPRIORITY=50
+CONFIG_SCHED_WORKPRIORITY=192
CONFIG_SCHED_WORKPERIOD=50000
CONFIG_SCHED_WORKSTACKSIZE=1024
CONFIG_SIG_SIGWORK=4
diff --git a/nuttx/configs/stm32f4discovery/ostest/defconfig b/nuttx/configs/stm32f4discovery/ostest/defconfig
index 438694af2..dfdea14d5 100644
--- a/nuttx/configs/stm32f4discovery/ostest/defconfig
+++ b/nuttx/configs/stm32f4discovery/ostest/defconfig
@@ -461,7 +461,7 @@ CONFIG_FDCLONE_DISABLE=n
CONFIG_FDCLONE_STDIO=n
CONFIG_SDCLONE_DISABLE=y
CONFIG_SCHED_WORKQUEUE=n
-CONFIG_SCHED_WORKPRIORITY=50
+CONFIG_SCHED_WORKPRIORITY=192
CONFIG_SCHED_WORKPERIOD=50000
CONFIG_SCHED_WORKSTACKSIZE=1024
CONFIG_SIG_SIGWORK=4
diff --git a/nuttx/configs/stm32f4discovery/pm/defconfig b/nuttx/configs/stm32f4discovery/pm/defconfig
index 58b7df7cb..799eea34c 100644
--- a/nuttx/configs/stm32f4discovery/pm/defconfig
+++ b/nuttx/configs/stm32f4discovery/pm/defconfig
@@ -489,7 +489,7 @@ CONFIG_FDCLONE_DISABLE=n
CONFIG_FDCLONE_STDIO=n
CONFIG_SDCLONE_DISABLE=y
CONFIG_SCHED_WORKQUEUE=y
-CONFIG_SCHED_WORKPRIORITY=50
+CONFIG_SCHED_WORKPRIORITY=192
CONFIG_SCHED_WORKPERIOD=50000
CONFIG_SCHED_WORKSTACKSIZE=1024
CONFIG_SIG_SIGWORK=4