Merge branch 'NuttX/master'

Conflicts:
	apps/netutils/thttpd/thttpd_cgi.c
	nuttx/Documentation/NuttX.html
	nuttx/arch/8051/src/Makefile
	nuttx/arch/arm/src/lpc17xx/lpc17_usbhost.c
	nuttx/arch/avr/Kconfig
	nuttx/arch/avr/src/atmega/atmega_lowinit.c
	nuttx/arch/mips/Kconfig
	nuttx/arch/z80/src/Makefile.sdcc
	nuttx/configs/amber/README.txt
	nuttx/configs/amber/hello/defconfig
	nuttx/configs/avr32dev1/README.txt
	nuttx/configs/avr32dev1/nsh/defconfig
	nuttx/configs/avr32dev1/ostest/defconfig
	nuttx/configs/c5471evm/README.txt
	nuttx/configs/c5471evm/httpd/defconfig
	nuttx/configs/c5471evm/nettest/defconfig
	nuttx/configs/c5471evm/nsh/defconfig
	nuttx/configs/c5471evm/ostest/defconfig
	nuttx/configs/compal_e88/nsh_highram/defconfig
	nuttx/configs/compal_e99/nsh_compalram/defconfig
	nuttx/configs/compal_e99/nsh_highram/defconfig
	nuttx/configs/demo9s12ne64/README.txt
	nuttx/configs/demo9s12ne64/ostest/defconfig
	nuttx/configs/ea3131/nsh/defconfig
	nuttx/configs/ea3131/ostest/defconfig
	nuttx/configs/ea3131/pgnsh/defconfig
	nuttx/configs/ea3131/usbserial/defconfig
	nuttx/configs/ea3131/usbstorage/defconfig
	nuttx/configs/ea3152/ostest/defconfig
	nuttx/configs/eagle100/README.txt
	nuttx/configs/eagle100/httpd/defconfig
	nuttx/configs/eagle100/nettest/defconfig
	nuttx/configs/eagle100/nsh/defconfig
	nuttx/configs/eagle100/nxflat/defconfig
	nuttx/configs/eagle100/ostest/defconfig
	nuttx/configs/eagle100/thttpd/defconfig
	nuttx/configs/ekk-lm3s9b96/README.txt
	nuttx/configs/ekk-lm3s9b96/nsh/defconfig
	nuttx/configs/ekk-lm3s9b96/ostest/defconfig
	nuttx/configs/ez80f910200kitg/ostest/defconfig
	nuttx/configs/ez80f910200zco/dhcpd/defconfig
	nuttx/configs/ez80f910200zco/httpd/defconfig
	nuttx/configs/ez80f910200zco/nettest/defconfig
	nuttx/configs/ez80f910200zco/nsh/defconfig
	nuttx/configs/ez80f910200zco/ostest/defconfig
	nuttx/configs/ez80f910200zco/poll/defconfig
	nuttx/configs/hymini-stm32v/README.txt
	nuttx/configs/hymini-stm32v/buttons/defconfig
	nuttx/configs/hymini-stm32v/nsh/defconfig
	nuttx/configs/hymini-stm32v/nsh2/defconfig
	nuttx/configs/hymini-stm32v/nx/defconfig
	nuttx/configs/hymini-stm32v/nxlines/defconfig
	nuttx/configs/hymini-stm32v/usbserial/defconfig
	nuttx/configs/hymini-stm32v/usbstorage/defconfig
	nuttx/configs/kwikstik-k40/README.txt
	nuttx/configs/kwikstik-k40/ostest/defconfig
	nuttx/configs/lincoln60/README.txt
	nuttx/configs/lincoln60/nsh/defconfig
	nuttx/configs/lincoln60/ostest/defconfig
	nuttx/configs/lm3s6432-s2e/README.txt
	nuttx/configs/lm3s6432-s2e/nsh/defconfig
	nuttx/configs/lm3s6432-s2e/ostest/defconfig
	nuttx/configs/lm3s6965-ek/README.txt
	nuttx/configs/lm3s6965-ek/nsh/defconfig
	nuttx/configs/lm3s6965-ek/nx/defconfig
	nuttx/configs/lm3s6965-ek/ostest/defconfig
	nuttx/configs/lm3s8962-ek/README.txt
	nuttx/configs/lm3s8962-ek/nsh/defconfig
	nuttx/configs/lm3s8962-ek/nx/defconfig
	nuttx/configs/lm3s8962-ek/ostest/defconfig
	nuttx/configs/lpc4330-xplorer/README.txt
	nuttx/configs/lpc4330-xplorer/nsh/defconfig
	nuttx/configs/lpc4330-xplorer/ostest/defconfig
	nuttx/configs/lpcxpresso-lpc1768/README.txt
	nuttx/configs/lpcxpresso-lpc1768/dhcpd/defconfig
	nuttx/configs/lpcxpresso-lpc1768/nsh/defconfig
	nuttx/configs/lpcxpresso-lpc1768/nx/defconfig
	nuttx/configs/lpcxpresso-lpc1768/ostest/defconfig
	nuttx/configs/lpcxpresso-lpc1768/thttpd/defconfig
	nuttx/configs/lpcxpresso-lpc1768/usbstorage/defconfig
	nuttx/configs/m68332evb/defconfig
	nuttx/configs/mbed/README.txt
	nuttx/configs/mbed/hidkbd/defconfig
	nuttx/configs/mbed/nsh/defconfig
	nuttx/configs/mcu123-lpc214x/README.txt
	nuttx/configs/mcu123-lpc214x/composite/defconfig
	nuttx/configs/mcu123-lpc214x/nsh/defconfig
	nuttx/configs/mcu123-lpc214x/ostest/defconfig
	nuttx/configs/mcu123-lpc214x/usbserial/defconfig
	nuttx/configs/mcu123-lpc214x/usbstorage/defconfig
	nuttx/configs/micropendous3/README.txt
	nuttx/configs/micropendous3/hello/defconfig
	nuttx/configs/mirtoo/README.txt
	nuttx/configs/mirtoo/nsh/defconfig
	nuttx/configs/mirtoo/nxffs/defconfig
	nuttx/configs/mirtoo/ostest/defconfig
	nuttx/configs/mx1ads/ostest/defconfig
	nuttx/configs/ne64badge/README.txt
	nuttx/configs/ne64badge/ostest/defconfig
	nuttx/configs/ntosd-dm320/nettest/defconfig
	nuttx/configs/ntosd-dm320/nsh/defconfig
	nuttx/configs/ntosd-dm320/ostest/defconfig
	nuttx/configs/ntosd-dm320/poll/defconfig
	nuttx/configs/ntosd-dm320/thttpd/defconfig
	nuttx/configs/ntosd-dm320/udp/defconfig
	nuttx/configs/ntosd-dm320/uip/defconfig
	nuttx/configs/nucleus2g/README.txt
	nuttx/configs/nucleus2g/nsh/defconfig
	nuttx/configs/nucleus2g/ostest/defconfig
	nuttx/configs/nucleus2g/usbserial/defconfig
	nuttx/configs/nucleus2g/usbstorage/defconfig
	nuttx/configs/olimex-lpc1766stk/README.txt
	nuttx/configs/olimex-lpc1766stk/ftpc/defconfig
	nuttx/configs/olimex-lpc1766stk/hidkbd/defconfig
	nuttx/configs/olimex-lpc1766stk/nettest/defconfig
	nuttx/configs/olimex-lpc1766stk/nsh/defconfig
	nuttx/configs/olimex-lpc1766stk/nx/defconfig
	nuttx/configs/olimex-lpc1766stk/ostest/defconfig
	nuttx/configs/olimex-lpc1766stk/slip-httpd/defconfig
	nuttx/configs/olimex-lpc1766stk/thttpd/defconfig
	nuttx/configs/olimex-lpc1766stk/usbserial/defconfig
	nuttx/configs/olimex-lpc1766stk/usbstorage/defconfig
	nuttx/configs/olimex-lpc1766stk/wlan/defconfig
	nuttx/configs/olimex-lpc2378/nsh/defconfig
	nuttx/configs/olimex-lpc2378/ostest/defconfig
	nuttx/configs/olimex-stm32-p107/nsh/defconfig
	nuttx/configs/olimex-stm32-p107/ostest/defconfig
	nuttx/configs/olimex-strp711/nettest/defconfig
	nuttx/configs/olimex-strp711/nsh/defconfig
	nuttx/configs/olimex-strp711/ostest/defconfig
	nuttx/configs/pcblogic-pic32mx/README.txt
	nuttx/configs/pcblogic-pic32mx/nsh/defconfig
	nuttx/configs/pcblogic-pic32mx/ostest/defconfig
	nuttx/configs/pic32-starterkit/README.txt
	nuttx/configs/pic32-starterkit/nsh/defconfig
	nuttx/configs/pic32-starterkit/nsh2/defconfig
	nuttx/configs/pic32-starterkit/ostest/defconfig
	nuttx/configs/pic32mx7mmb/README.txt
	nuttx/configs/pic32mx7mmb/nsh/defconfig
	nuttx/configs/pic32mx7mmb/ostest/defconfig
	nuttx/configs/pjrc-8051/defconfig
	nuttx/configs/qemu-i486/nsh/defconfig
	nuttx/configs/qemu-i486/ostest/defconfig
	nuttx/configs/rgmp/arm/default/defconfig
	nuttx/configs/rgmp/arm/nsh/defconfig
	nuttx/configs/rgmp/x86/default/defconfig
	nuttx/configs/rgmp/x86/nsh/defconfig
	nuttx/configs/sam3u-ek/README.txt
	nuttx/configs/sam3u-ek/knsh/defconfig
	nuttx/configs/sam3u-ek/nsh/defconfig
	nuttx/configs/sam3u-ek/nx/defconfig
	nuttx/configs/sam3u-ek/ostest/defconfig
	nuttx/configs/sam3u-ek/touchscreen/defconfig
	nuttx/configs/sim/mount/defconfig
	nuttx/configs/sim/nettest/defconfig
	nuttx/configs/sim/nsh/defconfig
	nuttx/configs/sim/nsh2/defconfig
	nuttx/configs/sim/nx/defconfig
	nuttx/configs/sim/nx11/defconfig
	nuttx/configs/sim/nxffs/defconfig
	nuttx/configs/sim/nxwm/defconfig
	nuttx/configs/sim/ostest/defconfig
	nuttx/configs/sim/pashello/defconfig
	nuttx/configs/sim/touchscreen/defconfig
	nuttx/configs/skp16c26/ostest/defconfig
	nuttx/configs/stm3210e-eval/Kconfig
	nuttx/configs/stm3210e-eval/README.txt
	nuttx/configs/stm3210e-eval/RIDE/defconfig
	nuttx/configs/stm3210e-eval/buttons/defconfig
	nuttx/configs/stm3210e-eval/composite/defconfig
	nuttx/configs/stm3210e-eval/nsh/defconfig
	nuttx/configs/stm3210e-eval/nsh2/defconfig
	nuttx/configs/stm3210e-eval/nx/defconfig
	nuttx/configs/stm3210e-eval/nxconsole/defconfig
	nuttx/configs/stm3210e-eval/nxlines/defconfig
	nuttx/configs/stm3210e-eval/nxtext/defconfig
	nuttx/configs/stm3210e-eval/ostest/defconfig
	nuttx/configs/stm3210e-eval/pm/defconfig
	nuttx/configs/stm3210e-eval/src/up_idle.c
	nuttx/configs/stm3210e-eval/usbserial/defconfig
	nuttx/configs/stm3210e-eval/usbstorage/defconfig
	nuttx/configs/stm3220g-eval/Kconfig
	nuttx/configs/stm3220g-eval/README.txt
	nuttx/configs/stm3220g-eval/dhcpd/defconfig
	nuttx/configs/stm3220g-eval/include/board.h
	nuttx/configs/stm3220g-eval/nettest/defconfig
	nuttx/configs/stm3220g-eval/nsh/defconfig
	nuttx/configs/stm3220g-eval/nsh2/defconfig
	nuttx/configs/stm3220g-eval/nxwm/defconfig
	nuttx/configs/stm3220g-eval/ostest/defconfig
	nuttx/configs/stm3220g-eval/src/Makefile
	nuttx/configs/stm3220g-eval/src/stm3220g-internal.h
	nuttx/configs/stm3220g-eval/src/up_boot.c
	nuttx/configs/stm3220g-eval/src/up_nsh.c
	nuttx/configs/stm3220g-eval/telnetd/defconfig
	nuttx/configs/stm3240g-eval/Kconfig
	nuttx/configs/stm3240g-eval/README.txt
	nuttx/configs/stm3240g-eval/dhcpd/defconfig
	nuttx/configs/stm3240g-eval/include/board.h
	nuttx/configs/stm3240g-eval/nettest/defconfig
	nuttx/configs/stm3240g-eval/nsh/defconfig
	nuttx/configs/stm3240g-eval/nsh2/defconfig
	nuttx/configs/stm3240g-eval/nxconsole/defconfig
	nuttx/configs/stm3240g-eval/nxwm/defconfig
	nuttx/configs/stm3240g-eval/ostest/defconfig
	nuttx/configs/stm3240g-eval/telnetd/defconfig
	nuttx/configs/stm32f4discovery/README.txt
	nuttx/configs/stm32f4discovery/include/board.h
	nuttx/configs/stm32f4discovery/nsh/defconfig
	nuttx/configs/stm32f4discovery/nxlines/defconfig
	nuttx/configs/stm32f4discovery/ostest/defconfig
	nuttx/configs/stm32f4discovery/pm/defconfig
	nuttx/configs/sure-pic32mx/README.txt
	nuttx/configs/sure-pic32mx/nsh/defconfig
	nuttx/configs/sure-pic32mx/ostest/defconfig
	nuttx/configs/sure-pic32mx/usbnsh/defconfig
	nuttx/configs/teensy/README.txt
	nuttx/configs/teensy/hello/defconfig
	nuttx/configs/teensy/nsh/defconfig
	nuttx/configs/teensy/src/up_spi.c
	nuttx/configs/teensy/usbstorage/defconfig
	nuttx/configs/twr-k60n512/README.txt
	nuttx/configs/twr-k60n512/nsh/defconfig
	nuttx/configs/twr-k60n512/ostest/defconfig
	nuttx/configs/ubw32/README.txt
	nuttx/configs/ubw32/nsh/defconfig
	nuttx/configs/ubw32/ostest/defconfig
	nuttx/configs/us7032evb1/nsh/defconfig
	nuttx/configs/us7032evb1/ostest/defconfig
	nuttx/configs/vsn/README.txt
	nuttx/configs/vsn/nsh/defconfig
	nuttx/configs/xtrs/nsh/defconfig
	nuttx/configs/xtrs/ostest/defconfig
	nuttx/configs/xtrs/pashello/defconfig
	nuttx/configs/z16f2800100zcog/ostest/defconfig
	nuttx/configs/z16f2800100zcog/pashello/defconfig
	nuttx/configs/z80sim/nsh/defconfig
	nuttx/configs/z80sim/ostest/defconfig
	nuttx/configs/z80sim/pashello/defconfig
	nuttx/configs/z8encore000zco/ostest/defconfig
	nuttx/configs/z8f64200100kit/ostest/defconfig
