Merge remote-tracking branch 'origin/master' into composite

This commit is contained in:
Gregory Nutt
2017-07-10 11:07:36 -06:00
431 changed files with 23162 additions and 433988 deletions

1
.gitignore vendored
View File

@@ -13,6 +13,7 @@ core
/.config
/.config.old
/.version
/defconfig
/Make.defs
/nuttx
/nuttx.*

View File

@@ -8,7 +8,7 @@
<tr align="center" bgcolor="#e4e4e4">
<td>
<h1><big><font color="#3c34ec"><i>NuttX RTOS</i></font></big></h1>
<p>Last Updated: June 5, 2017</p>
<p>Last Updated: July 8, 2017</p>
</td>
</tr>
</table>
@@ -796,6 +796,14 @@
</p>
</td>
</tr>
<tr>
<td><br></td>
<td>
<p>
<li>IP Forwarding.</li>
</p>
</td>
</tr>
<tr>
<td><br></td>
<td>

View File

@@ -515,6 +515,18 @@ do_gconfig: dirlinks apps_preconfig
gconfig: do_gconfig clean_context
do_savedefconfig: dirlinks apps_preconfig
savedefconfig: do_savedefconfig
$(Q) APPSDIR=${CONFIG_APPS_DIR} kconfig-conf --savedefconfig defconfig.tmp Kconfig
$(Q) sed -i -e "/CONFIG_APPS_DIR=/d" defconfig.tmp
$(Q) grep "CONFIG_ARCH=" .config >> defconfig.tmp
-$(Q) grep "^CONFIG_ARCH_CHIP_" .config >> defconfig.tmp
-$(Q) grep "CONFIG_ARCH_BOARD=" .config && grep "CONFIG_ARCH_BOARD=" .config >> defconfig.tmp
-$(Q) grep "^CONFIG_ARCH_CUSTOM" .config && grep "^CONFIG_ARCH_CUSTOM" .config >> defconfig.tmp
$(Q) cat defconfig.tmp | sort | uniq > defconfig
$(Q) rm -f defconfig.tmp
# export
#
# The export target will package the NuttX libraries and header files into

View File

@@ -501,6 +501,18 @@ do_menuconfig: dirlinks configenv apps_preconfig
menuconfig: do_menuconfig clean_context
do_savedefconfig: dirlinks apps_preconfig
savedefconfig: do_savedefconfig
$(Q) set APPSDIR=$(patsubst "%",%,${CONFIG_APPS_DIR})& kconfig-conf --savedefconfig defconfig.tmp Kconfig
$(Q) sed -i -e "/CONFIG_APPS_DIR=/d" defconfig.tmp
$(Q) grep "CONFIG_ARCH=" .config >> defconfig.tmp
-$(Q) grep "^CONFIG_ARCH_CHIP_" .config >> defconfig.tmp
-$(Q) grep "CONFIG_ARCH_BOARD=" .config >> defconfig.tmp
-$(Q) grep "^CONFIG_ARCH_CUSTOM" .config >> defconfig.tmp
$(Q) cat defconfig.tmp | sort | uniq > defconfig
$(Q) rm -f defconfig.tmp
# export
#
# The export target will package the NuttX libraries and header files into

View File

