From df822a66c202b5b36d1ed743a9f670071a12efe3 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Fri, 17 Oct 2014 08:43:06 -0600 Subject: [PATCH 01/13] Add directory for EFM32 G8XX STK board --- configs/efm32-g8xx-stk/Kconfig | 10 + configs/efm32-g8xx-stk/include/board.h | 47 ++ configs/efm32-g8xx-stk/nsh/Make.defs | 111 ++++ configs/efm32-g8xx-stk/nsh/defconfig | 585 ++++++++++++++++++++ configs/efm32-g8xx-stk/nsh/setenv.sh | 63 +++ configs/efm32-g8xx-stk/scripts/ld.script | 110 ++++ configs/efm32-g8xx-stk/src/.gitignore | 2 + configs/efm32-g8xx-stk/src/Makefile | 77 +++ configs/efm32-g8xx-stk/src/efm32-g8xx-stk.h | 47 ++ configs/efm32-g8xx-stk/src/efm32_boot.c | 79 +++ 10 files changed, 1131 insertions(+) create mode 100644 configs/efm32-g8xx-stk/Kconfig create mode 100644 configs/efm32-g8xx-stk/include/board.h create mode 100644 configs/efm32-g8xx-stk/nsh/Make.defs create mode 100644 configs/efm32-g8xx-stk/nsh/defconfig create mode 100755 configs/efm32-g8xx-stk/nsh/setenv.sh create mode 100644 configs/efm32-g8xx-stk/scripts/ld.script create mode 100644 configs/efm32-g8xx-stk/src/.gitignore create mode 100644 configs/efm32-g8xx-stk/src/Makefile create mode 100644 configs/efm32-g8xx-stk/src/efm32-g8xx-stk.h create mode 100644 configs/efm32-g8xx-stk/src/efm32_boot.c diff --git a/configs/efm32-g8xx-stk/Kconfig b/configs/efm32-g8xx-stk/Kconfig new file mode 100644 index 0000000000..ef346141e1 --- /dev/null +++ b/configs/efm32-g8xx-stk/Kconfig @@ -0,0 +1,10 @@ +# +# For a description of the syntax of this configuration file, +# see misc/tools/kconfig-language.txt. +# + +if ARCH_BOARD_EFM32G8XXSTK + +#comment "EFM32 G8XX STK Hardware Configuration" + +endif # ARCH_BOARD_EFM32G8XXSTK diff --git a/configs/efm32-g8xx-stk/include/board.h b/configs/efm32-g8xx-stk/include/board.h new file mode 100644 index 0000000000..ddc32d0707 --- /dev/null +++ b/configs/efm32-g8xx-stk/include/board.h @@ -0,0 +1,47 @@ +/**************************************************************************** + * configs/efm32-g8xx-stk/include/board.h + * + * Copyright (C) 2014 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * 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_EFM32_G8XX_STK_INCLUDE_BOARD_H +#define __CONFIGS_EFM32_G8XX_STK_INCLUDE_BOARD_H + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +/**************************************************************************** + * Public Function Prototypes + ****************************************************************************/ + +#endif /* __CONFIGS_EFM32_DK3650_INCLUDE_BOARD_H */ diff --git a/configs/efm32-g8xx-stk/nsh/Make.defs b/configs/efm32-g8xx-stk/nsh/Make.defs new file mode 100644 index 0000000000..47fdb324d8 --- /dev/null +++ b/configs/efm32-g8xx-stk/nsh/Make.defs @@ -0,0 +1,111 @@ +############################################################################ +# configs/efm32-g8xx-stk/nsh/Make.defs +# +# Copyright (C) 2014 Gregory Nutt. All rights reserved. +# Author: Gregory Nutt +# +# 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}/arch/arm/src/armv7-m/Toolchain.defs +include ${TOPDIR}/tools/Config.mk + +LDSCRIPT = ld.script + +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) -fno-strict-aliasing -fno-strength-reduce -fomit-frame-pointer +endif + +ARCHCFLAGS = -fno-builtin +ARCHCXXFLAGS = -fno-builtin -fno-exceptions -fno-rtti +ARCHWARNINGS = -Wall -Wstrict-prototypes -Wshadow +ARCHWARNINGSXX = -Wall -Wshadow +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 + +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 -g -pipe +HOSTLDFLAGS = diff --git a/configs/efm32-g8xx-stk/nsh/defconfig b/configs/efm32-g8xx-stk/nsh/defconfig new file mode 100644 index 0000000000..588c4d39a8 --- /dev/null +++ b/configs/efm32-g8xx-stk/nsh/defconfig @@ -0,0 +1,585 @@ +# +# Automatically generated file; DO NOT EDIT. +# Nuttx/ Configuration +# +CONFIG_NUTTX_NEWCONFIG=y + +# +# Build Setup +# +# CONFIG_EXPERIMENTAL is not set +# CONFIG_HOST_OSX is not set +CONFIG_HOST_WINDOWS=y +# CONFIG_HOST_OTHER is not set +CONFIG_WINDOWS_CYGWIN=y + +# +# Build Configuration +# +CONFIG_APPS_DIR="../apps" +# CONFIG_BUILD_2PASS is not set + +# +# Binary Output Formats +# +# CONFIG_RRLOAD_BINARY is not set +# CONFIG_INTELHEX_BINARY is not set +# CONFIG_MOTOROLA_SREC is not set +CONFIG_RAW_BINARY=y + +# +# Customize Header Files +# +# CONFIG_ARCH_STDBOOL_H is not set +# CONFIG_ARCH_MATH_H is not set +# CONFIG_ARCH_FLOAT_H is not set +# CONFIG_ARCH_STDARG_H is not set + +# +# Debug Options +# +# CONFIG_DEBUG is not set +CONFIG_ARCH_HAVE_STACKCHECK=y +# CONFIG_ARCH_HAVE_HEAPCHECK is not set +CONFIG_DEBUG_SYMBOLS=y +# CONFIG_DEBUG_NOOPT is not set + +# +# System Type +# +# CONFIG_ARCH_8051 is not set +CONFIG_ARCH_ARM=y +# CONFIG_ARCH_AVR is not set +# CONFIG_ARCH_HC is not set +# CONFIG_ARCH_MIPS is not set +# CONFIG_ARCH_RGMP is not set +# CONFIG_ARCH_SH is not set +# CONFIG_ARCH_SIM is not set +# CONFIG_ARCH_X86 is not set +# CONFIG_ARCH_Z16 is not set +# CONFIG_ARCH_Z80 is not set +CONFIG_ARCH="arm" + +# +# ARM Options +# +# CONFIG_ARCH_CHIP_A1X is not set +# CONFIG_ARCH_CHIP_C5471 is not set +# CONFIG_ARCH_CHIP_CALYPSO is not set +# CONFIG_ARCH_CHIP_DM320 is not set +CONFIG_ARCH_CHIP_EFM32=y +# CONFIG_ARCH_CHIP_IMX is not set +# CONFIG_ARCH_CHIP_KINETIS is not set +# CONFIG_ARCH_CHIP_KL is not set +# CONFIG_ARCH_CHIP_LM is not set +# CONFIG_ARCH_CHIP_LPC17XX is not set +# CONFIG_ARCH_CHIP_LPC214X is not set +# CONFIG_ARCH_CHIP_LPC2378 is not set +# CONFIG_ARCH_CHIP_LPC31XX is not set +# CONFIG_ARCH_CHIP_LPC43XX is not set +# CONFIG_ARCH_CHIP_NUC1XX is not set +# CONFIG_ARCH_CHIP_SAMA5 is not set +# CONFIG_ARCH_CHIP_SAM34 is not set +# CONFIG_ARCH_CHIP_STM32 is not set +# CONFIG_ARCH_CHIP_STR71X is not set +# CONFIG_ARCH_ARM7TDMI is not set +# CONFIG_ARCH_ARM926EJS is not set +# CONFIG_ARCH_ARM920T is not set +# CONFIG_ARCH_CORTEXM0 is not set +CONFIG_ARCH_CORTEXM3=y +# CONFIG_ARCH_CORTEXM4 is not set +# CONFIG_ARCH_CORTEXA5 is not set +# CONFIG_ARCH_CORTEXA8 is not set +CONFIG_ARCH_FAMILY="armv7-m" +CONFIG_ARCH_CHIP="efm32" +# CONFIG_ARMV7M_USEBASEPRI is not set +CONFIG_ARCH_HAVE_CMNVECTOR=y +CONFIG_ARMV7M_CMNVECTOR=y +# CONFIG_ARCH_HAVE_FPU is not set +# CONFIG_ARCH_HAVE_MPU is not set + +# +# ARMV7M Configuration Options +# +# CONFIG_ARMV7M_TOOLCHAIN_BUILDROOT is not set +# CONFIG_ARMV7M_TOOLCHAIN_CODEREDL is not set +CONFIG_ARMV7M_TOOLCHAIN_CODESOURCERYW=y + +# +# EFM32 Configuration Options +# +CONFIG_ARCH_CHIP_EFM32G890F128=y + +# +# Architecture Options +# +# CONFIG_ARCH_NOINTC is not set +# CONFIG_ARCH_VECNOTIRQ is not set +# CONFIG_ARCH_DMA is not set +CONFIG_ARCH_HAVE_IRQPRIO=y +# CONFIG_CUSTOM_STACK is not set +# CONFIG_ADDRENV is not set +CONFIG_ARCH_HAVE_VFORK=y +# CONFIG_ARCH_IRQPRIO is not set +CONFIG_ARCH_STACKDUMP=y +# CONFIG_ENDIAN_BIG is not set +# CONFIG_ARCH_HAVE_RAMFUNCS is not set +CONFIG_ARCH_HAVE_RAMVECTORS=y +# CONFIG_ARCH_RAMVECTORS is not set + +# +# Board Settings +# +CONFIG_BOARD_LOOPSPERMSEC=4531 +# CONFIG_ARCH_CALIBRATION is not set + +# +# Interrupt options +# +CONFIG_ARCH_HAVE_INTERRUPTSTACK=y +CONFIG_ARCH_INTERRUPTSTACK=0 +CONFIG_ARCH_HAVE_HIPRI_INTERRUPT=y +# CONFIG_ARCH_HIPRI_INTERRUPT is not set + +# +# Boot options +# +# CONFIG_BOOT_RUNFROMEXTSRAM is not set +CONFIG_BOOT_RUNFROMFLASH=y +# CONFIG_BOOT_RUNFROMISRAM is not set +# CONFIG_BOOT_RUNFROMSDRAM is not set +# CONFIG_BOOT_COPYTORAM is not set + +# +# Boot Memory Configuration +# +CONFIG_RAM_START=0x20000000 +CONFIG_RAM_SIZE=32768 + +# +# Board Selection +# +CONFIG_ARCH_BOARD_EFM32G8XXSTK=y +# CONFIG_ARCH_BOARD_CUSTOM is not set +CONFIG_ARCH_BOARD="efm32-g8xx-stk" + +# +# Common Board Options +# + +# +# Board-Specific Options +# + +# +# EFM32 DK3650 Hardware Configuration +# + +# +# RTOS Features +# +# CONFIG_BOARD_INITIALIZE is not set +CONFIG_MSEC_PER_TICK=10 +# CONFIG_SYSTEM_TIME64 is not set +CONFIG_RR_INTERVAL=200 +# CONFIG_SCHED_INSTRUMENTATION is not set +CONFIG_TASK_NAME_SIZE=0 +# CONFIG_SCHED_HAVE_PARENT is not set +# CONFIG_JULIAN_TIME is not set +CONFIG_START_YEAR=2010 +CONFIG_START_MONTH=5 +CONFIG_START_DAY=6 +CONFIG_DEV_CONSOLE=y +# CONFIG_MUTEX_TYPES is not set +# CONFIG_PRIORITY_INHERITANCE is not set +# CONFIG_FDCLONE_DISABLE is not set +# CONFIG_FDCLONE_STDIO is not set +CONFIG_SDCLONE_DISABLE=y +# CONFIG_SCHED_WAITPID is not set +# CONFIG_SCHED_STARTHOOK is not set +# CONFIG_SCHED_ATEXIT is not set +# CONFIG_SCHED_ONEXIT is not set +CONFIG_USER_ENTRYPOINT="nsh_main" +CONFIG_DISABLE_OS_API=y +# CONFIG_DISABLE_CLOCK is not set +# CONFIG_DISABLE_POSIX_TIMERS is not set +# CONFIG_DISABLE_PTHREAD is not set +# CONFIG_DISABLE_SIGNALS is not set +# CONFIG_DISABLE_MQUEUE is not set +CONFIG_DISABLE_ENVIRON=y + +# +# Signal Numbers +# +CONFIG_SIG_SIGUSR1=1 +CONFIG_SIG_SIGUSR2=2 +CONFIG_SIG_SIGALARM=3 +CONFIG_SIG_SIGCONDTIMEDOUT=16 + +# +# Sizes of configurable things (0 disables) +# +CONFIG_MAX_TASKS=16 +CONFIG_MAX_TASK_ARGS=4 +CONFIG_NPTHREAD_KEYS=4 +CONFIG_NFILE_DESCRIPTORS=8 +CONFIG_NFILE_STREAMS=8 +CONFIG_NAME_MAX=32 +CONFIG_PREALLOC_MQ_MSGS=4 +CONFIG_MQ_MAXMSGSIZE=32 +CONFIG_MAX_WDOGPARMS=2 +CONFIG_PREALLOC_WDOGS=4 +CONFIG_PREALLOC_TIMERS=4 +CONFIG_WDOG_INTRESERVE=1 + +# +# Stack and heap information +# +CONFIG_IDLETHREAD_STACKSIZE=1024 +CONFIG_USERMAIN_STACKSIZE=2048 +CONFIG_PTHREAD_STACK_MIN=256 +CONFIG_PTHREAD_STACK_DEFAULT=2048 + +# +# Device Drivers +# +CONFIG_DISABLE_POLL=y +CONFIG_DEV_NULL=y +# CONFIG_DEV_ZERO is not set +# CONFIG_LOOP is not set +# CONFIG_RAMDISK is not set +# CONFIG_CAN is not set +# CONFIG_ARCH_HAVE_PWM_PULSECOUNT is not set +# CONFIG_PWM is not set +# CONFIG_ARCH_HAVE_I2CRESET is not set +# CONFIG_I2C is not set +# CONFIG_SPI is not set +# CONFIG_I2S is not set +# CONFIG_RTC is not set +# CONFIG_WATCHDOG is not set +# CONFIG_ANALOG is not set +# CONFIG_AUDIO_DEVICES is not set +# CONFIG_VIDEO_DEVICES is not set +# CONFIG_BCH is not set +# CONFIG_INPUT is not set +# CONFIG_LCD is not set +# CONFIG_MMCSD is not set +# CONFIG_MTD is not set +# CONFIG_PIPES is not set +# CONFIG_PM is not set +# CONFIG_POWER is not set +# CONFIG_SENSORS is not set +# CONFIG_SERCOMM_CONSOLE is not set +CONFIG_SERIAL=y +CONFIG_DEV_LOWCONSOLE=y +# CONFIG_16550_UART is not set + +# +# USART Configuration +# +# CONFIG_SERIAL_IFLOWCONTROL is not set +# CONFIG_SERIAL_OFLOWCONTROL is not set +# CONFIG_USBDEV is not set +# CONFIG_USBHOST is not set +# CONFIG_WIRELESS is not set + +# +# System Logging Device Options +# + +# +# System Logging +# +# CONFIG_RAMLOG is not set + +# +# Networking Support +# +# CONFIG_ARCH_HAVE_NET is not set +# CONFIG_ARCH_HAVE_PHY is not set +# CONFIG_NET is not set + +# +# File Systems +# + +# +# File system configuration +# +CONFIG_DISABLE_MOUNTPOINT=y +# CONFIG_FS_READABLE is not set +# CONFIG_FS_WRITABLE is not set +# CONFIG_FS_RAMMAP is not set +# CONFIG_FS_PROCFS is not set + +# +# System Logging +# +# CONFIG_SYSLOG_ENABLE is not set +# CONFIG_SYSLOG is not set + +# +# Graphics Support +# +# CONFIG_NX is not set + +# +# Memory Management +# +# CONFIG_MM_MULTIHEAP is not set +# CONFIG_MM_SMALL is not set +CONFIG_MM_REGIONS=1 +# CONFIG_GRAN is not set + +# +# Audio Support +# +# CONFIG_AUDIO is not set + +# +# Binary Formats +# +# CONFIG_BINFMT_DISABLE is not set +# CONFIG_NXFLAT is not set +# CONFIG_ELF is not set +# CONFIG_BUILTIN is not set +# CONFIG_PIC is not set +# CONFIG_SYMTAB_ORDEREDBYNAME is not set + +# +# Library Routines +# + +# +# Standard C Library Options +# +CONFIG_STDIO_BUFFER_SIZE=64 +CONFIG_STDIO_LINEBUFFER=y +CONFIG_NUNGET_CHARS=2 +# CONFIG_LIBM is not set +# CONFIG_NOPRINTF_FIELDWIDTH is not set +# CONFIG_LIBC_FLOATINGPOINT is not set +CONFIG_LIB_RAND_ORDER=1 +# CONFIG_EOL_IS_CR is not set +# CONFIG_EOL_IS_LF is not set +# CONFIG_EOL_IS_BOTH_CRLF is not set +CONFIG_EOL_IS_EITHER_CRLF=y +# CONFIG_LIBC_EXECFUNCS is not set +CONFIG_POSIX_SPAWN_PROXY_STACKSIZE=1024 +CONFIG_TASK_SPAWN_DEFAULT_STACKSIZE=2048 +# CONFIG_LIBC_STRERROR is not set +# CONFIG_LIBC_PERROR_STDOUT is not set +CONFIG_ARCH_LOWPUTC=y +CONFIG_LIB_SENDFILE_BUFSIZE=512 +# CONFIG_ARCH_ROMGETC is not set +# CONFIG_ARCH_OPTIMIZED_FUNCTIONS is not set + +# +# Non-standard Library Support +# +# CONFIG_SCHED_WORKQUEUE is not set +# CONFIG_LIB_KBDCODEC is not set +# CONFIG_LIB_SLCDCODEC is not set + +# +# Basic CXX Support +# +# CONFIG_C99_BOOL8 is not set +# CONFIG_HAVE_CXX is not set + +# +# Application Configuration +# + +# +# Built-In Applications +# + +# +# Examples +# +# CONFIG_EXAMPLES_BUTTONS is not set +# CONFIG_EXAMPLES_CAN is not set +# CONFIG_EXAMPLES_CONFIGDATA is not set +# CONFIG_EXAMPLES_DHCPD is not set +# CONFIG_EXAMPLES_ELF is not set +# CONFIG_EXAMPLES_FTPC is not set +# CONFIG_EXAMPLES_FTPD is not set +# CONFIG_EXAMPLES_HELLO is not set +# CONFIG_EXAMPLES_HELLOXX is not set +# CONFIG_EXAMPLES_JSON is not set +# CONFIG_EXAMPLES_HIDKBD is not set +# CONFIG_EXAMPLES_KEYPADTEST is not set +# CONFIG_EXAMPLES_IGMP is not set +# CONFIG_EXAMPLES_LCDRW is not set +# CONFIG_EXAMPLES_MM is not set +# CONFIG_EXAMPLES_MODBUS is not set +# CONFIG_EXAMPLES_MOUNT is not set +# CONFIG_EXAMPLES_NRF24L01TERM is not set +CONFIG_EXAMPLES_NSH=y +# CONFIG_EXAMPLES_NULL is not set +# CONFIG_EXAMPLES_NX is not set +# CONFIG_EXAMPLES_NXCONSOLE is not set +# CONFIG_EXAMPLES_NXFFS is not set +# CONFIG_EXAMPLES_NXFLAT is not set +# CONFIG_EXAMPLES_NXHELLO is not set +# CONFIG_EXAMPLES_NXIMAGE is not set +# CONFIG_EXAMPLES_NXLINES is not set +# CONFIG_EXAMPLES_NXTEXT is not set +# CONFIG_EXAMPLES_OSTEST is not set +# CONFIG_EXAMPLES_PASHELLO is not set +# CONFIG_EXAMPLES_PIPE is not set +# CONFIG_EXAMPLES_POLL is not set +# CONFIG_EXAMPLES_POSIXSPAWN is not set +# CONFIG_EXAMPLES_QENCODER is not set +# CONFIG_EXAMPLES_RGMP is not set +# CONFIG_EXAMPLES_ROMFS is not set +# CONFIG_EXAMPLES_SENDMAIL is not set +# CONFIG_EXAMPLES_SERLOOP is not set +# CONFIG_EXAMPLES_SLCD is not set +# CONFIG_EXAMPLES_SMART is not set +# CONFIG_EXAMPLES_TCPECHO is not set +# CONFIG_EXAMPLES_TELNETD is not set +# CONFIG_EXAMPLES_THTTPD is not set +# CONFIG_EXAMPLES_TIFF is not set +# CONFIG_EXAMPLES_TOUCHSCREEN is not set +# CONFIG_EXAMPLES_UDP is not set +# CONFIG_EXAMPLES_UIP is not set +# CONFIG_EXAMPLES_USBSERIAL is not set +# CONFIG_EXAMPLES_USBTERM is not set +# CONFIG_EXAMPLES_WATCHDOG is not set + +# +# Graphics Support +# +# CONFIG_TIFF is not set + +# +# Interpreters +# +# CONFIG_INTERPRETERS_FICL is not set +# CONFIG_INTERPRETERS_PCODE is not set + +# +# Network Utilities +# + +# +# Networking Utilities +# +# CONFIG_NETUTILS_CODECS is not set +# CONFIG_NETUTILS_DHCPD is not set +# CONFIG_NETUTILS_FTPC is not set +# CONFIG_NETUTILS_FTPD is not set +# CONFIG_NETUTILS_JSON is not set +# CONFIG_NETUTILS_SMTP is not set +# CONFIG_NETUTILS_TFTPC is not set +# CONFIG_NETUTILS_THTTPD is not set +# CONFIG_NETUTILS_UIPLIB is not set +# CONFIG_NETUTILS_WEBCLIENT is not set + +# +# FreeModBus +# +# CONFIG_MODBUS is not set + +# +# NSH Library +# +# CONFIG_NSH_LIBRARY is not set + +# +# NxWidgets/NxWM +# + +# +# Platform-specific Support +# +# CONFIG_PLATFORM_CONFIGDATA is not set + +# +# System Libraries and NSH Add-Ons +# + +# +# USB CDC/ACM Device Commands +# + +# +# USB Composite Device Commands +# + +# +# Custom Free Memory Command +# +# CONFIG_SYSTEM_FREE is not set + +# +# I2C tool +# + +# +# INI File Parser +# +# CONFIG_SYSTEM_INIFILE is not set + +# +# FLASH Program Installation +# +# CONFIG_SYSTEM_INSTALL is not set + +# +# FLASH Erase-all Command +# + +# +# NxPlayer media player library / command Line +# +# CONFIG_SYSTEM_NXPLAYER is not set + +# +# RAM test +# +# CONFIG_SYSTEM_RAMTEST is not set + +# +# readline() +# +# CONFIG_SYSTEM_READLINE is not set + +# +# Power Off +# +# CONFIG_SYSTEM_POWEROFF is not set + +# +# RAMTRON +# +# CONFIG_SYSTEM_RAMTRON is not set + +# +# SD Card +# +# CONFIG_SYSTEM_SDCARD is not set + +# +# Sysinfo +# +# CONFIG_SYSTEM_SYSINFO is not set + +# +# USB Monitor +# + +# +# Stack Monitor +# + +# +# USB Mass Storage Device Commands +# + +# +# Zmodem Commands +# +# CONFIG_SYSTEM_ZMODEM is not set diff --git a/configs/efm32-g8xx-stk/nsh/setenv.sh b/configs/efm32-g8xx-stk/nsh/setenv.sh new file mode 100755 index 0000000000..bf73cc9af1 --- /dev/null +++ b/configs/efm32-g8xx-stk/nsh/setenv.sh @@ -0,0 +1,63 @@ +#!/bin/bash +# configs/efm32-g8xx-stk/nsh/setenv.sh +# +# Copyright (C) 2014 Gregory Nutt. All rights reserved. +# Author: Gregory Nutt +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in +# the documentation and/or other materials provided with the +# distribution. +# 3. Neither the name NuttX nor the names of its contributors may be +# used to endorse or promote products derived from this software +# without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS +# OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED +# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +# POSSIBILITY OF SUCH DAMAGE. +# + +if [ "$_" = "$0" ] ; then + echo "You must source this script, not run it!" 1>&2 + exit 1 +fi + +WD=`pwd` +if [ ! -x "setenv.sh" ]; then + echo "This script must be executed from the top-level NuttX build directory" + exit 1 +fi + +if [ -z "${PATH_ORIG}" ]; then + export PATH_ORIG="${PATH}" +fi + +# This is the Cygwin path to the location where I installed the CodeSourcery +# toolchain under windows. You will also have to edit this if you install +# the CodeSourcery toolchain in any other location +export TOOLCHAIN_BIN="/cygdrive/c/Program Files (x86)/CodeSourcery/Sourcery G++ Lite/bin" +#export TOOLCHAIN_BIN="/cygdrive/c/Users/MyName/MentorGraphics/Sourcery_CodeBench_Lite_for_ARM_EABI/bin" + +# This is the Cygwin path to the location where I build the buildroot +# toolchain. +#export TOOLCHAIN_BIN="${WD}/../misc/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}" diff --git a/configs/efm32-g8xx-stk/scripts/ld.script b/configs/efm32-g8xx-stk/scripts/ld.script new file mode 100644 index 0000000000..a9e6c2202f --- /dev/null +++ b/configs/efm32-g8xx-stk/scripts/ld.script @@ -0,0 +1,110 @@ +/**************************************************************************** + * configs/efm32-g8xx-stk/scripts/ld.script + * + * Copyright (C) 2012, 2014 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. + * + ****************************************************************************/ + +MEMORY +{ + flash (rx) : ORIGIN = 0x00000000, LENGTH = 131072 + sram (rwx) : ORIGIN = 0x20000000, LENGTH = 16384 +} + +OUTPUT_ARCH(arm) +EXTERN(_vectors) +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) } +} diff --git a/configs/efm32-g8xx-stk/src/.gitignore b/configs/efm32-g8xx-stk/src/.gitignore new file mode 100644 index 0000000000..726d936e1e --- /dev/null +++ b/configs/efm32-g8xx-stk/src/.gitignore @@ -0,0 +1,2 @@ +/.depend +/Make.dep diff --git a/configs/efm32-g8xx-stk/src/Makefile b/configs/efm32-g8xx-stk/src/Makefile new file mode 100644 index 0000000000..49b07942cc --- /dev/null +++ b/configs/efm32-g8xx-stk/src/Makefile @@ -0,0 +1,77 @@ +############################################################################ +# configs/efm32-g8xx-stk/src/Makefile +# +# Copyright (C) 2014 Gregory Nutt. All rights reserved. +# Author: Gregory Nutt +# +# 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 + +CSRCS = efm32_boot.c + +COBJS = $(CSRCS:.c=$(OBJEXT)) +SRCS = $(ASRCS) $(CSRCS) +OBJS = $(AOBJS) $(COBJS) + +ARCH_SRCDIR = $(TOPDIR)/arch/$(CONFIG_ARCH)/src +ifeq ($(CONFIG_WINDOWS_NATIVE),y) + CFLAGS += -I$(ARCH_SRCDIR)\chip -I$(ARCH_SRCDIR)\common -I$(ARCH_SRCDIR)\armv7-m +else +ifeq ($(WINTOOL),y) + CFLAGS += -I "${shell cygpath -w $(ARCH_SRCDIR)/chip}" \ + -I "${shell cygpath -w $(ARCH_SRCDIR)/common}" \ + -I "${shell cygpath -w $(ARCH_SRCDIR)/armv7-m}" +else + CFLAGS += -I$(ARCH_SRCDIR)/chip -I$(ARCH_SRCDIR)/common -I$(ARCH_SRCDIR)/armv7-m +endif +endif + +$(COBJS) $(LINKOBJS): %$(OBJEXT): %.c + $(call COMPILE, $<, $@) + +libboard$(LIBEXT): $(OBJS) + $(call ARCHIVE, $@, $(OBJS)) + +.depend: Makefile $(SRCS) + $(Q) $(MKDEP) $(CC) -- $(CFLAGS) -- $(SRCS) >Make.dep + $(Q) touch $@ + +depend: .depend + +clean: + $(call DELFILE, libboard$(LIBEXT)) + $(call CLEAN) + +distclean: clean + $(call DELFILE, Make.dep) + $(call DELFILE, .depend) + +-include Make.dep diff --git a/configs/efm32-g8xx-stk/src/efm32-g8xx-stk.h b/configs/efm32-g8xx-stk/src/efm32-g8xx-stk.h new file mode 100644 index 0000000000..21ac078a97 --- /dev/null +++ b/configs/efm32-g8xx-stk/src/efm32-g8xx-stk.h @@ -0,0 +1,47 @@ +/**************************************************************************** + * configs/efm32-g8xx-stk/src/efm32-g8xx-stk.h + * + * Copyright (C) 2014 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * 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_EFM32_G8XX_STK_SRC_EFM32_G8XX_STK_H +#define __CONFIGS_EFM32_G8XX_STK_SRC_EFM32_G8XX_STK_H + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +/**************************************************************************** + * Public Function Prototypes + ****************************************************************************/ + +#endif /* __CONFIGS_EFM32_DK3650_INCLUDE_BOARD_H */ diff --git a/configs/efm32-g8xx-stk/src/efm32_boot.c b/configs/efm32-g8xx-stk/src/efm32_boot.c new file mode 100644 index 0000000000..4529b32610 --- /dev/null +++ b/configs/efm32-g8xx-stk/src/efm32_boot.c @@ -0,0 +1,79 @@ +/***************************************************************************** + * configs/efm32-dk3650/src/efm32_boot.c + * + * Copyright (C) 2014 Richard Cochran. All rights reserved. + * Author: Richard Cochran + * + * 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 + +#include "efm3_g8xx_stk.h" + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +/************************************************************************************ + * Name: efm32_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 efm32_boardinitialize(void) +{ +} + +/**************************************************************************** + * 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_initialize() 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) +{ +} +#endif From b41dd463f23b52406b0a09acb6b690486de5e255 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Fri, 17 Oct 2014 09:25:52 -0600 Subject: [PATCH 02/13] Add configuration support for the EFM32 Gecko Starter Kit --- configs/Kconfig | 12 + configs/efm32-g8xx-stk/nsh/defconfig | 354 +++++++++++++++++++++------ 2 files changed, 294 insertions(+), 72 deletions(-) diff --git a/configs/Kconfig b/configs/Kconfig index 8104c8705e..dc7cf28c1a 100755 --- a/configs/Kconfig +++ b/configs/Kconfig @@ -126,6 +126,14 @@ config ARCH_BOARD_EAGLE100 an ARM Cortex-M3 MCU, the Luminary LM3S6918. This OS is built with the arm-nuttx-elf toolchain*. STATUS: This port is complete and mature. +config ARCH_BOARD_EFM32G8XXSTK + bool "EFM32 Gecko Starter Kit" + depends on ARCH_CHIP_EFM32G890F128 + select ARCH_HAVE_LEDS + select ARCH_HAVE_BUTTONS + ---help--- + This options selects the EFM32 Gecko Starter Kit (EFM32-G8XX-STK). + config ARCH_BOARD_EKKLM3S9B96 bool "TI/Stellaris EKK-LM3S9B96" depends on ARCH_CHIP_LM3S9B96 @@ -969,6 +977,7 @@ config ARCH_BOARD default "ea3131" if ARCH_BOARD_EA3131 default "ea3152" if ARCH_BOARD_EA3152 default "eagle100" if ARCH_BOARD_EAGLE100 + default "efm32-g8xx-stk" if ARCH_BOARD_EFM32G8XXSTK default "ekk-lm3s9b96" if ARCH_BOARD_EKKLM3S9B96 default "ez80f910200kitg" if ARCH_BOARD_EZ80F910200KITG default "ez80f910200zco" if ARCH_BOARD_EZ80F910200ZCO @@ -1140,6 +1149,9 @@ endif if ARCH_BOARD_EAGLE100 source "configs/eagle100/Kconfig" endif +if ARCH_BOARD_EFM32G8XXSTK +source "configs/efm32-g8xx-stk/Kconfig" +endif if ARCH_BOARD_EKKLM3S9B96 source "configs/ekk-lm3s9b96/Kconfig" endif diff --git a/configs/efm32-g8xx-stk/nsh/defconfig b/configs/efm32-g8xx-stk/nsh/defconfig index 588c4d39a8..10893bca75 100644 --- a/configs/efm32-g8xx-stk/nsh/defconfig +++ b/configs/efm32-g8xx-stk/nsh/defconfig @@ -2,21 +2,26 @@ # Automatically generated file; DO NOT EDIT. # Nuttx/ Configuration # -CONFIG_NUTTX_NEWCONFIG=y # # Build Setup # # CONFIG_EXPERIMENTAL is not set +# CONFIG_DEFAULT_SMALL is not set +# CONFIG_HOST_LINUX is not set # CONFIG_HOST_OSX is not set CONFIG_HOST_WINDOWS=y # CONFIG_HOST_OTHER is not set +# CONFIG_WINDOWS_NATIVE is not set CONFIG_WINDOWS_CYGWIN=y +# CONFIG_WINDOWS_MSYS is not set +# CONFIG_WINDOWS_OTHER is not set # # Build Configuration # -CONFIG_APPS_DIR="../apps" +# CONFIG_APPS_DIR="../apps" +CONFIG_BUILD_FLAT=y # CONFIG_BUILD_2PASS is not set # @@ -26,10 +31,12 @@ CONFIG_APPS_DIR="../apps" # CONFIG_INTELHEX_BINARY is not set # CONFIG_MOTOROLA_SREC is not set CONFIG_RAW_BINARY=y +# CONFIG_UBOOT_UIMAGE is not set # # Customize Header Files # +# CONFIG_ARCH_STDINT_H is not set # CONFIG_ARCH_STDBOOL_H is not set # CONFIG_ARCH_MATH_H is not set # CONFIG_ARCH_FLOAT_H is not set @@ -41,13 +48,15 @@ CONFIG_RAW_BINARY=y # CONFIG_DEBUG is not set CONFIG_ARCH_HAVE_STACKCHECK=y # CONFIG_ARCH_HAVE_HEAPCHECK is not set -CONFIG_DEBUG_SYMBOLS=y +# CONFIG_DEBUG_SYMBOLS is not set +CONFIG_ARCH_HAVE_CUSTOMOPT=y # CONFIG_DEBUG_NOOPT is not set +# CONFIG_DEBUG_CUSTOMOPT is not set +CONFIG_DEBUG_FULLOPT=y # # System Type # -# CONFIG_ARCH_8051 is not set CONFIG_ARCH_ARM=y # CONFIG_ARCH_AVR is not set # CONFIG_ARCH_HC is not set @@ -72,6 +81,7 @@ CONFIG_ARCH_CHIP_EFM32=y # CONFIG_ARCH_CHIP_KINETIS is not set # CONFIG_ARCH_CHIP_KL is not set # CONFIG_ARCH_CHIP_LM is not set +# CONFIG_ARCH_CHIP_TIVA is not set # CONFIG_ARCH_CHIP_LPC17XX is not set # CONFIG_ARCH_CHIP_LPC214X is not set # CONFIG_ARCH_CHIP_LPC2378 is not set @@ -79,6 +89,7 @@ CONFIG_ARCH_CHIP_EFM32=y # CONFIG_ARCH_CHIP_LPC43XX is not set # CONFIG_ARCH_CHIP_NUC1XX is not set # CONFIG_ARCH_CHIP_SAMA5 is not set +# CONFIG_ARCH_CHIP_SAMD is not set # CONFIG_ARCH_CHIP_SAM34 is not set # CONFIG_ARCH_CHIP_STM32 is not set # CONFIG_ARCH_CHIP_STR71X is not set @@ -96,19 +107,29 @@ CONFIG_ARCH_CHIP="efm32" CONFIG_ARCH_HAVE_CMNVECTOR=y CONFIG_ARMV7M_CMNVECTOR=y # CONFIG_ARCH_HAVE_FPU is not set -# CONFIG_ARCH_HAVE_MPU is not set # # ARMV7M Configuration Options # +# CONFIG_ARMV7M_TOOLCHAIN_ATOLLIC is not set # CONFIG_ARMV7M_TOOLCHAIN_BUILDROOT is not set -# CONFIG_ARMV7M_TOOLCHAIN_CODEREDL is not set +# CONFIG_ARMV7M_TOOLCHAIN_CODEREDW is not set CONFIG_ARMV7M_TOOLCHAIN_CODESOURCERYW=y +# CONFIG_ARMV7M_TOOLCHAIN_DEVKITARM is not set +# CONFIG_ARMV7M_TOOLCHAIN_GNU_EABIL is not set +# CONFIG_ARMV7M_TOOLCHAIN_GNU_EABIW is not set +# CONFIG_ARMV7M_TOOLCHAIN_RAISONANCE is not set # # EFM32 Configuration Options # +# CONFIG_ARCH_CHIP_EFM32TG840F32 is not set +# CONFIG_ARCH_CHIP_EFM32G880F128 is not set CONFIG_ARCH_CHIP_EFM32G890F128=y +# CONFIG_ARCH_CHIP_EFM32GG332F1024 is not set +# CONFIG_EFM32_EFM32TG is not set +CONFIG_EFM32_EFM32G=y +# CONFIG_EFM32_EFM32GG is not set # # Architecture Options @@ -117,12 +138,19 @@ CONFIG_ARCH_CHIP_EFM32G890F128=y # CONFIG_ARCH_VECNOTIRQ is not set # CONFIG_ARCH_DMA is not set CONFIG_ARCH_HAVE_IRQPRIO=y -# CONFIG_CUSTOM_STACK is not set -# CONFIG_ADDRENV is not set +# CONFIG_ARCH_L2CACHE is not set +# CONFIG_ARCH_HAVE_COHERENT_DCACHE is not set +# CONFIG_ARCH_HAVE_ADDRENV is not set +# CONFIG_ARCH_NEED_ADDRENV_MAPPING is not set CONFIG_ARCH_HAVE_VFORK=y +# CONFIG_ARCH_HAVE_MMU is not set +# CONFIG_ARCH_HAVE_MPU is not set +# CONFIG_ARCH_NAND_HWECC is not set +# CONFIG_ARCH_HAVE_EXTCLK is not set # CONFIG_ARCH_IRQPRIO is not set CONFIG_ARCH_STACKDUMP=y # CONFIG_ENDIAN_BIG is not set +# CONFIG_ARCH_IDLE_CUSTOM is not set # CONFIG_ARCH_HAVE_RAMFUNCS is not set CONFIG_ARCH_HAVE_RAMVECTORS=y # CONFIG_ARCH_RAMVECTORS is not set @@ -155,6 +183,7 @@ CONFIG_BOOT_RUNFROMFLASH=y # CONFIG_RAM_START=0x20000000 CONFIG_RAM_SIZE=32768 +# CONFIG_ARCH_HAVE_SDRAM is not set # # Board Selection @@ -166,48 +195,87 @@ CONFIG_ARCH_BOARD="efm32-g8xx-stk" # # Common Board Options # +CONFIG_ARCH_HAVE_LEDS=y +CONFIG_ARCH_LEDS=y +CONFIG_ARCH_HAVE_BUTTONS=y +# CONFIG_ARCH_BUTTONS is not set +CONFIG_NSH_MMCSDMINOR=0 # # Board-Specific Options # -# -# EFM32 DK3650 Hardware Configuration -# - # # RTOS Features # -# CONFIG_BOARD_INITIALIZE is not set -CONFIG_MSEC_PER_TICK=10 -# CONFIG_SYSTEM_TIME64 is not set -CONFIG_RR_INTERVAL=200 -# CONFIG_SCHED_INSTRUMENTATION is not set -CONFIG_TASK_NAME_SIZE=0 -# CONFIG_SCHED_HAVE_PARENT is not set -# CONFIG_JULIAN_TIME is not set -CONFIG_START_YEAR=2010 -CONFIG_START_MONTH=5 -CONFIG_START_DAY=6 -CONFIG_DEV_CONSOLE=y -# CONFIG_MUTEX_TYPES is not set -# CONFIG_PRIORITY_INHERITANCE is not set -# CONFIG_FDCLONE_DISABLE is not set -# CONFIG_FDCLONE_STDIO is not set -CONFIG_SDCLONE_DISABLE=y -# CONFIG_SCHED_WAITPID is not set -# CONFIG_SCHED_STARTHOOK is not set -# CONFIG_SCHED_ATEXIT is not set -# CONFIG_SCHED_ONEXIT is not set -CONFIG_USER_ENTRYPOINT="nsh_main" CONFIG_DISABLE_OS_API=y -# CONFIG_DISABLE_CLOCK is not set # CONFIG_DISABLE_POSIX_TIMERS is not set # CONFIG_DISABLE_PTHREAD is not set # CONFIG_DISABLE_SIGNALS is not set # CONFIG_DISABLE_MQUEUE is not set CONFIG_DISABLE_ENVIRON=y +# +# Clocks and Timers +# +CONFIG_USEC_PER_TICK=10000 +# CONFIG_SYSTEM_TIME64 is not set +# CONFIG_CLOCK_MONOTONIC is not set +# CONFIG_JULIAN_TIME is not set +CONFIG_START_YEAR=2010 +CONFIG_START_MONTH=5 +CONFIG_START_DAY=6 +CONFIG_MAX_WDOGPARMS=2 +CONFIG_PREALLOC_WDOGS=4 +CONFIG_WDOG_INTRESERVE=1 +CONFIG_PREALLOC_TIMERS=4 + +# +# Tasks and Scheduling +# +# CONFIG_INIT_NONE is not set +CONFIG_INIT_ENTRYPOINT=y +# CONFIG_INIT_FILEPATH is not set +CONFIG_USER_ENTRYPOINT="nsh_main" +CONFIG_RR_INTERVAL=200 +CONFIG_TASK_NAME_SIZE=0 +CONFIG_MAX_TASK_ARGS=4 +CONFIG_MAX_TASKS=16 +# CONFIG_SCHED_HAVE_PARENT is not set +# CONFIG_SCHED_WAITPID is not set + +# +# Pthread Options +# +# CONFIG_MUTEX_TYPES is not set +CONFIG_NPTHREAD_KEYS=4 + +# +# Performance Monitoring +# +# CONFIG_SCHED_CPULOAD is not set +# CONFIG_SCHED_INSTRUMENTATION is not set + +# +# Files and I/O +# +CONFIG_DEV_CONSOLE=y +# CONFIG_FDCLONE_DISABLE is not set +# CONFIG_FDCLONE_STDIO is not set +CONFIG_SDCLONE_DISABLE=y +CONFIG_NFILE_DESCRIPTORS=8 +CONFIG_NFILE_STREAMS=8 +CONFIG_NAME_MAX=32 +# CONFIG_PRIORITY_INHERITANCE is not set + +# +# RTOS hooks +# +# CONFIG_BOARD_INITIALIZE is not set +# CONFIG_SCHED_STARTHOOK is not set +# CONFIG_SCHED_ATEXIT is not set +# CONFIG_SCHED_ONEXIT is not set + # # Signal Numbers # @@ -217,20 +285,17 @@ CONFIG_SIG_SIGALARM=3 CONFIG_SIG_SIGCONDTIMEDOUT=16 # -# Sizes of configurable things (0 disables) +# POSIX Message Queue Options # -CONFIG_MAX_TASKS=16 -CONFIG_MAX_TASK_ARGS=4 -CONFIG_NPTHREAD_KEYS=4 -CONFIG_NFILE_DESCRIPTORS=8 -CONFIG_NFILE_STREAMS=8 -CONFIG_NAME_MAX=32 CONFIG_PREALLOC_MQ_MSGS=4 CONFIG_MQ_MAXMSGSIZE=32 -CONFIG_MAX_WDOGPARMS=2 -CONFIG_PREALLOC_WDOGS=4 -CONFIG_PREALLOC_TIMERS=4 -CONFIG_WDOG_INTRESERVE=1 + +# +# Work Queue Support +# +# CONFIG_SCHED_WORKQUEUE is not set +# CONFIG_SCHED_HPWORK is not set +# CONFIG_SCHED_LPWORK is not set # # Stack and heap information @@ -239,6 +304,7 @@ CONFIG_IDLETHREAD_STACKSIZE=1024 CONFIG_USERMAIN_STACKSIZE=2048 CONFIG_PTHREAD_STACK_MIN=256 CONFIG_PTHREAD_STACK_DEFAULT=2048 +# CONFIG_LIB_SYSCALL is not set # # Device Drivers @@ -247,6 +313,12 @@ CONFIG_DISABLE_POLL=y CONFIG_DEV_NULL=y # CONFIG_DEV_ZERO is not set # CONFIG_LOOP is not set + +# +# Buffering +# +# CONFIG_DRVR_WRITEBUFFER is not set +# CONFIG_DRVR_READAHEAD is not set # CONFIG_RAMDISK is not set # CONFIG_CAN is not set # CONFIG_ARCH_HAVE_PWM_PULSECOUNT is not set @@ -257,6 +329,7 @@ CONFIG_DEV_NULL=y # CONFIG_I2S is not set # CONFIG_RTC is not set # CONFIG_WATCHDOG is not set +# CONFIG_TIMER is not set # CONFIG_ANALOG is not set # CONFIG_AUDIO_DEVICES is not set # CONFIG_VIDEO_DEVICES is not set @@ -273,10 +346,32 @@ CONFIG_DEV_NULL=y CONFIG_SERIAL=y CONFIG_DEV_LOWCONSOLE=y # CONFIG_16550_UART is not set +# CONFIG_ARCH_HAVE_UART is not set +# CONFIG_ARCH_HAVE_UART0 is not set +# CONFIG_ARCH_HAVE_UART1 is not set +# CONFIG_ARCH_HAVE_UART2 is not set +# CONFIG_ARCH_HAVE_UART3 is not set +# CONFIG_ARCH_HAVE_UART4 is not set +# CONFIG_ARCH_HAVE_UART5 is not set +# CONFIG_ARCH_HAVE_UART6 is not set +# CONFIG_ARCH_HAVE_UART7 is not set +# CONFIG_ARCH_HAVE_UART8 is not set +# CONFIG_ARCH_HAVE_SCI0 is not set +# CONFIG_ARCH_HAVE_SCI1 is not set +# CONFIG_ARCH_HAVE_USART0 is not set +# CONFIG_ARCH_HAVE_USART1 is not set +# CONFIG_ARCH_HAVE_USART2 is not set +# CONFIG_ARCH_HAVE_USART3 is not set +# CONFIG_ARCH_HAVE_USART4 is not set +# CONFIG_ARCH_HAVE_USART5 is not set +# CONFIG_ARCH_HAVE_USART6 is not set +# CONFIG_ARCH_HAVE_USART7 is not set +# CONFIG_ARCH_HAVE_USART8 is not set # # USART Configuration # +# CONFIG_MCU_SERIAL is not set # CONFIG_SERIAL_IFLOWCONTROL is not set # CONFIG_SERIAL_OFLOWCONTROL is not set # CONFIG_USBDEV is not set @@ -299,6 +394,11 @@ CONFIG_DEV_LOWCONSOLE=y # CONFIG_ARCH_HAVE_PHY is not set # CONFIG_NET is not set +# +# Crypto API +# +# CONFIG_CRYPTO is not set + # # File Systems # @@ -307,15 +407,17 @@ CONFIG_DEV_LOWCONSOLE=y # File system configuration # CONFIG_DISABLE_MOUNTPOINT=y +# CONFIG_DISABLE_PSEUDOFS_OPERATIONS is not set # CONFIG_FS_READABLE is not set # CONFIG_FS_WRITABLE is not set +# CONFIG_FS_NAMED_SEMAPHORES is not set +CONFIG_FS_MQUEUE_MPATH="/var/mqueue" # CONFIG_FS_RAMMAP is not set # CONFIG_FS_PROCFS is not set # # System Logging # -# CONFIG_SYSLOG_ENABLE is not set # CONFIG_SYSLOG is not set # @@ -326,9 +428,9 @@ CONFIG_DISABLE_MOUNTPOINT=y # # Memory Management # -# CONFIG_MM_MULTIHEAP is not set # CONFIG_MM_SMALL is not set CONFIG_MM_REGIONS=1 +# CONFIG_ARCH_HAVE_HEAP2 is not set # CONFIG_GRAN is not set # @@ -337,7 +439,7 @@ CONFIG_MM_REGIONS=1 # CONFIG_AUDIO is not set # -# Binary Formats +# Binary Loader # # CONFIG_BINFMT_DISABLE is not set # CONFIG_NXFLAT is not set @@ -377,7 +479,6 @@ CONFIG_LIB_SENDFILE_BUFSIZE=512 # # Non-standard Library Support # -# CONFIG_SCHED_WORKQUEUE is not set # CONFIG_LIB_KBDCODEC is not set # CONFIG_LIB_SLCDCODEC is not set @@ -401,6 +502,7 @@ CONFIG_LIB_SENDFILE_BUFSIZE=512 # CONFIG_EXAMPLES_BUTTONS is not set # CONFIG_EXAMPLES_CAN is not set # CONFIG_EXAMPLES_CONFIGDATA is not set +# CONFIG_EXAMPLES_CPUHOG is not set # CONFIG_EXAMPLES_DHCPD is not set # CONFIG_EXAMPLES_ELF is not set # CONFIG_EXAMPLES_FTPC is not set @@ -411,7 +513,6 @@ CONFIG_LIB_SENDFILE_BUFSIZE=512 # CONFIG_EXAMPLES_HIDKBD is not set # CONFIG_EXAMPLES_KEYPADTEST is not set # CONFIG_EXAMPLES_IGMP is not set -# CONFIG_EXAMPLES_LCDRW is not set # CONFIG_EXAMPLES_MM is not set # CONFIG_EXAMPLES_MODBUS is not set # CONFIG_EXAMPLES_MOUNT is not set @@ -419,7 +520,7 @@ CONFIG_LIB_SENDFILE_BUFSIZE=512 CONFIG_EXAMPLES_NSH=y # CONFIG_EXAMPLES_NULL is not set # CONFIG_EXAMPLES_NX is not set -# CONFIG_EXAMPLES_NXCONSOLE is not set +# CONFIG_EXAMPLES_NXTERM is not set # CONFIG_EXAMPLES_NXFFS is not set # CONFIG_EXAMPLES_NXFLAT is not set # CONFIG_EXAMPLES_NXHELLO is not set @@ -427,7 +528,6 @@ CONFIG_EXAMPLES_NSH=y # CONFIG_EXAMPLES_NXLINES is not set # CONFIG_EXAMPLES_NXTEXT is not set # CONFIG_EXAMPLES_OSTEST is not set -# CONFIG_EXAMPLES_PASHELLO is not set # CONFIG_EXAMPLES_PIPE is not set # CONFIG_EXAMPLES_POLL is not set # CONFIG_EXAMPLES_POSIXSPAWN is not set @@ -435,6 +535,8 @@ CONFIG_EXAMPLES_NSH=y # CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_ROMFS is not set # CONFIG_EXAMPLES_SENDMAIL is not set +# CONFIG_EXAMPLES_SERIALBLASTER is not set +# CONFIG_EXAMPLES_SERIALRX is not set # CONFIG_EXAMPLES_SERLOOP is not set # CONFIG_EXAMPLES_SLCD is not set # CONFIG_EXAMPLES_SMART is not set @@ -444,7 +546,7 @@ CONFIG_EXAMPLES_NSH=y # CONFIG_EXAMPLES_TIFF is not set # CONFIG_EXAMPLES_TOUCHSCREEN is not set # CONFIG_EXAMPLES_UDP is not set -# CONFIG_EXAMPLES_UIP is not set +# CONFIG_EXAMPLES_WEBSERVER is not set # CONFIG_EXAMPLES_USBSERIAL is not set # CONFIG_EXAMPLES_USBTERM is not set # CONFIG_EXAMPLES_WATCHDOG is not set @@ -475,7 +577,7 @@ CONFIG_EXAMPLES_NSH=y # CONFIG_NETUTILS_SMTP is not set # CONFIG_NETUTILS_TFTPC is not set # CONFIG_NETUTILS_THTTPD is not set -# CONFIG_NETUTILS_UIPLIB is not set +# CONFIG_NETUTILS_NETLIB is not set # CONFIG_NETUTILS_WEBCLIENT is not set # @@ -486,7 +588,85 @@ CONFIG_EXAMPLES_NSH=y # # NSH Library # -# CONFIG_NSH_LIBRARY is not set +CONFIG_NSH_LIBRARY=y + +# +# Command Line Configuration +# +# CONFIG_NSH_READLINE is not set +CONFIG_NSH_CLE=y +CONFIG_NSH_LINELEN=78 +# CONFIG_NSH_DISABLE_SEMICOLON is not set +CONFIG_NSH_MAXARGUMENTS=6 +CONFIG_NSH_ARGCAT=y +CONFIG_NSH_NESTDEPTH=3 +# CONFIG_NSH_DISABLEBG is not set + +# +# Disable Individual commands +# +# CONFIG_NSH_DISABLE_ADDROUTE is not set +# CONFIG_NSH_DISABLE_CAT is not set +# CONFIG_NSH_DISABLE_CD is not set +# CONFIG_NSH_DISABLE_CP is not set +# CONFIG_NSH_DISABLE_CMP is not set +# CONFIG_NSH_DISABLE_DD is not set +# CONFIG_NSH_DISABLE_DF is not set +# CONFIG_NSH_DISABLE_DELROUTE is not set +# CONFIG_NSH_DISABLE_ECHO is not set +# CONFIG_NSH_DISABLE_EXEC is not set +# CONFIG_NSH_DISABLE_EXIT is not set +# CONFIG_NSH_DISABLE_FREE is not set +# CONFIG_NSH_DISABLE_GET is not set +# CONFIG_NSH_DISABLE_HELP is not set +# CONFIG_NSH_DISABLE_HEXDUMP is not set +# CONFIG_NSH_DISABLE_IFCONFIG is not set +# CONFIG_NSH_DISABLE_KILL is not set +# CONFIG_NSH_DISABLE_LOSETUP is not set +# CONFIG_NSH_DISABLE_LS is not set +# CONFIG_NSH_DISABLE_MB is not set +# CONFIG_NSH_DISABLE_MKDIR is not set +# CONFIG_NSH_DISABLE_MKFIFO is not set +# CONFIG_NSH_DISABLE_MKRD is not set +# CONFIG_NSH_DISABLE_MH is not set +# CONFIG_NSH_DISABLE_MOUNT is not set +# CONFIG_NSH_DISABLE_MW is not set +# CONFIG_NSH_DISABLE_PS is not set +# CONFIG_NSH_DISABLE_PUT is not set +# CONFIG_NSH_DISABLE_PWD is not set +# CONFIG_NSH_DISABLE_RM is not set +# CONFIG_NSH_DISABLE_RMDIR is not set +# CONFIG_NSH_DISABLE_SET is not set +# CONFIG_NSH_DISABLE_SH is not set +# CONFIG_NSH_DISABLE_SLEEP is not set +# CONFIG_NSH_DISABLE_TEST is not set +# CONFIG_NSH_DISABLE_UMOUNT is not set +# CONFIG_NSH_DISABLE_UNSET is not set +# CONFIG_NSH_DISABLE_USLEEP is not set +# CONFIG_NSH_DISABLE_WGET is not set +# CONFIG_NSH_DISABLE_XD is not set + +# +# Configure Command Options +# +CONFIG_NSH_CMDOPT_DF_H=y +CONFIG_NSH_CODECS_BUFSIZE=128 +CONFIG_NSH_CMDOPT_HEXDUMP=y +CONFIG_NSH_FILEIOSIZE=256 + +# +# Scripting Support +# +# CONFIG_NSH_DISABLESCRIPT is not set +# CONFIG_NSH_DISABLE_ITEF is not set +# CONFIG_NSH_DISABLE_LOOPS is not set + +# +# Console Configuration +# +CONFIG_NSH_CONSOLE=y +# CONFIG_NSH_ALTCONDEV is not set +# CONFIG_NSH_ARCHINIT is not set # # NxWidgets/NxWM @@ -501,27 +681,16 @@ CONFIG_EXAMPLES_NSH=y # System Libraries and NSH Add-Ons # -# -# USB CDC/ACM Device Commands -# - -# -# USB Composite Device Commands -# - # # Custom Free Memory Command # # CONFIG_SYSTEM_FREE is not set # -# I2C tool +# EMACS-like Command Line Editor # - -# -# INI File Parser -# -# CONFIG_SYSTEM_INIFILE is not set +CONFIG_SYSTEM_CLE=y +CONFIG_SYSTEM_CLE_DEBUGLEVEL=0 # # FLASH Program Installation @@ -532,6 +701,20 @@ CONFIG_EXAMPLES_NSH=y # FLASH Erase-all Command # +# +# Intel HEX to binary conversion +# +# CONFIG_SYSTEM_HEX2BIN is not set + +# +# I2C tool +# + +# +# INI File Parser +# +# CONFIG_SYSTEM_INIFILE is not set + # # NxPlayer media player library / command Line # @@ -545,7 +728,16 @@ CONFIG_EXAMPLES_NSH=y # # readline() # -# CONFIG_SYSTEM_READLINE is not set +CONFIG_SYSTEM_READLINE=y +CONFIG_READLINE_ECHO=y + +# +# P-Code Support +# + +# +# PHY Tool +# # # Power Off @@ -562,23 +754,41 @@ CONFIG_EXAMPLES_NSH=y # # CONFIG_SYSTEM_SDCARD is not set +# +# Sudoku +# +# CONFIG_SYSTEM_SUDOKU is not set + # # Sysinfo # # CONFIG_SYSTEM_SYSINFO is not set # -# USB Monitor +# VI Work-Alike Editor # +# CONFIG_SYSTEM_VI is not set # # Stack Monitor # +# +# USB CDC/ACM Device Commands +# + +# +# USB Composite Device Commands +# + # # USB Mass Storage Device Commands # +# +# USB Monitor +# + # # Zmodem Commands # From 84f26a3d0725f4790f4d55cd5246b7779af7064f Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Fri, 17 Oct 2014 10:34:39 -0600 Subject: [PATCH 03/13] Add EFM32 interrupt vector defintions --- configs/efm32-g8xx-stk/README.txt | 16 ++++++++++++++++ configs/efm32-g8xx-stk/nsh/Make.defs | 4 ++-- configs/efm32-g8xx-stk/src/efm32_boot.c | 2 +- 3 files changed, 19 insertions(+), 3 deletions(-) create mode 100644 configs/efm32-g8xx-stk/README.txt diff --git a/configs/efm32-g8xx-stk/README.txt b/configs/efm32-g8xx-stk/README.txt new file mode 100644 index 0000000000..46fa9400dd --- /dev/null +++ b/configs/efm32-g8xx-stk/README.txt @@ -0,0 +1,16 @@ +README +====== + + This README file discusses the port of NuttX to the Silicon Labs EFM32™ Gecko Starter Kit (EFM32-G8XX-STK). The Gecko Starter Kit features: + + • EFM32G890F128 MCU with 128 kB flash and 16 kB RAM + • 32.768 kHz crystal + • 32 MHz crystal + • Advanced Energy Monitoring + • Touch slider + • 4x40 LCD + • 4 User LEDs + • 2 pushbutton switches + • Reset button and a switch to disconnect the battery. + • On-board SEGGER J-Link USB emulator + • ARM 20 pin JTAG/SWD standard Debug in/out connector diff --git a/configs/efm32-g8xx-stk/nsh/Make.defs b/configs/efm32-g8xx-stk/nsh/Make.defs index 47fdb324d8..4b7e461548 100644 --- a/configs/efm32-g8xx-stk/nsh/Make.defs +++ b/configs/efm32-g8xx-stk/nsh/Make.defs @@ -46,13 +46,13 @@ ifeq ($(WINTOOL),y) 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}" + 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 + ARCHSCRIPT = -T$(TOPDIR)/configs/$(CONFIG_ARCH_BOARD)/scripts/$(LDSCRIPT) endif CC = $(CROSSDEV)gcc diff --git a/configs/efm32-g8xx-stk/src/efm32_boot.c b/configs/efm32-g8xx-stk/src/efm32_boot.c index 4529b32610..ebe9ad0df1 100644 --- a/configs/efm32-g8xx-stk/src/efm32_boot.c +++ b/configs/efm32-g8xx-stk/src/efm32_boot.c @@ -39,7 +39,7 @@ #include -#include "efm3_g8xx_stk.h" +#include "efm32-g8xx-stk.h" /**************************************************************************** * Public Functions From cee68cc44eec5ef9beb5f1b9b090db55a156ea67 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Fri, 17 Oct 2014 12:02:32 -0600 Subject: [PATCH 04/13] More EFM32 files and logic --- configs/efm32-g8xx-stk/README.txt | 70 +++++++++++++++++++++++++ configs/efm32-g8xx-stk/include/board.h | 64 ++++++++++++++++++++++ configs/efm32-g8xx-stk/src/efm32_boot.c | 18 ++++--- 3 files changed, 144 insertions(+), 8 deletions(-) diff --git a/configs/efm32-g8xx-stk/README.txt b/configs/efm32-g8xx-stk/README.txt index 46fa9400dd..ed375c1c5f 100644 --- a/configs/efm32-g8xx-stk/README.txt +++ b/configs/efm32-g8xx-stk/README.txt @@ -14,3 +14,73 @@ README • Reset button and a switch to disconnect the battery. • On-board SEGGER J-Link USB emulator • ARM 20 pin JTAG/SWD standard Debug in/out connector + +LEDs +==== + + The EFM32 Gecko Start Kithas four yellow LEDs. 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/efm32_autoleds.c. + The LEDs are used to encode OS-related events as follows: + + SYMBOL Meaning LED1* LED2 LED3 LED4 + ----------------- ----------------------- ------ ----- ----- ------ + LED_STARTED NuttX has been started ON OFF OFF OFF + LED_HEAPALLOCATE Heap has been allocated OFF ON OFF OFF + LED_IRQSENABLED Interrupts enabled ON ON OFF OFF + LED_STACKCREATED Idle stack created OFF OFF ON OFF + LED_INIRQ In an interrupt** ON N/C N/C OFF + LED_SIGNAL In a signal handler*** N/C ON N/C OFF + LED_ASSERTION An assertion failed ON ON N/C OFF + LED_PANIC The system has crashed N/C N/C N/C ON + LED_IDLE STM32 is is sleep mode (Optional, not used) + + * If LED1, LED2, LED3 are statically on, then NuttX probably failed to boot + and these LEDs will give you some indication of where the failure was + ** The normal state is LED3 ON and LED1 faintly glowing. This faint glow + is because of timer interrupt that result in the LED being illuminated + on a small proportion of the time. +*** LED2 may also flicker normally if signals are processed. + +Configurations +============== + Each EFM32 Gecko Starter Kit configuration is maintained in a sub-director + and can be selected as follow: + + cd tools + ./configure.sh efm32-g8xx-stk/ + cd - + . ./setenv.sh + + If this is a Windows native build, then configure.bat should be used + instead of configure.sh: + + configure.bat STM32F4Discovery\ + + Where is one of the following: + + nsh: + --- + Configures the NuttShell (nsh) located at apps/examples/nsh. The + Configuration enables the serial interfaces on USARTx. Support for + builtin applications is enabled, but in the base configuration no + builtin applications are selected (see NOTES below). + + NOTES: + + 1. This configuration uses the mconf-based configuration tool. To + change this configuration using that tool, you should: + + a. Build and install the kconfig-mconf tool. See nuttx/README.txt + and misc/tools/ + + b. Execute 'make menuconfig' in nuttx/ in order to start the + reconfiguration process. + + 2. By default, this configuration uses the CodeSourcery toolchain + for Windows and builds under Cygwin (or probably MSYS). That + can easily be reconfigured, of course. + + CONFIG_HOST_WINDOWS=y : Builds under Windows + CONFIG_WINDOWS_CYGWIN=y : Using Cygwin + CONFIG_ARMV7M_TOOLCHAIN_CODESOURCERYW=y : CodeSourcery for Windows diff --git a/configs/efm32-g8xx-stk/include/board.h b/configs/efm32-g8xx-stk/include/board.h index ddc32d0707..eb2bb574f2 100644 --- a/configs/efm32-g8xx-stk/include/board.h +++ b/configs/efm32-g8xx-stk/include/board.h @@ -40,8 +40,72 @@ * Included Files ****************************************************************************/ +#include + +#include + +/**************************************************************************** + * Pre-Processor Definitions + ****************************************************************************/ +/* The EFM32 Gecko Starter Kit supports 4 yellow LEDs. One side is grounded + * so these LEDs are illuminated by outputting a high value. + * + * If CONFIG_ARCH_LEDS is not defined, then the user can control the LEDs in + * any way. The following definitions are used to access individual LEDs. + */ + +/* LED index values for use with efm32_setled() */ + +#define BOARD_LED1 0 +#define BOARD_LED2 1 +#define BOARD_LED3 2 +#define BOARD_LED4 3 +#define BOARD_NLEDS 4 + +#define BOARD_LED_GREEN BOARD_LED1 +#define BOARD_LED_ORANGE BOARD_LED2 +#define BOARD_LED_RED BOARD_LED3 +#define BOARD_LED_BLUE BOARD_LED4 + +/* LED bits for use with efm32_setleds() */ + +#define BOARD_LED1_BIT (1 << BOARD_LED1) +#define BOARD_LED2_BIT (1 << BOARD_LED2) +#define BOARD_LED3_BIT (1 << BOARD_LED3) +#define BOARD_LED4_BIT (1 << BOARD_LED4) + +/* If CONFIG_ARCH_LEDs is defined, then NuttX will control the 4 LEDs on + * board the EFM32 Gecko Starter Kit. The following definitions describe + * how NuttX controls the LEDs in this configuration: + */ + +#define LED_STARTED 0 /* LED1 */ +#define LED_HEAPALLOCATE 1 /* LED2 */ +#define LED_IRQSENABLED 2 /* LED1 + LED2 */ +#define LED_STACKCREATED 3 /* LED3 */ +#define LED_INIRQ 4 /* LED1 + LED3 */ +#define LED_SIGNAL 5 /* LED2 + LED3 */ +#define LED_ASSERTION 6 /* LED1 + LED2 + LED3 */ +#define LED_PANIC 7 /* N/C + N/C + N/C + LED4 */ + /**************************************************************************** * Public Function Prototypes ****************************************************************************/ +/**************************************************************************** + * Name: efm32_ledinit, efm32_setled, and efm32_setleds + * + * Description: + * If CONFIG_ARCH_LEDS is defined, then NuttX will control the on-board + * LEDs. If CONFIG_ARCH_LEDS is not defined, then the following interfaces + * are available to control the LEDs from user applications. + * + ****************************************************************************/ + +#ifndef CONFIG_ARCH_LEDS +void efm32_ledinit(void); +void efm32_setled(int led, bool ledon); +void efm32_setleds(uint8_t ledset); +#endif + #endif /* __CONFIGS_EFM32_DK3650_INCLUDE_BOARD_H */ diff --git a/configs/efm32-g8xx-stk/src/efm32_boot.c b/configs/efm32-g8xx-stk/src/efm32_boot.c index ebe9ad0df1..b288be27b8 100644 --- a/configs/efm32-g8xx-stk/src/efm32_boot.c +++ b/configs/efm32-g8xx-stk/src/efm32_boot.c @@ -1,8 +1,8 @@ /***************************************************************************** - * configs/efm32-dk3650/src/efm32_boot.c + * configs/efm32-g8xx-stk/src/efm32_boot.c * - * Copyright (C) 2014 Richard Cochran. All rights reserved. - * Author: Richard Cochran + * Copyright (C) 2014 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -39,21 +39,23 @@ #include +#include "efm32_start.h" + #include "efm32-g8xx-stk.h" /**************************************************************************** * Public Functions ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Name: efm32_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. + * All EFM32 architectures must provide the following entry point. This + * entry point is called early in the initialization before any devices + * have been initialized. * - ************************************************************************************/ + ****************************************************************************/ void efm32_boardinitialize(void) { From fcdc23a6a739d2ca0623e100d8e2b33a200f812f Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Fri, 17 Oct 2014 14:17:44 -0600 Subject: [PATCH 05/13] Add GPIO header file and EFM32 Gecko Starter Kit LED support --- configs/efm32-g8xx-stk/README.txt | 23 +- configs/efm32-g8xx-stk/src/Makefile | 6 + configs/efm32-g8xx-stk/src/efm32-g8xx-stk.h | 31 +++ configs/efm32-g8xx-stk/src/efm32_autoleds.c | 258 ++++++++++++++++++++ configs/efm32-g8xx-stk/src/efm32_userleds.c | 245 +++++++++++++++++++ 5 files changed, 559 insertions(+), 4 deletions(-) create mode 100644 configs/efm32-g8xx-stk/src/efm32_autoleds.c create mode 100644 configs/efm32-g8xx-stk/src/efm32_userleds.c diff --git a/configs/efm32-g8xx-stk/README.txt b/configs/efm32-g8xx-stk/README.txt index ed375c1c5f..284f7d745f 100644 --- a/configs/efm32-g8xx-stk/README.txt +++ b/configs/efm32-g8xx-stk/README.txt @@ -18,10 +18,25 @@ README LEDs ==== - The EFM32 Gecko Start Kithas four yellow LEDs. 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/efm32_autoleds.c. - The LEDs are used to encode OS-related events as follows: + The EFM32 Gecko Start Kit has four yellow LEDs. These LEDs are connected + as follows: + + ------------------------------------- -------------------- + EFM32 PIN BOARD SIGNALS + ------------------------------------- -------------------- + C0/USART1_TX#0/PCNT0_S0IN#2/ACMP0_CH0 MCU_PC0 UIF_LED0 + C1/USART1_RX#0/PCNT0_S1IN#2/ACMP0_CH1 MCU_PC1 UIF_LED1 + C2/USART2_TX#0/ACMP0_CH2 MCU_PC2 UIF_LED2 + C3/USART2_RX#0/ACMP0_CH3 MCU_PC3 UIF_LED3 + ------------------------------------- -------------------- + + All LEDs are grounded and so are illuminated by outputting a high + value to the LED. + + 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/efm32_autoleds.c. The LEDs are used to + encode OS-related events as follows: SYMBOL Meaning LED1* LED2 LED3 LED4 ----------------- ----------------------- ------ ----- ----- ------ diff --git a/configs/efm32-g8xx-stk/src/Makefile b/configs/efm32-g8xx-stk/src/Makefile index 49b07942cc..d2503cc8bd 100644 --- a/configs/efm32-g8xx-stk/src/Makefile +++ b/configs/efm32-g8xx-stk/src/Makefile @@ -37,6 +37,12 @@ CSRCS = efm32_boot.c +ifeq ($(CONFIG_ARCH_LEDS),y) +CSRCS += efm32_autoleds.c +else +CSRCS += efm32_userleds.c +endif + COBJS = $(CSRCS:.c=$(OBJEXT)) SRCS = $(ASRCS) $(CSRCS) OBJS = $(AOBJS) $(COBJS) diff --git a/configs/efm32-g8xx-stk/src/efm32-g8xx-stk.h b/configs/efm32-g8xx-stk/src/efm32-g8xx-stk.h index 21ac078a97..dd0aff5c01 100644 --- a/configs/efm32-g8xx-stk/src/efm32-g8xx-stk.h +++ b/configs/efm32-g8xx-stk/src/efm32-g8xx-stk.h @@ -40,6 +40,37 @@ * Included Files ****************************************************************************/ +/**************************************************************************** + * Pre-processor Definitions + ****************************************************************************/ + + /* LEDs + * + * The EFM32 Gecko Start Kit has four yellow LEDs. These LEDs are connected + * as follows: + * + * ------------------------------------- -------------------- + * EFM32 PIN BOARD SIGNALS + * ------------------------------------- -------------------- + * C0/USART1_TX#0/PCNT0_S0IN#2/ACMP0_CH0 MCU_PC0 UIF_LED0 + * C1/USART1_RX#0/PCNT0_S1IN#2/ACMP0_CH1 MCU_PC1 UIF_LED1 + * C2/USART2_TX#0/ACMP0_CH2 MCU_PC2 UIF_LED2 + * C3/USART2_RX#0/ACMP0_CH3 MCU_PC3 UIF_LED3 + * ------------------------------------- -------------------- + * + * All LEDs are grounded and so are illuminated by outputting a high + * value to the LED. + */ + +#define GPIO_LED1 (GPIO_OUTPUT_WIREDOR_PULLDOWN|\ + GPIO_OUTPUT_CLEAR|GPIO_PORTC|GPIO_PIN0) +#define GPIO_LED2 (GPIO_OUTPUT_WIREDOR_PULLDOWN|\ + GPIO_OUTPUT_CLEAR|GPIO_PORTC|GPIO_PIN1) +#define GPIO_LED3 (GPIO_OUTPUT_WIREDOR_PULLDOWN|\ + GPIO_OUTPUT_CLEAR|GPIO_PORTC|GPIO_PIN2) +#define GPIO_LED4 (GPIO_OUTPUT_WIREDOR_PULLDOWN|\ + GPIO_OUTPUT_CLEAR|GPIO_PORTC|GPIO_PIN3) + /**************************************************************************** * Public Function Prototypes ****************************************************************************/ diff --git a/configs/efm32-g8xx-stk/src/efm32_autoleds.c b/configs/efm32-g8xx-stk/src/efm32_autoleds.c new file mode 100644 index 0000000000..a155b4a751 --- /dev/null +++ b/configs/efm32-g8xx-stk/src/efm32_autoleds.c @@ -0,0 +1,258 @@ +/**************************************************************************** + * configs/efm32-g8xx-stk/src/efm32_autoleds.c + * + * Copyright (C) 2014 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * 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 + +#include +#include +#include + +#include + +#include "chip.h" +#include "up_arch.h" +#include "up_internal.h" + +#include "efm32_gpio.h" +#include "efm32-g8xx-stk.h" + +#ifdef CONFIG_ARCH_LEDS + +/**************************************************************************** + * Definitions + ****************************************************************************/ + +/* CONFIG_DEBUG_LEDS enables debug output from this file (needs CONFIG_DEBUG + * with CONFIG_DEBUG_VERBOSE too) + */ + +#ifdef CONFIG_DEBUG_LEDS +# define leddbg lldbg +# define ledvdbg llvdbg +#else +# define leddbg(x...) +# define ledvdbg(x...) +#endif + +/* The following definitions map the encoded LED setting to GPIO settings */ + +#define EFM32F4_LED1 (1 << 0) +#define EFM32F4_LED2 (1 << 1) +#define EFM32F4_LED3 (1 << 2) +#define EFM32F4_LED4 (1 << 3) + +#define ON_SETBITS_SHIFT (0) +#define ON_CLRBITS_SHIFT (4) +#define OFF_SETBITS_SHIFT (8) +#define OFF_CLRBITS_SHIFT (12) + +#define ON_BITS(v) ((v) & 0xff) +#define OFF_BITS(v) (((v) >> 8) & 0x0ff) +#define SETBITS(b) ((b) & 0x0f) +#define CLRBITS(b) (((b) >> 4) & 0x0f) + +#define ON_SETBITS(v) (SETBITS(ON_BITS(v)) +#define ON_CLRBITS(v) (CLRBITS(ON_BITS(v)) +#define OFF_SETBITS(v) (SETBITS(OFF_BITS(v)) +#define OFF_CLRBITS(v) (CLRBITS(OFF_BITS(v)) + +#define LED_STARTED_ON_SETBITS ((EFM32F4_LED1) << ON_SETBITS_SHIFT) +#define LED_STARTED_ON_CLRBITS ((EFM32F4_LED2|EFM32F4_LED3|EFM32F4_LED4) << ON_CLRBITS_SHIFT) +#define LED_STARTED_OFF_SETBITS (0 << OFF_SETBITS_SHIFT) +#define LED_STARTED_OFF_CLRBITS ((EFM32F4_LED1|EFM32F4_LED2|EFM32F4_LED3|EFM32F4_LED4) << OFF_CLRBITS_SHIFT) + +#define LED_HEAPALLOCATE_ON_SETBITS ((EFM32F4_LED2) << ON_SETBITS_SHIFT) +#define LED_HEAPALLOCATE_ON_CLRBITS ((EFM32F4_LED1|EFM32F4_LED3|EFM32F4_LED4) << ON_CLRBITS_SHIFT) +#define LED_HEAPALLOCATE_OFF_SETBITS ((EFM32F4_LED1) << OFF_SETBITS_SHIFT) +#define LED_HEAPALLOCATE_OFF_CLRBITS ((EFM32F4_LED2|EFM32F4_LED3|EFM32F4_LED4) << OFF_CLRBITS_SHIFT) + +#define LED_IRQSENABLED_ON_SETBITS ((EFM32F4_LED1|EFM32F4_LED2) << ON_SETBITS_SHIFT) +#define LED_IRQSENABLED_ON_CLRBITS ((EFM32F4_LED3|EFM32F4_LED4) << ON_CLRBITS_SHIFT) +#define LED_IRQSENABLED_OFF_SETBITS ((EFM32F4_LED2) << OFF_SETBITS_SHIFT) +#define LED_IRQSENABLED_OFF_CLRBITS ((EFM32F4_LED1|EFM32F4_LED3|EFM32F4_LED4) << OFF_CLRBITS_SHIFT) + +#define LED_STACKCREATED_ON_SETBITS ((EFM32F4_LED3) << ON_SETBITS_SHIFT) +#define LED_STACKCREATED_ON_CLRBITS ((EFM32F4_LED1|EFM32F4_LED2|EFM32F4_LED4) << ON_CLRBITS_SHIFT) +#define LED_STACKCREATED_OFF_SETBITS ((EFM32F4_LED1|EFM32F4_LED2) << OFF_SETBITS_SHIFT) +#define LED_STACKCREATED_OFF_CLRBITS ((EFM32F4_LED3|EFM32F4_LED4) << OFF_CLRBITS_SHIFT) + +#define LED_INIRQ_ON_SETBITS ((EFM32F4_LED1) << ON_SETBITS_SHIFT) +#define LED_INIRQ_ON_CLRBITS ((0) << ON_CLRBITS_SHIFT) +#define LED_INIRQ_OFF_SETBITS ((0) << OFF_SETBITS_SHIFT) +#define LED_INIRQ_OFF_CLRBITS ((EFM32F4_LED1) << OFF_CLRBITS_SHIFT) + +#define LED_SIGNAL_ON_SETBITS ((EFM32F4_LED2) << ON_SETBITS_SHIFT) +#define LED_SIGNAL_ON_CLRBITS ((0) << ON_CLRBITS_SHIFT) +#define LED_SIGNAL_OFF_SETBITS ((0) << OFF_SETBITS_SHIFT) +#define LED_SIGNAL_OFF_CLRBITS ((EFM32F4_LED2) << OFF_CLRBITS_SHIFT) + +#define LED_ASSERTION_ON_SETBITS ((EFM32F4_LED4) << ON_SETBITS_SHIFT) +#define LED_ASSERTION_ON_CLRBITS ((0) << ON_CLRBITS_SHIFT) +#define LED_ASSERTION_OFF_SETBITS ((0) << OFF_SETBITS_SHIFT) +#define LED_ASSERTION_OFF_CLRBITS ((EFM32F4_LED4) << OFF_CLRBITS_SHIFT) + +#define LED_PANIC_ON_SETBITS ((EFM32F4_LED4) << ON_SETBITS_SHIFT) +#define LED_PANIC_ON_CLRBITS ((0) << ON_CLRBITS_SHIFT) +#define LED_PANIC_OFF_SETBITS ((0) << OFF_SETBITS_SHIFT) +#define LED_PANIC_OFF_CLRBITS ((EFM32F4_LED4) << OFF_CLRBITS_SHIFT) + +/**************************************************************************** + * Private Data + ****************************************************************************/ + +static const uint16_t g_ledbits[8] = +{ + (LED_STARTED_ON_SETBITS | LED_STARTED_ON_CLRBITS | + LED_STARTED_OFF_SETBITS | LED_STARTED_OFF_CLRBITS), + + (LED_HEAPALLOCATE_ON_SETBITS | LED_HEAPALLOCATE_ON_CLRBITS | + LED_HEAPALLOCATE_OFF_SETBITS | LED_HEAPALLOCATE_OFF_CLRBITS), + + (LED_IRQSENABLED_ON_SETBITS | LED_IRQSENABLED_ON_CLRBITS | + LED_IRQSENABLED_OFF_SETBITS | LED_IRQSENABLED_OFF_CLRBITS), + + (LED_STACKCREATED_ON_SETBITS | LED_STACKCREATED_ON_CLRBITS | + LED_STACKCREATED_OFF_SETBITS | LED_STACKCREATED_OFF_CLRBITS), + + (LED_INIRQ_ON_SETBITS | LED_INIRQ_ON_CLRBITS | + LED_INIRQ_OFF_SETBITS | LED_INIRQ_OFF_CLRBITS), + + (LED_SIGNAL_ON_SETBITS | LED_SIGNAL_ON_CLRBITS | + LED_SIGNAL_OFF_SETBITS | LED_SIGNAL_OFF_CLRBITS), + + (LED_ASSERTION_ON_SETBITS | LED_ASSERTION_ON_CLRBITS | + LED_ASSERTION_OFF_SETBITS | LED_ASSERTION_OFF_CLRBITS), + + (LED_PANIC_ON_SETBITS | LED_PANIC_ON_CLRBITS | + LED_PANIC_OFF_SETBITS | LED_PANIC_OFF_CLRBITS) +}; + +/**************************************************************************** + * Private Functions + ****************************************************************************/ + +static inline void led_clrbits(unsigned int clrbits) +{ + if ((clrbits & EFM32F4_LED1) != 0) + { + efm32_gpiowrite(GPIO_LED1, false); + } + + if ((clrbits & EFM32F4_LED2) != 0) + { + efm32_gpiowrite(GPIO_LED2, false); + } + + if ((clrbits & EFM32F4_LED3) != 0) + { + efm32_gpiowrite(GPIO_LED3, false); + } + + if ((clrbits & EFM32F4_LED4) != 0) + { + efm32_gpiowrite(GPIO_LED4, false); + } +} + +static inline void led_setbits(unsigned int setbits) +{ + if ((setbits & EFM32F4_LED1) != 0) + { + efm32_gpiowrite(GPIO_LED1, true); + } + + if ((setbits & EFM32F4_LED2) != 0) + { + efm32_gpiowrite(GPIO_LED2, true); + } + + if ((setbits & EFM32F4_LED3) != 0) + { + efm32_gpiowrite(GPIO_LED3, true); + } + + if ((setbits & EFM32F4_LED4) != 0) + { + efm32_gpiowrite(GPIO_LED4, true); + } +} + +static void led_setonoff(unsigned int bits) +{ + led_clrbits(CLRBITS(bits)); + led_setbits(SETBITS(bits)); +} + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: board_led_initialize + ****************************************************************************/ + +void board_led_initialize(void) +{ + /* Configure LED1-4 GPIOs for output */ + + efm32_configgpio(GPIO_LED1); + efm32_configgpio(GPIO_LED2); + efm32_configgpio(GPIO_LED3); + efm32_configgpio(GPIO_LED4); +} + +/**************************************************************************** + * Name: board_led_on + ****************************************************************************/ + +void board_led_on(int led) +{ + led_setonoff(ON_BITS(g_ledbits[led])); +} + +/**************************************************************************** + * Name: board_led_off + ****************************************************************************/ + +void board_led_off(int led) +{ + led_setonoff(OFF_BITS(g_ledbits[led])); +} + +#endif /* CONFIG_ARCH_LEDS */ diff --git a/configs/efm32-g8xx-stk/src/efm32_userleds.c b/configs/efm32-g8xx-stk/src/efm32_userleds.c new file mode 100644 index 0000000000..503e17aeca --- /dev/null +++ b/configs/efm32-g8xx-stk/src/efm32_userleds.c @@ -0,0 +1,245 @@ +/**************************************************************************** + * configs/efm32-g8xx-stk/src/efm32_userleds.c + * + * Copyright (C) 2014 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * 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 + +#include +#include +#include + +#include +#include + +#include "chip.h" +#include "up_arch.h" +#include "up_internal.h" + +#include "efm32_gpio.h" +#include "efm32-g8xx-stk.h" + +#ifndef CONFIG_ARCH_LEDS + +/**************************************************************************** + * Definitions + ****************************************************************************/ + +/* CONFIG_DEBUG_LEDS enables debug output from this file (needs CONFIG_DEBUG + * with CONFIG_DEBUG_VERBOSE too) + */ + +#ifdef CONFIG_DEBUG_LEDS +# define leddbg lldbg +# define ledvdbg llvdbg +#else +# define leddbg(x...) +# define ledvdbg(x...) +#endif + +/**************************************************************************** + * Private Data + ****************************************************************************/ +/* This array maps an LED number to GPIO pin configuration */ + +static gpio_pinset_t g_ledcfg[BOARD_NLEDS] = +{ + GPIO_LED1, GPIO_LED2, GPIO_LED3, GPIO_LED4 +}; + +/**************************************************************************** + * Private Function Protototypes + ****************************************************************************/ + +/* LED Power Management */ + +#ifdef CONFIG_PM +static void led_pm_notify(struct pm_callback_s *cb, enum pm_state_e pmstate); +static int led_pm_prepare(struct pm_callback_s *cb, enum pm_state_e pmstate); +#endif + +/**************************************************************************** + * Private Data + ****************************************************************************/ + +#ifdef CONFIG_PM +static struct pm_callback_s g_ledscb = +{ + .notify = led_pm_notify, + .prepare = led_pm_prepare, +}; +#endif + +/**************************************************************************** + * Private Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: led_pm_notify + * + * Description: + * Notify the driver of new power state. This callback is called after + * all drivers have had the opportunity to prepare for the new power state. + * + ****************************************************************************/ + +#ifdef CONFIG_PM +static void led_pm_notify(struct pm_callback_s *cb , enum pm_state_e pmstate) +{ + switch (pmstate) + { + case(PM_NORMAL): + { + /* Restore normal LEDs operation */ + + } + break; + + case(PM_IDLE): + { + /* Entering IDLE mode - Turn leds off */ + + } + break; + + case(PM_STANDBY): + { + /* Entering STANDBY mode - Logic for PM_STANDBY goes here */ + + } + break; + + case(PM_SLEEP): + { + /* Entering SLEEP mode - Logic for PM_SLEEP goes here */ + + } + break; + + default: + { + /* Should not get here */ + + } + break; + } +} +#endif + +/**************************************************************************** + * Name: led_pm_prepare + * + * Description: + * Request the driver to prepare for a new power state. This is a warning + * that the system is about to enter into a new power state. The driver + * should begin whatever operations that may be required to enter power + * state. The driver may abort the state change mode by returning a + * non-zero value from the callback function. + * + ****************************************************************************/ + +#ifdef CONFIG_PM +static int led_pm_prepare(struct pm_callback_s *cb , enum pm_state_e pmstate) +{ + /* No preparation to change power modes is required by the LEDs driver. + * We always accept the state change by returning OK. + */ + + return OK; +} +#endif + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: efm32_ledinit + ****************************************************************************/ + +void efm32_ledinit(void) +{ + /* Configure LED1-4 GPIOs for output */ + + efm32_configgpio(GPIO_LED1); + efm32_configgpio(GPIO_LED2); + efm32_configgpio(GPIO_LED3); + efm32_configgpio(GPIO_LED4); +} + +/**************************************************************************** + * Name: efm32_setled + ****************************************************************************/ + +void efm32_setled(int led, bool ledon) +{ + if ((unsigned)led < BOARD_NLEDS) + { + efm32_gpiowrite(g_ledcfg[led], ledon); + } +} + +/**************************************************************************** + * Name: efm32_setleds + ****************************************************************************/ + +void efm32_setleds(uint8_t ledset) +{ + efm32_gpiowrite(GPIO_LED1, (ledset & BOARD_LED1_BIT) == 0); + efm32_gpiowrite(GPIO_LED2, (ledset & BOARD_LED2_BIT) == 0); + efm32_gpiowrite(GPIO_LED3, (ledset & BOARD_LED3_BIT) == 0); + efm32_gpiowrite(GPIO_LED4, (ledset & BOARD_LED4_BIT) == 0); +} + +/**************************************************************************** + * Name: efm32_led_pminitialize + ****************************************************************************/ + +#ifdef CONFIG_PM +void efm32_led_pminitialize(void) +{ + /* Register to receive power management callbacks */ + + int ret = pm_register(&g_ledscb); + if (ret != OK) + { + board_led_on(LED_ASSERTION); + } +} +#endif /* CONFIG_PM */ + +#endif /* !CONFIG_ARCH_LEDS */ From b327a408a4706bec22f59bd6a15dbf70a6dada4a Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Fri, 17 Oct 2014 16:43:52 -0600 Subject: [PATCH 06/13] Add EFM32 Memory Maps --- configs/efm32-g8xx-stk/README.txt | 49 +++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) diff --git a/configs/efm32-g8xx-stk/README.txt b/configs/efm32-g8xx-stk/README.txt index 284f7d745f..b81df54ff3 100644 --- a/configs/efm32-g8xx-stk/README.txt +++ b/configs/efm32-g8xx-stk/README.txt @@ -57,6 +57,55 @@ LEDs on a small proportion of the time. *** LED2 may also flicker normally if signals are processed. +Serial Console +============== + + The EFM32G890F128 support the following options for serial output: + + ------- -- ---- + US0_RX #0 PE11 + US0_RX #1 PE6 + US0_RX #2 PC10 + + US0_TX #0 PE10 + US0_TX #1 PE7 + US0_TX #2 PC11 + ------- -- ---- + US1_RX #0 PC1 + US1_RX #1 PD1 + + US1_TX #0 PC0 + US1_TX #1 PD0 + ------- -- ---- + US2_RX #0 PC3 + US2_RX #1 PB4 + + US2_TX #0 PC2 + US2_TX #1 PB3 + ------- -- ---- + U0_RX #1 PE1 + U0_RX #2 PA4 + + U0_TX #0 PF6 + U0_TX #1 PE0 + U0_TX #2 PA3 + U0_TX #3 PC14 + ------- -- ---- + LEU0_RX #0 PD5 + LEU0_RX #1 PB14 + LEU0_RX #2 PE15 + + LEU0_TX #0 PD4 + LEU0_TX #1 PB13 + LEU0_TX #2 PE14 + ------- -- ---- + LEU1_RX #0 PC7 + LEU1_RX #1 PA6 + + LEU1_TX #0 PC6 + LEU1_TX #1 PA5 + ------- -- ---- + Configurations ============== Each EFM32 Gecko Starter Kit configuration is maintained in a sub-director From d359e4bf3fd50fe44954d71f6f2622eed87eec50 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Sat, 18 Oct 2014 09:26:56 -0600 Subject: [PATCH 07/13] Add EFM32 CMU header file --- configs/efm32-g8xx-stk/include/board.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/configs/efm32-g8xx-stk/include/board.h b/configs/efm32-g8xx-stk/include/board.h index eb2bb574f2..a3d2f78384 100644 --- a/configs/efm32-g8xx-stk/include/board.h +++ b/configs/efm32-g8xx-stk/include/board.h @@ -47,6 +47,21 @@ /**************************************************************************** * Pre-Processor Definitions ****************************************************************************/ +/* Clocking *****************************************************************/ +/* Clock Sources + * - 1-28 MHz High Frequency RC Oscillator (HFRCO) + * - 4-32 MHz High Frequency Crystal Oscillator (HFXO) + * - 32.768 kHz Low Frequency RC Oscillator (LFRCO) + * - 32.768 kHz Low Frequency Crystal Oscillator (LFXO) + * + * The device boots with 14 MHz HFRCO as the HFCLK source. + */ + +#define BOARD_HFRCO_FREQUENCY 14000000 /* 14MHz on reset */ +#define BOARD_HFXO_FREQUENCY 32000000 /* 32MHz crystal on board */ +#define BOARD_LFRCO_FREQUENCY 32768 /* Low frequency oscillator */ +#define BOARD_LFXO_FREQUENCY 32768 /* 32MHz crystal on board */ + /* The EFM32 Gecko Starter Kit supports 4 yellow LEDs. One side is grounded * so these LEDs are illuminated by outputting a high value. * From d707a29c357f36b4d52682f517477044de1fd2dd Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Sat, 18 Oct 2014 12:07:34 -0600 Subject: [PATCH 08/13] Add board XTAL definitions --- configs/efm32-g8xx-stk/include/board.h | 93 ++++++++++++++++++++++++++ 1 file changed, 93 insertions(+) diff --git a/configs/efm32-g8xx-stk/include/board.h b/configs/efm32-g8xx-stk/include/board.h index a3d2f78384..850801a9d1 100644 --- a/configs/efm32-g8xx-stk/include/board.h +++ b/configs/efm32-g8xx-stk/include/board.h @@ -44,6 +44,8 @@ #include +#include "chip/efm32_cmu.h" + /**************************************************************************** * Pre-Processor Definitions ****************************************************************************/ @@ -57,11 +59,102 @@ * The device boots with 14 MHz HFRCO as the HFCLK source. */ +#define BOARD_HAVE_HFXO 1 /* Have High frequency crystal oscillator */ +#define BOARD_HAVE_LFXO 1 /* Have Loq frequency crystal oscillator */ + #define BOARD_HFRCO_FREQUENCY 14000000 /* 14MHz on reset */ #define BOARD_HFXO_FREQUENCY 32000000 /* 32MHz crystal on board */ #define BOARD_LFRCO_FREQUENCY 32768 /* Low frequency oscillator */ #define BOARD_LFXO_FREQUENCY 32768 /* 32MHz crystal on board */ +/* HFCLK - High Frequency Clock + * + * HFCLK is the selected High Frequency Clock. This clock is used by the CMU + * and drives the two prescalers that generate HFCORECLK and HFPERCLK. The + * HFCLK can be driven by a high-frequency oscillator (HFRCO or HFXO) or one + * of the low-frequency oscillators (LFRCO or LFXO). By default the HFRCO is + * selected. + * + * HFCLK can optionally be divided down by setting HFCLKDIV in CMU_CTRL to a + * nonzero value. _CMU_CTRL_HFCLKDIV_DEFAULT is zero. + */ + +#define BOARD_HFCLKSEL _CMU_CMD_HFCLKSEL_HFXO +#define BOARD_HFCLKDIV _CMU_CTRL_HFCLKDIV_DEFAULT +#define BOARD_HFCLK_FREQUENCY BOARD_HFXO_FREQUENCY + +/* HFCORECLK - High Frequency Core Clock + * + * HFCORECLK is a prescaled version of HFCLK. This clock drives the Core + * Modules, which consists of the CPU and modules that are tightly coupled + * to the CPU, e.g. MSC, DMA etc. The frequency of HFCORECLK is set using + * the CMU_HFCORECLKDIV register. + */ + +#define BOARD_HFCORECLKDIV _CMU_HFCORECLKDIV_HFCORECLKDIV_DEFAULT +#define BOARD_HFCORECLK_FREQUENCY BOARD_HFXO_FREQUENCY + +/* HFPERCLK - High Frequency Peripheral Clock + * + * Like HFCORECLK, HFPERCLK can also be a prescaled version of HFCLK. This + * clock drives the High-Frequency Peripherals. The frequency of HFPERCLK is + * set using the CMU_HFPERCLKDIV register. + */ + +#define BOARD_HFPERCLKDIV _CMU_HFPERCLKDIV_HFPERCLKDIV_DEFAULT +#define BOARD_HFPERCLK_FREQUENCY BOARD_HFXO_FREQUENCY + +/* LFACLK - Low Frequency A Clock + * + * LFACLK is the selected clock for the Low Energy A Peripherals. There are + * four selectable sources for LFACLK: LFRCO, LFXO, HFCORECLK/2 and ULFRCO. + * From reset, the LFACLK source is set to LFRCO. However, note that the + * LFRCO is disabled from reset. The selection is configured using the LFA + * field in CMU_LFCLKSEL. The HFCORECLK/2 setting allows the Low Energy A + * Peripherals to be used as high-frequency peripherals. + */ + +#define BOARD_LFACLKSEL _CMU_LFCLKSEL_LFA_LFXO +#define BOARD_LFACLK_FREQUENCY BOARD_LFXO_FREQUENCY + +/* LFBCLK - Low Frequency B Clock + * + * LFBCLK is the selected clock for the Low Energy B Peripherals. There are + * four selectable sources for LFBCLK: LFRCO, LFXO, HFCORECLK/2 and ULFRCO. + * From reset, the LFBCLK source is set to LFRCO. However, note that the + * LFRCO is disabled from reset. The selection is configured using the LFB + * field in CMU_LFCLKSEL. The HFCORECLK/2 setting allows the Low Energy B + * Peripherals to be used as high-frequency peripherals. + */ + +#define BOARD_LFBCLKSEL _CMU_LFCLKSEL_LFB_LFXO +#define BOARD_LFBCLK_FREQUENCY BOARD_LFXO_FREQUENCY + +/* PCNTnCLK - Pulse Counter n Clock + * + * Each available pulse counter is driven by its own clock, PCNTnCLK where + * n is the pulse counter instance number. Each pulse counter can be + * configured to use an external pin (PCNTn_S0) or LFACLK as PCNTnCLK. + */ + +/* WDOGCLK - Watchdog Timer Clock + * + * The Watchdog Timer (WDOG) can be configured to use one of three different + * clock sources: LFRCO, LFXO or ULFRCO. ULFRCO (Ultra Low Frequency RC + * Oscillator) is a separate 1 kHz RC oscillator that also runs in EM3. + */ + +/* AUXCLK - Auxiliary Clock + * + * AUXCLK is a 1-28 MHz clock driven by a separate RC oscillator, AUXHFRCO. + * This clock is used for flash programming and Serial Wire Output (SWO). + * During flash programming this clock will be active. If the AUXHFRCO has + * not been enabled explicitly by software, the MSC will automatically + * start and stop it. The AUXHFRCO is enabled by writing a 1 to AUXHFRCOEN + * in CMU_OSCENCMD. This explicit enabling is required when SWO is used. + */ + +/* LEDs *********************************************************************/ /* The EFM32 Gecko Starter Kit supports 4 yellow LEDs. One side is grounded * so these LEDs are illuminated by outputting a high value. * From 192ef77d681a89e29729a1457ddd10878990b20a Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Sat, 18 Oct 2014 12:47:45 -0600 Subject: [PATCH 09/13] Use UART0 for the serial console --- configs/efm32-g8xx-stk/README.txt | 82 +++++++++++++++++----------- configs/efm32-g8xx-stk/nsh/defconfig | 36 +++++++++++- 2 files changed, 83 insertions(+), 35 deletions(-) diff --git a/configs/efm32-g8xx-stk/README.txt b/configs/efm32-g8xx-stk/README.txt index b81df54ff3..d84035e2b7 100644 --- a/configs/efm32-g8xx-stk/README.txt +++ b/configs/efm32-g8xx-stk/README.txt @@ -60,52 +60,70 @@ LEDs Serial Console ============== - The EFM32G890F128 support the following options for serial output: + Pin Availability + ---------------- + The EFM32G890F128 support the following options for serial output. NOTE + (1) that not all of these pins are available for use as a serial console, + however. And (2) not all pins made available by the board. - ------- -- ---- - US0_RX #0 PE11 - US0_RX #1 PE6 - US0_RX #2 PC10 + EFM32 PIN GPIO NOTES/CONFLICTS/AVAILABILITY + ------- -- ---- ---------------------------------------------- + US0_RX #0 PE11 LCD_PE11, LCD_SEG7 + US0_RX #1 PE6 LCD_PE6, LCD_COM2 + US0_RX #2 PC10 UIF_SLIDER2 - US0_TX #0 PE10 - US0_TX #1 PE7 - US0_TX #2 PC11 + US0_TX #0 PE10 LCD_PE10, LCD_SEGG + US0_TX #1 PE7 LCD_PE7, LCD_COM3 + US0_TX #2 PC11 UIF_SLIDER3 ------- -- ---- - US1_RX #0 PC1 - US1_RX #1 PD1 + US1_RX #0 PC1 UIF_LED1 + US1_RX #1 PD1 Not connected on this board - US1_TX #0 PC0 - US1_TX #1 PD0 + US1_TX #0 PC0 UIF_LED0 + US1_TX #1 PD0 Not connected on this board ------- -- ---- - US2_RX #0 PC3 - US2_RX #1 PB4 + US2_RX #0 PC3 UIF_LED3 + US2_RX #1 PB4 LCD_PB4, LCD_SEG21 - US2_TX #0 PC2 - US2_TX #1 PB3 + US2_TX #0 PC2 UIF_LED2 + US2_TX #1 PB3 LCD_PB3, LCD_SEG20 ------- -- ---- - U0_RX #1 PE1 - U0_RX #2 PA4 + U0_RX #1 PE1 **AVAILABLE at TP130** (if BC_EN is low, see below) + U0_RX #2 PA4 LCD_PA4, LCD_SEG17 - U0_TX #0 PF6 - U0_TX #1 PE0 - U0_TX #2 PA3 - U0_TX #3 PC14 + U0_TX #0 PF6 LCD_PF6, LCD_SEG24 + U0_TX #1 PE0 **AVAILABLE at TP129** (if BC_EN is low, see below) + U0_TX #2 PA3 LCD_PA3, LCD_SEG16 + U0_TX #3 PC14 **AVAILABLE at TP117** ------- -- ---- - LEU0_RX #0 PD5 - LEU0_RX #1 PB14 - LEU0_RX #2 PE15 + LEU0_RX #0 PD5 **AVAILABLE at TP123 and EXP port pin 14** + LEU0_RX #1 PB14 CTRLMCU_SPI_MISO + LEU0_RX #2 PE15 LCD_PE15, LCD_SEG11 - LEU0_TX #0 PD4 - LEU0_TX #1 PB13 - LEU0_TX #2 PE14 + LEU0_TX #0 PD4 **AVAILABLE at TP122 and EXP port pin 12** + LEU0_TX #1 PB13 CTRLMCU_SPI_SCK + LEU0_TX #2 PE14 LCD_PE14, LCD_SEG10 ------- -- ---- - LEU1_RX #0 PC7 - LEU1_RX #1 PA6 + LEU1_RX #0 PC7 DEBUG_MCU_SW_ENABLE + LEU1_RX #1 PA6 DEBUG_TDI_IN - LEU1_TX #0 PC6 - LEU1_TX #1 PA5 + LEU1_TX #0 PC6 DEBUG_DH_SW_ENABLE + LEU1_TX #1 PA5 DEBUG_TMS_SWDIO_IN ------- -- ---- + Default Serial Console + ---------------------- + UART0 is configured as the default serial console at 115200 8N1 + on pins PE0 and PE1. + + Communication through the Board Controller + ------------------------------------------ + The control MCU acts as a board controller (BC). There is a UART + connection between the EFM and the BC. The connection is made by + setting the BC_EN line high. The EFM can then use the BSP to send + commands to the BC. When BC_EN is low, BC_TX and BC_RX can be used + by other applications. + Configurations ============== Each EFM32 Gecko Starter Kit configuration is maintained in a sub-director diff --git a/configs/efm32-g8xx-stk/nsh/defconfig b/configs/efm32-g8xx-stk/nsh/defconfig index 10893bca75..4ada1f017a 100644 --- a/configs/efm32-g8xx-stk/nsh/defconfig +++ b/configs/efm32-g8xx-stk/nsh/defconfig @@ -20,7 +20,7 @@ CONFIG_WINDOWS_CYGWIN=y # # Build Configuration # -# CONFIG_APPS_DIR="../apps" +#CONFIG_APPS_DIR="../apps" CONFIG_BUILD_FLAT=y # CONFIG_BUILD_2PASS is not set @@ -131,6 +131,22 @@ CONFIG_ARCH_CHIP_EFM32G890F128=y CONFIG_EFM32_EFM32G=y # CONFIG_EFM32_EFM32GG is not set +# +# EFM32 Peripheral Support +# +CONFIG_EFM32_HAVE_USART2=y +CONFIG_EFM32_HAVE_UART0=y +# CONFIG_EFM32_HAVE_UART1 is not set +CONFIG_EFM32_HAVE_LEUART1=y +CONFIG_EFM32_UART=y +# CONFIG_EFM32_USART0 is not set +# CONFIG_EFM32_USART1 is not set +# CONFIG_EFM32_USART2 is not set +CONFIG_EFM32_UART0=y +# CONFIG_EFM32_UART1 is not set +# CONFIG_EFM32_LEUART0 is not set +# CONFIG_EFM32_LEUART1 is not set + # # Architecture Options # @@ -347,7 +363,7 @@ CONFIG_SERIAL=y CONFIG_DEV_LOWCONSOLE=y # CONFIG_16550_UART is not set # CONFIG_ARCH_HAVE_UART is not set -# CONFIG_ARCH_HAVE_UART0 is not set +CONFIG_ARCH_HAVE_UART0=y # CONFIG_ARCH_HAVE_UART1 is not set # CONFIG_ARCH_HAVE_UART2 is not set # CONFIG_ARCH_HAVE_UART3 is not set @@ -371,7 +387,21 @@ CONFIG_DEV_LOWCONSOLE=y # # USART Configuration # -# CONFIG_MCU_SERIAL is not set +CONFIG_MCU_SERIAL=y +CONFIG_UART0_SERIAL_CONSOLE=y +# CONFIG_NO_SERIAL_CONSOLE is not set + +# +# UART0 Configuration +# +CONFIG_UART0_RXBUFSIZE=64 +CONFIG_UART0_TXBUFSIZE=64 +CONFIG_UART0_BAUD=115200 +CONFIG_UART0_BITS=8 +CONFIG_UART0_PARITY=0 +CONFIG_UART0_2STOP=0 +# CONFIG_UART0_IFLOWCONTROL is not set +# CONFIG_UART0_OFLOWCONTROL is not set # CONFIG_SERIAL_IFLOWCONTROL is not set # CONFIG_SERIAL_OFLOWCONTROL is not set # CONFIG_USBDEV is not set From 5842b5d7052976ce0f4c92dd2916e5728550f8dc Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Sat, 18 Oct 2014 16:15:14 -0600 Subject: [PATCH 10/13] Need to enable the standard serial driver for NSH --- configs/efm32-g8xx-stk/nsh/defconfig | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/configs/efm32-g8xx-stk/nsh/defconfig b/configs/efm32-g8xx-stk/nsh/defconfig index 4ada1f017a..fbddb464f2 100644 --- a/configs/efm32-g8xx-stk/nsh/defconfig +++ b/configs/efm32-g8xx-stk/nsh/defconfig @@ -20,7 +20,7 @@ CONFIG_WINDOWS_CYGWIN=y # # Build Configuration # -#CONFIG_APPS_DIR="../apps" +# CONFIG_APPS_DIR="../apps" CONFIG_BUILD_FLAT=y # CONFIG_BUILD_2PASS is not set @@ -360,7 +360,7 @@ CONFIG_DEV_NULL=y # CONFIG_SENSORS is not set # CONFIG_SERCOMM_CONSOLE is not set CONFIG_SERIAL=y -CONFIG_DEV_LOWCONSOLE=y +# CONFIG_DEV_LOWCONSOLE is not set # CONFIG_16550_UART is not set # CONFIG_ARCH_HAVE_UART is not set CONFIG_ARCH_HAVE_UART0=y @@ -388,6 +388,7 @@ CONFIG_ARCH_HAVE_UART0=y # USART Configuration # CONFIG_MCU_SERIAL=y +CONFIG_STANDARD_SERIAL=y CONFIG_UART0_SERIAL_CONSOLE=y # CONFIG_NO_SERIAL_CONSOLE is not set From 17403fe074400d8b1b0ae81675ea3d04891122e9 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Sat, 18 Oct 2014 18:40:08 -0600 Subject: [PATCH 11/13] Add frame for EFM32 GPIO logic (empty functions) --- configs/efm32-g8xx-stk/nsh/defconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/configs/efm32-g8xx-stk/nsh/defconfig b/configs/efm32-g8xx-stk/nsh/defconfig index fbddb464f2..c0e09fe6a5 100644 --- a/configs/efm32-g8xx-stk/nsh/defconfig +++ b/configs/efm32-g8xx-stk/nsh/defconfig @@ -146,6 +146,7 @@ CONFIG_EFM32_UART0=y # CONFIG_EFM32_UART1 is not set # CONFIG_EFM32_LEUART0 is not set # CONFIG_EFM32_LEUART1 is not set +CONFIG_EFM32_GPIO_IRQ=y # # Architecture Options From 4d6f0a7708ec8eed422d3305e8bc4f1ead6c4be7 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Sun, 19 Oct 2014 11:08:56 -0600 Subject: [PATCH 12/13] Basic clock configuration logic --- configs/efm32-g8xx-stk/include/board.h | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/configs/efm32-g8xx-stk/include/board.h b/configs/efm32-g8xx-stk/include/board.h index 850801a9d1..8c0b424418 100644 --- a/configs/efm32-g8xx-stk/include/board.h +++ b/configs/efm32-g8xx-stk/include/board.h @@ -74,13 +74,10 @@ * HFCLK can be driven by a high-frequency oscillator (HFRCO or HFXO) or one * of the low-frequency oscillators (LFRCO or LFXO). By default the HFRCO is * selected. - * - * HFCLK can optionally be divided down by setting HFCLKDIV in CMU_CTRL to a - * nonzero value. _CMU_CTRL_HFCLKDIV_DEFAULT is zero. */ #define BOARD_HFCLKSEL _CMU_CMD_HFCLKSEL_HFXO -#define BOARD_HFCLKDIV _CMU_CTRL_HFCLKDIV_DEFAULT +#define BOARD_HFCLKDIV 0 /* Does not apply to EFM32G */ #define BOARD_HFCLK_FREQUENCY BOARD_HFXO_FREQUENCY /* HFCORECLK - High Frequency Core Clock From 180c0e9decb22cf8413d89dcdb4b794583572157 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Sun, 19 Oct 2014 16:42:15 -0600 Subject: [PATCH 13/13] Add some UART configuration logic (still incomplete) --- configs/efm32-g8xx-stk/README.txt | 2 ++ configs/efm32-g8xx-stk/include/board.h | 10 ++++++++++ 2 files changed, 12 insertions(+) diff --git a/configs/efm32-g8xx-stk/README.txt b/configs/efm32-g8xx-stk/README.txt index d84035e2b7..bd0c549a4e 100644 --- a/configs/efm32-g8xx-stk/README.txt +++ b/configs/efm32-g8xx-stk/README.txt @@ -88,8 +88,10 @@ Serial Console US2_TX #0 PC2 UIF_LED2 US2_TX #1 PB3 LCD_PB3, LCD_SEG20 ------- -- ---- + U0_RX #0 PF7 LCD_PF7, LCD_SEG25 U0_RX #1 PE1 **AVAILABLE at TP130** (if BC_EN is low, see below) U0_RX #2 PA4 LCD_PA4, LCD_SEG17 + U0_RX #3 PC15 MCUDBG_TDO_SWO U0_TX #0 PF6 LCD_PF6, LCD_SEG24 U0_TX #1 PE0 **AVAILABLE at TP129** (if BC_EN is low, see below) diff --git a/configs/efm32-g8xx-stk/include/board.h b/configs/efm32-g8xx-stk/include/board.h index 8c0b424418..2bcddbb71c 100644 --- a/configs/efm32-g8xx-stk/include/board.h +++ b/configs/efm32-g8xx-stk/include/board.h @@ -45,6 +45,7 @@ #include #include "chip/efm32_cmu.h" +#include "chip/efm32_usart.h" /**************************************************************************** * Pre-Processor Definitions @@ -193,6 +194,15 @@ #define LED_ASSERTION 6 /* LED1 + LED2 + LED3 */ #define LED_PANIC 7 /* N/C + N/C + N/C + LED4 */ +/* Pin routing **************************************************************/ +/* UART0: + * + * U0_RX #1 PE1 **AVAILABLE at TP130** + * U0_TX #1 PE0 **AVAILABLE at TP129** + */ + +#define BOARD_UART0_ROUTE_LOCATION _USART_ROUTE_LOCATION_LOC1 + /**************************************************************************** * Public Function Prototypes ****************************************************************************/