This commit is contained in:
px4dev 2012-08-26 16:26:39 -07:00
commit e214981d11
33 changed files with 4669 additions and 2906 deletions

View File

@ -248,7 +248,7 @@
being set to the priority of the parent thread; losing its configured
priority. Reported by Mike Smith.
6.21 2012-xx-xx Gregory Nutt <gnutt@nuttx.org>
6.21 2012-08-25 Gregory Nutt <gnutt@nuttx.org>
* apps/include/: Stylistic clean-up of all header files.
* apps/modbus and apps/include/modbus: A port of freemodbus-v1.5.0
@ -259,9 +259,9 @@
* apps/modbus: Add CONFIG_MB_TERMIOS. If the driver doesn't support
termios ioctls, then don't bother trying to configure the baud, parity
etc.
* apps/nslib: If waitpid() is supported, then NSH not catches the
* apps/nshlib: If waitpid() is supported, then NSH now catches the
return value from spawned applications (provided by Mike Smith)
* apps/nslib: Lock the schedule while starting built-in applications
* apps/nshlib: Lock the scheduler while starting built-in applications
in order to eliminate race conditions (also from Mike Smith).
* apps/examples/adc, pwm, and qencoder: Add support for testing
devices with multiple ADC, PWM, and QE devices.
@ -272,9 +272,15 @@
properties of mounted file systems.
* apps/nshlib/nsh_parse.c: Extend help command options. 'help' with
no arguments outputs a short list of commands. With -v lists all
command line details. And command name can be added to just get
command line details. A command name can be added to just get
help on one command.
* system/readline.c: If character input/output is interrupted by a
signal, then readline() will try the read/write again.
* apps/*/Make.defs: Numerous fixes needed to use the automated
configuration (from Richard Cochran).
6.22 2012-xx-xx Gregory Nutt <gnutt@nuttx.org>
* apps/netutils/thttpd/thttpd_cgi.c: Missing NULL in argv[]
list (contributed by Kate).

View File

@ -58,12 +58,22 @@
#ifndef CONFIG_SEM_PREALLOCHOLDERS
# define CONFIG_SEM_PREALLOCHOLDERS 0
#endif
#define NLOWPRI_THREADS (CONFIG_SEM_PREALLOCHOLDERS+1)
#if CONFIG_SEM_PREALLOCHOLDERS > 3
# define NLOWPRI_THREADS 3
#else
# define NLOWPRI_THREADS (CONFIG_SEM_PREALLOCHOLDERS+1)
#endif
#ifndef CONFIG_SEM_NNESTPRIO
# define CONFIG_SEM_NNESTPRIO 0
#endif
#define NHIGHPRI_THREADS (CONFIG_SEM_NNESTPRIO+1)
#if CONFIG_SEM_NNESTPRIO > 3
# define NHIGHPRI_THREADS 3
#else
# define NHIGHPRI_THREADS (CONFIG_SEM_NNESTPRIO+1)
#endif
/****************************************************************************
* Private Data

View File

@ -2280,7 +2280,7 @@
the particular condition that revealed the bug occurred. My impression is
that this latter bugfix also fixes some STM32 USB performance problems.
* configs/hymini-stm32v: A configuration for the HY-Mini STM32v board contributed
by Laurent Latil. Theses changes also include support for the STM32F103VCT6.
by Laurent Latil. These changes also include support for the STM32F103VCT6.
* arch/configs/stm3240g-eval/src/up_pwm.c: Add hooks needed to use the new
apps/examples/pwm test of the STM32 PWM driver.
* drivers/mtd/mp25x.c: Add ability to use different SPI modes and different
@ -2977,7 +2977,7 @@
* configs/lpc4330-xplorer/nsh: Add an NSH configuration for the LPC4330
Xplorer board.
6.21 2012-xx-xx Gregory Nutt <gnutt@nuttx.org>
6.21 2012-08-25 Gregory Nutt <gnutt@nuttx.org>
* configs/lpc4330-xplorer/up_nsh.c: Add support for a basic SPIFI block
driver for use by NSH. Does not work! Crashes on first SPIFI write.
@ -3024,7 +3024,7 @@
but the driver still does not work.
* arch/arm/src/stm32 and arch/arm/include/stm32: Make name of RTC ALARM interrupt
common on STM32 F1,2,4
* arch/arm/src/stm32 and arch/arm/include/stm32: Add add support for the
* arch/arm/src/stm32 and arch/arm/include/stm32: Add support for the
STM32F100x "Value Line" devices. This includes changes to stm32F10xx_rcc.c that
add the ability to run the chip off the internal oscillator. There is no open
board configuration for this part yet (the STM32VLDiscovery would be a candidate).
@ -3050,7 +3050,7 @@
* include/termios.h and lib/termios/*: Redesigned yet again (this is getting
painful. NuttX now supports the BOTHER baud setting just as Linux does. termios
Bxxx definitions are again encoded; cf[set|get][o|i]speed now deal with only the
encoded values. If the encode baud is set to BOTHER, then the values in the (non-
encoded values. If the encoded baud is set to BOTHER, then the values in the (non-
standard) c_ispeed and c_ospeed baud values may be accessed directly.
* arch/arm/src/stm32/stm32_serial.c: Add minimal termios support for the STM32
(BOTHER style baud settings only). Contributed by Mike Smith.
@ -3063,8 +3063,7 @@
* arch/arm/src/stm32/stm32_sdio.c and chip/stm32f20xx_pinmap.h: STM32 F2 SDIO
fixes from Gary Teravskis and Scott Rondestvedt.
* include/termios.h and lib/termios/*: Replace cfsetispeed and cfsetospeed with
cfsetspeed (with definitions for the input/outputs in termios.h). Same for
cfgetispeed and cfgetospeed.
cfsetspeed (with definitions for the input/outputs in termios.h).
* configs/stm32f4discovery/src and configs/stm32f4discovery/pm: Add a power
management configuration for the STM32F4Discovery and supporting logic. This
check-in also includes some fixes for the F4 RTC alarm logic.
@ -3090,10 +3089,10 @@
* arch/mips/src/pic32mx/pic32mx-gpio.c: Now supports the PIC32MX1/2 ANSEL
IOPORT register.
* lib/string/lib_memchr.c: Add support for memchr() (contributed by Mike Smith)
* lib/string/lib_memccpy.c: Add support for memcpy()
* lib/string/lib_memccpy.c: Add support for memccpy()
* arch/arm/src/lpc17xx/lpc17_serial.c: Now supports ioctl commands to change
the baud using tcsetattr() (contributed by Chris Taglia).
* arch/*/src/*_serial.c: Fix ioctl method return values. Theses methods
* arch/*/src/*_serial.c: Fix ioctl method return values. These methods
should return a negated errno value; they should not set the errno
variable.
* sched/on_exit.c, sched/task_exithook.c, and include/nuttx/sched.c: Add
@ -3118,7 +3117,7 @@
* arch/arm/src/stm32/stm32*_rcc.c and .h: If CONFIG_PM is defined, add a
function called stm32_clockenable() that can be used by PM logic to re-start
the PLL after re-awakening from deep sleep modes.
* fs/fs_foreachinode.c and fs/fs_foreachmountpoint.c: All logic to traverse
* fs/fs_foreachinode.c and fs/fs_foreachmountpoint.c: Add logic to traverse
inodes and mountpoints in the NuttX pseudo-file system.
* fs/fat/fs_fat32.c: Max. filename length reported by statfs() was wrong
if FAT long file names were enabled.
@ -3137,7 +3136,7 @@
LPC31xx has the same USB IP, but will require some additional initialization
(and lots of testing) before it can be used with the LPC43xx.
* nuttx/Documentation/NuttShell.html: Added a section covering ways to
customize the behavior or NSH.
customize the behavior of NSH.
* arch/arm/src/stm32/chip/stm32f1*_pinmap.h: STM32 CAN TX/RX pins reversed;
inconsistent conditional compilation. Reported by Max Holtzberg.
* arch/arm/*/stm32: Add support for STM32 F107 "Connectivity Line"
@ -3166,5 +3165,23 @@
for all 8-bit AVR platforms (Thanks Richard Cochran).
* lib/stdio/lib_*stream.c: Revised to handle new error return values from
serial.c.
* arch/arm/src/stm32/stm32_spi.c: SPI driver can now survice re-
* arch/arm/src/stm32/stm32_spi.c: SPI driver can now service re-
initialization (Mike Smith).
* tools/mkconfig.c: If CONFIG_DRAM_END is not specified, this tool
will provide default definition of (CONFIG_DRAM_START + CONFIG_DRAM_SIZE)
* arch/arm/src/stm32/stm32_otgfshost.c: Renamed from stm32_usbhost.c.
This is nearly code complete and, with any luck, will be available
in NuttX-6.21.
* configs/*/defconfig: Update all defconfig files to remove syntax
that is incompatible with the mconf configuration tool.
* arch/arm/src/stm32/stm32_otgfshost.c: This driver now appears to be
functional (although more testing is necesary).
6.22 2012-xx-xx Gregory Nutt <gnutt@nuttx.org>
* include/semaphore.h, sched/sem_holders.c, and lib/semaphore/sem_init.c:
Fix some strange (and probably wrong) list handling when
CONFIG_PRIORITY_INHERITANCE and CONFIG_SEM_PREALLOCHOLDERS are defined.
This list handling was probably causing errors reported by Mike Smith
* sched/sched_waitpid.c: Fix a possible issue with logic logic that
should be brought into a critical section (suggested by Mike Smith)

View File

@ -276,8 +276,8 @@ include/stdarg.h:
endif
# Targets used to build include/nuttx/version.h. Creation of version.h is
# part of the overall NuttX configuration sequency. Notice that the
# tools/mkversion tool is cuilt and used to create include/nuttx/version.h
# part of the overall NuttX configuration sequence. Notice that the
# tools/mkversion tool is built and used to create include/nuttx/version.h
tools/mkversion:
@$(MAKE) -C tools -f Makefile.host TOPDIR="$(TOPDIR)" mkversion
@ -293,8 +293,8 @@ include/nuttx/version.h: $(TOPDIR)/.version tools/mkversion
@tools/mkversion $(TOPDIR) > include/nuttx/version.h
# Targets used to build include/nuttx/config.h. Creation of config.h is
# part of the overall NuttX configuration sequency. Notice that the
# tools/mkconfig tool is cuilt and used to create include/nuttx/config.h
# part of the overall NuttX configuration sequence. Notice that the
# tools/mkconfig tool is built and used to create include/nuttx/config.h
tools/mkconfig:
@$(MAKE) -C tools -f Makefile.host TOPDIR="$(TOPDIR)" mkconfig

View File

@ -2999,3 +2999,67 @@ Bugfixes (see the change log for details) :
on Z80.
As well as other, less critical bugs (see the ChangeLog for details)
NuttX-6.21
^^^^^^^^^^
The 88th release of NuttX, Version 6.21, was made on August 25, 2012,
and is available for download from the SourceForge website. Note
that release consists of two tarballs: nuttx-6.21.tar.gz and
apps-6.21.tar.gz. Both may be needed (see the top-level nuttx/README.txt
file for build information).
This release corresponds with SVN release number: r5052
Additional new features and extended functionality:
* Core: Add support for multiple registered atexit() functions. Syslog
extended: Now any character driver may be used for the debug logging
device. Mountpoint traversal logic.
* Drivers: Added support for the TI PGA112-7 amplifier/multiplexor.
* LPC43xx: Added clock ramp-up logic to run at 204 MHz
* LPC43xx Drivers: SPIFI block driver, RS-485 support, Minimal termios
support. Framework for USB0 device controller driver.
* LPC17xx Drivers: Minimal termios support
* STM32: Support for STM32 F1 "Value Line" (contributed by Mike Smith).
Add support for STM32 F107 "Connectivity Line" (contributed by Max
Holtzberg).
Clock restart logic needed for recovery from low power modes.
* STM32 Drivers: RTC alarm support. Usable for wakeup from sleep mode,
Minimal serial termios support. USB OTG FS host driver (alpha).
* STM32 Boards: Add power management hooks for the STM32F4Discovery,
Add support for the Olimex STM32-P107 (contributed by Max Holtzberg).
* PIC32: Add support for the Pinguino MIPS toolchain.
* PIC32 Drivers: GPIO driver now supports F1 analog regiaters (ANSEL).
* PIC32 Boards: Add support for the PGA117 on the Mirtoo module.
* Calypso: Add support for the SSD1783 LCD on the Compal E99.
* Library: cfsetispeed(), cfsetospeed(), tcflush(), memchr(), and
memccpy().
* Applications: Port of freemodbus-v1.5.0. Add support for testing
devices with multiple ADC, PWM, and QE devices.
NSH: NSH 'mount' command (with no arguments) will now show mounted
volumes. Add new NSH 'df' command. Extended 'help' support. NSH
now catches the return value from spawned applications (provided
by Mike Smith).
* Build System: mkconfig will not define CONFIG_DRAM_END. A lot of
progress has been made on the automated NuttX configuration logic
(Thanks go to Richard Cochran).
* Documentation: Document ways to customize the behavior of NSH.
Bugfixes (see the change log for details) :
* Serial drivers (all): Fix ioctl return value. Common "upper half"
serial driver will now return with EINTR if a serial wait is
interrupted by a signal.
* FAT: Fix statfs() file name length.
* LPC43xx: Clock configuration.
* STM32: Pinmap fixes, SPI driver re-initialization
* STM32 Boards: Correct and lower SDIO frequency for F2 and f4 boards.
* AVR: C++ build issues.
* PM: Fix a place where interrupts were not be re-enabled.
* Applications: NSH application start-up race conditions.
* Library: Fieldwidth and justification for %s format. Fixed several
issues with presenting floating point numbers. NULL definition
for C++
As well as other, less critical bugs (see the ChangeLog for details)

View File

@ -19,11 +19,13 @@ config ARCH_ARM
config ARCH_AVR
bool "AVR"
select ARCH_NOINTC
---help---
Atmel 8-bit bit AVR and 32-bit AVR32 architectures
config ARCH_HC
bool "Freescale HC"
select ARCH_NOINTC
---help---
Freescale HC architectures (M9S12)
@ -39,7 +41,8 @@ config ARCH_RGMP
http://rgmp.sourceforge.net/wiki/index.php/Main_Page.
config ARCH_SH
bool "Rensas"
bool "Renesas"
select ARCH_NOINTC
---help---
Renesas architectures (SH and M16C).
@ -90,3 +93,35 @@ source arch/sim/Kconfig
source arch/x86/Kconfig
source arch/z16/Kconfig
source arch/z80/Kconfig
comment "Architecture Options"
config ARCH_NOINTC
bool
default n
config ARCH_STACKDUMP
bool "Dump stack on assertions"
default n
---help---
Enable to do stack dumps after assertions
comment "Board Settings"
config BOARD_LOOPSPERMSEC
int "Loops per millisecond"
help
Must be calibrated for correct operation of delay loops.
You simply use a stop watch to measure the 100 second delay
then adjust CONFIG_BOARD_LOOPSPERMSEC until it is actually
is 100 seconds.
config DRAM_START
hex "DRAM start address"
help
The physical start address of installed RAM.
config DRAM_SIZE
int "DRAM size"
help
The size in bytes of the installed RAM.

View File

@ -118,12 +118,6 @@ config ARCH_CHIP
default "stm32" if ARCH_CHIP_STM32
default "str71x" if ARCH_CHIP_STR71X
config ARCH_STACKDUMP
bool "Dump stack on assertions"
default n
---help---
Enable to do stack dumps after assertions
config ARCH_LEDS
bool "Use board LEDs to show state"
default y

View File

@ -1910,3 +1910,56 @@ config STM32_MII_MCO1
bool
default y if !STM32_MII_MCO2
depends on STM32_MII
menu "USB Host Configuration"
config STM32_OTGFS_RXFIFO_SIZE
int "Rx Packet Size"
default 128
depends on USBHOST && STM32_OTGFS
---help---
Size of the RX FIFO in 32-bit words. Default 128 (512 bytes)
config STM32_OTGFS_NPTXFIFO_SIZE
int "Non-periodic Tx FIFO Size"
default 96
depends on USBHOST && STM32_OTGFS
---help---
Size of the non-periodic Tx FIFO in 32-bit words. Default 96 (384 bytes)
config STM32_OTGFS_PTXFIFO_SIZE
int "Periodic Tx FIFO size"
default 128
depends on USBHOST && STM32_OTGFS
---help---
Size of the periodic Tx FIFO in 32-bit words. Default 96 (384 bytes)
config STM32_OTGFS_DESCSIZE
int "Descriptor Size"
default 128
depends on USBHOST && STM32_OTGFS
---help---
Maximum size to allocate for descriptor memory descriptor. Default: 128
config STM32_OTGFS_SOFINTR
bool "Enable SOF interrupts"
default n
depends on USBHOST && STM32_OTGFS
---help---
Enable SOF interrupts. Why would you ever want to do that?
config STM32_USBHOST_REGDEBUG
bool "Register-Level Debug"
default n
depends on USBHOST && STM32_OTGFS
---help---
Enable very low-level register access debug. Depends on CONFIG_DEBUG.
config STM32_USBHOST_PKTDUMP
bool "Packet Dump Debug"
default n
depends on USBHOST && STM32_OTGFS
---help---
Dump all incoming and outgoing USB packets. Depends on CONFIG_DEBUG.
endmenu

View File

@ -81,6 +81,12 @@ CMN_CSRCS += stm32_otgfsdev.c
endif
endif
ifeq ($(CONFIG_USBHOST),y)
ifeq ($(CONFIG_STM32_OTGFS),y)
CMN_CSRCS += stm32_otgfshost.c
endif
endif
ifeq ($(CONFIG_ARMV7M_CMNVECTOR),y)
CHIP_ASRCS += stm32_vectors.S
endif

View File

@ -46,6 +46,18 @@
/****************************************************************************************************
* Pre-processor Definitions
****************************************************************************************************/
/* General definitions */
#define OTGFS_EPTYPE_CTRL (0) /* Control */
#define OTGFS_EPTYPE_ISOC (1) /* Isochronous */
#define OTGFS_EPTYPE_BULK (2) /* Bulk */
#define OTGFS_EPTYPE_INTR (3) /* Interrupt */
#define OTGFS_PID_DATA0 (0)
#define OTGFS_PID_DATA2 (1)
#define OTGFS_PID_DATA1 (2)
#define OTGFS_PID_MDATA (3) /* Non-control */
#define OTGFS_PID_SETUP (3) /* Control */
/* Register Offsets *********************************************************************************/
/* Core global control and status registers */
@ -125,8 +137,8 @@
#define STM32_OTGFS_HCTSIZ3_OFFSET 0x0570 /* Host channel-3 interrupt register */
#define STM32_OTGFS_HCTSIZ4_OFFSET 0x0590 /* Host channel-4 interrupt register */
#define STM32_OTGFS_HCTSIZ5_OFFSET 0x05b0 /* Host channel-5 interrupt register */
#define STM32_OTGFS_HCTSIZ6_OFFSET 0x05d9 /* Host channel-6 interrupt register */
#define STM32_OTGFS_HCTSIZ7_OFFSET 0x05f9 /* Host channel-7 interrupt register */
#define STM32_OTGFS_HCTSIZ6_OFFSET 0x05d0 /* Host channel-6 interrupt register */
#define STM32_OTGFS_HCTSIZ7_OFFSET 0x05f0 /* Host channel-7 interrupt register */
/* Device-mode control and status registers */
@ -193,6 +205,10 @@
#define STM32_OTGFS_DOEPTSIZ2_OFFSET 0x00b50 /* Device OUT endpoint-2 transfer size register */
#define STM32_OTGFS_DOEPTSIZ3_OFFSET 0x00b70 /* Device OUT endpoint-3 transfer size register */
/* Power and clock gating registers */
#define STM32_OTGFS_PCGCCTL_OFFSET 0x0e00 /* Power and clock gating control register */
/* Data FIFO (DFIFO) access registers */
#define STM32_OTGFS_DFIFO_DEP_OFFSET(n) (0x1000 + ((n) << 12))
@ -204,15 +220,11 @@
#define STM32_OTGFS_DFIFO_DEP1_OFFSET 0x2000 /* 0x2000-0x2ffc Device IN/OUT Endpoint 1 DFIFO Write/Read Access */
#define STM32_OTGFS_DFIFO_HCH1_OFFSET 0x2000 /* 0x2000-0x2ffc Host OUT/IN Channel 1 DFIFO Read/Write Access */
#define STM32_OTGFS_DFIFO_DEP2_OFFSET 0x3000 /* 0x3000-0x3ffc Device IN/OUT Endpoint 1 DFIFO Write/Read Access */
#define STM32_OTGFS_DFIFO_HCH2_OFFSET 0x3000 /* 0x3000-0x3ffc Host OUT/IN Channel 1 DFIFO Read/Write Access */
#define STM32_OTGFS_DFIFO_DEP2_OFFSET 0x3000 /* 0x3000-0x3ffc Device IN/OUT Endpoint 2 DFIFO Write/Read Access */
#define STM32_OTGFS_DFIFO_HCH2_OFFSET 0x3000 /* 0x3000-0x3ffc Host OUT/IN Channel 2 DFIFO Read/Write Access */
#define STM32_OTGFS_DFIFO_DEP3_OFFSET 0x4000 /* 0x4000-0x4ffc Device IN/OUT Endpoint 1 DFIFO Write/Read Access */
#define STM32_OTGFS_DFIFO_HCH3_OFFSET 0x4000 /* 0x4000-0x4ffc Host OUT/IN Channel 1 DFIFO Read/Write Access */
/* Power and clock gating registers */
#define STM32_OTGFS_PCGCCTL_OFFSET 0x0e00 /* Power and clock gating control register */
#define STM32_OTGFS_DFIFO_DEP3_OFFSET 0x4000 /* 0x4000-0x4ffc Device IN/OUT Endpoint 3 DFIFO Write/Read Access */
#define STM32_OTGFS_DFIFO_HCH3_OFFSET 0x4000 /* 0x4000-0x4ffc Host OUT/IN Channel 3 DFIFO Read/Write Access */
/* Register Addresses *******************************************************************************/
@ -349,6 +361,10 @@
#define STM32_OTGFS_DOEPTSIZ2 (STM32_OTGFS_BASE+STM32_OTGFS_DOEPTSIZ2_OFFSET)
#define STM32_OTGFS_DOEPTSIZ3 (STM32_OTGFS_BASE+STM32_OTGFS_DOEPTSIZ3_OFFSET)
/* Power and clock gating registers */
#define STM32_OTGFS_PCGCCTL (STM32_OTGFS_BASE+STM32_OTGFS_PCGCCTL_OFFSET)
/* Data FIFO (DFIFO) access registers */
#define STM32_OTGFS_DFIFO_DEP(n) (STM32_OTGFS_BASE+STM32_OTGFS_DFIFO_DEP_OFFSET(n))
@ -366,10 +382,6 @@
#define STM32_OTGFS_DFIFO_DEP3 (STM32_OTGFS_BASE+STM32_OTGFS_DFIFO_DEP3_OFFSET)
#define STM32_OTGFS_DFIFO_HCH3 (STM32_OTGFS_BASE+STM32_OTGFS_DFIFO_HCH3_OFFSET)
/* Power and clock gating registers */
#define STM32_OTGFS_PCGCCTL (STM32_OTGFS_BASE+STM32_OTGFS_PCGCCTL_OFFSET)
/* Register Bitfield Definitions ********************************************************************/
/* Core global control and status registers */
@ -411,7 +423,9 @@
#define OTGFS_GUSBCFG_TOCAL_SHIFT (0) /* Bits 0-2: FS timeout calibration */
#define OTGFS_GUSBCFG_TOCAL_MASK (7 << OTGFS_GUSBCFG_TOCAL_SHIFT)
/* Bits 3-6: Reserved, must be kept at reset value */
/* Bits 3-5: Reserved, must be kept at reset value */
#define OTGFS_GUSBCFG_PHYSEL (1 << 6) /* Bit 6: Full Speed serial transceiver select */
/* Bit 7: Reserved, must be kept at reset value */
#define OTGFS_GUSBCFG_SRPCAP (1 << 8) /* Bit 8: SRP-capable */
#define OTGFS_GUSBCFG_HNPCAP (1 << 9) /* Bit 9: HNP-capable */
#define OTGFS_GUSBCFG_TRDT_SHIFT (10) /* Bits 10-13: USB turnaround time */
@ -491,7 +505,7 @@
#define OTGFS_GRXSTSH_PKTSTS_MASK (15 << OTGFS_GRXSTSH_PKTSTS_SHIFT)
# define OTGFS_GRXSTSH_PKTSTS_INRECVD (2 << OTGFS_GRXSTSH_PKTSTS_SHIFT) /* IN data packet received */
# define OTGFS_GRXSTSH_PKTSTS_INDONE (3 << OTGFS_GRXSTSH_PKTSTS_SHIFT) /* IN transfer completed */
# define OTGFS_GRXSTSH_PKTSTS_DTOGERR (2 << OTGFS_GRXSTSH_PKTSTS_SHIFT) /* Data toggle error */
# define OTGFS_GRXSTSH_PKTSTS_DTOGERR (5 << OTGFS_GRXSTSH_PKTSTS_SHIFT) /* Data toggle error */
# define OTGFS_GRXSTSH_PKTSTS_HALTED (7 << OTGFS_GRXSTSH_PKTSTS_SHIFT) /* Channel halted */
/* Bits 21-31: Reserved, must be kept at reset value */
/* Receive status debug read/OTG status read and pop registers (device mode) */
@ -559,7 +573,7 @@
# define OTGFS_HNPTXSTS_EPNUM_SHIFT (27) /* Bits 27-30: Endpoint number */
# define OTGFS_HNPTXSTS_EPNUM_MASK (15 << OTGFS_HNPTXSTS_EPNUM_SHIFT)
/* Bit 31 Reserved, must be kept at reset value */
/* general core configuration register */
/* General core configuration register */
/* Bits 15:0 Reserved, must be kept at reset value */
#define OTGFS_GCCFG_PWRDWN (1 << 16) /* Bit 16: Power down */
/* Bit 17 Reserved, must be kept at reset value */
@ -625,9 +639,11 @@
# define OTGFS_HPTXSTS_TYPE_HALT (3 << OTGFS_HPTXSTS_TYPE_SHIFT) /* Disable channel command */
# define OTGFS_HPTXSTS_EPNUM_SHIFT (27) /* Bits 27-30: Endpoint number */
# define OTGFS_HPTXSTS_EPNUM_MASK (15 << OTGFS_HPTXSTS_EPNUM_SHIFT)
# define OTGFS_HPTXSTS_CHNUM_SHIFT (27) /* Bits 27-30: Channel number */
# define OTGFS_HPTXSTS_CHNUM_MASK (15 << OTGFS_HPTXSTS_CHNUM_SHIFT)
# define OTGFS_HPTXSTS_ODD (1 << 24) /* Bit 31: Send in odd (vs even) frame */
/* Host all channels interrupt and all channels interrupt mask registers */
/* Host all channels interrupt and all channels interrupt mask registers */
#define OTGFS_HAINT(n) (1 << (n)) /* Bits 15:0 HAINTM: Channel interrupt */
@ -664,7 +680,7 @@
/* Host channel-n characteristics register */
#define OTGFS_HCCHAR0_MPSIZ_SHIFT (0) /* Bits 0-10: Maximum packet size */
#define OTGFS_HCCHAR_MPSIZ_SHIFT (0) /* Bits 0-10: Maximum packet size */
#define OTGFS_HCCHAR_MPSIZ_MASK (0x7ff << OTGFS_HCCHAR_MPSIZ_SHIFT)
#define OTGFS_HCCHAR_EPNUM_SHIFT (11) /* Bits 11-14: Endpoint number */
#define OTGFS_HCCHAR_EPNUM_MASK (15 << OTGFS_HCCHAR_EPNUM_SHIFT)
@ -695,7 +711,7 @@
#define OTGFS_HCINT_STALL (1 << 3) /* Bit 3: STALL response received interrupt */
#define OTGFS_HCINT_NAK (1 << 4) /* Bit 4: NAK response received interrupt */
#define OTGFS_HCINT_ACK (1 << 5) /* Bit 5: ACK response received/transmitted interrupt */
#define OTGFS_HCINTMSK_NYET (1 << 6) /* Bit 6: response received interrupt mask */
#define OTGFS_HCINT_NYET (1 << 6) /* Bit 6: Response received interrupt */
#define OTGFS_HCINT_TXERR (1 << 7) /* Bit 7: Transaction error */
#define OTGFS_HCINT_BBERR (1 << 8) /* Bit 8: Babble error */
#define OTGFS_HCINT_FRMOR (1 << 9) /* Bit 9: Frame overrun */
@ -712,7 +728,8 @@
# define OTGFS_HCTSIZ_DPID_DATA0 (0 << OTGFS_HCTSIZ_DPID_SHIFT)
# define OTGFS_HCTSIZ_DPID_DATA2 (1 << OTGFS_HCTSIZ_DPID_SHIFT)
# define OTGFS_HCTSIZ_DPID_DATA1 (2 << OTGFS_HCTSIZ_DPID_SHIFT)
# define OTGFS_HCTSIZ_DPID_MDATA (3 << OTGFS_HCTSIZ_DPID_SHIFT)
# define OTGFS_HCTSIZ_DPID_MDATA (3 << OTGFS_HCTSIZ_DPID_SHIFT) /* Non-control */
# define OTGFS_HCTSIZ_PID_SETUP (3 << OTGFS_HCTSIZ_DPID_SHIFT) /* Control */
/* Bit 31 Reserved, must be kept at reset value */
/* Device-mode control and status registers */
@ -989,8 +1006,6 @@
# define OTGFS_DOEPTSIZ_RXDPID_DATA1 (2 << OTGFS_DOEPTSIZ_RXDPID_SHIFT)
# define OTGFS_DOEPTSIZ_RXDPID_MDATA (3 << OTGFS_DOEPTSIZ_RXDPID_SHIFT)
/* Bit 31: Reserved, must be kept at reset value */
/* Power and clock gating registers */
/* Power and clock gating control register */
#define OTGFS_PCGCCTL_STPPCLK (1 << 0) /* Bit 0: Stop PHY clock */