@@ -19,6 +19,8 @@ README
- Reveal Hidden Configuration Options
- Make Sure that You on on the Right Platform
- Comparing Two Configurations
- Making defconfig Files
- Configuring with "Compressed" defconfig Files
- Incompatibilities with Older Configurations
- NuttX Configuration Tool under DOS
o Toolchains
@@ -41,7 +43,7 @@ ENVIRONMENTS
NuttX requires a POSIX development environment such as you would find under
Linux or OSX. NuttX may be also be installed and built on Windows system
if you also provde such a POSIX development environment. Options for a
if you also provide such a POSIX development environment. Options for a
POSIX development environment under Windows include:
- An installation of Linux on a virtual machine (VM) in Windows. I have
@@ -55,7 +57,7 @@ ENVIRONMENTS
- The Cygwin environment. Instructions for installation of Cygwin on a
Windows system are provided in the following paragraph, "Installing
Cygwin". Cygwin is a mature, well-tested, and very convenient
environment. It is especially expecially convenient if you need to
environment. It is especially especially convenient if you need to
integrate with Windows tools and files. Downsides are that the
installation time is very long and the compile times are slow.
@@ -71,7 +73,7 @@ ENVIRONMENTS
and that configuration will not be discussed in this README file.
See http://www.mingw.org/wiki/MSYS if you are interested in
using MSYS. People report to me that they have used MSYS
successfully. I suppose that the advantages of the MSYS environemnt
successfully. I suppose that the advantages of the MSYS environment
is that it is closer to a native Windows environment and uses only a
minimal of add-on POSIX-land tools.
@@ -124,7 +126,7 @@ Installing Cygwin
instructions assume that you are at a bash command line prompt in
either Linux or in Cygwin shell.
UPDATE: The last time I installed EVERTHING, the download was
UPDATE: The last time I installed EVERYTHING, the download was
about 5GiB. The server I selected was also very slow so it took
over a day to do the whole install!
@@ -179,7 +181,7 @@ Ubuntu Bash under Windows 10
Accessing Windows Files from Ubuntu
-----------------------------------
File sysems will be mounted under "/mnt" so for example "C:\Program Files"
File systems will be mounted under "/mnt" so for example "C:\Program Files"
appears at "/mnt/c/Program Files". This is as opposed to Cgwin where
the same directory would appear at "/cygdrive/c/Program Files".
@@ -270,7 +272,7 @@ Ubuntu Bash under Windows 10
The Ubuntu version support by Microsoft is a command-line only version.
There is no support for Linux graphics utilities.
This limititation is not a limitation of Ubuntu, however, only in what
This limitation is not a limitation of Ubuntu, however, only in what
Microsoft is willing to support. If you install a X-Server, then you
can also use basic graphics utilities. See for example:
@@ -491,7 +493,7 @@ Notes about Header Files
Certain header files, such as setjmp.h, stdarg.h, and math.h, may still
be needed from your toolchain and your compiler may not, however, be able
to find these if you compile NuttX without using standard header files
(ie., with -nostdinc). If that is the case, one solution is to copy
(i.e., with -nostdinc). If that is the case, one solution is to copy
those header file from your toolchain into the NuttX include directory.
Duplicated Header Files.
@@ -513,7 +515,7 @@ Notes about Header Files
been tuned for your CPU. Sometimes such such tuned math libraries are
bundled with your toolchain.
The math libary header file, math.h, is a then special case. If you do
The math library header file, math.h, is a then special case. If you do
nothing, the standard math.h header file that is provided with your
toolchain will be used.
@@ -583,7 +585,7 @@ Instantiating "Canned" Configurations
included in the build and what is not. This file is also used
to generate a C configuration header at include/nuttx/config.h.
Copy other, environment-specic files to ${TOPDIR
Copy other, environment-specific files to ${TOPDIR
This might include files like .gdbinit or IDE configuration files
like .project or .cproject.
@@ -652,10 +654,10 @@ Refreshing Configurations
NuttX Configuration Tool
------------------------
An automated tool has been incorported to support re-configuration
An automated tool has been incorporated to support re-configuration
of NuttX. This automated tool is based on the kconfig-frontends
application available at http://ymorin.is-a-geek.org/projects/kconfig-frontends
(A snapshot of this tool is also available fromo the tools repository at
(A snapshot of this tool is also available from the tools repository at
https://bitbucket.org/nuttx/tools). This application provides a tool
called 'kconfig-mconf' that is used by the NuttX top-level Makefile.
The following make target is provided:
@@ -731,7 +733,7 @@ NuttX Configuration Tool
make gconfig
Some keyboard shortcus supported by kconfig-mconf, the tool that runs
Some keyboard shortcuts supported by kconfig-mconf, the tool that runs
when you do 'make menuconfig':
- '?' will bring up the mconfig help display.
@@ -752,7 +754,7 @@ Finding Selections in the Configuration Menus
narrow things down.
But if you know exactly what configuration setting you want to select,
say CONFIG_XYZ, but not where to find it, then the 'make memconfig'
say CONFIG_XYZ, but not where to find it, then the 'make menuconfig'
version of the tool offers some help: By pressing the '/' key, the
tool will bring up a menu that will allow you to search for a
configuration item. Just enter the string CONFIG_XYZ and press 'ENTER'.
@@ -849,6 +851,78 @@ Comparing Two Configurations
manual configurations to the current configurations based on the
kconfig-frontends tools. See the following paragraph.
Making defconfig Files
----------------------
The minimum defconfig file is simply the generated .config file with
CONFIG_APPS_DIR setting removed or commented out. That setting provides
the name and location of the apps/ directory relative to the nuttx build
directory. The default is ../apps/, however, the apps directory may be
any other location and may have a different name. For example, the name
of versioned NuttX releases are always in the form apps-xx.yy where xx.yy
is the version number.
When the default configuration is installed using on of the scripts or
programs in the NuttX tools directory, there will be an option to provide
the path to the apps/ directory. If not provided, then the configure tool
will look around and try to make a reasonable decision about where the
apps/ directory is located.
The Makefile also supports an option to generate very small defconfig
files. The .config files are quite large and complex. But most of the
settings in the .config file simply have the default settings from the
Kconfig files. These .config files can be converted into small defconfig
file:
make savedefconfig
That make target will generate a defconfig file in the top-level
directory. The size reduction is really quite remarkable:
$ wc -l .config defconfig
1085 .config
82 defconfig
1167 total
In order to be usable, the .config file installed from the compressed
defconfig file must be reconstituted using:
make olddefconfig
CAUTION: There is only one caution. This size reduction was
accomplished by removing all setting from the .config file that were at
the default value. 'make olddefconfig' can regenerate the original
.config file by simply restoring those default settings. The underlying
assumption here is, of course, that the default settings do not change.
If the default settings change, and they often do, then the original
.config may not be reproducible.
Configuring with "Compressed" defconfig Files
---------------------------------------------
2017-07-08: Currently all defconfig files are in .config form. However,
in the long term I would hope that the defconfig files will eventual
all be converted to the "compressed" defconfig format. This would be
a great savings in the total size of the NuttX files.
As described in the previous section, "Making defconfig Files," defconfig
files may be "compressed" using 'make savedeconfig'. These compressed
defconfig files may not be fully usable and may not build the target
binaries that you want because the compression process removed all of the
default settings from the defconfig file. To restore the default
settings, you should run the following after configuring:
make olddefconfig
That will restore the the missing defaulted values.
Using this command after configuring is generally a good practice anyway:
Even if the defconfig files are not "compressed" in this fashion, the
defconfig file may be old and the only way to assure that the installed
.config is is uptodate is via 'make oldconfig' or 'make olddefconfig'.
See the paragraph above entitled ""Refreshing Configurations" for
additional information.
Incompatibilities with Older Configurations
-------------------------------------------
@@ -924,7 +998,7 @@ NuttX Configuration Tool under DOS
directly in the Windows console window. In this case, you do not
have to modify the .config file, but there are other complexities:
a. You need to temporarily set the Cgywin directories in the PATH
a. You need to temporarily set the Cygwin directories in the PATH
variable then run kconfig-mconf manually like:
kconfig-mconf Kconfig
@@ -957,7 +1031,7 @@ Cross-Development Toolchains
tools and development environments for use with your board.
In any case, the PATH environment variable will need to be updated to
include the loction where the build can find the toolchain binaries.
include the location where the build can find the toolchain binaries.
NuttX Buildroot Toolchain
-------------------------
@@ -1064,7 +1138,7 @@ Re-building
build is still using the version of the file in the copied directory, not
your modified file!
Older versions of NuttX did not support dependiencies in this
Older versions of NuttX did not support dependencies in this
configuration. So a simple work around this annoying behavior in this
case was the following when you re-build:
@@ -1075,7 +1149,7 @@ Re-building
However, more recent versions of NuttX do support dependencies for the
Cygwin build. As a result, the above command will cause everything to be
rebuilt (beause it removes and will cause recreating the
rebuilt (because it removes and will cause recreating the
include/nuttx/config.h header file). A much less gracefully but still
effective command in this case is the following for the ARM configuration:
@@ -1310,7 +1384,7 @@ Window Native Toolchain Issues
There are many popular Windows native toolchains that may be used with NuttX.
Examples include CodeSourcery (for Windows), devkitARM, and several vendor-
provied toolchains. There are several limitations with using a and Windows
provided toolchains. There are several limitations with using a and Windows
based toolchain in a Cygwin environment. The three biggest are:
1. The Windows toolchain cannot follow Cygwin paths. Path conversions are
@@ -1392,7 +1466,7 @@ Building Original Linux Boards in Cygwin
be used in each configuration. It is possible to change the default
setup. Here, for example, is what you must do in order to compile a
default Linux configuration in the Cygwin environment using the
CodeSourceery for Windows toolchain. After instantiating a "canned"
CodeSourcery for Windows toolchain. After instantiating a "canned"
NuttX configuration, run the target 'menuconfig' and set the following
items:

View File

@@ -310,7 +310,7 @@ void netdriver_loop(void)
else
#endif
{
nwarn("WARNING: Unsupported Ethernet type %u\n", eth->type)
nwarn("WARNING: Unsupported Ethernet type %u\n", eth->type);
}
}
}

View File

@@ -1166,6 +1166,15 @@ config ARCH_BOARD_STM32F746_WS
---help---
Waveshare STM32F746 development board featuring the STM32F746IG MCU.
config ARCH_BOARD_B_L475E_IOT01A
bool "STMicro IoT Discovery kit"
depends on ARCH_CHIP_STM32L475VG
select ARCH_HAVE_LEDS
---help---
STMicro IoT development board featuring the STM32L475VG
MCU. The STM32L475VG is a Cortex-M4 optimised for low-power operation
at up to 80MHz operation with 1024Kb Flash memory and 96+32Kb SRAM.
config ARCH_BOARD_STM32L476VG_DISCO
bool "STMicro STM32L476VG -Discovery board"
depends on ARCH_CHIP_STM32L476RG
@@ -1613,6 +1622,7 @@ config ARCH_BOARD
default "stm32f429i-disco" if ARCH_BOARD_STM32F429I_DISCO
default "stm32f746g-disco" if ARCH_BOARD_STM32F746G_DISCO
default "stm32f746-ws" if ARCH_BOARD_STM32F746_WS
default "b-l475e-iot01a" if ARCH_BOARD_B_L475E_IOT01A
default "stm32l476vg-disco" if ARCH_BOARD_STM32L476VG_DISCO
default "stm32l476-mdk" if ARCH_BOARD_STM32L476_MDK
default "stm32ldiscovery" if ARCH_BOARD_STM32L_DISCOVERY
@@ -2004,6 +2014,9 @@ endif
if ARCH_BOARD_STM32F746G_DISCO
source "configs/stm32f746g-disco/Kconfig"
endif
if ARCH_BOARD_B_L475E_IOT01A
source "configs/b-l475e-iot01a/Kconfig"
endif
if ARCH_BOARD_STM32F746_WS
source "configs/stm32f746-ws/Kconfig"
endif

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,10 @@
#
# For a description of the syntax of this configuration file,
# see the file kconfig-language.txt in the NuttX tools repository.
#
# if ARCH_BOARD_B_L475E_IOT01A
# TODO
# endif

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,149 @@
/************************************************************************************
* configs/b-l475e-iot01a/include/board.h
*
* Copyright (C) 2017 Gregory Nutt. All rights reserved.
* Author: Simon Piriou <spiriou31@gmail.com>
*
* 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.
*
************************************************************************************/
#ifndef __CONFIG_B_L475E_IOT01A_INCLUDE_BOARD_H
#define __CONFIG_B_L475E_IOT01A_INCLUDE_BOARD_H
/************************************************************************************
* Included Files
************************************************************************************/
#include <nuttx/config.h>
#ifndef __ASSEMBLY__
# include <stdbool.h>
#endif
#include <stm32l4.h>
/************************************************************************************
* Pre-processor Definitions
************************************************************************************/
/* Clocking *************************************************************************/
#include <arch/board/b-l475e-iot01a_clock.h>
/* LED definitions ******************************************************************/
/* LEDs
*
* Two user LEDs are available on pins PA5 and PB14.
*/
/* LED index values for use with board_userled() */
#define BOARD_LED1 0
#define BOARD_LED2 1
#define BOARD_NLEDS 2
/* LED bits for use with board_userled_all() */
#define BOARD_LED1_BIT (1 << BOARD_LED1)
#define BOARD_LED2_BIT (1 << BOARD_LED2)
/* These LEDs are not used by the board port unless CONFIG_ARCH_LEDS is
* defined. In that case, the usage by the board port is defined in
* include/board.h and src/sam_autoleds.c. The LEDs are used to encode
* OS-related events as follows:
*
* ------------------- ---------------------------- ------
* SYMBOL Meaning LED
* ------------------- ---------------------------- ------ */
#define LED_STARTED 0 /* NuttX has been started OFF */
#define LED_HEAPALLOCATE 0 /* Heap has been allocated OFF */
#define LED_IRQSENABLED 0 /* Interrupts enabled OFF */
#define LED_STACKCREATED 1 /* Idle stack created ON */
#define LED_INIRQ 2 /* In an interrupt N/C */
#define LED_SIGNAL 2 /* In a signal handler N/C */
#define LED_ASSERTION 2 /* An assertion failed N/C */
#define LED_PANIC 3 /* The system has crashed FLASH */
#undef LED_IDLE /* MCU is is sleep mode Not used */
/* Thus if LED is statically on, NuttX has successfully booted and is,
* apparently, running normally. If LED is flashing at approximately
* 2Hz, then a fatal error has been detected and the system has halted.
*/
/* Alternate function pin selections ************************************************/
/* USART1: Connected to STLink Debug via PB6, PB7 */
#define GPIO_USART1_RX GPIO_USART1_RX_2
#define GPIO_USART1_TX GPIO_USART1_TX_2
/* UART4: Connected to arduino compatible pins DO/D1 via PA0, PA1 */
#define GPIO_UART4_RX GPIO_UART4_RX_1
#define GPIO_UART4_TX GPIO_UART4_TX_1
/************************************************************************************
* Public Data
************************************************************************************/
#ifndef __ASSEMBLY__
#undef EXTERN
#if defined(__cplusplus)
#define EXTERN extern "C"
extern "C"
{
#else
#define EXTERN extern
#endif
/************************************************************************************
* Public Function Prototypes
************************************************************************************/
/************************************************************************************
* Name: stm32_boardinitialize
*
* Description:
* All STM32 architectures must provide the following entry point. This entry point
* is called early in the initialization -- after all memory has been configured
* and mapped but before any devices have been initialized.
*
************************************************************************************/
void stm32_boardinitialize(void);
#undef EXTERN
#if defined(__cplusplus)
}
#endif
#endif /* __ASSEMBLY__ */
#endif /* __CONFIG_B_L475E_IOT01A_INCLUDE_BOARD_H */

View File

@@ -0,0 +1,118 @@
############################################################################
# configs/b-l475e-iot01a/nsh/Make.defs
#
# Copyright (C) 2017 Gregory Nutt. All rights reserved.
#
# 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
# TODO add stm32 bootloader support
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 = $(ARCROSSDEV)ar rcs
NM = $(ARCROSSDEV)nm
OBJCOPY = $(CROSSDEV)objcopy
OBJDUMP = $(CROSSDEV)objdump
# See http://dfu-util.sourceforge.net/
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-pcrel.ld -no-check-sections
LDNXFLATFLAGS = -e main -s 2048
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 =
define DOWNLOAD
$(Q) echo "Download firmware $(1).bin"
$(Q) st-flash write $(1).bin 0x08000000
endef

View File

@@ -0,0 +1,44 @@
# CONFIG_NSH_ARGCAT is not set
# CONFIG_NSH_CMDOPT_DF_H is not set
# CONFIG_NSH_CMDOPT_HEXDUMP is not set
# CONFIG_NSH_CMDPARMS is not set
CONFIG_ARCH_BOARD_B_L475E_IOT01A=y
CONFIG_ARCH_BOARD="b-l475e-iot01a"
CONFIG_ARCH_CHIP_STM32L4=y
CONFIG_ARCH_CHIP_STM32L475VG=y
CONFIG_ARCH_STACKDUMP=y
CONFIG_ARCH="arm"
CONFIG_BOARD_LOOPSPERMSEC=16717
CONFIG_BUILTIN=y
CONFIG_DISABLE_POLL=y
CONFIG_EXAMPLES_NSH=y
CONFIG_FS_PROCFS=y
CONFIG_HAVE_CXX=y
CONFIG_HAVE_CXXINITIALIZE=y
CONFIG_INTELHEX_BINARY=y
CONFIG_MAX_TASKS=16
CONFIG_MAX_WDOGPARMS=2
CONFIG_MM_REGIONS=2
CONFIG_NFILE_DESCRIPTORS=8
CONFIG_NFILE_STREAMS=8
CONFIG_NSH_ARCHINIT=y
CONFIG_NSH_BUILTIN_APPS=y
CONFIG_NSH_FILEIOSIZE=512
CONFIG_NSH_LINELEN=64
CONFIG_NSH_READLINE=y
CONFIG_PREALLOC_MQ_MSGS=4
CONFIG_PREALLOC_TIMERS=4
CONFIG_PREALLOC_WDOGS=16
CONFIG_RAM_SIZE=114688
CONFIG_RAM_START=0x20000000
CONFIG_RAW_BINARY=y
CONFIG_RR_INTERVAL=200
CONFIG_SCHED_WAITPID=y
CONFIG_SDCLONE_DISABLE=y
CONFIG_START_DAY=6
CONFIG_START_MONTH=12
CONFIG_START_YEAR=2011
CONFIG_STM32L4_UART4=y
CONFIG_UART4_SERIAL_CONSOLE=y
CONFIG_USER_ENTRYPOINT="nsh_main"
CONFIG_WATCHDOG=y

View File

@@ -0,0 +1,120 @@
/****************************************************************************
* configs/b-l475e-iot01a/scripts/flash.ld
*
* Copyright (C) 2017 Gregory Nutt. All rights reserved.
*
* 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.
*
****************************************************************************/
/* The STM32L475VG has 1024Kb of FLASH beginning at address 0x0800:0000 and
* 128Kb of SRAM. SRAM is split up into three blocks:
*
* 1) 96Kb of SRAM beginning at address 0x2000:0000
* 2) 32Kb of SRAM beginning at address 0x2001:8000
*
* When booting from FLASH, FLASH memory is aliased to address 0x0000:0000
* where the code expects to begin execution by jumping to the entry point in
* the 0x0800:0000 address
* range.
*/
MEMORY
{
flash (rx) : ORIGIN = 0x08000000, LENGTH = 1024K
sram (rwx) : ORIGIN = 0x20000000, LENGTH = 128K
}
OUTPUT_ARCH(arm)
ENTRY(_stext)
SECTIONS
{
.text : {
_stext = ABSOLUTE(.);
*(.vectors)
*(.text .text.*)
*(.fixup)
*(.gnu.warning)
*(.rodata .rodata.*)
*(.gnu.linkonce.t.*)
*(.glue_7)
*(.glue_7t)
*(.got)
*(.gcc_except_table)
*(.gnu.linkonce.r.*)
_etext = ABSOLUTE(.);
} > flash
.init_section : {
_sinit = ABSOLUTE(.);
*(.init_array .init_array.*)
_einit = ABSOLUTE(.);
} > flash
.ARM.extab : {
*(.ARM.extab*)
} > flash
__exidx_start = ABSOLUTE(.);
.ARM.exidx : {
*(.ARM.exidx*)
} > flash
__exidx_end = ABSOLUTE(.);
_eronly = ABSOLUTE(.);
.data : {
_sdata = ABSOLUTE(.);
*(.data .data.*)
*(.gnu.linkonce.d.*)
CONSTRUCTORS
_edata = ABSOLUTE(.);
} > sram AT > flash
.bss : {
_sbss = ABSOLUTE(.);
*(.bss .bss.*)
*(.gnu.linkonce.b.*)
*(COMMON)
_ebss = ABSOLUTE(.);
} > sram
/* Stabs debugging sections. */
.stab 0 : { *(.stab) }
.stabstr 0 : { *(.stabstr) }
.stab.excl 0 : { *(.stab.excl) }
.stab.exclstr 0 : { *(.stab.exclstr) }
.stab.index 0 : { *(.stab.index) }
.stab.indexstr 0 : { *(.stab.indexstr) }
.comment 0 : { *(.comment) }
.debug_abbrev 0 : { *(.debug_abbrev) }
.debug_info 0 : { *(.debug_info) }
.debug_line 0 : { *(.debug_line) }
.debug_pubnames 0 : { *(.debug_pubnames) }
.debug_aranges 0 : { *(.debug_aranges) }
}

2
configs/b-l475e-iot01a/src/.gitignore vendored Normal file
View File

@@ -0,0 +1,2 @@
/.depend
/Make.dep

View File

@@ -0,0 +1,50 @@
############################################################################
# configs/b-l475e-iot01a/src/Makefile
#
# Copyright (C) 2017 Gregory Nutt. All rights reserved.
#
# 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)/Make.defs
ASRCS =
CSRCS = stm32_boot.c stm32_bringup.c
ifeq ($(CONFIG_LIB_BOARDCTL),y)
CSRCS += stm32_appinit.c
endif
ifeq ($(CONFIG_ARCH_LEDS),y)
CSRCS += stm32_autoleds.c
else
CSRCS += stm32_userleds.c
endif
include $(TOPDIR)/configs/Board.mk

View File

@@ -0,0 +1,88 @@
/****************************************************************************
* configs/b-l475e-iot01a/src/b-l475e-iot01a.h
*
* Copyright (C) 2017 Gregory Nutt. All rights reserved.
* Author: Simon Piriou <spiriou31@gmail.com>
*
* 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.
*
****************************************************************************/
#ifndef __CONFIGS_B_L475E_IOT01A_SRC_B_L475E_IOT01A_H
#define __CONFIGS_B_L475E_IOT01A_SRC_B_L475E_IOT01A_H
/****************************************************************************
* Included Files
****************************************************************************/
#include <nuttx/config.h>
#include <nuttx/compiler.h>
#include <arch/stm32l4/chip.h>
/****************************************************************************
* Pre-processor Definitions
****************************************************************************/
/* LEDs */
#define GPIO_LED1 (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_50MHz|\
GPIO_OUTPUT_CLEAR|GPIO_PORTA|GPIO_PIN5)
#define GPIO_LED2 (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_50MHz|\
GPIO_OUTPUT_CLEAR|GPIO_PORTB|GPIO_PIN14)
/****************************************************************************
* Public Types
****************************************************************************/
/****************************************************************************
* Public data
****************************************************************************/
#ifndef __ASSEMBLY__
/****************************************************************************
* Public Functions
****************************************************************************/
/****************************************************************************
* Name: stm32_bringup
*
* Description:
* Called either by board_intialize() if CONFIG_BOARD_INITIALIZE or by
* board_app_initialize if CONFIG_LIB_BOARDCTL is selected. This function
* initializes and configures all on-board features appropriate for the
* selected configuration.
*
****************************************************************************/
#if defined(CONFIG_LIB_BOARDCTL) || defined(CONFIG_BOARD_INITIALIZE)
int stm32l4_bringup(void);
#endif
#endif /* __ASSEMBLY__ */
#endif /* __CONFIGS_B_L475E_IOT01A_SRC_B_L475E_IOT01A_H */

View File

@@ -0,0 +1,90 @@
/****************************************************************************
* config/b-l475e-iot01a/src/stm32_appinit.c
*
* 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.
*
****************************************************************************/
/****************************************************************************
* Included Files
****************************************************************************/
#include <nuttx/config.h>
#include <sys/types.h>
#include <nuttx/board.h>
#include "b-l475e-iot01a.h"
#ifdef CONFIG_LIB_BOARDCTL
/****************************************************************************
* Public Functions
****************************************************************************/
/****************************************************************************
* Name: board_app_initialize
*
* Description:
* Perform application specific initialization. This function is never
* called directly from application code, but only indirectly via the
* (non-standard) boardctl() interface using the command BOARDIOC_INIT.
*
* Input Parameters:
* arg - The boardctl() argument is passed to the board_app_initialize()
* implementation without modification. The argument has no
* meaning to NuttX; the meaning of the argument is a contract
* between the board-specific initalization logic and the
* matching application logic. The value cold be such things as a
* mode enumeration value, a set of DIP switch switch settings, a
* pointer to configuration data read from a file or serial FLASH,
* or whatever you would like to do with it. Every implementation
* should accept zero/NULL as a default configuration.
*
* Returned Value:
* Zero (OK) is returned on success; a negated errno value is returned on
* any failure to indicate the nature of the failure.
*
****************************************************************************/
int board_app_initialize(uintptr_t arg)
{
#ifndef CONFIG_BOARD_INITIALIZE
/* Perform board initialization */
return stm32l4_bringup();
#else
return OK;
#endif
}
#endif /* CONFIG_LIB_BOARDCTL */

View File

@@ -0,0 +1,116 @@
/****************************************************************************
* configs/b-l475e-iot01a/src/stm32_autoleds.c
*
* 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.
*
****************************************************************************/
/* LEDs
*
* A single LED is available driven by PA13.
*
* These LEDs are not used by the board port unless CONFIG_ARCH_LEDS is
* defined. In that case, the usage by the board port is defined in
* include/board.h and src/sam_autoleds.c. The LEDs are used to encode
* OS-related events as follows:
*
* ------------------- ----------------------- ------
* SYMBOL Meaning LED
* ------------------- ----------------------- ------
* LED_STARTED NuttX has been started OFF
* LED_HEAPALLOCATE Heap has been allocated OFF
* LED_IRQSENABLED Interrupts enabled OFF
* LED_STACKCREATED Idle stack created ON
* LED_INIRQ In an interrupt N/C
* LED_SIGNAL In a signal handler N/C
* LED_ASSERTION An assertion failed N/C
* LED_PANIC The system has crashed FLASH
*
* Thus is LED is statically on, NuttX has successfully booted and is,
* apparently, running normally. If LED is flashing at approximately
* 2Hz, then a fatal error has been detected and the system has halted.
*/
/****************************************************************************
* Included Files
****************************************************************************/
#include <nuttx/config.h>
#include <debug.h>
#include <nuttx/board.h>
#include <arch/board/board.h>
#include "stm32l4_gpio.h"
#include "b-l475e-iot01a.h"
#ifdef CONFIG_ARCH_LEDS
/****************************************************************************
* Public Functions
****************************************************************************/
/****************************************************************************
* Name: board_autoled_initialize
****************************************************************************/
void board_autoled_initialize(void)
{
/* Configure LED gpio as output */
stm32l4_configgpio(GPIO_LED2);
}
/****************************************************************************
* Name: board_autoled_on
****************************************************************************/
void board_autoled_on(int led)
{
if (led == 1 || led == 3)
{
stm32l4_gpiowrite(GPIO_LED2, true);
}
}
/****************************************************************************
* Name: board_autoled_off
****************************************************************************/
void board_autoled_off(int led)
{
if (led == 3)
{
stm32l4_gpiowrite(GPIO_LED2, false);
}
}
#endif /* CONFIG_ARCH_LEDS */

View File

@@ -0,0 +1,91 @@
/************************************************************************************
* configs/b-l475e-iot01a/src/stm32_boot.c
*
* Copyright (C) 2017 Gregory Nutt. All rights reserved.
* Author: Simon Piriou <spiriou31@gmail.com>
*
* 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.
*
************************************************************************************/
/************************************************************************************
* Included Files
************************************************************************************/
#include <nuttx/config.h>
#include <nuttx/board.h>
#include <arch/board/board.h>
#include "up_arch.h"
#include "b-l475e-iot01a.h"
/************************************************************************************
* Public Functions
************************************************************************************/
/************************************************************************************
* Name: stm32_boardinitialize
*
* Description:
* All STM32 architectures must provide the following entry point. This entry point
* is called early in the initialization -- after all memory has been configured
* and mapped but before any devices have been initialized.
*
************************************************************************************/
void stm32l4_boardinitialize(void)
{
#ifdef CONFIG_ARCH_LEDS
/* Configure on-board LEDs if LED support has been selected. */
board_autoled_initialize();
#endif
}
/****************************************************************************
* Name: board_initialize
*
* Description:
* If CONFIG_BOARD_INITIALIZE is selected, then an additional
* initialization call will be performed in the boot-up sequence to a
* function called board_initialize(). board_initialize() will be
* called immediately after up_intitialize() is called and just before the
* initial application is started. This additional initialization phase
* may be used, for example, to initialize board-specific device drivers.
*
****************************************************************************/
#ifdef CONFIG_BOARD_INITIALIZE
void board_initialize(void)
{
/* Perform board initialization */
(void)stm32_bringup();
}
#endif /* CONFIG_BOARD_INITIALIZE */

View File

@@ -0,0 +1,101 @@
/****************************************************************************
* config/b-l475e-iot01a/src/stm32_bringup.c
*
* Copyright (C) 2017 Gregory Nutt. All rights reserved.
* Author: Simon Piriou <spiriou31@gmail.com>
*
* 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.
*
****************************************************************************/
/****************************************************************************
* Included Files
****************************************************************************/
#include <nuttx/config.h>
#include <sys/types.h>
#include <sys/mount.h>
#include <syslog.h>
#include <nuttx/input/buttons.h>
#include <nuttx/leds/userled.h>
#include <nuttx/board.h>
#include <arch/board/board.h>
#include "b-l475e-iot01a.h"
/****************************************************************************
* Public Functions
****************************************************************************/
/****************************************************************************
* Name: stm32l4_bringup
*
* Description:
* Called either by board_intialize() if CONFIG_BOARD_INITIALIZE or by
* board_app_initialize if CONFIG_LIB_BOARDCTL is selected. This function
* initializes and configures all on-board features appropriate for the
* selected configuration.
*
****************************************************************************/
int stm32l4_bringup(void)
{
int ret = OK;
#ifdef CONFIG_FS_PROCFS
/* Mount the procfs file system */
ret = mount(NULL, "/proc", "procfs", 0, NULL);
if (ret < 0)
{
syslog(LOG_ERR, "ERROR: Failed to mount procfs at /proc: %d\n", ret);
}
#endif
#if defined(CONFIG_USERLED) && !defined(CONFIG_ARCH_LEDS)
#ifdef CONFIG_USERLED_LOWER
/* Register the LED driver */
ret = userled_lower_initialize("/dev/userleds");
if (ret != OK)
{
syslog(LOG_ERR, "ERROR: userled_lower_initialize() failed: %d\n", ret);
return ret;
}
#else
/* Enable USER LED support for some other purpose */
board_userled_initialize();
#endif /* CONFIG_USERLED_LOWER */
#endif /* CONFIG_USERLED && !CONFIG_ARCH_LEDS */
return ret;
}

View File

@@ -0,0 +1,92 @@
/****************************************************************************
* configs/b-l475e-iot01a/src/stm32_userleds.c
*
* Copyright (C) 2017 Gregory Nutt. All rights reserved.
* Author: Simon Piriou <spiriou31@gmail.com>
*
* 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.
*
****************************************************************************/
/****************************************************************************
* Included Files
****************************************************************************/
#include <nuttx/config.h>
#include <debug.h>
#include <arch/board/board.h>
#include "b-l475e-iot01a.h"
#include "stm32l4_gpio.h"
#ifndef CONFIG_ARCH_LEDS
/****************************************************************************
* Public Functions
****************************************************************************/
/****************************************************************************
* Name: board_userled_initialize
****************************************************************************/
void board_userled_initialize(void)
{
/* Configure LED gpio as output */
stm32l4_configgpio(GPIO_LED1);
stm32l4_configgpio(GPIO_LED2);
}
/****************************************************************************
* Name: board_userled
****************************************************************************/
void board_userled(int led, bool ledon)
{
if (led == BOARD_LED1)
{
stm32l4_gpiowrite(GPIO_LED1, ledon);
}
else if (led == BOARD_LED2)
{
stm32l4_gpiowrite(GPIO_LED2, ledon);
}
}
/****************************************************************************
* Name: board_userled_all
****************************************************************************/
void board_userled_all(uint8_t ledset)
{
stm32l4_gpiowrite(GPIO_LED1, !!(ledset & BOARD_LED1_BIT));
stm32l4_gpiowrite(GPIO_LED2, !!(ledset & BOARD_LED2_BIT));
}
#endif /* !CONFIG_ARCH_LEDS */

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

Some files were not shown because too many files have changed in this diff Show More