SAMV7-XULT: Add an NSH protected build configuration. Untested on initial commit.

This commit is contained in:
Gregory Nutt
2015-11-18 11:45:01 -06:00
parent 67be368aa0
commit aa812f3838
8 changed files with 1563 additions and 9 deletions
+106 -7
View File
@@ -71,10 +71,11 @@ the following paragraphs.
The BASIC nsh configuration is fully function (as described below under The BASIC nsh configuration is fully function (as described below under
"Configurations"). There is also a graphics configuration (mxtxplnd), a "Configurations"). There is also a graphics configuration (mxtxplnd), a
a configuration for network testing (netnsh), and a graphics demo (nxwm). a configuration for network testing (netnsh), a graphics demo (nxwm), and
There are still open issues that need to be resolved. General problems are a sample protected mode build (knsh). There are still open issues that need
listed below. But see the STATUS section associated with each configuration to be resolved. General problems are listed below. But see the STATUS
for additional issues specific to a particular configuration. section associated with each configuration for additional issues specific
to a particular configuration.
1. HSCMI. CONFIG_MMCSD_MULTIBLOCK_DISABLE=y is set to disable multi-block 1. HSCMI. CONFIG_MMCSD_MULTIBLOCK_DISABLE=y is set to disable multi-block
transfers only because I have not yet had a chance to verify this. The transfers only because I have not yet had a chance to verify this. The
@@ -150,6 +151,9 @@ for additional issues specific to a particular configuration.
10. On-chip FLASH support as added and verified on 2015-11-13. See the 10. On-chip FLASH support as added and verified on 2015-11-13. See the
"Program FLASH Access" section below for further information. "Program FLASH Access" section below for further information.
11. The knsh "protected mode" configuration was added on 2015-11-18. The
configuration has not been tested as of this writing.
Serial Console Serial Console
============== ==============
@@ -1512,11 +1516,102 @@ NOTES:
Configuration sub-directories Configuration sub-directories
----------------------------- -----------------------------
knsh:
This is identical to the nsh configuration below except that NuttX
is built as a kernel-mode, monolithic module and the user applications
are built separately. There are four very similar NSH configurations:
- knsh. This is a somewhat simplified version of the nsh configuration
that builds using the protected build mode (CONFIG_BUILD_PROTECTED=y).
- nsh. This configuration is focused on low level, command-line
driver testing. It has no network.
- netnsh. This configuration is focused on network testing and
has only limited command support.
- mxtxplnd. This configuration is identical to the nsh configuration
but assumes that you have a maXTouch Xplained Pro LCD attached
and includes extra tests for the touchscreen and LCD.
It is recommends to use a special make command; not just 'make' but make
with the following two arguments:
make pass1 pass2
In the normal case (just 'make'), make will attempt to build both user-
and kernel-mode blobs more or less interleaved. This actual works!
However, for me it is very confusing so I prefer the above make command:
Make the user-space binaries first (pass1), then make the kernel-space
binaries (pass2)
NOTES:
1. At the end of the build, there will be several files in the top-level
NuttX build directory:
PASS1:
nuttx_user.elf - The pass1 user-space ELF file
nuttx_user.hex - The pass1 Intel HEX format file (selected in defconfig)
User.map - Symbols in the user-space ELF file
PASS2:
nuttx - The pass2 kernel-space ELF file
nuttx.hex - The pass2 Intel HEX file (selected in defconfig)
System.map - Symbols in the kernel-space ELF file
The J-Link programmer will except files in .hex, .mot, .srec, and .bin
formats.
2. Combining .hex files. If you plan to use the .hex files with your
debugger or FLASH utility, then you may need to combine the two hex
files into a single .hex file. Here is how you can do that.
a. The 'tail' of the nuttx.hex file should look something like this
(with my comments added):
$ tail nuttx.hex
# 00, data records
...
:10 9DC0 00 01000000000800006400020100001F0004
:10 9DD0 00 3B005A0078009700B500D400F300110151
:08 9DE0 00 30014E016D0100008D
# 05, Start Linear Address Record
:04 0000 05 0800 0419 D2
# 01, End Of File record
:00 0000 01 FF
Use an editor such as vi to remove the 05 and 01 records.
b. The 'head' of the nuttx_user.hex file should look something like
this (again with my comments added):
$ head nuttx_user.hex
# 04, Extended Linear Address Record
:02 0000 04 0801 F1
# 00, data records
:10 8000 00 BD89 01084C800108C8110208D01102087E
:10 8010 00 0010 00201C1000201C1000203C16002026
:10 8020 00 4D80 01085D80010869800108ED83010829
...
Nothing needs to be done here. The nuttx_user.hex file should
be fine.
c. Combine the edited nuttx.hex and un-edited nuttx_user.hex
file to produce a single combined hex file:
$ cat nuttx.hex nuttx_user.hex >combined.hex
Then use the combined.hex file with the to write the FLASH image.
If you do this a lot, you will probably want to invest a little time
to develop a tool to automate these steps.
mxtxplnd: mxtxplnd:
Configures the NuttShell (nsh) located at examples/nsh. There are three Configures the NuttShell (nsh) located at examples/nsh. There are four
very similar NSH configurations: very similar NSH configurations:
- knsh. This is a somewhat simplified version of the nsh configuration
that builds using the protected build mode (CONFIG_BUILD_PROTECTED=y).
- nsh. This configuration is focused on low level, command-line - nsh. This configuration is focused on low level, command-line
driver testing. It has no network. driver testing. It has no network.
- netnsh. This configuration is focused on network testing and - netnsh. This configuration is focused on network testing and
@@ -1619,9 +1714,11 @@ Configuration sub-directories
netnsh: netnsh:
Configures the NuttShell (nsh) located at examples/nsh. There are three Configures the NuttShell (nsh) located at examples/nsh. There are four
very similar NSH configurations: very similar NSH configurations:
- knsh. This is a somewhat simplified version of the nsh configuration
that builds using the protected build mode (CONFIG_BUILD_PROTECTED=y).
- nsh. This configuration is focused on low level, command-line - nsh. This configuration is focused on low level, command-line
driver testing. It has no network. driver testing. It has no network.
- netnsh. This configuration is focused on network testing and - netnsh. This configuration is focused on network testing and
@@ -1730,9 +1827,11 @@ Configuration sub-directories
nsh: nsh:
Configures the NuttShell (nsh) located at examples/nsh. There are three Configures the NuttShell (nsh) located at examples/nsh. There are four
very similar NSH configurations: very similar NSH configurations:
- knsh. This is a somewhat simplified version of the nsh configuration
that builds using the protected build mode (CONFIG_BUILD_PROTECTED=y).
- nsh. This configuration is focused on low level, command-line - nsh. This configuration is focused on low level, command-line
driver testing. It has no network. driver testing. It has no network.
- netnsh. This configuration is focused on network testing and - netnsh. This configuration is focused on network testing and
+2
View File
@@ -0,0 +1,2 @@
/nuttx_user.elf
+116
View File
@@ -0,0 +1,116 @@
############################################################################
# configs/samv7-xult/kernel/Makefile
#
# Copyright (C) 2015 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)/Make.defs
# This is the directory for the board-specific header files
BOARD_INCLUDE = $(TOPDIR)$(DELIM)configs$(DELIM)$(CONFIG_ARCH_BOARD)$(DELIM)include
# The entry point name (if none is provided in the .config file)
CONFIG_USER_ENTRYPOINT ?= user_start
ENTRYPT = $(patsubst "%",%,$(CONFIG_USER_ENTRYPOINT))
# Get the paths to the libraries and the links script path in format that
# is appropriate for the host OS
ifeq ($(WINTOOL),y)
# Windows-native toolchains
USER_LIBPATHS = ${shell for path in $(USERLIBS); do dir=`dirname $(TOPDIR)$(DELIM)$$path`;echo "-L\"`cygpath -w $$dir`\"";done}
USER_LDSCRIPT = -T "${shell cygpath -w $(TOPDIR)$(DELIM)configs$(DELIM)$(CONFIG_ARCH_BOARD)$(DELIM)scripts$(DELIM)memory.ld}"
USER_LDSCRIPT += -T "${shell cygpath -w $(TOPDIR)$(DELIM)configs$(DELIM)$(CONFIG_ARCH_BOARD)$(DELIM)scripts$(DELIM)user-space.ld}"
else
# Linux/Cygwin-native toolchain
USER_LIBPATHS = $(addprefix -L$(TOPDIR)$(DELIM),$(dir $(USERLIBS)))
USER_LDSCRIPT = -T$(TOPDIR)$(DELIM)configs$(DELIM)$(CONFIG_ARCH_BOARD)$(DELIM)scripts$(DELIM)memory.ld
USER_LDSCRIPT += -T$(TOPDIR)$(DELIM)configs$(DELIM)$(CONFIG_ARCH_BOARD)$(DELIM)scripts$(DELIM)user-space.ld
endif
USER_LDFLAGS = --undefined=$(ENTRYPT) --entry=$(ENTRYPT) $(USER_LDSCRIPT)
USER_LDLIBS = $(patsubst lib%,-l%,$(basename $(notdir $(USERLIBS))))
USER_LIBGCC = "${shell "$(CC)" $(ARCHCPUFLAGS) -print-libgcc-file-name}"
# Source files
CSRCS = sam_userspace.c
COBJS = $(CSRCS:.c=$(OBJEXT))
OBJS = $(COBJS)
# Targets:
all: $(TOPDIR)$(DELIM)nuttx_user.elf $(TOPDIR)$(DELIM)User.map
.PHONY: nuttx_user.elf depend clean distclean
$(COBJS): %$(OBJEXT): %.c
$(call COMPILE, $<, $@)
# Create the nuttx_user.elf file containing all of the user-mode code
nuttx_user.elf: $(OBJS)
$(Q) $(LD) -o $@ $(USER_LDFLAGS) $(USER_LIBPATHS) $(OBJS) --start-group $(USER_LDLIBS) --end-group $(USER_LIBGCC)
$(TOPDIR)$(DELIM)nuttx_user.elf: nuttx_user.elf
@echo "LD: nuttx_user.elf"
$(Q) cp -a nuttx_user.elf $(TOPDIR)$(DELIM)nuttx_user.elf
ifeq ($(CONFIG_INTELHEX_BINARY),y)
@echo "CP: nuttx_user.hex"
$(Q) $(OBJCOPY) $(OBJCOPYARGS) -O ihex nuttx_user.elf $(TOPDIR)$(DELIM)nuttx_user.hex
endif
ifeq ($(CONFIG_MOTOROLA_SREC),y)
@echo "CP: nuttx_user.srec"
$(Q) $(OBJCOPY) $(OBJCOPYARGS) -O srec nuttx_user.elf $(TOPDIR)$(DELIM)nuttx_user.srec
endif
ifeq ($(CONFIG_RAW_BINARY),y)
@echo "CP: nuttx_user.bin"
$(Q) $(OBJCOPY) $(OBJCOPYARGS) -O binary nuttx_user.elf $(TOPDIR)$(DELIM)nuttx_user.bin
endif
$(TOPDIR)$(DELIM)User.map: nuttx_user.elf
@echo "MK: User.map"
$(Q) $(NM) nuttx_user.elf >$(TOPDIR)$(DELIM)User.map
$(Q) $(CROSSDEV)size nuttx_user.elf
.depend:
depend: .depend
clean:
$(call DELFILE, nuttx_user.elf)
$(call DELFILE, "$(TOPDIR)$(DELIM)nuttx_user.*")
$(call DELFILE, "$(TOPDIR)$(DELIM)User.map")
$(call CLEAN)
distclean: clean
+132
View File
@@ -0,0 +1,132 @@
/****************************************************************************
* configs/samv71-xult/kernel/sam_userspace.c
*
* Copyright (C) 2015 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 <stdlib.h>
#include <nuttx/userspace.h>
#include <nuttx/wqueue.h>
#include <nuttx/mm/mm.h>
#if defined(CONFIG_BUILD_PROTECTED) && !defined(__KERNEL__)
/****************************************************************************
* Pre-processor Definitions
****************************************************************************/
/* Configuration ************************************************************/
#ifndef CONFIG_NUTTX_USERSPACE
# error "CONFIG_NUTTX_USERSPACE not defined"
#endif
#if CONFIG_NUTTX_USERSPACE != 0x00500000
# error "CONFIG_NUTTX_USERSPACE must be 0x00500000 to match user-space.ld"
#endif
/****************************************************************************
* Public Data
****************************************************************************/
/* These 'addresses' of these values are setup by the linker script. They are
* not actual uint32_t storage locations! They are only used meaningfully in the
* following way:
*
* - The linker script defines, for example, the symbol_sdata.
* - The declareion extern uint32_t _sdata; makes C happy. C will believe
* that the value _sdata is the address of a uint32_t variable _data (it is
* not!).
* - We can recoved the linker value then by simply taking the address of
* of _data. like: uint32_t *pdata = &_sdata;
*/
extern uint32_t _stext; /* Start of .text */
extern uint32_t _etext; /* End_1 of .text + .rodata */
extern const uint32_t _eronly; /* End+1 of read only section (.text + .rodata) */
extern uint32_t _sdata; /* Start of .data */
extern uint32_t _edata; /* End+1 of .data */
extern uint32_t _sbss; /* Start of .bss */
extern uint32_t _ebss; /* End+1 of .bss */
/* This is the user space entry point */
int CONFIG_USER_ENTRYPOINT(int argc, char *argv[]);
const struct userspace_s userspace __attribute__ ((section (".userspace"))) =
{
/* General memory map */
.us_entrypoint = (main_t)CONFIG_USER_ENTRYPOINT,
.us_textstart = (uintptr_t)&_stext,
.us_textend = (uintptr_t)&_etext,
.us_datasource = (uintptr_t)&_eronly,
.us_datastart = (uintptr_t)&_sdata,
.us_dataend = (uintptr_t)&_edata,
.us_bssstart = (uintptr_t)&_sbss,
.us_bssend = (uintptr_t)&_ebss,
/* Memory manager heap structure */
.us_heap = &g_mmheap,
/* Task/thread startup routines */
.task_startup = task_startup,
#ifndef CONFIG_DISABLE_PTHREAD
.pthread_startup = pthread_startup,
#endif
/* Signal handler trampoline */
#ifndef CONFIG_DISABLE_SIGNALS
.signal_handler = up_signal_handler,
#endif
/* User-space work queue support (declared in include/nuttx/wqueue.h) */
#ifdef CONFIG_LIB_USRWORK
.work_usrstart = work_usrstart,
#endif
};
/****************************************************************************
* Public Functions
****************************************************************************/
#endif /* CONFIG_BUILD_PROTECTED && !__KERNEL__ */
+117
View File
@@ -0,0 +1,117 @@
############################################################################
# configs/samv71-xult/knsh/Make.defs
#
# Copyright (C) 2015 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
ifeq ($(CONFIG_ARMV7M_DTCM),y)
LDSCRIPT = flash-dtcm.ld
else
LDSCRIPT = flash-sram.ld
endif
ifeq ($(WINTOOL),y)
# Windows-native toolchains
DIRLINK = $(TOPDIR)/tools/copydir.sh
DIRUNLINK = $(TOPDIR)/tools/unlink.sh
MKDEP = $(TOPDIR)/tools/mknulldeps.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.sh
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)
endif
ARCHCFLAGS = -fno-builtin
ARCHCXXFLAGS = -fno-builtin -fno-exceptions -fno-rtti
ARCHWARNINGS = -Wall -Wstrict-prototypes -Wshadow -Wundef -fno-strict-aliasing
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 =
File diff suppressed because it is too large Load Diff
+77
View File
@@ -0,0 +1,77 @@
#!/bin/bash
# configs/samv7-xult/knsh/Make.defs
#
# Copyright (C) 2015 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 Atmel GCC
# toolchain under Windows. You will also have to edit this if you install
# this toolchain in any other location
#export TOOLCHAIN_BIN="/cygdrive/c/Program Files (x86)/Atmel/Atmel Toolchain/ARM GCC/Native/4.7.3.99/arm-gnu-toolchain/bin"
# 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"
# 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}"
+26 -2
View File
@@ -150,6 +150,15 @@ CONFIG_SDIO_DMA=y
# #
# SAMV7 Configuration Options # SAMV7 Configuration Options
# #
# CONFIG_ARCH_CHIP_SAME70Q19 is not set
# CONFIG_ARCH_CHIP_SAME70Q20 is not set
# CONFIG_ARCH_CHIP_SAME70Q21 is not set
# CONFIG_ARCH_CHIP_SAME70N19 is not set
# CONFIG_ARCH_CHIP_SAME70N20 is not set
# CONFIG_ARCH_CHIP_SAME70N21 is not set
# CONFIG_ARCH_CHIP_SAME70J19 is not set
# CONFIG_ARCH_CHIP_SAME70J20 is not set
# CONFIG_ARCH_CHIP_SAME70J21 is not set
# CONFIG_ARCH_CHIP_SAMV71Q19 is not set # CONFIG_ARCH_CHIP_SAMV71Q19 is not set
# CONFIG_ARCH_CHIP_SAMV71Q20 is not set # CONFIG_ARCH_CHIP_SAMV71Q20 is not set
CONFIG_ARCH_CHIP_SAMV71Q21=y CONFIG_ARCH_CHIP_SAMV71Q21=y
@@ -159,6 +168,10 @@ CONFIG_ARCH_CHIP_SAMV71Q21=y
# CONFIG_ARCH_CHIP_SAMV71J19 is not set # CONFIG_ARCH_CHIP_SAMV71J19 is not set
# CONFIG_ARCH_CHIP_SAMV71J20 is not set # CONFIG_ARCH_CHIP_SAMV71J20 is not set
# CONFIG_ARCH_CHIP_SAMV71J21 is not set # CONFIG_ARCH_CHIP_SAMV71J21 is not set
# CONFIG_ARCH_CHIP_SAME70 is not set
# CONFIG_ARCH_CHIP_SAME70Q is not set
# CONFIG_ARCH_CHIP_SAME70N is not set
# CONFIG_ARCH_CHIP_SAME70J is not set
CONFIG_ARCH_CHIP_SAMV71=y CONFIG_ARCH_CHIP_SAMV71=y
CONFIG_ARCH_CHIP_SAMV71Q=y CONFIG_ARCH_CHIP_SAMV71Q=y
# CONFIG_ARCH_CHIP_SAMV71N is not set # CONFIG_ARCH_CHIP_SAMV71N is not set
@@ -171,6 +184,7 @@ CONFIG_SAMV7_HAVE_EBI=y
CONFIG_SAMV7_HSMCI=y CONFIG_SAMV7_HSMCI=y
CONFIG_SAMV7_HAVE_HSMCI0=y CONFIG_SAMV7_HAVE_HSMCI0=y
# CONFIG_SAMV7_HAVE_ISI8 is not set # CONFIG_SAMV7_HAVE_ISI8 is not set
CONFIG_SAMV7_HAVE_MEDIALB=y
CONFIG_SAMV7_HAVE_SDRAMC=y CONFIG_SAMV7_HAVE_SDRAMC=y
CONFIG_SAMV7_HAVE_SPI0=y CONFIG_SAMV7_HAVE_SPI0=y
CONFIG_SAMV7_HAVE_SPI1=y CONFIG_SAMV7_HAVE_SPI1=y
@@ -247,6 +261,7 @@ CONFIG_SAMV7_GPIOB_IRQ=y
# CONFIG_SAMV7_GPIOC_IRQ is not set # CONFIG_SAMV7_GPIOC_IRQ is not set
CONFIG_SAMV7_GPIOD_IRQ=y CONFIG_SAMV7_GPIOD_IRQ=y
# CONFIG_SAMV7_GPIOE_IRQ is not set # CONFIG_SAMV7_GPIOE_IRQ is not set
# CONFIG_SAMV7_PROGMEM is not set
# #
# SDRAM Configuration # SDRAM Configuration
@@ -347,6 +362,7 @@ CONFIG_NSH_MMCSDSLOTNO=0
# #
# CONFIG_SAMV71XULT_MXTXPLND is not set # CONFIG_SAMV71XULT_MXTXPLND is not set
CONFIG_LIB_BOARDCTL=y CONFIG_LIB_BOARDCTL=y
# CONFIG_BOARDCTL_UNIQUEID is not set
# CONFIG_BOARDCTL_TSCTEST is not set # CONFIG_BOARDCTL_TSCTEST is not set
# CONFIG_BOARDCTL_ADCTEST is not set # CONFIG_BOARDCTL_ADCTEST is not set
# CONFIG_BOARDCTL_PWMTEST is not set # CONFIG_BOARDCTL_PWMTEST is not set
@@ -474,6 +490,7 @@ CONFIG_DEV_NULL=y
# CONFIG_RAMDISK is not set # CONFIG_RAMDISK is not set
# CONFIG_CAN is not set # CONFIG_CAN is not set
# CONFIG_ARCH_HAVE_PWM_PULSECOUNT is not set # CONFIG_ARCH_HAVE_PWM_PULSECOUNT is not set
# CONFIG_ARCH_HAVE_PWM_MULTICHAN is not set
# CONFIG_PWM is not set # CONFIG_PWM is not set
# CONFIG_ARCH_HAVE_I2CRESET is not set # CONFIG_ARCH_HAVE_I2CRESET is not set
CONFIG_I2C=y CONFIG_I2C=y
@@ -503,7 +520,7 @@ CONFIG_SPI_EXCHANGE=y
# CONFIG_VIDEO_DEVICES is not set # CONFIG_VIDEO_DEVICES is not set
# CONFIG_BCH is not set # CONFIG_BCH is not set
# CONFIG_INPUT is not set # CONFIG_INPUT is not set
# CONFIG_IOEXPANDER is not set # CONFIG_DISCRETE_IO is not set
# CONFIG_LCD is not set # CONFIG_LCD is not set
CONFIG_MMCSD=y CONFIG_MMCSD=y
CONFIG_MMCSD_NSLOTS=1 CONFIG_MMCSD_NSLOTS=1
@@ -526,6 +543,7 @@ CONFIG_MTD=y
# CONFIG_MTD_PARTITION is not set # CONFIG_MTD_PARTITION is not set
# CONFIG_MTD_SECT512 is not set # CONFIG_MTD_SECT512 is not set
# CONFIG_MTD_BYTE_WRITE is not set # CONFIG_MTD_BYTE_WRITE is not set
# CONFIG_MTD_PROGMEM is not set
CONFIG_MTD_CONFIG=y CONFIG_MTD_CONFIG=y
# CONFIG_MTD_CONFIG_RAM_CONSOLIDATE is not set # CONFIG_MTD_CONFIG_RAM_CONSOLIDATE is not set
CONFIG_MTD_CONFIG_ERASEDVALUE=0xff CONFIG_MTD_CONFIG_ERASEDVALUE=0xff
@@ -536,10 +554,12 @@ CONFIG_MTD_CONFIG_ERASEDVALUE=0xff
# CONFIG_MTD_NAND is not set # CONFIG_MTD_NAND is not set
# CONFIG_RAMMTD is not set # CONFIG_RAMMTD is not set
CONFIG_MTD_AT24XX=y CONFIG_MTD_AT24XX=y
# CONFIG_AT24XX_MULTI is not set
CONFIG_AT24XX_SIZE=2 CONFIG_AT24XX_SIZE=2
CONFIG_AT24XX_ADDR=0x57 CONFIG_AT24XX_ADDR=0x57
CONFIG_AT24XX_EXTENDED=y CONFIG_AT24XX_EXTENDED=y
CONFIG_AT24XX_EXTSIZE=160 CONFIG_AT24XX_EXTSIZE=160
CONFIG_AT24XX_FREQUENCY=100000
CONFIG_MTD_AT25=y CONFIG_MTD_AT25=y
CONFIG_AT25_SPIMODE=0 CONFIG_AT25_SPIMODE=0
CONFIG_AT25_SPIFREQUENCY=20000000 CONFIG_AT25_SPIFREQUENCY=20000000
@@ -591,6 +611,7 @@ CONFIG_MCU_SERIAL=y
CONFIG_STANDARD_SERIAL=y CONFIG_STANDARD_SERIAL=y
# CONFIG_SERIAL_IFLOWCONTROL is not set # CONFIG_SERIAL_IFLOWCONTROL is not set
# CONFIG_SERIAL_OFLOWCONTROL is not set # CONFIG_SERIAL_OFLOWCONTROL is not set
# CONFIG_SERIAL_DMA is not set
CONFIG_ARCH_HAVE_SERIAL_TERMIOS=y CONFIG_ARCH_HAVE_SERIAL_TERMIOS=y
CONFIG_UART3_SERIAL_CONSOLE=y CONFIG_UART3_SERIAL_CONSOLE=y
# CONFIG_OTHER_SERIAL_CONSOLE is not set # CONFIG_OTHER_SERIAL_CONSOLE is not set
@@ -607,6 +628,7 @@ CONFIG_UART3_PARITY=0
CONFIG_UART3_2STOP=0 CONFIG_UART3_2STOP=0
# CONFIG_UART3_IFLOWCONTROL is not set # CONFIG_UART3_IFLOWCONTROL is not set
# CONFIG_UART3_OFLOWCONTROL is not set # CONFIG_UART3_OFLOWCONTROL is not set
# CONFIG_UART3_DMA is not set
# CONFIG_USBDEV is not set # CONFIG_USBDEV is not set
# CONFIG_USBHOST is not set # CONFIG_USBHOST is not set
# CONFIG_WIRELESS is not set # CONFIG_WIRELESS is not set
@@ -656,6 +678,7 @@ CONFIG_FAT_MAXFNAME=32
# CONFIG_FAT_DMAMEMORY is not set # CONFIG_FAT_DMAMEMORY is not set
# CONFIG_FS_NXFFS is not set # CONFIG_FS_NXFFS is not set
# CONFIG_FS_ROMFS is not set # CONFIG_FS_ROMFS is not set
# CONFIG_FS_TMPFS is not set
# CONFIG_FS_SMARTFS is not set # CONFIG_FS_SMARTFS is not set
# CONFIG_FS_BINFS is not set # CONFIG_FS_BINFS is not set
# CONFIG_FS_PROCFS is not set # CONFIG_FS_PROCFS is not set
@@ -778,14 +801,15 @@ CONFIG_EXAMPLES_BUTTONS_NAME7="Button 7"
# CONFIG_EXAMPLES_CPUHOG is not set # CONFIG_EXAMPLES_CPUHOG is not set
# CONFIG_EXAMPLES_DHCPD is not set # CONFIG_EXAMPLES_DHCPD is not set
# CONFIG_EXAMPLES_ELF is not set # CONFIG_EXAMPLES_ELF is not set
# CONFIG_EXAMPLES_FSTEST is not set
# CONFIG_EXAMPLES_FTPC is not set # CONFIG_EXAMPLES_FTPC is not set
# CONFIG_EXAMPLES_FTPD is not set # CONFIG_EXAMPLES_FTPD is not set
# CONFIG_EXAMPLES_HELLO is not set # CONFIG_EXAMPLES_HELLO is not set
# CONFIG_EXAMPLES_HELLOXX is not set
# CONFIG_EXAMPLES_JSON is not set # CONFIG_EXAMPLES_JSON is not set
# CONFIG_EXAMPLES_HIDKBD is not set # CONFIG_EXAMPLES_HIDKBD is not set
# CONFIG_EXAMPLES_KEYPADTEST is not set # CONFIG_EXAMPLES_KEYPADTEST is not set
# CONFIG_EXAMPLES_IGMP is not set # CONFIG_EXAMPLES_IGMP is not set
# CONFIG_EXAMPLES_MEDIA is not set
# CONFIG_EXAMPLES_MM is not set # CONFIG_EXAMPLES_MM is not set
# CONFIG_EXAMPLES_MODBUS is not set # CONFIG_EXAMPLES_MODBUS is not set
# CONFIG_EXAMPLES_MOUNT is not set # CONFIG_EXAMPLES_MOUNT is not set