View File

@ -365,7 +365,7 @@
#define GPIO_JTMS_SWDIO (GPIO_ALT|GPIO_AF0|GPIO_PORTA|GPIO_PIN13)
#define GPIO_JTRST (GPIO_ALT|GPIO_AF0|GPIO_PORTB|GPIO_PIN4)
/* OTG FS/HS */
/* OTG FS/HS (VBUS PA9 is not an alternate configuration) */
#define GPIO_OTGFS_DM (GPIO_ALT|GPIO_FLOAT|GPIO_AF10|GPIO_SPEED_100MHz|GPIO_PUSHPULL|GPIO_PORTA|GPIO_PIN11)
#define GPIO_OTGFS_DP (GPIO_ALT|GPIO_FLOAT|GPIO_AF10|GPIO_SPEED_100MHz|GPIO_PUSHPULL|GPIO_PORTA|GPIO_PIN12)

View File

@ -365,7 +365,7 @@
#define GPIO_JTMS_SWDIO (GPIO_ALT|GPIO_AF0|GPIO_PORTA|GPIO_PIN13)
#define GPIO_JTRST (GPIO_ALT|GPIO_AF0|GPIO_PORTB|GPIO_PIN4)
/* OTG FS/HS */
/* OTG FS/HS (VBUS PA9 is not an alternate configuration) */
#define GPIO_OTGFS_DM (GPIO_ALT|GPIO_FLOAT|GPIO_AF10|GPIO_SPEED_100MHz|GPIO_PUSHPULL|GPIO_PORTA|GPIO_PIN11)
#define GPIO_OTGFS_DP (GPIO_ALT|GPIO_FLOAT|GPIO_AF10|GPIO_SPEED_100MHz|GPIO_PUSHPULL|GPIO_PORTA|GPIO_PIN12)

