Merge remote-tracking branch 'upstream/master'
This commit is contained in:
commit
045f0edfac
@ -249,3 +249,55 @@ Configurations
|
||||
CONFIG_HAVE_CXX=y
|
||||
CONFIG_HAVE_CXXINITIALIZE=y
|
||||
CONFIG_EXAMPLES_NSH_CXXINITIALIZE=y
|
||||
|
||||
usbnsh:
|
||||
-------
|
||||
|
||||
This is another NSH example. If differs from other 'nsh' configurations
|
||||
in that this configurations uses a USB serial device for console I/O.
|
||||
Such a configuration is useful on the Clicker2 STM32 which has no
|
||||
builtin RS-232 drivers.
|
||||
|
||||
NOTES:
|
||||
|
||||
1. This configuration does have USART3 output enabled and set up as
|
||||
the system logging device:
|
||||
|
||||
CONFIG_SYSLOG_CHAR=y : Use a character device for system logging
|
||||
CONFIG_SYSLOG_DEVPATH="/dev/ttyS0" : USART3 will be /dev/ttyS0
|
||||
|
||||
However, there is nothing to generate SYLOG output in the default
|
||||
configuration so nothing should appear on USART3 unless you enable
|
||||
some debug output or enable the USB monitor.
|
||||
|
||||
2. 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 logging device (USART3 in this
|
||||
configuration):
|
||||
|
||||
CONFIG_USBDEV_TRACE=y : Enable USB trace feature
|
||||
CONFIG_USBDEV_TRACE_NRECORDS=128 : Buffer 128 records in memory
|
||||
CONFIG_NSH_USBDEV_TRACE=n : No builtin tracing from NSH
|
||||
CONFIG_NSH_ARCHINIT=y : Automatically start the USB monitor
|
||||
CONFIG_USBMONITOR=y : Enable the USB monitor daemon
|
||||
CONFIG_USBMONITOR_STACKSIZE=2048 : USB monitor daemon stack size
|
||||
CONFIG_USBMONITOR_PRIORITY=50 : USB monitor daemon priority
|
||||
CONFIG_USBMONITOR_INTERVAL=2 : Dump trace data every 2 seconds
|
||||
|
||||
CONFIG_USBMONITOR_TRACEINIT=y : Enable TRACE output
|
||||
CONFIG_USBMONITOR_TRACECLASS=y
|
||||
CONFIG_USBMONITOR_TRACETRANSFERS=y
|
||||
CONFIG_USBMONITOR_TRACECONTROLLER=y
|
||||
CONFIG_USBMONITOR_TRACEINTERRUPTS=y
|
||||
|
||||
Using the Prolifics PL2303 Emulation
|
||||
------------------------------------
|
||||
You could also use the non-standard PL2303 serial device instead of
|
||||
the standard CDC/ACM serial device by changing:
|
||||
|
||||
CONFIG_CDCACM=n : Disable the CDC/ACM serial device class
|
||||
CONFIG_CDCACM_CONSOLE=n : The CDC/ACM serial device is NOT the console
|
||||
CONFIG_PL2303=y : The Prolifics PL2303 emulation is enabled
|
||||
CONFIG_PL2303_CONSOLE=y : The PL2303 serial device is the console
|
||||
|
||||
|
@ -148,14 +148,10 @@ CONFIG_ARM_HAVE_MPU_UNIFIED=y
|
||||
# CONFIG_ARMV7M_TOOLCHAIN_CODEREDL is not set
|
||||
# CONFIG_ARMV7M_TOOLCHAIN_CODESOURCERYL is not set
|
||||
CONFIG_ARMV7M_TOOLCHAIN_GNU_EABIL=y
|
||||
# CONFIG_ARMV7M_OABI_TOOLCHAIN is not set
|
||||
CONFIG_ARMV7M_HAVE_STACKCHECK=y
|
||||
# CONFIG_ARMV7M_STACKCHECK is not set
|
||||
# CONFIG_ARMV7M_ITMSYSLOG is not set
|
||||
# CONFIG_SERIAL_TERMIOS is not set
|
||||
# CONFIG_USBHOST_BULK_DISABLE is not set
|
||||
# CONFIG_USBHOST_INT_DISABLE is not set
|
||||
# CONFIG_USBHOST_ISOC_DISABLE is not set
|
||||
|
||||
#
|
||||
# STM32 Configuration Options
|
||||
@ -414,7 +410,7 @@ CONFIG_STM32_HAVE_SPI3=y
|
||||
# CONFIG_STM32_I2C1 is not set
|
||||
# CONFIG_STM32_I2C2 is not set
|
||||
# CONFIG_STM32_I2C3 is not set
|
||||
CONFIG_STM32_OTGFS=y
|
||||
# CONFIG_STM32_OTGFS is not set
|
||||
# CONFIG_STM32_OTGHS is not set
|
||||
CONFIG_STM32_PWR=y
|
||||
# CONFIG_STM32_RNG is not set
|
||||
@ -451,6 +447,7 @@ CONFIG_STM32_USART3=y
|
||||
# Alternate Pin Mapping
|
||||
#
|
||||
# CONFIG_STM32_FLASH_PREFETCH is not set
|
||||
# CONFIG_STM32_FLASH_WORKAROUND_DATA_CACHE_CORRUPTION_ON_RWW is not set
|
||||
# CONFIG_STM32_JTAG_DISABLE is not set
|
||||
# CONFIG_STM32_JTAG_FULL_ENABLE is not set
|
||||
# CONFIG_STM32_JTAG_NOJNTRST_ENABLE is not set
|
||||
@ -504,11 +501,6 @@ CONFIG_STM32_USART3_SERIALDRIVER=y
|
||||
#
|
||||
# USB FS Host Configuration
|
||||
#
|
||||
CONFIG_STM32_OTGFS_RXFIFO_SIZE=128
|
||||
CONFIG_STM32_OTGFS_NPTXFIFO_SIZE=96
|
||||
CONFIG_STM32_OTGFS_PTXFIFO_SIZE=128
|
||||
CONFIG_STM32_OTGFS_DESCSIZE=128
|
||||
# CONFIG_STM32_OTGFS_SOFINTR is not set
|
||||
|
||||
#
|
||||
# USB HS Host Configuration
|
||||
@ -603,6 +595,8 @@ CONFIG_ARCH_IRQBUTTONS=y
|
||||
#
|
||||
# Board-Specific Options
|
||||
#
|
||||
# CONFIG_CLICKER2_STM32_MB1_SPI is not set
|
||||
# CONFIG_CLICKER2_STM32_MB2_SPI is not set
|
||||
# CONFIG_BOARD_CRASHDUMP is not set
|
||||
CONFIG_LIB_BOARDCTL=y
|
||||
# CONFIG_BOARDCTL_RESET is not set
|
||||
@ -843,18 +837,7 @@ CONFIG_USART3_2STOP=0
|
||||
# CONFIG_USART3_DMA is not set
|
||||
# CONFIG_PSEUDOTERM is not set
|
||||
# CONFIG_USBDEV is not set
|
||||
CONFIG_USBHOST=y
|
||||
CONFIG_USBHOST_NPREALLOC=4
|
||||
CONFIG_USBHOST_HAVE_ASYNCH=y
|
||||
# CONFIG_USBHOST_ASYNCH is not set
|
||||
# CONFIG_USBHOST_HUB is not set
|
||||
# CONFIG_USBHOST_COMPOSITE is not set
|
||||
CONFIG_USBHOST_MSC=y
|
||||
# CONFIG_USBHOST_CDCACM is not set
|
||||
# CONFIG_USBHOST_HIDKBD is not set
|
||||
# CONFIG_USBHOST_HIDMOUSE is not set
|
||||
# CONFIG_USBHOST_XBOXCONTROLLER is not set
|
||||
# CONFIG_USBHOST_TRACE is not set
|
||||
# CONFIG_USBHOST is not set
|
||||
# CONFIG_HAVE_USBTRACE is not set
|
||||
# CONFIG_DRIVERS_WIRELESS is not set
|
||||
# CONFIG_DRIVERS_CONTACTLESS is not set
|
||||
@ -1152,6 +1135,7 @@ CONFIG_EXAMPLES_NSH_CXXINITIALIZE=y
|
||||
# CONFIG_EXAMPLES_USBSERIAL is not set
|
||||
# CONFIG_EXAMPLES_WATCHDOG is not set
|
||||
# CONFIG_EXAMPLES_WEBSERVER is not set
|
||||
# CONFIG_EXAMPLES_XBC_TEST is not set
|
||||
|
||||
#
|
||||
# File System Utilities
|
||||
|
122
configs/clicker2-stm32/usbnsh/Make.defs
Normal file
122
configs/clicker2-stm32/usbnsh/Make.defs
Normal file
@ -0,0 +1,122 @@
|
||||
############################################################################
|
||||
# configs/clicker2-stm32/usbnsh/Make.defs
|
||||
#
|
||||
# Copyright (C) 2017 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
|
||||
# are met:
|
||||
#
|
||||
# 1. Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# 2. Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in
|
||||
# the documentation and/or other materials provided with the
|
||||
# distribution.
|
||||
# 3. Neither the name NuttX nor the names of its contributors may be
|
||||
# used to endorse or promote products derived from this software
|
||||
# without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||
# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||
# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||
# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
|
||||
# OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
||||
# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
||||
# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
# POSSIBILITY OF SUCH DAMAGE.
|
||||
#
|
||||
############################################################################
|
||||
|
||||
include ${TOPDIR}/.config
|
||||
include ${TOPDIR}/tools/Config.mk
|
||||
include ${TOPDIR}/arch/arm/src/armv7-m/Toolchain.defs
|
||||
|
||||
LDSCRIPT = flash.ld
|
||||
|
||||
ifeq ($(WINTOOL),y)
|
||||
# Windows-native toolchains
|
||||
DIRLINK = $(TOPDIR)/tools/copydir.sh
|
||||
DIRUNLINK = $(TOPDIR)/tools/unlink.sh
|
||||
MKDEP = $(TOPDIR)/tools/mkwindeps.sh
|
||||
ARCHINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)/include}"
|
||||
ARCHXXINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)/include}" -isystem "${shell cygpath -w $(TOPDIR)/include/cxx}"
|
||||
ARCHSCRIPT = -T "${shell cygpath -w $(TOPDIR)/configs/$(CONFIG_ARCH_BOARD)/scripts/$(LDSCRIPT)}"
|
||||
else
|
||||
# Linux/Cygwin-native toolchain
|
||||
MKDEP = $(TOPDIR)/tools/mkdeps$(HOSTEXEEXT)
|
||||
ARCHINCLUDES = -I. -isystem $(TOPDIR)/include
|
||||
ARCHXXINCLUDES = -I. -isystem $(TOPDIR)/include -isystem $(TOPDIR)/include/cxx
|
||||
ARCHSCRIPT = -T$(TOPDIR)/configs/$(CONFIG_ARCH_BOARD)/scripts/$(LDSCRIPT)
|
||||
endif
|
||||
|
||||
CC = $(CROSSDEV)gcc
|
||||
CXX = $(CROSSDEV)g++
|
||||
CPP = $(CROSSDEV)gcc -E
|
||||
LD = $(CROSSDEV)ld
|
||||
AR = $(CROSSDEV)ar rcs
|
||||
NM = $(CROSSDEV)nm
|
||||
OBJCOPY = $(CROSSDEV)objcopy
|
||||
OBJDUMP = $(CROSSDEV)objdump
|
||||
|
||||
ARCHCCVERSION = ${shell $(CC) -v 2>&1 | sed -n '/^gcc version/p' | sed -e 's/^gcc version \([0-9\.]\)/\1/g' -e 's/[-\ ].*//g' -e '1q'}
|
||||
ARCHCCMAJOR = ${shell echo $(ARCHCCVERSION) | cut -d'.' -f1}
|
||||
|
||||
ifeq ($(CONFIG_DEBUG_SYMBOLS),y)
|
||||
ARCHOPTIMIZATION = -g
|
||||
endif
|
||||
|
||||
ifneq ($(CONFIG_DEBUG_NOOPT),y)
|
||||
ARCHOPTIMIZATION += $(MAXOPTIMIZATION) -fno-strict-aliasing -fno-strength-reduce -fomit-frame-pointer
|
||||
endif
|
||||
|
||||
ARCHCFLAGS = -fno-builtin
|
||||
ARCHCXXFLAGS = -fno-builtin -fno-exceptions -fcheck-new -fno-rtti
|
||||
ARCHWARNINGS = -Wall -Wstrict-prototypes -Wshadow -Wundef
|
||||
ARCHWARNINGSXX = -Wall -Wshadow -Wundef
|
||||
ARCHDEFINES =
|
||||
ARCHPICFLAGS = -fpic -msingle-pic-base -mpic-register=r10
|
||||
|
||||
CFLAGS = $(ARCHCFLAGS) $(ARCHWARNINGS) $(ARCHOPTIMIZATION) $(ARCHCPUFLAGS) $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES) -pipe
|
||||
CPICFLAGS = $(ARCHPICFLAGS) $(CFLAGS)
|
||||
CXXFLAGS = $(ARCHCXXFLAGS) $(ARCHWARNINGSXX) $(ARCHOPTIMIZATION) $(ARCHCPUFLAGS) $(ARCHXXINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES) -pipe
|
||||
CXXPICFLAGS = $(ARCHPICFLAGS) $(CXXFLAGS)
|
||||
CPPFLAGS = $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES)
|
||||
AFLAGS = $(CFLAGS) -D__ASSEMBLY__
|
||||
|
||||
NXFLATLDFLAGS1 = -r -d -warn-common
|
||||
NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-gotoff.ld -no-check-sections
|
||||
LDNXFLATFLAGS = -e main -s 2048
|
||||
|
||||
# Loadable module definitions
|
||||
|
||||
CMODULEFLAGS = $(CFLAGS) -mlong-calls # --target1-abs
|
||||
|
||||
LDMODULEFLAGS = -r -e module_initialize
|
||||
ifeq ($(WINTOOL),y)
|
||||
LDMODULEFLAGS += -T "${shell cygpath -w $(TOPDIR)/libc/modlib/gnu-elf.ld}"
|
||||
else
|
||||
LDMODULEFLAGS += -T $(TOPDIR)/libc/modlib/gnu-elf.ld
|
||||
endif
|
||||
|
||||
ASMEXT = .S
|
||||
OBJEXT = .o
|
||||
LIBEXT = .a
|
||||
EXEEXT =
|
||||
|
||||
ifneq ($(CROSSDEV),arm-nuttx-elf-)
|
||||
LDFLAGS += -nostartfiles -nodefaultlibs
|
||||
endif
|
||||
ifeq ($(CONFIG_DEBUG_SYMBOLS),y)
|
||||
LDFLAGS += -g
|
||||
endif
|
||||
|
||||
HOSTCC = gcc
|
||||
HOSTINCLUDES = -I.
|
||||
HOSTCFLAGS = -Wall -Wstrict-prototypes -Wshadow -Wundef -g -pipe
|
||||
HOSTLDFLAGS =
|
1353
configs/clicker2-stm32/usbnsh/defconfig
Normal file
1353
configs/clicker2-stm32/usbnsh/defconfig
Normal file
File diff suppressed because it is too large
Load Diff
80
configs/clicker2-stm32/usbnsh/setenv.sh
Normal file
80
configs/clicker2-stm32/usbnsh/setenv.sh
Normal file
@ -0,0 +1,80 @@
|
||||
#!/bin/bash
|
||||
# configs/clicker2-stm32/usbnsh/setenv.sh
|
||||
#
|
||||
# Copyright (C) 2017 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
|
||||
# are met:
|
||||
#
|
||||
# 1. Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# 2. Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in
|
||||
# the documentation and/or other materials provided with the
|
||||
# distribution.
|
||||
# 3. Neither the name NuttX nor the names of its contributors may be
|
||||
# used to endorse or promote products derived from this software
|
||||
# without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||
# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||
# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||
# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
|
||||
# OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
||||
# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
||||
# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
# POSSIBILITY OF SUCH DAMAGE.
|
||||
#
|
||||
|
||||
if [ "$_" = "$0" ] ; then
|
||||
echo "You must source this script, not run it!" 1>&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
WD=`pwd`
|
||||
if [ ! -x "setenv.sh" ]; then
|
||||
echo "This script must be executed from the top-level NuttX build directory"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ -z "${PATH_ORIG}" ]; then
|
||||
export PATH_ORIG="${PATH}"
|
||||
fi
|
||||
|
||||
# This is the Cygwin path to the location where I installed the CodeSourcery
|
||||
# toolchain under windows. You will also have to edit this if you install
|
||||
# the CodeSourcery toolchain in any other location
|
||||
#export TOOLCHAIN_BIN="/cygdrive/c/Program Files (x86)/CodeSourcery/Sourcery G++ Lite/bin"
|
||||
#export TOOLCHAIN_BIN="/cygdrive/c/Program Files (x86)/CodeSourcery/Sourcery_CodeBench_Lite_for_ARM_EABI/bin"
|
||||
# export TOOLCHAIN_BIN="/cygdrive/c/Users/MyName/MentorGraphics/Sourcery_CodeBench_Lite_for_ARM_EABI/bin"
|
||||
|
||||
# This is the location where I installed the ARM "GNU Tools for ARM Embedded Processors"
|
||||
# You can this free toolchain here https://launchpad.net/gcc-arm-embedded
|
||||
export TOOLCHAIN_BIN="/cygdrive/c/Program Files (x86)/GNU Tools ARM Embedded/4.9 2015q2/bin"
|
||||
|
||||
# This is the path to the location where I installed the devkitARM toolchain
|
||||
# You can get this free toolchain from http://devkitpro.org/ or http://sourceforge.net/projects/devkitpro/
|
||||
#export TOOLCHAIN_BIN="/cygdrive/c/Program Files (x86)/devkitARM/bin"
|
||||
|
||||
# These are the Cygwin paths to the locations where I installed the Atollic
|
||||
# toolchain under windows. You will also have to edit this if you install
|
||||
# the Atollic toolchain in any other location. /usr/bin is added before
|
||||
# the Atollic bin path because there is are binaries named gcc.exe and g++.exe
|
||||
# at those locations as well.
|
||||
#export TOOLCHAIN_BIN="/usr/bin:/cygdrive/c/Program Files (x86)/Atollic/TrueSTUDIO for ARM Pro 2.3.0/ARMTools/bin"
|
||||
#export TOOLCHAIN_BIN="/usr/bin:/cygdrive/c/Program Files (x86)/Atollic/TrueSTUDIO for STMicroelectronics STM32 Lite 2.3.0/ARMTools/bin"
|
||||
|
||||
# This is the Cygwin path to the location where I build the buildroot
|
||||
# toolchain.
|
||||
# export TOOLCHAIN_BIN="${WD}/../buildroot/build_arm_nofpu/staging_dir/bin"
|
||||
|
||||
# Add the path to the toolchain to the PATH varialble
|
||||
export PATH="${TOOLCHAIN_BIN}:/sbin:/usr/sbin:${PATH_ORIG}"
|
||||
|
||||
echo "PATH : ${PATH}"
|
Loading…
Reference in New Issue
Block a user