From e87b39e6729e43535a52a1fa4ac153279dbf5628 Mon Sep 17 00:00:00 2001 From: Bob Feretich Date: Tue, 10 Apr 2018 07:12:56 -0600 Subject: [PATCH] configs/indium-f7: Cleanup. Remove nucleo references. Remove xxx-evalos configurations. --- configs/indium-f7/f746-evalos/Make.defs | 115 ------------ configs/indium-f7/f746-evalos/defconfig | 63 ------- configs/indium-f7/f767-evalos/Make.defs | 115 ------------ configs/indium-f7/f767-evalos/defconfig | 63 ------- configs/indium-f7/include/board.h | 16 +- configs/indium-f7/scripts/f722-flash.ld | 45 ++++- configs/indium-f7/src/indium-f7.h | 184 ++++++++++++++------ configs/indium-f7/src/stm32_appinitialize.c | 8 +- 8 files changed, 178 insertions(+), 431 deletions(-) delete mode 100644 configs/indium-f7/f746-evalos/Make.defs delete mode 100644 configs/indium-f7/f746-evalos/defconfig delete mode 100644 configs/indium-f7/f767-evalos/Make.defs delete mode 100644 configs/indium-f7/f767-evalos/defconfig diff --git a/configs/indium-f7/f746-evalos/Make.defs b/configs/indium-f7/f746-evalos/Make.defs deleted file mode 100644 index 67998f798cc..00000000000 --- a/configs/indium-f7/f746-evalos/Make.defs +++ /dev/null @@ -1,115 +0,0 @@ -############################################################################ -# configs/indium-f7/f746-evalos/Make.defs -# -# Copyright (C) 2017 Gregory Nutt. All rights reserved. -# Authors: Gregory Nutt -# Mark Olsson -# David Sidrane -# -# 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 = f746-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 -STRIP = $(CROSSDEV)strip --strip-unneeded -AR = $(ARCROSSDEV)ar rcs -NM = $(ARCROSSDEV)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-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 = diff --git a/configs/indium-f7/f746-evalos/defconfig b/configs/indium-f7/f746-evalos/defconfig deleted file mode 100644 index 35ed6036caf..00000000000 --- a/configs/indium-f7/f746-evalos/defconfig +++ /dev/null @@ -1,63 +0,0 @@ -# CONFIG_ARCH_FPU is not set -# CONFIG_ARCH_LEDS is not set -# CONFIG_DISABLE_OS_API is not set -# CONFIG_NSH_DISABLE_DATE is not set -# CONFIG_NSH_DISABLE_IFCONFIG is not set -# CONFIG_NSH_DISABLE_PS is not set -CONFIG_ARCH_BOARD_INDIUM_F7=y -CONFIG_ARCH_BOARD="indium-f7" -CONFIG_ARCH_CHIP_STM32F7=y -CONFIG_ARCH_CHIP_STM32F746ZG=y -CONFIG_ARCH_STACKDUMP=y -CONFIG_ARCH="arm" -CONFIG_ARMV7M_DCACHE_WRITETHROUGH=y -CONFIG_ARMV7M_DCACHE=y -CONFIG_ARMV7M_DTCM=y -CONFIG_ARMV7M_ICACHE=y -CONFIG_BOARD_LOOPSPERMSEC=43103 -CONFIG_BUILTIN=y -CONFIG_DEBUG_SYMBOLS=y -CONFIG_DISABLE_POLL=y -CONFIG_EXAMPLES_HELLOXX=y -CONFIG_EXAMPLES_LEDS=y -CONFIG_EXAMPLES_NSH_CXXINITIALIZE=y -CONFIG_EXAMPLES_NSH=y -CONFIG_HAVE_CXX=y -CONFIG_HAVE_CXXINITIALIZE=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=4 -CONFIG_PRIORITY_INHERITANCE=y -CONFIG_RAM_SIZE=245760 -CONFIG_RAM_START=0x20010000 -CONFIG_RAW_BINARY=y -CONFIG_READLINE_CMD_HISTORY=y -CONFIG_READLINE_TABCOMPLETION=y -CONFIG_RR_INTERVAL=200 -CONFIG_SCHED_HPWORK=y -CONFIG_SCHED_LPWORK=y -CONFIG_SCHED_WAITPID=y -CONFIG_SDCLONE_DISABLE=y -CONFIG_SERIAL_DISABLE_REORDERING=y -CONFIG_SPI=y -CONFIG_STACK_COLORATION=y -CONFIG_START_DAY=30 -CONFIG_START_MONTH=11 -CONFIG_START_YEAR=2015 -CONFIG_STM32F7_SERIALBRK_BSDCOMPAT=y -CONFIG_STM32F7_USART_BREAKS=y -CONFIG_TASK_NAME_SIZE=0 -CONFIG_USER_ENTRYPOINT="nsh_main" -CONFIG_USERLED_LOWER=y -CONFIG_USERLED=y -CONFIG_WDOG_INTRESERVE=0 diff --git a/configs/indium-f7/f767-evalos/Make.defs b/configs/indium-f7/f767-evalos/Make.defs deleted file mode 100644 index 03a3c1ee7fc..00000000000 --- a/configs/indium-f7/f767-evalos/Make.defs +++ /dev/null @@ -1,115 +0,0 @@ -############################################################################ -# configs/indium-f7/f767-evalos/Make.defs -# -# Copyright (C) 2017 Gregory Nutt. All rights reserved. -# Authors: Gregory Nutt -# Mark Olsson -# David Sidrane -# -# 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 = f767-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 -STRIP = $(CROSSDEV)strip --strip-unneeded -AR = $(ARCROSSDEV)ar rcs -NM = $(ARCROSSDEV)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-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 = diff --git a/configs/indium-f7/f767-evalos/defconfig b/configs/indium-f7/f767-evalos/defconfig deleted file mode 100644 index 5e653276f93..00000000000 --- a/configs/indium-f7/f767-evalos/defconfig +++ /dev/null @@ -1,63 +0,0 @@ -# CONFIG_ARCH_FPU is not set -# CONFIG_ARCH_LEDS is not set -# CONFIG_DISABLE_OS_API is not set -# CONFIG_NSH_DISABLE_DATE is not set -# CONFIG_NSH_DISABLE_IFCONFIG is not set -# CONFIG_NSH_DISABLE_PS is not set -CONFIG_ARCH_BOARD_INDIUM_F7=y -CONFIG_ARCH_BOARD="indium-f7" -CONFIG_ARCH_CHIP_STM32F7=y -CONFIG_ARCH_CHIP_STM32F767ZI=y -CONFIG_ARCH_STACKDUMP=y -CONFIG_ARCH="arm" -CONFIG_ARMV7M_DCACHE_WRITETHROUGH=y -CONFIG_ARMV7M_DCACHE=y -CONFIG_ARMV7M_DTCM=y -CONFIG_ARMV7M_ICACHE=y -CONFIG_BOARD_LOOPSPERMSEC=43103 -CONFIG_BUILTIN=y -CONFIG_DEBUG_SYMBOLS=y -CONFIG_DISABLE_POLL=y -CONFIG_EXAMPLES_HELLOXX=y -CONFIG_EXAMPLES_LEDS=y -CONFIG_EXAMPLES_NSH_CXXINITIALIZE=y -CONFIG_EXAMPLES_NSH=y -CONFIG_HAVE_CXX=y -CONFIG_HAVE_CXXINITIALIZE=y -CONFIG_MAX_TASKS=16 -CONFIG_MAX_WDOGPARMS=2 -CONFIG_MM_REGIONS=3 -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=4 -CONFIG_PRIORITY_INHERITANCE=y -CONFIG_RAM_SIZE=245760 -CONFIG_RAM_START=0x20010000 -CONFIG_RAW_BINARY=y -CONFIG_READLINE_CMD_HISTORY=y -CONFIG_READLINE_TABCOMPLETION=y -CONFIG_RR_INTERVAL=200 -CONFIG_SCHED_HPWORK=y -CONFIG_SCHED_LPWORK=y -CONFIG_SCHED_WAITPID=y -CONFIG_SDCLONE_DISABLE=y -CONFIG_SERIAL_DISABLE_REORDERING=y -CONFIG_SPI=y -CONFIG_STACK_COLORATION=y -CONFIG_START_DAY=30 -CONFIG_START_MONTH=11 -CONFIG_START_YEAR=2015 -CONFIG_STM32F7_SERIALBRK_BSDCOMPAT=y -CONFIG_STM32F7_USART_BREAKS=y -CONFIG_TASK_NAME_SIZE=0 -CONFIG_USER_ENTRYPOINT="nsh_main" -CONFIG_USERLED_LOWER=y -CONFIG_USERLED=y -CONFIG_WDOG_INTRESERVE=0 diff --git a/configs/indium-f7/include/board.h b/configs/indium-f7/include/board.h index cc7edacb6b2..7ddd96fe8ee 100644 --- a/configs/indium-f7/include/board.h +++ b/configs/indium-f7/include/board.h @@ -49,13 +49,6 @@ # include #endif -#ifdef __KERNEL__ -#include "stm32_rcc.h" -#ifdef CONFIG_STM32F7_SDMMC1 -# include "stm32_sdmmc.h" -#endif -#endif - /************************************************************************************ * Pre-processor Definitions ************************************************************************************/ @@ -274,21 +267,20 @@ # define GPIO_SDMMC2_D3 GPIO_SDMMC2_D3_1 #endif -/* DMA Channl/Stream Selections *****************************************************/ +/* DMA Channel/Stream Selections *****************************************************/ /* Stream selections for DMA1 */ #define DMAMAP_I2C1_RX STM32_DMA_MAP(DMA1,DMA_STREAM0,DMA_CHAN1) #define DMAMAP_I2C2_RX STM32_DMA_MAP(DMA1,DMA_STREAM2,DMA_CHAN7) -#define DMAMAP_SPI2_RX STM32_DMA_MAP(DMA1,DMA_STREAM3,DMA_CHAN0) -#define DMAMAP_SPI2_TX STM32_DMA_MAP(DMA1,DMA_STREAM4,DMA_CHAN0) + #define DMAMAP_I2C1_TX STM32_DMA_MAP(DMA1,DMA_STREAM6,DMA_CHAN1) #define DMAMAP_I2C2_TX STM32_DMA_MAP(DMA1,DMA_STREAM7,DMA_CHAN7) /* Stream selections for DMA2 */ -#define DMAMAP_SPI2_RX STM32_DMA_MAP(DMA2,DMA_STREAM0,DMA_CHAN3) +#define DMAMAP_SPI1_RX STM32_DMA_MAP(DMA2,DMA_STREAM0,DMA_CHAN3) #define DMAMAP_USART1_RX STM32_DMA_MAP(DMA2,DMA_STREAM2,DMA_CHAN4) -#define DMAMAP_SPI2_TX STM32_DMA_MAP(DMA2,DMA_STREAM3,DMA_CHAN3) +#define DMAMAP_SPI1_TX STM32_DMA_MAP(DMA2,DMA_STREAM3,DMA_CHAN3) #define DMAMAP_ADC1 STM32_DMA_MAP(DMA2,DMA_STREAM4,DMA_CHAN0) #define DMAMAP_SDMMC1 STM32_DMA_MAP(DMA2,DMA_STREAM6,DMA_CHAN6) #define DMAMAP_USART1_TX STM32_DMA_MAP(DMA2,DMA_STREAM7,DMA_CHAN4) diff --git a/configs/indium-f7/scripts/f722-flash.ld b/configs/indium-f7/scripts/f722-flash.ld index 58b20a6bc6c..48a6d9d26f5 100644 --- a/configs/indium-f7/scripts/f722-flash.ld +++ b/configs/indium-f7/scripts/f722-flash.ld @@ -1,7 +1,7 @@ /**************************************************************************** * configs/indium-f7/scripts/f722-flash.ld * - * Copyright (C) 2017 Gregory Nutt. All rights reserved. + * Copyright (C) 2017, 2018 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * Bob Feretich * @@ -66,6 +66,11 @@ * the 0x0800:0000 address range. */ +/* Size of the 512-byte buffer pool. Must match configs//include/dtcm_defs.h */ + +_Buf_512_size = (64 * 512); /* Size of the 512-byte buffer pool */ +_Buf_256_size = (32 * 256); /* Size of the 256-byte buffer pool */ + MEMORY { itcm (rwx) : ORIGIN = 0x00200000, LENGTH = 512K @@ -80,7 +85,8 @@ EXTERN(_vectors) ENTRY(_stext) SECTIONS { - .text : { + .text : + { _stext = ABSOLUTE(.); *(.vectors) *(.text .text.*) @@ -96,25 +102,30 @@ SECTIONS _etext = ABSOLUTE(.); } > flash - .init_section : { + .init_section : + { _sinit = ABSOLUTE(.); *(.init_array .init_array.*) _einit = ABSOLUTE(.); } > flash - .ARM.extab : { + .ARM.extab : + { *(.ARM.extab*) } > flash __exidx_start = ABSOLUTE(.); - .ARM.exidx : { + + .ARM.exidx : + { *(.ARM.exidx*) } > flash __exidx_end = ABSOLUTE(.); _eronly = ABSOLUTE(.); - .data : { + .data : + { _sdata = ABSOLUTE(.); *(.data .data.*) *(.gnu.linkonce.d.*) @@ -122,7 +133,8 @@ SECTIONS _edata = ABSOLUTE(.); } > sram1 AT > flash - .bss : { + .bss : + { _sbss = ABSOLUTE(.); *(.bss .bss.*) *(.gnu.linkonce.b.*) @@ -130,7 +142,26 @@ SECTIONS _ebss = ABSOLUTE(.); } > sram1 + .dtcm (NOLOAD) : + { + _DTCM_HDR_START = ABSOLUTE(.); /* global variable at dtcm header start */ + KEEP(*(.dtcmstart) ) /* beginning of dtcm header section */ + _DTCM_HDR_END = ABSOLUTE(.); /* global variable at dtcm header end */ + . = ALIGN(512); + _DTCM512_START = ABSOLUTE(.); /* global variable at 512 byte buffer start */ + . = . + _Buf_512_size; + _DTCM512_END = ABSOLUTE(.); /* global variable at 512 byte buffer end */ + . = ALIGN(256); + _DTCM256_START = ABSOLUTE(.); /* global variable at 256 byte buffer start */ + . = . + _Buf_256_size; + _DTCM256_END = ABSOLUTE(.); /* global variable at 256 byte buffer end */ + ASSERT (_DTCM256_END <= 0x20010000, ".dtcm region overflow!"); + *(.dtcmdata) /* beginning of dtcm initialized data */ + *(.dtcmbss) /* beginning of dtcm zeroed data */ + } > dtcm + /* Stabs debugging sections. */ + .stab 0 : { *(.stab) } .stabstr 0 : { *(.stabstr) } .stab.excl 0 : { *(.stab.excl) } diff --git a/configs/indium-f7/src/indium-f7.h b/configs/indium-f7/src/indium-f7.h index 552e240aa39..49abcf07399 100644 --- a/configs/indium-f7/src/indium-f7.h +++ b/configs/indium-f7/src/indium-f7.h @@ -1,7 +1,7 @@ -/************************************************************************************ +/******************************************************************************* * configs/indium-f7/src/indium-f7.h * - * Copyright (C) 2016-2017 Gregory Nutt. All rights reserved. + * Copyright (C) 2016-2018 Gregory Nutt. All rights reserved. * Authors: Gregory Nutt * Mark Olsson * David Sidrane @@ -34,24 +34,24 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - ************************************************************************************/ + ******************************************************************************/ #ifndef __CONFIGS_INDIUM_F7_SRC_INDIUM_F7_H #define __CONFIGS_INDIUM_F7_SRC_INDIUM_F7_H -/************************************************************************************ +/******************************************************************************* * Included Files - ************************************************************************************/ + ******************************************************************************/ #include #include #include -/************************************************************************************ +/******************************************************************************* * Pre-processor Definitions - ************************************************************************************/ + ******************************************************************************/ -/* Configuration ********************************************************************/ +/* Configuration **************************************************************/ /* procfs File System */ #ifdef CONFIG_FS_PROCFS @@ -62,7 +62,31 @@ # endif #endif -/* Indium F7 GPIO Pin Definitions **************************************************/ +/* Indium F7 GPIO set/reset macro ********************************************* + * + * When BOOL == 1, INDIUM_GPIOSR sets the gpio bit specified by the GPR pin + * spec. + * When BOOL == 0, INDIUM_GPIOSR resets the gpio bit specified by the GPR pin + * spec. + * + * The pin spec is the 20-bit encoding described in + * arch/arm/src/stm32f7/stm32_gpio.h. For this macro, only the low order 8 bits + * are used. + */ + +#ifndef STM32_GPIO_INCR +# error "Not defined -> STM32_GPIO_INCR" +#endif + +#ifndef STM32_GPIOA_BSRR +# error "Not defined -> STM32_GPIOA_BSRR" +#endif + +#define INDIUM_GPIOSR(GPR, BOOL) \ + *((uint32_t *)(((GPR & 0x0F0) >> 4) * STM32_GPIO_INCR + STM32_GPIOA_BSRR)) \ + = ((uint32_t)(1 << (16 * (1 - (BOOL & 0x1)) + (GPR & 0x0F)))) + +/* Indium F7 GPIO Pin Definitions ********************************************/ #define GPIO_OUTPUT_INIT_TO_0 GPIO_OUTPUT_CLEAR #define GPIO_OUTPUT_INIT_TO_1 GPIO_OUTPUT_SET @@ -71,25 +95,25 @@ #define GPIO_OSC32_OUT (GPIO_INPUT | GPIO_FLOAT | GPIO_PORTC | GPIO_PIN15) #define GPIO_PD_REQ GPIO_OSC32_OUT -#define GPIO_OSC_IN (GPIO_OUTPUT | GPIO_PUSHPULL | GPIO_SPEED_50MHz | GPIO_OUTPUT_INIT_TO_1 | \ - GPIO_PORTH | GPIO_PIN0) -#define GPIO_VBAT_ENn GPIO_OSC_IN -#define GPIO_OSC_OUT (GPIO_OUTPUT | GPIO_PUSHPULL | GPIO_SPEED_50MHz | GPIO_OUTPUT_INIT_TO_0 | \ - GPIO_PORTH | GPIO_PIN1) -#define GPIO_LED_RED GPIO_OSC_OUT +#define GPIO_OSC_IN (GPIO_OUTPUT | GPIO_PUSHPULL | GPIO_SPEED_50MHz | \ + GPIO_OUTPUT_INIT_TO_0 | GPIO_PORTH | GPIO_PIN0) +#define GPIO_VBAT_ENn GPIO_OSC_IN +#define GPIO_OSC_OUT (GPIO_OUTPUT | GPIO_PUSHPULL | GPIO_SPEED_50MHz | \ + GPIO_OUTPUT_INIT_TO_0 | GPIO_PORTH | GPIO_PIN1) +#define GPIO_LED_RED GPIO_OSC_OUT /* LED * - * The Indium-F7 board has three LEDs, LD1 a Green LED, LD2 a Blue LED, and - * LD3 a Red LED, that can be controlled by software. + * The Indium-F7 board has three LEDs, LD1 a Green LED, LD2 a Blue LED, and + * LD3 a Red LED, that can be controlled by software. */ /* GPIO_LED_RED is defined above in the Oscillator section. */ -#define GPIO_LED_GREEN (GPIO_OUTPUT | GPIO_PUSHPULL | GPIO_SPEED_50MHz | GPIO_OUTPUT_INIT_TO_0 | \ - GPIO_PORTC | GPIO_PIN1) -#define GPIO_LED_BLUE (GPIO_OUTPUT | GPIO_PUSHPULL | GPIO_SPEED_50MHz | GPIO_OUTPUT_INIT_TO_0 | \ - GPIO_PORTA | GPIO_PIN8) +#define GPIO_LED_GREEN (GPIO_OUTPUT | GPIO_PUSHPULL | GPIO_SPEED_50MHz | \ + GPIO_OUTPUT_INIT_TO_0 | GPIO_PORTC | GPIO_PIN1) +#define GPIO_LED_BLUE (GPIO_OUTPUT | GPIO_PUSHPULL | GPIO_SPEED_50MHz | \ + GPIO_OUTPUT_INIT_TO_0 | GPIO_PORTC | GPIO_PIN6) #define GPIO_LD1 GPIO_LED_GREEN #define GPIO_LD2 GPIO_LED_BLUE @@ -97,10 +121,10 @@ #define LED_DRIVER_PATH "/dev/userleds" -/* SPI ***************************************************************************/ +/* SPI ************************************************************************/ #define GPIO_SPI_CS (GPIO_OUTPUT | GPIO_PUSHPULL | GPIO_SPEED_50MHz | \ - GPIO_OUTPUT_INIT_TO_1 ) + GPIO_OUTPUT_INIT_TO_1) #define GPIO_SPI1_CS0 (GPIO_SPI_CS | GPIO_PORTC | GPIO_PIN13) #define GPIO_SPI2_CS0 (GPIO_SPI_CS | GPIO_PORTB | GPIO_PIN1) @@ -114,13 +138,13 @@ #define SPI_CS_ADXL372 GPIO_SPI2_CS2 #define SPI_CS_FRAM GPIO_SPI2_CS3 -/* Logical SPI Chip Selects used to index */ +/* Logical SPI Chip Selects (aka devid) used to index g_spigpio */ -#define NUCLEO_SPI_BUS1_CS0 0 -#define NUCLEO_SPI_BUS2_CS0 1 -#define NUCLEO_SPI_BUS2_CS1 2 -#define NUCLEO_SPI_BUS2_CS2 3 -#define NUCLEO_SPI_BUS2_CS3 4 +#define INDIUM_EXTSPI_IDX_CS0 0 +#define INDIUM_LSM330ACL_IDX_CS0 1 +#define INDIUM_LSM330GYRO_IDX_CS1 2 +#define INDIUM_ADXL372_IDX_CS2 3 +#define INDIUM_FRAM_IDX_CS3 4 #if defined(CONFIG_STM32F7_SDMMC1) || defined(CONFIG_STM32F7_SDMMC2) # define HAVE_SDIO @@ -135,7 +159,7 @@ #ifdef HAVE_SDIO # if defined(CONFIG_STM32F7_SDMMC1) -# define GPIO_SDMMC1_NCD (GPIO_INPUT|GPIO_FLOAT|GPIO_EXTI | GPIO_PORTC | GPIO_PIN6) +# define GPIO_SDMMC1_NCD (GPIO_INPUT|GPIO_FLOAT|GPIO_EXTI | GPIO_PORTC | GPIO_PIN7) # endif # if defined(CONFIG_NSH_MMCSDSLOTNO) && (CONFIG_NSH_MMCSDSLOTNO != 0) @@ -172,49 +196,101 @@ #define GPIO_B5 (GPIO_PORTB | GPIO_PIN5 | GPIO_OUTPUT_INIT_TO_0 | \ GPIO_OUTPUT | GPIO_PUSHPULL | GPIO_FLOAT | GPIO_SPEED_2MHz) #define GPIO_FWENB (GPIO_PORTB | GPIO_PIN0 | GPIO_OUTPUT_INIT_TO_0 | \ - GPIO_OUTPUT | GPIO_PUSHPULL |GPIO_PULLDOWN | GPIO_SPEED_50MHz) + GPIO_OUTPUT | GPIO_PUSHPULL | GPIO_PULLDOWN | GPIO_SPEED_50MHz) +#define GPIO_EXT_RSTn (GPIO_PORTC | GPIO_PIN3 | GPIO_OUTPUT_INIT_TO_1 | \ + GPIO_OUTPUT | GPIO_PUSHPULL | GPIO_PULLDOWN | GPIO_SPEED_50MHz) +#define GPIO_INTA (GPIO_INPUT | GPIO_PORTB | GPIO_PIN2 | GPIO_PULLDOWN) +#define GPIO_EXT_DIO (GPIO_INPUT | GPIO_PORTC | GPIO_PIN2 | GPIO_PULLDOWN) /* Analog Inputs */ -#define GPIO_EXT_ADC (GPIO_ANALOG | GPIO_PORTC | GPIO_PIN4) -#define GPIO_BATT_ADC (GPIO_ANALOG | GPIO_PORTC | GPIO_PIN0) +#define GPIO_EXT_ADC (GPIO_ANALOG | GPIO_PORTC | GPIO_PIN4) +#define GPIO_BATT_ADC (GPIO_ANALOG | GPIO_PORTC | GPIO_PIN0) -/************************************************************************************ +/******************************************************************************* * Public data - ************************************************************************************/ + ******************************************************************************/ #ifndef __ASSEMBLY__ -/************************************************************************************ +/******************************************************************************* * Public Functions - ************************************************************************************/ + ******************************************************************************/ -/************************************************************************************ +/******************************************************************************* * Name: stm32_spidev_initialize * * Description: - * Called to configure SPI chip select GPIO pins for the Nucleo-144 board. + * Called to configure SPI chip select GPIO pins for the Indium-F7 board. * - ************************************************************************************/ + ******************************************************************************/ #if defined(CONFIG_SPI) void stm32_spidev_initialize(void); + +/******************************************************************************* + * Name: board_driver_initialize + * + * Description: + * Called to register platform drivers on the Indium board. + * + ******************************************************************************/ + +# if defined(CONFIG_BOARD_INITIALIZE) +int board_spi_initialize(void); +# endif #endif -/************************************************************************************ +/******************************************************************************* * Name: stm32_spidev_bus_test * * Description: * Called to create the defined SPI buses and test them by initializing them * and sending the NUCLEO_SPI_TEST (no chip select). * - ************************************************************************************/ + ******************************************************************************/ #if defined(CONFIG_NUCLEO_SPI_TEST) int stm32_spidev_bus_test(void); #endif -/************************************************************************************ +/******************************************************************************* + * Name: board_i2c_initialize + * + * Description: + * Called to configure I2C buses. + * + ******************************************************************************/ + +#if defined(CONFIG_I2C) +int board_i2c_initialize(void); +#endif + +/******************************************************************************* + * Name: stm32_adc_setup + * + * Description: + * Called to configure Analog to Digital Converters. + * + ******************************************************************************/ + +#if defined(CONFIG_STM32F7_ADC) +int stm32_adc_setup(void); +#endif + +/******************************************************************************* + * Name: stm32_adc_indium_setup + * + * Description: + * Called to modify the standard configuration of the Analog to Digital Converters. + * + ******************************************************************************/ + +#if defined(CONFIG_STM32F7_ADC) +void stm32_adc_indium_setup(void); +#endif + +/******************************************************************************* * Name: stm32_dma_alloc_init * * Description: @@ -223,7 +299,7 @@ int stm32_spidev_bus_test(void); * Returned Value: * 0 on success or -ENOMEM * - ************************************************************************************/ + ******************************************************************************/ void stm32_dma_alloc_init(void); @@ -231,46 +307,46 @@ void stm32_dma_alloc_init(void); int stm32_dma_alloc_init(void); #endif -/**************************************************************************** +/****************************************************************************** * Name: stm32_sdio_initialize * * Description: * Called at application startup time to initialize the SCMMC functionality. * - ****************************************************************************/ + ******************************************************************************/ #ifdef CONFIG_MMCSD int stm32_sdio_initialize(void); #endif -/************************************************************************************ +/******************************************************************************* * Name: stm32_usbinitialize * * Description: - * Called from stm32_usbinitialize very early in inialization to setup USB-related - * GPIO pins for the indium-f7 board. + * Called from stm32_usbinitialize very early in initialization to setup + * USB-related GPIO pins for the indium-f7 board. * - ************************************************************************************/ + ******************************************************************************/ #ifdef CONFIG_STM32F7_OTGFS void stm32_usbinitialize(void); #endif -/************************************************************************************ +/******************************************************************************* * Name: stm32_adc_setup * * Description: * Initialize ADC and register the ADC driver. * - ************************************************************************************/ + ******************************************************************************/ #ifdef CONFIG_ADC int stm32_adc_setup(void); #endif -/************************************************************************************ +/******************************************************************************* * Name: stm32_bbsram_int - ************************************************************************************/ + ******************************************************************************/ #ifdef CONFIG_STM32F7_BBSRAM int stm32_bbsram_int(void); diff --git a/configs/indium-f7/src/stm32_appinitialize.c b/configs/indium-f7/src/stm32_appinitialize.c index 62f97ee1db4..8a842834b01 100644 --- a/configs/indium-f7/src/stm32_appinitialize.c +++ b/configs/indium-f7/src/stm32_appinitialize.c @@ -1,7 +1,7 @@ /**************************************************************************** * config/indium-f7/src/stm32_appinitialize.c * - * Copyright (C) 2016-2017 Gregory Nutt. All rights reserved. + * Copyright (C) 2016-2018 Gregory Nutt. All rights reserved. * Authors: Gregory Nutt * Mark Olsson * David Sidrane @@ -47,8 +47,12 @@ #include #include -#include "indium-f7.h" +#include #include +#include + +#include "stm32_spi.h" +#include "indium-f7.h" /**************************************************************************** * Public Functions