View File

@ -4086,7 +4086,7 @@ static void *stm32_ep_allocbuffer(FAR struct usbdev_ep_s *ep, unsigned bytes)
*
*******************************************************************************/
#ifdef CONFIG_LPC313x_USBDEV_DMA
#ifdef CONFIG_STM32_USBDEV_DMA
static void stm32_ep_freebuffer(FAR struct usbdev_ep_s *ep, FAR void *buf)
{
usbtrace(TRACE_EPFREEBUFFER, privep->epphy);
@ -4645,7 +4645,6 @@ static int stm32_wakeup(struct usbdev_s *dev)
regval &= ~(OTGFS_PCGCCTL_STPPCLK | OTGFS_PCGCCTL_GATEHCLK);
stm32_putreg(regval, STM32_OTGFS_PCGCCTL);
#endif
/* Activate Remote wakeup signaling */
regval = stm32_getreg(STM32_OTGFS_DCTL);
@ -4971,7 +4970,7 @@ static void stm32_hwinitialize(FAR struct stm32_usbdev_s *priv)
#ifndef CONFIG_USBDEV_VBUSSENSING
regval |= OTGFS_GCCFG_NOVBUSSENS;
#endif
#ifdef CONFIG_USBDEV_SOFOUTPUT
#ifdef CONFIG_STM32_OTGFS_SOFOUTPUT
regval |= OTGFS_GCCFG_SOFOUTEN;
#endif
stm32_putreg(regval, STM32_OTGFS_GCCFG);
@ -5173,12 +5172,29 @@ void up_usbinitialize(void)
* current detection.
*/
/* Configure OTG FS alternate function pins */
/* Configure OTG FS alternate function pins
*
* PIN* SIGNAL DIRECTION
* ---- ----------- ----------
* PA8 OTG_FS_SOF SOF clock output
* PA9 OTG_FS_VBUS VBUS input for device, Driven by external regulator by
* host (not an alternate function)
* PA10 OTG_FS_ID OTG ID pin (only needed in Dual mode)
* PA11 OTG_FS_DM D- I/O
* PA12 OTG_FS_DP D+ I/O
*
* *Pins may vary from device-to-device.
*/
stm32_configgpio(GPIO_OTGFS_DM);
stm32_configgpio(GPIO_OTGFS_DP);
stm32_configgpio(GPIO_OTGFS_ID);
stm32_configgpio(GPIO_OTGFS_ID); /* Only needed for OTG */
/* SOF output pin configuration is configurable. */
#ifdef CONFIG_STM32_OTGFS_SOFOUTPUT
stm32_configgpio(GPIO_OTGFS_SOF);
#endif
/* Uninitialize the hardware so that we know that we are starting from a
* known state. */

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -47,6 +47,34 @@
#include "chip.h"
#include "chip/stm32_otgfs.h"
#if defined(CONFIG_STM32_OTGFS) && defined(CONFIG_USBHOST)
/************************************************************************************
* Public Functions
************************************************************************************/
/*
* STM32 USB OTG FS Host Driver Support
*
* Pre-requisites
*
* CONFIG_USBHOST - Enable general USB host support
* CONFIG_STM32_OTGFS - Enable the STM32 USB OTG FS block
* CONFIG_STM32_SYSCFG - Needed
*
* Options:
*
* CONFIG_STM32_OTGFS_RXFIFO_SIZE - Size of the RX FIFO in 32-bit words.
* Default 128 (512 bytes)
* CONFIG_STM32_OTGFS_NPTXFIFO_SIZE - Size of the non-periodic Tx FIFO
* in 32-bit words. Default 96 (384 bytes)
* CONFIG_STM32_OTGFS_PTXFIFO_SIZE - Size of the periodic Tx FIFO in 32-bit
* words. Default 96 (384 bytes)
* CONFIG_STM32_OTGFS_SOFINTR - Enable SOF interrupts. Why would you ever
* want to do that?
* CONFIG_STM32_USBHOST_REGDEBUG - Enable very low-level register access
* debug. Depends on CONFIG_DEBUG.
*/
/************************************************************************************
* Public Functions
************************************************************************************/
@ -61,11 +89,40 @@ extern "C" {
#define EXTERN extern
#endif
/***********************************************************************************
* Name: stm32_usbhost_vbusdrive
*
* Description:
* Enable/disable driving of VBUS 5V output. This function must be provided be
* each platform that implements the STM32 OTG FS host interface
*
* "On-chip 5 V VBUS generation is not supported. For this reason, a charge pump
* or, if 5 V are available on the application board, a basic power switch, must
* be added externally to drive the 5 V VBUS line. The external charge pump can
* be driven by any GPIO output. When the application decides to power on VBUS
* using the chosen GPIO, it must also set the port power bit in the host port
* control and status register (PPWR bit in OTG_FS_HPRT).
*
* "The application uses this field to control power to this port, and the core
* clears this bit on an overcurrent condition."
*
* Input Parameters:
* iface - For future growth to handle multiple USB host interface. Should be zero.
* enable - true: enable VBUS power; false: disable VBUS power
*
* Returned Value:
* None
*
***********************************************************************************/
EXTERN void stm32_usbhost_vbusdrive(int iface, bool enable);
#undef EXTERN
#if defined(__cplusplus)
}
#endif
#endif /* __ASSEMBLY__ */
#endif /* CONFIG_STM32_OTGFS && CONFIG_USBHOST */
#endif /* __ARCH_ARM_SRC_STM32_STM32_USBHOST_H */

View File

@ -616,7 +616,7 @@ static void stm32_stdclockconfig(void)
/* Set the PLL dividers and multiplers to configure the main PLL */
regval = (STM32_PLLCFG_PLLM | STM32_PLLCFG_PLLN |STM32_PLLCFG_PLLP |
RCC_PLLCFG_PLLSRC_HSE | STM32_PLLCFG_PPQ);
RCC_PLLCFG_PLLSRC_HSE | STM32_PLLCFG_PLLQ);
putreg32(regval, STM32_RCC_PLLCFG);
/* Enable the main PLL */

View File

@ -618,7 +618,7 @@ static void stm32_stdclockconfig(void)
/* Set the PLL dividers and multiplers to configure the main PLL */
regval = (STM32_PLLCFG_PLLM | STM32_PLLCFG_PLLN |STM32_PLLCFG_PLLP |
RCC_PLLCFG_PLLSRC_HSE | STM32_PLLCFG_PPQ);
RCC_PLLCFG_PLLSRC_HSE | STM32_PLLCFG_PLLQ);
putreg32(regval, STM32_RCC_PLLCFG);
/* Enable the main PLL */

View File

@ -194,7 +194,7 @@ config ARCH_BOARD_MCU123
lpc214x development board. This OS is also built with the arm-elf
toolchain*. The port supports serial, timer0, spi, and usb.
config ARCH_BOARD_MICROPENDOUS
config ARCH_BOARD_MICROPENDOUS3
bool "Opendous Micropendous 3 board"
depends on ARCH_CHIP_AT90USB646 || ARCH_CHIP_AT90USB647 || ARCH_CHIP_AT90USB1286 || ARCH_CHIP_AT90USB1287
---help---
@ -509,7 +509,7 @@ config ARCH_BOARD
default "m68322evb" if ARCH_BOARD_M68332EVB
default "mbed" if ARCH_BOARD_MBED
default "mcu123-lpc214x" if ARCH_BOARD_MCU123
default "micropendous3" if ARCH_BOARD_MICROPENDOUS
default "micropendous3" if ARCH_BOARD_MICROPENDOUS3
default "mirtoo" if ARCH_BOARD_MIRTOO
default "mx1ads" if ARCH_BOARD_MX1ADS
default "ne64badge" if ARCH_BOARD_NE64BADGE
@ -613,7 +613,7 @@ endif
if ARCH_BOARD_MCU123
source "configs/mcu123-lpc214x/Kconfig"
endif
if ARCH_BOARD_MICROPENDOUS
if ARCH_BOARD_MICROPENDOUS3
source "configs/micropendous3/Kconfig"
endif
if ARCH_BOARD_MIRTOO

View File

@ -182,6 +182,10 @@ menuconfig LCD
Drivers for parallel and serial LCD and OLED type devices. These
drivers support interfaces as defined in include/nuttx/lcd/lcd.h
This selection is necessary to enable support for LCD drivers in
drivers/lcd as well as for board-specific LCD drivers in the configs/
subdirectories.
if LCD
source drivers/lcd/Kconfig
endif

View File

@ -173,3 +173,42 @@ config LCD_UG9664HSWAG01
ug-9664hswag01.c. OLED Display Module, UG-9664HSWAG01", Univision
Technology Inc. Used with the LPC Xpresso and Embedded Artists
base board.
choice
prompt "LCD Orientation"
default LCD_LANDSCAPE
depends on LCD
---help---
Some LCD drivers may support displays in different orientations.
If the LCD driver supports this capability, than these are configuration
options to select that display orientation.
config LCD_LANDSCAPE
bool "Landscape orientation"
---help---
Define for "landscape" orientation support. Landscape mode refers one
of two orientations where the the display is wider than it is tall
(LCD_RLANDSCAPE is the other). This is the default orientation.
config LCD_PORTRAIT
bool "Portrait orientation"
---help---
Define for "portrait" orientation support. Portrait mode refers one
of two orientations where the the display is taller than it is wide
(LCD_RPORTAIT is the other).
config LCD_RPORTRAIT
bool "Reverse portrait display"
---help---
Define for "reverse portrait" orientation support. Reverse portrait mode
refers one of two orientations where the the display is taller than it is
wide (LCD_PORTAIT is the other).
config LCD_RLANDSCAPE
bool "Reverse landscape orientation"
---help---
Define for "reverse landscape" orientation support. Reverse landscape mode
refers one of two orientations where the the display is wider than it is
tall (LCD_LANDSCAPE is the other).
endchoice

View File

@ -37,7 +37,10 @@
# These drivers depend on I2C support
ifeq ($(CONFIG_I2C),y)
ifeq ($(CONFIG_I2C_TRANSFER),y)
CSRCS += lis331dl.c
endif
ifeq ($(CONFIG_I2C_LM75),y)
CSRCS += lm75.c

View File

@ -1,8 +1,8 @@
/*******************************************************************************
* drivers/usbhost/usbhost_enumerate.c
*
* Copyright (C) 2011 Gregory Nutt. All rights reserved.
* Authors: Gregory Nutt <spudmonkey@racsa.co.cr>
* Copyright (C) 2011-2012 Gregory Nutt. All rights reserved.
* Authors: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@ -122,8 +122,8 @@ static void usbhost_putle16(uint8_t *dest, uint16_t val)
*
*******************************************************************************/
static inline int usbhost_devdesc(const struct usb_devdesc_s *devdesc,
struct usbhost_id_s *id)
static inline int usbhost_devdesc(FAR const struct usb_devdesc_s *devdesc,
FAR struct usbhost_id_s *id)
{
/* Clear the ID info */
@ -131,7 +131,7 @@ static inline int usbhost_devdesc(const struct usb_devdesc_s *devdesc,
/* Pick off the class ID info */
id->base = devdesc->class;
id->base = devdesc->classid;
id->subclass = devdesc->subclass;
id->proto = devdesc->protocol;
@ -194,7 +194,7 @@ static inline int usbhost_configdesc(const uint8_t *configdesc, int cfglen,
*/
DEBUGASSERT(remaining >= sizeof(struct usb_ifdesc_s));
id->base = ifdesc->class;
id->base = ifdesc->classid;
id->subclass = ifdesc->subclass;
id->proto = ifdesc->protocol;
uvdbg("class:%d subclass:%d protocol:%d\n",

View File

@ -255,7 +255,9 @@ static inline int usbhost_devinit(FAR struct usbhost_state_s *priv);
static inline uint16_t usbhost_getle16(const uint8_t *val);
static inline void usbhost_putle16(uint8_t *dest, uint16_t val);
static inline uint32_t usbhost_getle32(const uint8_t *val);
#if 0 /* Not used */
static void usbhost_putle32(uint8_t *dest, uint32_t val);
#endif
/* Transfer descriptor memory management */
@ -701,7 +703,7 @@ static int usbhost_kbdpoll(int argc, char *argv[])
#if defined(CONFIG_DEBUG_USB) && defined(CONFIG_DEBUG_VERBOSE)
unsigned int npolls = 0;
#endif
unsigned int nerrors;
unsigned int nerrors = 0;
int ret;
uvdbg("Started\n");
@ -1381,6 +1383,7 @@ static inline uint32_t usbhost_getle32(const uint8_t *val)
*
****************************************************************************/
#if 0 /* Not used */
static void usbhost_putle32(uint8_t *dest, uint32_t val)
{
/* Little endian means LS halfword first in byte stream */
@ -1388,6 +1391,7 @@ static void usbhost_putle32(uint8_t *dest, uint32_t val)
usbhost_putle16(dest, (uint16_t)(val & 0xffff));
usbhost_putle16(dest+2, (uint16_t)(val >> 16));
}
#endif
/****************************************************************************
* Name: usbhost_tdalloc

View File

@ -1,8 +1,8 @@
/****************************************************************************
* drivers/usbhost/usbhost_storage.c
*
* Copyright (C) 2010-2011 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
* Copyright (C) 2010-2012 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@ -123,7 +123,7 @@ struct usbhost_state_s
struct usbhost_driver_s *drvr;
/* The remainder of the fields are provide to the mass storage class */
char sdchar; /* Character identifying the /dev/sd[n] device */
volatile bool disconnected; /* TRUE: Device has been disconnected */
uint8_t ifno; /* Interface number */
@ -217,7 +217,7 @@ static inline int usbhost_tfree(FAR struct usbhost_state_s *priv);
static FAR struct usbmsc_cbw_s *usbhost_cbwalloc(FAR struct usbhost_state_s *priv);
/* struct usbhost_registry_s methods */
static struct usbhost_class_s *usbhost_create(FAR struct usbhost_driver_s *drvr,
FAR const struct usbhost_id_s *id);
@ -248,7 +248,7 @@ static int usbhost_ioctl(FAR struct inode *inode, int cmd,
* Private Data
****************************************************************************/
/* This structure provides the registry entry ID informatino that will be
/* This structure provides the registry entry ID informatino that will be
* used to associate the USB host mass storage class to a connected USB
* device.
*/
@ -416,7 +416,7 @@ static inline void usbhost_freeclass(FAR struct usbhost_state_s *class)
flags = irqsave();
class->class.flink = g_freelist;
g_freelist = class;
irqrestore(flags);
irqrestore(flags);
}
#else
static inline void usbhost_freeclass(FAR struct usbhost_state_s *class)
@ -700,16 +700,16 @@ static inline int usbhost_testunitready(FAR struct usbhost_state_s *priv)
int result;
/* Initialize a CBW (re-using the allocated transfer buffer) */
cbw = usbhost_cbwalloc(priv);
if (!cbw)
{
udbg("ERROR: Failed to create CBW\n");
return -ENOMEM;
}
/* Construct and send the CBW */
usbhost_testunitreadycbw(cbw);
result = DRVR_TRANSFER(priv->drvr, priv->bulkout,
(uint8_t*)cbw, USBMSC_CBW_SIZEOF);
@ -733,7 +733,7 @@ static inline int usbhost_requestsense(FAR struct usbhost_state_s *priv)
int result;
/* Initialize a CBW (re-using the allocated transfer buffer) */
cbw = usbhost_cbwalloc(priv);
if (!cbw)
{
@ -742,7 +742,7 @@ static inline int usbhost_requestsense(FAR struct usbhost_state_s *priv)
}
/* Construct and send the CBW */
usbhost_requestsensecbw(cbw);
result = DRVR_TRANSFER(priv->drvr, priv->bulkout,
(uint8_t*)cbw, USBMSC_CBW_SIZEOF);
@ -775,7 +775,7 @@ static inline int usbhost_readcapacity(FAR struct usbhost_state_s *priv)
int result;
/* Initialize a CBW (re-using the allocated transfer buffer) */
cbw = usbhost_cbwalloc(priv);
if (!cbw)
{
@ -784,7 +784,7 @@ static inline int usbhost_readcapacity(FAR struct usbhost_state_s *priv)
}
/* Construct and send the CBW */
usbhost_readcapacitycbw(cbw);
result = DRVR_TRANSFER(priv->drvr, priv->bulkout,
(uint8_t*)cbw, USBMSC_CBW_SIZEOF);
@ -823,7 +823,7 @@ static inline int usbhost_inquiry(FAR struct usbhost_state_s *priv)
int result;
/* Initialize a CBW (re-using the allocated transfer buffer) */
cbw = usbhost_cbwalloc(priv);
if (!cbw)
{
@ -832,7 +832,7 @@ static inline int usbhost_inquiry(FAR struct usbhost_state_s *priv)
}
/* Construct and send the CBW */
usbhost_inquirycbw(cbw);
result = DRVR_TRANSFER(priv->drvr, priv->bulkout,
(uint8_t*)cbw, USBMSC_CBW_SIZEOF);
@ -885,7 +885,7 @@ static void usbhost_destroy(FAR void *arg)
DEBUGASSERT(priv != NULL);
uvdbg("crefs: %d\n", priv->crefs);
/* Unregister the block driver */
usbhost_mkdevname(priv, devname);
@ -965,10 +965,10 @@ static inline int usbhost_cfgdesc(FAR struct usbhost_state_s *priv,
uint8_t found = 0;
int ret;
DEBUGASSERT(priv != NULL &&
DEBUGASSERT(priv != NULL &&
configdesc != NULL &&
desclen >= sizeof(struct usb_cfgdesc_s));
/* Verify that we were passed a configuration descriptor */
cfgdesc = (FAR struct usb_cfgdesc_s *)configdesc;
@ -1004,7 +1004,7 @@ static inline int usbhost_cfgdesc(FAR struct usbhost_state_s *priv,
case USB_DESC_TYPE_INTERFACE:
{
FAR struct usb_ifdesc_s *ifdesc = (FAR struct usb_ifdesc_s *)configdesc;
uvdbg("Interface descriptor\n");
DEBUGASSERT(remaining >= USB_SIZEOF_IFDESC);
@ -1078,7 +1078,7 @@ static inline int usbhost_cfgdesc(FAR struct usbhost_state_s *priv,
found |= USBHOST_BINFOUND;
/* Save the bulk IN endpoint information */
bindesc.addr = epdesc->addr & USB_EP_ADDR_NUMBER_MASK;
bindesc.in = 1;
bindesc.funcaddr = funcaddr;
@ -1108,7 +1108,7 @@ static inline int usbhost_cfgdesc(FAR struct usbhost_state_s *priv,
}
/* Increment the address of the next descriptor */
configdesc += desc->len;
remaining -= desc->len;
}
@ -1116,7 +1116,7 @@ static inline int usbhost_cfgdesc(FAR struct usbhost_state_s *priv,
/* Sanity checking... did we find all of things that we need? Hmmm.. I wonder..
* can we work read-only or write-only if only one bulk endpoint found?
*/
if (found != USBHOST_ALLFOUND)
{
ulldbg("ERROR: Found IF:%s BIN:%s BOUT:%s\n",
@ -1202,7 +1202,7 @@ static inline int usbhost_initvolume(FAR struct usbhost_state_s *priv)
uvdbg("Test unit ready, retries=%d\n", retries);
/* Send TESTUNITREADY to see the unit is ready */
ret = usbhost_testunitready(priv);
if (ret == OK)
{
@ -1585,7 +1585,7 @@ static FAR struct usbmsc_cbw_s *usbhost_cbwalloc(FAR struct usbhost_state_s *pri
* Name: usbhost_create
*
* Description:
* This function implements the create() method of struct usbhost_registry_s.
* This function implements the create() method of struct usbhost_registry_s.
* The create() method is a callback into the class implementation. It is
* used to (1) create a new instance of the USB host class state and to (2)
* bind a USB host driver "session" to the class instance. Use of this
@ -1644,9 +1644,9 @@ static FAR struct usbhost_class_s *usbhost_create(FAR struct usbhost_driver_s *d
priv->drvr = drvr;
/* NOTE: We do not yet know the geometry of the USB mass storage device */
/* Return the instance of the USB mass storage class */
return &priv->class;
}
}
@ -1701,7 +1701,7 @@ static int usbhost_connect(FAR struct usbhost_class_s *class,
FAR struct usbhost_state_s *priv = (FAR struct usbhost_state_s *)class;
int ret;
DEBUGASSERT(priv != NULL &&
DEBUGASSERT(priv != NULL &&
configdesc != NULL &&
desclen >= sizeof(struct usb_cfgdesc_s));
@ -1722,7 +1722,7 @@ static int usbhost_connect(FAR struct usbhost_class_s *class,
udbg("usbhost_initvolume() failed: %d\n", ret);
}
}
return ret;
}
@ -1792,7 +1792,7 @@ static int usbhost_disconnected(struct usbhost_class_s *class)
}
}
irqrestore(flags);
irqrestore(flags);
return OK;
}
@ -1945,45 +1945,52 @@ static ssize_t usbhost_read(FAR struct inode *inode, unsigned char *buffer,
ret = -ENOMEM;
/* Initialize a CBW (re-using the allocated transfer buffer) */
cbw = usbhost_cbwalloc(priv);
if (cbw)
{
/* Assume some device failure */
/* Loop in the event that EAGAIN is returned (mean that the
* transaction was NAKed and we should try again.
*/
ret = -ENODEV;
/* Construct and send the CBW */
usbhost_readcbw(startsector, priv->blocksize, nsectors, cbw);
result = DRVR_TRANSFER(priv->drvr, priv->bulkout,
(uint8_t*)cbw, USBMSC_CBW_SIZEOF);
if (result == OK)
do
{
/* Receive the user data */
/* Assume some device failure */
result = DRVR_TRANSFER(priv->drvr, priv->bulkin,
buffer, priv->blocksize * nsectors);
ret = -ENODEV;
/* Construct and send the CBW */
usbhost_readcbw(startsector, priv->blocksize, nsectors, cbw);
result = DRVR_TRANSFER(priv->drvr, priv->bulkout,
(uint8_t*)cbw, USBMSC_CBW_SIZEOF);
if (result == OK)
{
/* Receive the CSW */
/* Receive the user data */
result = DRVR_TRANSFER(priv->drvr, priv->bulkin,
priv->tbuffer, USBMSC_CSW_SIZEOF);
buffer, priv->blocksize * nsectors);
if (result == OK)
{
FAR struct usbmsc_csw_s *csw;
/* Receive the CSW */
/* Check the CSW status */
csw = (FAR struct usbmsc_csw_s *)priv->tbuffer;
if (csw->status == 0)
result = DRVR_TRANSFER(priv->drvr, priv->bulkin,
priv->tbuffer, USBMSC_CSW_SIZEOF);
if (result == OK)
{
ret = nsectors;
FAR struct usbmsc_csw_s *csw;
/* Check the CSW status */
csw = (FAR struct usbmsc_csw_s *)priv->tbuffer;
if (csw->status == 0)
{
ret = nsectors;
}
}
}
}
}
} while (result == -EAGAIN);
}
usbhost_givesem(&priv->exclsem);
@ -2037,7 +2044,7 @@ static ssize_t usbhost_write(FAR struct inode *inode, const unsigned char *buffe
ret = -ENOMEM;
/* Initialize a CBW (re-using the allocated transfer buffer) */
cbw = usbhost_cbwalloc(priv);
if (cbw)
{
@ -2046,7 +2053,7 @@ static ssize_t usbhost_write(FAR struct inode *inode, const unsigned char *buffe
ret = -ENODEV;
/* Construct and send the CBW */
usbhost_writecbw(startsector, priv->blocksize, nsectors, cbw);
result = DRVR_TRANSFER(priv->drvr, priv->bulkout,
(uint8_t*)cbw, USBMSC_CBW_SIZEOF);

View File

@ -1,7 +1,7 @@
/************************************************************************************
* include/nuttx/usb/usbhost.h
*
* Copyright (C) 2010-2011 Gregory Nutt. All rights reserved.
* Copyright (C) 2010-2012 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* References:
@ -284,7 +284,7 @@
* Some hardware supports special memory in which request and descriptor data can
* be accessed more efficiently. This method provides a mechanism to allocate
* the request/descriptor memory. If the underlying hardware does not support
* such "special" memory, this functions may simply map to malloc.
* such "special" memory, this functions may simply map to kmalloc.
*
* This interface was optimized under a particular assumption. It was assumed
* that the driver maintains a pool of small, pre-allocated buffers for descriptor
@ -317,7 +317,7 @@
* Some hardware supports special memory in which request and descriptor data can
* be accessed more efficiently. This method provides a mechanism to free that
* request/descriptor memory. If the underlying hardware does not support
* such "special" memory, this functions may simply map to free().
* such "special" memory, this functions may simply map to kfree().
*
* Input Parameters:
* drvr - The USB host driver instance obtained as a parameter from the call to
@ -342,7 +342,7 @@
* Some hardware supports special memory in which larger IO buffers can
* be accessed more efficiently. This method provides a mechanism to allocate
* the request/descriptor memory. If the underlying hardware does not support
* such "special" memory, this functions may simply map to malloc.
* such "special" memory, this functions may simply map to kmalloc.
*
* This interface differs from DRVR_ALLOC in that the buffers are variable-sized.
*
@ -371,7 +371,7 @@
* Some hardware supports special memory in which IO data can be accessed more
* efficiently. This method provides a mechanism to free that IO buffer
* memory. If the underlying hardware does not support such "special" memory,
* this functions may simply map to free().
* this functions may simply map to kfree().
*
* Input Parameters:
* drvr - The USB host driver instance obtained as a parameter from the call to
@ -448,7 +448,13 @@
*
* Returned Values:
* On success, zero (OK) is returned. On a failure, a negated errno value is
* returned indicating the nature of the failure
* returned indicating the nature of the failure:
*
* EAGAIN - If devices NAKs the transfer (or NYET or other error where
* it may be appropriate to restart the entire transaction).
* EPERM - If the endpoint stalls
* EIO - On a TX or data toggle error
* EPIPE - Overrun errors
*
* Assumptions:
* This function will *not* be called from an interrupt handler.
@ -553,7 +559,7 @@ struct usbhost_class_s
};
/* This structure describes one endpoint. It is used as an input to the
* allocep() method. Most of this information comes from the endpoint
* epalloc() method. Most of this information comes from the endpoint
* descriptor.
*/
@ -562,12 +568,12 @@ struct usbhost_epdesc_s
uint8_t addr; /* Endpoint address */
bool in; /* Direction: true->IN */
uint8_t funcaddr; /* USB address of function containing endpoint */
uint8_t xfrtype; /* Transfer type. See SB_EP_ATTR_XFER_* in usb.h */
uint8_t xfrtype; /* Transfer type. See USB_EP_ATTR_XFER_* in usb.h */
uint8_t interval; /* Polling interval */
uint16_t mxpacketsize; /* Max packetsize */
};
/* This type represents one endpoint configured by the allocep() method.
/* This type represents one endpoint configured by the epalloc() method.
* The actual form is know only internally to the USB host controller
* (for example, for an OHCI driver, this would probably be a pointer
* to an endpoint descriptor).
@ -615,7 +621,7 @@ struct usbhost_driver_s
* be accessed more efficiently. The following methods provide a mechanism
* to allocate and free the transfer descriptor memory. If the underlying
* hardware does not support such "special" memory, these functions may
* simply map to malloc and free.
* simply map to kmalloc and kfree.
*
* This interface was optimized under a particular assumption. It was assumed
* that the driver maintains a pool of small, pre-allocated buffers for descriptor
@ -630,7 +636,7 @@ struct usbhost_driver_s
/* Some hardware supports special memory in which larger IO buffers can
* be accessed more efficiently. This method provides a mechanism to allocate
* the request/descriptor memory. If the underlying hardware does not support
* such "special" memory, this functions may simply map to malloc.
* such "special" memory, this functions may simply map to kmalloc.
*
* This interface differs from DRVR_ALLOC in that the buffers are variable-sized.
*/

View File

@ -60,16 +60,16 @@ extern "C" {
* Public Type Declarations
****************************************************************************/
/* This structure contains the holder of a semaphore */
/* This structure contains information about the holder of a semaphore */
#ifdef CONFIG_PRIORITY_INHERITANCE
struct semholder_s
{
#if CONFIG_SEM_PREALLOCHOLDERS > 0
struct semholder_s *flink; /* Implements singly linked list */
struct semholder_s *flink; /* Implements singly linked list */
#endif
void *holder; /* Holder TCB (actual type is _TCB) */
int16_t counts; /* Number of counts owned by this holder */
void *htcb; /* Holder TCB (actual type is _TCB) */
int16_t counts; /* Number of counts owned by this holder */
};
#if CONFIG_SEM_PREALLOCHOLDERS > 0
@ -83,12 +83,21 @@ struct semholder_s
struct sem_s
{
int16_t semcount; /* >0 -> Num counts available */
/* <0 -> Num tasks waiting for semaphore */
int16_t semcount; /* >0 -> Num counts available */
/* <0 -> Num tasks waiting for semaphore */
/* If priority inheritance is enabled, then we have to keep track of which
* tasks hold references to the semaphore.
*/
#ifdef CONFIG_PRIORITY_INHERITANCE
struct semholder_s hlist; /* List of holders of semaphore counts */
# if CONFIG_SEM_PREALLOCHOLDERS > 0
FAR struct semholder_s *hhead; /* List of holders of semaphore counts */
# else
struct semholder_s holder; /* Single holder */
# endif
#endif
};
typedef struct sem_s sem_t;
/* Initializers */

View File

@ -103,16 +103,17 @@ int sem_init(FAR sem_t *sem, int pshared, unsigned int value)
{
/* Initialize the seamphore count */
sem->semcount = (int16_t)value;
sem->semcount = (int16_t)value;
/* Initialize to support priority inheritance */
#ifdef CONFIG_PRIORITY_INHERITANCE
# if CONFIG_SEM_PREALLOCHOLDERS > 0
sem->hlist.flink = NULL;
sem->hhead = NULL;
# else
sem->holder.htcb = NULL;
sem->holder.counts = 0;
# endif
sem->hlist.holder = NULL;
sem->hlist.counts = 0;
#endif
return OK;
}

View File

@ -204,7 +204,7 @@ config SCHED_ONEXIT_MAX
config DISABLE_OS_API
bool "Disable NuttX interfaces"
default n
default y
---help---
The following can be used to disable categories of
APIs supported by the OS. If the compiler supports

View File

@ -289,6 +289,18 @@ void os_start(void)
g_idletcb.flags = TCB_FLAG_TTYPE_KERNEL;
up_initial_state(&g_idletcb);
/* Initialize the semaphore facility(if in link). This has to be done
* very early because many subsystems depend upon fully functional
* semaphores.
*/
#ifdef CONFIG_HAVE_WEAKFUNCTIONS
if (sem_initialize != NULL)
#endif
{
sem_initialize();
}
/* Initialize the memory manager */
#ifndef CONFIG_HEAP_BASE
@ -351,15 +363,6 @@ void os_start(void)
}
#endif
/* Initialize the semaphore facility. (if in link) */
#ifdef CONFIG_HAVE_WEAKFUNCTIONS
if (sem_initialize != NULL)
#endif
{
sem_initialize();
}
/* Initialize the named message queue facility (if in link) */
#ifndef CONFIG_DISABLE_MQUEUE

View File

@ -178,7 +178,7 @@
pid_t waitpid(pid_t pid, int *stat_loc, int options)
{
_TCB *tcb = sched_gettcb(pid);
_TCB *tcb;
bool mystat;
int err;
int ret;
@ -186,6 +186,7 @@ pid_t waitpid(pid_t pid, int *stat_loc, int options)
/* Disable pre-emption so that nothing changes in the following tests */
sched_lock();
tcb = sched_gettcb(pid);
if (!tcb)
{
err = ECHILD;

View File

@ -99,32 +99,31 @@ static inline FAR struct semholder_s *sem_allocholder(sem_t *sem)
* used to implement mutexes.
*/
if (!sem->hlist.holder)
#if CONFIG_SEM_PREALLOCHOLDERS > 0
pholder = g_freeholders;
if (pholder)
{
pholder = &sem->hlist;
/* Remove the holder from the free list an put it into the semaphore's holder list */
g_freeholders = pholder->flink;
pholder->flink = sem->hhead;
sem->hhead = pholder;
/* Make sure the initial count is zero */
pholder->counts = 0;
}
#else
if (!sem->holder.htcb)
{
pholder = &sem->holder;
pholder->counts = 0;
}
#endif
else
{
#if CONFIG_SEM_PREALLOCHOLDERS > 0
pholder = g_freeholders;
if (pholder)
{
/* Remove the holder from the free list an put it into the semaphore's holder list */
g_freeholders = pholder->flink;
pholder->flink = sem->hlist.flink;
sem->hlist.flink = pholder;
/* Make sure the initial count is zero */
pholder->counts = 0;
}
else
#else
pholder = NULL;
#endif
sdbg("Insufficient pre-allocated holders\n");
pholder = NULL;
}
return pholder;
@ -140,12 +139,13 @@ static FAR struct semholder_s *sem_findholder(sem_t *sem, FAR _TCB *htcb)
/* Try to find the holder in the list of holders associated with this semaphore */
pholder = &sem->hlist;
#if CONFIG_SEM_PREALLOCHOLDERS > 0
for (; pholder; pholder = pholder->flink)
for (pholder = sem->hhead; pholder; pholder = pholder->flink)
#else
pholder = &sem->holder;
#endif
{
if (pholder->holder == htcb)
if (pholder->htcb == htcb)
{
/* Got it! */
@ -186,31 +186,33 @@ static inline void sem_freeholder(sem_t *sem, FAR struct semholder_s *pholder)
/* Release the holder and counts */
pholder->holder = 0;
pholder->htcb = NULL;
pholder->counts = 0;
#if CONFIG_SEM_PREALLOCHOLDERS > 0
/* If this is the holder inside the semaphore, then do nothing more */
/* Search the list for the matching holder */
if (pholder != &sem->hlist)
for (prev = NULL, curr = sem->hhead;
curr && curr != pholder;
prev = curr, curr = curr->flink);
if (curr)
{
/* Otherwise, search the list for the matching holder */
/* Remove the holder from the list */
for (prev = &sem->hlist, curr = sem->hlist.flink;
curr && curr != pholder;
prev = curr, curr = curr->flink);
if (curr)
if (prev)
{
/* Remove the holder from the list */
prev->flink = pholder->flink;
/* And put it in the free list */
pholder->flink = g_freeholders;
g_freeholders = pholder;
}
else
{
sem->hhead = pholder->flink;
}
/* And put it in the free list */
pholder->flink = g_freeholders;
g_freeholders = pholder;
}
#endif
}
@ -221,14 +223,16 @@ static inline void sem_freeholder(sem_t *sem, FAR struct semholder_s *pholder)
static int sem_foreachholder(FAR sem_t *sem, holderhandler_t handler, FAR void *arg)
{
FAR struct semholder_s *pholder = &sem->hlist;
FAR struct semholder_s *pholder;
#if CONFIG_SEM_PREALLOCHOLDERS > 0
FAR struct semholder_s *next;
#endif
int ret = 0;
#if CONFIG_SEM_PREALLOCHOLDERS > 0
for (; pholder && ret == 0; pholder = next)
for (pholder = sem->hhead; pholder && ret == 0; pholder = next)
#else
pholder = &sem->holder;
#endif
{
#if CONFIG_SEM_PREALLOCHOLDERS > 0
@ -238,7 +242,7 @@ static int sem_foreachholder(FAR sem_t *sem, holderhandler_t handler, FAR void *
#endif
/* The initial "built-in" container may hold a NULL holder */
if (pholder->holder)
if (pholder->htcb)
{
/* Call the handler */
@ -268,7 +272,7 @@ static int sem_recoverholders(FAR struct semholder_s *pholder, FAR sem_t *sem, F
static int sem_boostholderprio(FAR struct semholder_s *pholder,
FAR sem_t *sem, FAR void *arg)
{
FAR _TCB *htcb = (FAR _TCB *)pholder->holder;
FAR _TCB *htcb = (FAR _TCB *)pholder->htcb;
FAR _TCB *rtcb = (FAR _TCB*)arg;
/* Make sure that the thread is still active. If it exited without releasing
@ -371,7 +375,7 @@ static int sem_boostholderprio(FAR struct semholder_s *pholder,
static int sem_verifyholder(FAR struct semholder_s *pholder, FAR sem_t *sem, FAR void *arg)
{
#if 0 // Need to revisit this, but these assumptions seem to be untrue -- OR there is a bug???
FAR _TCB *htcb = (FAR _TCB *)pholder->holder;
FAR _TCB *htcb = (FAR _TCB *)pholder->htcb;
/* Called after a semaphore has been released (incremented), the semaphore
* could is non-negative, and there is no thread waiting for the count.
@ -396,9 +400,9 @@ static int sem_dumpholder(FAR struct semholder_s *pholder, FAR sem_t *sem, FAR v
{
#if CONFIG_SEM_PREALLOCHOLDERS > 0
dbg(" %08x: %08x %08x %04x\n",
pholder, pholder->flink, pholder->holder, pholder->counts);
pholder, pholder->flink, pholder->htcb, pholder->counts);
#else
dbg(" %08x: %08x %04x\n", pholder, pholder->holder, pholder->counts);
dbg(" %08x: %08x %04x\n", pholder, pholder->htcb, pholder->counts);
#endif
return 0;
}
@ -410,7 +414,7 @@ static int sem_dumpholder(FAR struct semholder_s *pholder, FAR sem_t *sem, FAR v
static int sem_restoreholderprio(FAR struct semholder_s *pholder, FAR sem_t *sem, FAR void *arg)
{
FAR _TCB *htcb = (FAR _TCB *)pholder->holder;
FAR _TCB *htcb = (FAR _TCB *)pholder->htcb;
#if CONFIG_SEM_NNESTPRIO > 0
FAR _TCB *stcb = (FAR _TCB *)arg;
int rpriority;
@ -510,6 +514,7 @@ static int sem_restoreholderprio(FAR struct semholder_s *pholder, FAR sem_t *sem
{
htcb->pend_reprios[i] = htcb->pend_reprios[j];
}
htcb->npend_reprio = j;
break;
}
@ -534,7 +539,7 @@ static int sem_restoreholderprio(FAR struct semholder_s *pholder, FAR sem_t *sem
static int sem_restoreholderprioA(FAR struct semholder_s *pholder, FAR sem_t *sem, FAR void *arg)
{
FAR _TCB *rtcb = (FAR _TCB*)g_readytorun.head;
if (pholder->holder != rtcb)
if (pholder->htcb != rtcb)
{
return sem_restoreholderprio(pholder, sem, arg);
}
@ -545,7 +550,7 @@ static int sem_restoreholderprioA(FAR struct semholder_s *pholder, FAR sem_t *se
static int sem_restoreholderprioB(FAR struct semholder_s *pholder, FAR sem_t *sem, FAR void *arg)
{
FAR _TCB *rtcb = (FAR _TCB*)g_readytorun.head;
if (pholder->holder == rtcb)
if (pholder->htcb == rtcb)
{
(void)sem_restoreholderprio(pholder, sem, arg);
return 1;
@ -586,6 +591,7 @@ void sem_initholders(void)
{
g_holderalloc[i].flink = &g_holderalloc[i+1];
}
g_holderalloc[CONFIG_SEM_PREALLOCHOLDERS-1].flink = NULL;
#endif
}
@ -609,8 +615,8 @@ void sem_initholders(void)
void sem_destroyholder(FAR sem_t *sem)
{
/* It is an error is a semaphore is destroyed while there are any holders
* (except perhaps the thread releas the semaphore itself). Hmmm.. but
/* It is an error if a semaphore is destroyed while there are any holders
* (except perhaps the thread release the semaphore itself). Hmmm.. but
* we actually have to assume that the caller knows what it is doing because
* could have killed another thread that is the actual holder of the semaphore.
* We cannot make any assumptions about the state of the semaphore or the
@ -621,18 +627,18 @@ void sem_destroyholder(FAR sem_t *sem)
*/
#if CONFIG_SEM_PREALLOCHOLDERS > 0
if (sem->hlist.holder || sem->hlist.flink)
if (sem->hhead)
{
sdbg("Semaphore destroyed with holders\n");
(void)sem_foreachholder(sem, sem_recoverholders, NULL);
}
#else
if (sem->hlist.holder)
if (sem->holder.htcb)
{
sdbg("Semaphore destroyed with holder\n");
}
sem->hlist.holder = NULL;
sem->holder.htcb = NULL;
#endif
}
@ -664,7 +670,7 @@ void sem_addholder(FAR sem_t *sem)
{
/* Then set the holder and increment the number of counts held by this holder */
pholder->holder = rtcb;
pholder->htcb = rtcb;
pholder->counts++;
}
}

View File

@ -174,6 +174,12 @@ int main(int argc, char **argv, char **envp)
printf("#ifndef CONFIG_MM_REGIONS\n");
printf("# define CONFIG_MM_REGIONS 1\n");
printf("#endif\n\n");
printf("/* If the end of RAM is not specified then it is assumed to be the beginning\n");
printf(" * of RAM plus the RAM size.\n");
printf(" */\n\n");
printf("#ifndef CONFIG_DRAM_END\n");
printf("# define CONFIG_DRAM_END (CONFIG_DRAM_START+CONFIG_DRAM_SIZE)\n");
printf("#endif\n\n");
printf("/* If no file streams are configured, then make certain that buffered I/O\n");
printf(" * support is disabled\n");
printf(" */\n\n");
@ -256,6 +262,7 @@ int main(int argc, char **argv, char **envp)
printf("# undef CONFIG_DEBUG_USB\n");
printf("# undef CONFIG_DEBUG_GRAPHICS\n");
printf("# undef CONFIG_DEBUG_GPIO\n");
printf("# undef CONFIG_DEBUG_SPI\n");
printf("# undef CONFIG_DEBUG_STACK\n");
printf("#endif\n\n");
printf("#endif /* __INCLUDE_NUTTX_CONFIG_H */\n");