Add TI EK-TM4C1294XL launchpad support

This commit is contained in:
sauttefk 2015-02-12 00:30:38 +01:00
parent e9e9892646
commit a1b5538740
27 changed files with 4701 additions and 5 deletions

View file

@ -851,6 +851,14 @@ config ARCH_BOARD_TM4C123G_LAUNCHPAD
---help---
Tiva TM4C123G LaunchPad.
config ARCH_BOARD_TM4C1294_LAUNCHPAD
bool "Tiva EK-TM4C1294XL LaunchPad"
depends on ARCH_CHIP_TM4C1294NC
select ARCH_HAVE_LEDS
select ARCH_HAVE_BUTTONS
---help---
Tiva EK-TM4C1294XL LaunchPad.
config ARCH_BOARD_CC3200_LAUNCHPAD
bool "Tiva CC3200 Launchpad"
depends on ARCH_CHIP_CC3200
@ -1123,6 +1131,7 @@ config ARCH_BOARD
default "sure-pic32mx" if ARCH_BOARD_SUREPIC32MX
default "teensy" if ARCH_BOARD_TEENSY
default "tm4c123g-launchpad" if ARCH_BOARD_TM4C123G_LAUNCHPAD
default "tm4c1294-launchpad" if ARCH_BOARD_TM4C1294_LAUNCHPAD
default "cc3200-launchpad" if ARCH_BOARD_CC3200_LAUNCHPAD
default "twr-k60n512" if ARCH_BOARD_TWR_K60N512
default "ubw32" if ARCH_BOARD_UBW32

View file

@ -995,7 +995,7 @@ Where <subdir> is one of the following:
and Telnet again works from the host:
telent 10.0.0.2
telnet 10.0.0.2
3. You can enable IPv6 autonomous address configuration with the
following changes to the configuration:

View file

@ -6,7 +6,7 @@
source [find interface/ti-icdi.cfg]
set WORKAREASIZE 0x40000 # RAM size
set WORKAREASIZE 0x40000
set CHIPNAME tm4c129xnczad
source [find target/stellaris_icdi.cfg]

View file

@ -0,0 +1,75 @@
#
# For a description of the syntax of this configuration file,
# see misc/tools/kconfig-language.txt.
#
if ARCH_BOARD_TM4C1294_LAUNCHPAD
if TIMER && TIVA_TIMER32_PERIODIC
config TM4C1294_LAUNCHPAD_TIMER
bool
default n
choice
prompt "Timer driver selection"
default TM4C1294_LAUNCHPAD_TIMER_NONE
config TM4C1294_LAUNCHPAD_TIMER_NONE
bool "None"
config TM4C1294_LAUNCHPAD_TIMER0
bool "Timer 0"
depends on TIVA_TIMER0
select TM4C1294_LAUNCHPAD_TIMER
config TM4C1294_LAUNCHPAD_TIMER1
bool "Timer 1"
depends on TIVA_TIMER1
select TM4C1294_LAUNCHPAD_TIMER
config TM4C1294_LAUNCHPAD_TIMER2
bool "Timer 2"
depends on TIVA_TIMER2
select TM4C1294_LAUNCHPAD_TIMER
config TM4C1294_LAUNCHPAD_TIMER3
bool "Timer 3"
depends on TIVA_TIMER3
select TM4C1294_LAUNCHPAD_TIMER
config TM4C1294_LAUNCHPAD_TIMER4
bool "Timer 4"
depends on TIVA_TIMER4
select TM4C1294_LAUNCHPAD_TIMER
config TM4C1294_LAUNCHPAD_TIMER5
bool "Timer 5"
depends on TIVA_TIMER5
select TM4C1294_LAUNCHPAD_TIMER
config TM4C1294_LAUNCHPAD_TIMER6
bool "Timer 6"
depends on TIVA_TIMER6
select TM4C1294_LAUNCHPAD_TIMER
config TM4C1294_LAUNCHPAD_TIMER7
bool "Timer 7"
depends on TIVA_TIMER7
select TM4C1294_LAUNCHPAD_TIMER
endchoice # Timer driver selection
if TM4C1294_LAUNCHPAD_TIMER
config TM4C1294_LAUNCHPAD_TIMER_DEVNAME
string "Timer device name"
default "/dev/timer0"
config TM4C1294_LAUNCHPAD_TIMER_ALTCLK
bool "Use alternate clock source"
default n
depends on EXPERIMENTAL
endif # TM4C1294_LAUNCHPAD_TIMER
endif # TIVA_TIMER32_PERIODIC
endif # ARCH_BOARD_TM4C1294_LAUNCHPAD

View file

@ -0,0 +1,298 @@
/************************************************************************************
* configs/tm4c1294-launchpad/include/board.h
*
* Copyright (C) 2014 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
* 3. Neither the name NuttX nor the names of its contributors may be
* used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
************************************************************************************/
#ifndef __CONFIGS_TM4C1294_LAUNCHPAD_INCLUDE_BOARD_H
#define __CONFIGS_TM4C1294_LAUNCHPAD_INCLUDE_BOARD_H
/************************************************************************************
* Included Files
************************************************************************************/
#ifndef __ASSEMBLY__
# include <stdbool.h>
#endif
/************************************************************************************
* Pre-processor Definitions
************************************************************************************/
/* Clocking *************************************************************************/
/* Crystals on-board the EK-TM4C1294XL include:
*
* 1. 25.0MHz (Y2) is connected to OSC0/1 pins and is used as the run mode input to
* the PLL.
* 2. 32.768kHz (Y3) connected to XOSC0/1 and clocks the hibernation module.
*/
#define SYSCON_RCC_XTAL SYSCON_RCC_XTAL16000KHZ /* On-board crystal is 25 MHz */
#define XTAL_FREQUENCY 25000000
/* Frequencies of other clock sources */
#define PIOSC_FREQUENCY 16000000 /* Precision internal oscillator */
#define RTCOSC_FREQUENCY 32768 /* Hibernation Module RTC Oscillator */
#define LFIOSC_FREQUENCY 33000 /* Low frequency internal oscillator */
/* The PLL generates Fvco according to the following formulae. The input clock to
* the PLL may be either the external crystal (Fxtal) or PIOSC (Fpiosc). This
* logic supports only the external crystal as the PLL source clock.
*
* Fin = Fxtal / (Q + 1 )(N + 1) -OR- Fpiosc / (Q + 1)(N + 1)
* Mdiv = Mint + (MFrac / 1024)
* Fvco = Fin * Mdiv
*
* Where the register fields Q and N actually hold (Q-1) and (N-1). The following
* setup then generates Fvco = 480MHz:
*
* Fin = 25 MHz / 1 / 5 = 5 MHz
* Mdiv = 96
* Fvco = 480
*/
#define BOARD_PLL_MINT 96 /* Integer part of PLL M value */
#define BOARD_PLL_MFRAC 0 /* Fractional part of PLL M value */
#define BOARD_PLL_N 5 /* PLL N value */
#define BOARD_PLL_Q 1 /* PLL Q value */
#define BOARD_FVCO_FREQUENCY 480000000 /* Resulting Fvco */
/* When the PLL is active, the system clock frequency (SysClk) is calculated using
* the following equation:
*
* SysClk = Fvco/ (sysdiv + 1)
*
* The following setup generates Sysclk = 120MHz:
*/
#define BOARD_PLL_SYSDIV 4 /* Sysclk = Fvco / 4 = 120MHz */
#define SYSCLK_FREQUENCY 120000000 /* Resulting SysClk frequency */
/* Alternate Clock (ALTCLK)
*
* The ALTCLK provides a clock source of numerous frequencies to the general-purpose
* timer, SSI, and UART modules. The default source for the ALTCLK is the Precision
* Internal Oscillator (PIOSC). The Hibernation Real-time Clock (RTCOSC) and Low
* Frequency Internal Oscillator (LFIOSC) are alternatives. If the RTCOSC Output is
* selected, the clock source must also be enabled in the Hibernation module.
*/
#define BOARD_ALTCLKCFG SYSCON_ALTCLKCFG_ALTCLK_PIOSC
#define ALTCLK_FREQUENCY PIOSC_FREQUENCY
/* LED definitions ******************************************************************/
/* The EK-TM4C1294XL has a four green LEDs.
*
* --- ------------
* Pin Pin Function
* --- ------------
* PN1 Green LED D1
* PN0 Green LED D2
* PF4 Green LED D3
* PF0 Green LED D4
* --- ------------
*/
/* LED index values for use with tiva_setled() */
#define BOARD_LED_D1 0
#define BOARD_LED_D2 1
#define BOARD_LED_D3 2
#define BOARD_LED_D4 3
#define BOARD_NLEDS 4
/* LED bits for use with tiva_setleds() */
#define BOARD_LED_D1_BIT (1 << BOARD_LED_D1)
#define BOARD_LED_D2_BIT (1 << BOARD_LED_D2)
#define BOARD_LED_D3_BIT (1 << BOARD_LED_D3)
#define BOARD_LED_D4_BIT (1 << BOARD_LED_D4)
/* If CONFIG_ARCH_LEDS is defined, then automated support for the EK-TM4C1294XL LED
* will be included in the build:
*/
/* LED1 LED1 LED2 LED3 */
#define LED_STARTED 0 /* OFF OFF ON OFF */
#define LED_HEAPALLOCATE 1 /* NC NC NC OFF */
#define LED_IRQSENABLED 1 /* NC NC NC OFF */
#define LED_STACKCREATED 2 /* OFF ON OFF OFF */
#define LED_INIRQ 1 /* NC NC NC OFF */
#define LED_SIGNAL 1 /* NC NC NC OFF */
#define LED_ASSERTION 1 /* NC NC NC OFF */
#define LED_PANIC 3 /* ON OFF OFF OFF (flashing 2Hz) */
/* Button definitions ***************************************************************/
/* There are four push buttons on the board. Two of them are user controllable.
* The others are RESET and WAKE
*
* --- ------------
* Pin Pin Function
* --- ------------
* PJ0 USR_SW1
* PJ1 USR_SW2
* --- ------------
*/
#define BUTTON_SW1 0
#define BUTTON_SW2 1
#define NUM_BUTTONS 2
#define BUTTON_SW1_BIT (1 << BUTTON_SW1)
#define BUTTON_SW2_BIT (1 << BUTTON_SW2)
/* Pin Multiplexing Disambiguation **************************************************/
/* UARTs
*
* UART0: PA0-1 (fixed configuration)
* UART3: PJ0-1 to EM_TX/EM_RX or BOOSTER_PACK2_RX/BOOSTER_PACK2_TX(Depending
* on J12/J13)
* UART5: PH6-7 to BOOSTER_PACK1_RX/BOOSTER_PACK1_TX
*/
#define GPIO_UART3_RX GPIO_UART3_RX_2
#define GPIO_UART3_TX GPIO_UART3_TX_2
#define GPIO_UART5_RX GPIO_UART5_RX_2
#define GPIO_UART5_TX GPIO_UART5_TX_2
/* SSI:
*
* SSI0: PA2-5 are used for SSI0 to the second booster pack (fixed configuration)
* SSI3: PF0/PF4-5/PH4/PQ0-2 are used for the SPI flash (on-board and SD card).
* PH4 selects the SD card and PQ1 selects the on-board SPI flash.
*/
#define GPIO_SSI3_CLK GPIO_SSI3_CLK_2
#define GPIO_SSI3_FSS GPIO_SSI3_FSS_2
#define GPIO_SSI3_XDAT0 GPIO_SSI3_XDAT0_2
#define GPIO_SSI3_XDAT1 GPIO_SSI3_XDAT1_1
#define GPIO_SSI3_XDAT2 GPIO_SSI3_XDAT2_1
#define GPIO_SSI3_XDAT3 GPIO_SSI3_XDAT3_1
/* I2C:
*
* I2C3: PG4-5 are provide to the BoostPack 1 interface
* I2C7: PA4-5 are provide to the BoostPack 2 interface
* I2C6: PB6-7 are used for I2C to the TMP100 and the EM connector.
* J18 and J20 must be closed to connect the TMP100.
* I2C address is 0x4A
*/
#define GPIO_I2C3_SCL GPIO_I2C3_SCL_1
#define GPIO_I2C3_SDA GPIO_I2C3_SDA_1
#define GPIO_I2C7_SCL GPIO_I2C7_SCL_1
#define GPIO_I2C7_SDA GPIO_I2C7_SDA_1
#define GPIO_I2C6_SCL GPIO_I2C6_SCL_2
#define GPIO_I2C6_SDA GPIO_I2C6_SDA_2
/* USB:
*
* PB0-1/PD6-7/PL6-7 are used for USB (Only PD6-7 are not fixed configuration)
*/
#define GPIO_USB0_EPEN GPIO_USB0_EPEN_3
#define GPIO_USB0_PFLT GPIO_USB0_PFLT_2
/* Ethernet LEDs
*
* PF1/PK4/PK6 are used for Ethernet LEDs.
* PK4/EN0RXD3/LED0
* PK6/EN0TXD2/LED1
* PF1/LED2
*/
# define GPIO_EN0_LED0 GPIO_EN0_LED0_2
# define GPIO_EN0_LED1 GPIO_EN0_LED1_2
# define GPIO_EN0_LED2 GPIO_EN0_LED2_1
/* LCD
*
* PF6-7/PJ6/PS4-5/PR0-7 are used for the LCD (fixed configuration).
*/
/************************************************************************************
* Public Function Prototypes
************************************************************************************/
#ifndef __ASSEMBLY__
/************************************************************************************
* Name: tiva_boardinitialize
*
* Description:
* All Tiva 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 tiva_boardinitialize(void);
/************************************************************************************
* Name: tiva_ledinit, tiva_setled, and tiva_setleds
*
* Description:
* If CONFIG_ARCH_LEDS is defined, then NuttX will control the on-board LED. 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 tiva_ledinit(void);
void tiva_setled(int led, bool ledon);
void tiva_setleds(uint8_t ledset);
#endif
/************************************************************************************
* Name: tiva_tmp100_initialize
*
* Description:
* Initialize and register the TMP-100 Temperature Sensor driver.
*
* Input parameters:
* devpath - The full path to the driver to register. E.g., "/dev/temp0"
*
* Returned Value:
* Zero (OK) on success; a negated errno value on failure.
*
************************************************************************************/
#if defined(CONFIG_I2C) && defined(CONFIG_I2C_LM75) && defined(CONFIG_TIVA_I2C6)
int tiva_tmp100_initialize(FAR const char *devpath);
#endif
#endif /* __ASSEMBLY__ */
#endif /* __CONFIGS_TM4C1294_LAUNCHPAD_INCLUDE_BOARD_H */

View file

@ -0,0 +1,110 @@
############################################################################
# configs/dk-tm4c129x/ipv6/Make.defs
#
# Copyright (C) 2015 Gregory Nutt. All rights reserved.
# Author: Gregory Nutt <gnutt@nuttx.org>
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in
# the documentation and/or other materials provided with the
# distribution.
# 3. Neither the name NuttX nor the names of its contributors may be
# used to endorse or promote products derived from this software
# without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
# OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
#
############################################################################
include ${TOPDIR}/.config
include ${TOPDIR}/tools/Config.mk
include ${TOPDIR}/arch/arm/src/armv7-m/Toolchain.defs
ifeq ($(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/ld.script}"
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/ld.script
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
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 =

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,75 @@
#!/bin/bash
# configs/tm4c1294-launchpad/ipv6/setenv.sh
#
# Copyright (C) 2015 Gregory Nutt. All rights reserved.
# Author: Gregory Nutt <gnutt@nuttx.org>
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in
# the documentation and/or other materials provided with the
# distribution.
# 3. Neither the name NuttX nor the names of its contributors may be
# used to endorse or promote products derived from this software
# without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
# OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
#
if [ "$_" = "$0" ] ; then
echo "You must source this script, not run it!" 1>&2
exit 1
fi
WD=`pwd`
if [ ! -x "setenv.sh" ]; then
echo "This script must be executed from the top-level NuttX build directory"
exit 1
fi
if [ -z "${PATH_ORIG}" ]; then
export PATH_ORIG="${PATH}"
fi
# This is the Cygwin path to the location where I installed the CodeSourcery
# toolchain under windows. You will also have to edit this if you install
# the CodeSourcery toolchain in any other location
#export TOOLCHAIN_BIN="/cygdrive/c/Program Files (x86)/CodeSourcery/Sourcery G++ Lite/bin"
export TOOLCHAIN_BIN="/cygdrive/c/Program Files (x86)/CodeSourcery/Sourcery_CodeBench_Lite_for_ARM_EABI/bin"
#export TOOLCHAIN_BIN="/cygdrive/c/Users/MyName/MentorGraphics/Sourcery_CodeBench_Lite_for_ARM_EABI/bin"
# These are the Cygwin paths to the locations where I installed the Atollic
# toolchain under windows. You will also have to edit this if you install
# the Atollic toolchain in any other location. /usr/bin is added before
# the Atollic bin path because there is are binaries named gcc.exe and g++.exe
# at those locations as well.
#export TOOLCHAIN_BIN="/usr/bin:/cygdrive/c/Program Files (x86)/Atollic/TrueSTUDIO for ARM Pro 2.3.0/ARMTools/bin"
#export TOOLCHAIN_BIN="/usr/bin:/cygdrive/c/Program Files (x86)/Atollic/TrueSTUDIO for STMicroelectronics STM32 Lite 2.3.0/ARMTools/bin"
# This is the Cygwin path to the location where I build the buildroot
# toolchain.
# export TOOLCHAIN_BIN="${WD}/../misc/buildroot/build_arm_nofpu/staging_dir/bin"
# The tm4c1294-launchpad/tools directory
export TOOL_DIR="${WD}/configs/tm4c1294-launchpad/tools"
# Add the path to the toolchain and tools directory to the PATH varialble
export PATH="${TOOLCHAIN_BIN}:${TOOL_DIR}:/sbin:/usr/sbin:${PATH_ORIG}"
echo "PATH : ${PATH}"

View file

@ -0,0 +1,110 @@
############################################################################
# configs/tm4c1294-launchpad/nsh/Make.defs
#
# Copyright (C) 2014 Gregory Nutt. All rights reserved.
# Author: Gregory Nutt <gnutt@nuttx.org>
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in
# the documentation and/or other materials provided with the
# distribution.
# 3. Neither the name NuttX nor the names of its contributors may be
# used to endorse or promote products derived from this software
# without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
# OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
#
############################################################################
include ${TOPDIR}/.config
include ${TOPDIR}/tools/Config.mk
include ${TOPDIR}/arch/arm/src/armv7-m/Toolchain.defs
ifeq ($(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/ld.script}"
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/ld.script
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
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 =

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,75 @@
#!/bin/bash
# configs/tm4c1294-launchpad/nsh/setenv.sh
#
# Copyright (C) 2014 Gregory Nutt. All rights reserved.
# Author: Gregory Nutt <gnutt@nuttx.org>
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in
# the documentation and/or other materials provided with the
# distribution.
# 3. Neither the name NuttX nor the names of its contributors may be
# used to endorse or promote products derived from this software
# without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
# OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
#
if [ "$_" = "$0" ] ; then
echo "You must source this script, not run it!" 1>&2
exit 1
fi
WD=`pwd`
if [ ! -x "setenv.sh" ]; then
echo "This script must be executed from the top-level NuttX build directory"
exit 1
fi
if [ -z "${PATH_ORIG}" ]; then
export PATH_ORIG="${PATH}"
fi
# This is the Cygwin path to the location where I installed the CodeSourcery
# toolchain under windows. You will also have to edit this if you install
# the CodeSourcery toolchain in any other location
#export TOOLCHAIN_BIN="/cygdrive/c/Program Files (x86)/CodeSourcery/Sourcery G++ Lite/bin"
export TOOLCHAIN_BIN="/cygdrive/c/Program Files (x86)/CodeSourcery/Sourcery_CodeBench_Lite_for_ARM_EABI/bin"
#export TOOLCHAIN_BIN="/cygdrive/c/Users/MyName/MentorGraphics/Sourcery_CodeBench_Lite_for_ARM_EABI/bin"
# These are the Cygwin paths to the locations where I installed the Atollic
# toolchain under windows. You will also have to edit this if you install
# the Atollic toolchain in any other location. /usr/bin is added before
# the Atollic bin path because there is are binaries named gcc.exe and g++.exe
# at those locations as well.
#export TOOLCHAIN_BIN="/usr/bin:/cygdrive/c/Program Files (x86)/Atollic/TrueSTUDIO for ARM Pro 2.3.0/ARMTools/bin"
#export TOOLCHAIN_BIN="/usr/bin:/cygdrive/c/Program Files (x86)/Atollic/TrueSTUDIO for STMicroelectronics STM32 Lite 2.3.0/ARMTools/bin"
# This is the Cygwin path to the location where I build the buildroot
# toolchain.
# export TOOLCHAIN_BIN="${WD}/../misc/buildroot/build_arm_nofpu/staging_dir/bin"
# The tm4c1294-launchpad/tools directory
export TOOL_DIR="${WD}/configs/tm4c1294-launchpad/tools"
# Add the path to the toolchain and tools directory to the PATH varialble
export PATH="${TOOLCHAIN_BIN}:${TOOL_DIR}:/sbin:/usr/sbin:${PATH_ORIG}"
echo "PATH : ${PATH}"

View file

@ -0,0 +1,115 @@
/****************************************************************************
* configs/tm4c1294-launchpad/scripts/ld.script
*
* Copyright (C) 2014 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
* 3. Neither the name NuttX nor the names of its contributors may be
* used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
****************************************************************************/
/* The TM4C1294NCPDT has 1024Kib of FLASH beginning at address 0x0000:0000 and
* 256Kib of SRAM beginning at 0x2000:0000.
*/
MEMORY
{
flash (rx) : ORIGIN = 0x00000000, LENGTH = 1M
sram (rwx) : ORIGIN = 0x20000000, LENGTH = 256K
}
OUTPUT_ARCH(arm)
ENTRY(_stext)
SECTIONS
{
.text : {
_stext = ABSOLUTE(.);
*(.vectors)
*(.text .text.*)
*(.fixup)
*(.gnu.warning)
*(.rodata .rodata.*)
*(.gnu.linkonce.t.*)
*(.glue_7)
*(.glue_7t)
*(.got)
*(.gcc_except_table)
*(.gnu.linkonce.r.*)
_etext = ABSOLUTE(.);
} > flash
.init_section : {
_sinit = ABSOLUTE(.);
*(.init_array .init_array.*)
_einit = ABSOLUTE(.);
} > flash
.ARM.extab : {
*(.ARM.extab*)
} > flash
__exidx_start = ABSOLUTE(.);
.ARM.exidx : {
*(.ARM.exidx*)
} > flash
__exidx_end = ABSOLUTE(.);
_eronly = ABSOLUTE(.);
.data : {
_sdata = ABSOLUTE(.);
*(.data .data.*)
*(.gnu.linkonce.d.*)
CONSTRUCTORS
_edata = ABSOLUTE(.);
} > sram AT > flash
.bss : {
_sbss = ABSOLUTE(.);
*(.bss .bss.*)
*(.gnu.linkonce.b.*)
*(COMMON)
_ebss = ABSOLUTE(.);
} > sram
/* Stabs debugging sections. */
.stab 0 : { *(.stab) }
.stabstr 0 : { *(.stabstr) }
.stab.excl 0 : { *(.stab.excl) }
.stab.exclstr 0 : { *(.stab.exclstr) }
.stab.index 0 : { *(.stab.index) }
.stab.indexstr 0 : { *(.stab.indexstr) }
.comment 0 : { *(.comment) }
.debug_abbrev 0 : { *(.debug_abbrev) }
.debug_info 0 : { *(.debug_info) }
.debug_line 0 : { *(.debug_line) }
.debug_pubnames 0 : { *(.debug_pubnames) }
.debug_aranges 0 : { *(.debug_aranges) }
}

View file

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

View file

@ -0,0 +1,111 @@
############################################################################
# configs/dk-tm4c129x/src/Makefile
#
# Copyright (C) 2014 Gregory Nutt. All rights reserved.
# Author: Gregory Nutt <gnutt@nuttx.org>
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in
# the documentation and/or other materials provided with the
# distribution.
# 3. Neither the name NuttX nor the names of its contributors may be
# used to endorse or promote products derived from this software
# without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
# OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
#
############################################################################
-include $(TOPDIR)/Make.defs
CFLAGS += -I$(TOPDIR)/sched
ASRCS =
AOBJS = $(ASRCS:.S=$(OBJEXT))
CSRCS = tm4c_boot.c tm4c_bringup.c tm4c_ssi.c
ifeq ($(CONFIG_ARCH_LEDS),y)
CSRCS += tm4c_autoleds.c
else
CSRCS += tm4c_userleds.c
endif
ifeq ($(CONFIG_ARCH_BUTTONS),y)
CSRCS += tm4c_buttons.c
endif
ifeq ($(CONFIG_TIVA_ETHERNET),y)
CSRCS += tm4c_ethernet.c
endif
ifeq ($(CONFIG_DK_TM4C129X_TIMER),y)
CSRCS += tm4c_timer.c
endif
ifeq ($(CONFIG_NSH_ARCHINIT),y)
CSRCS += tm4c_nsh.c
endif
ifeq ($(CONFIG_I2C_LM75),y)
ifeq ($(CONFIG_TIVA_I2C6),y)
CSRCS += tm4c_tmp100.c
endif
endif
COBJS = $(CSRCS:.c=$(OBJEXT))
SRCS = $(ASRCS) $(CSRCS)
OBJS = $(AOBJS) $(COBJS)
ARCH_SRCDIR = $(TOPDIR)/arch/$(CONFIG_ARCH)/src
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
all: libboard$(LIBEXT)
$(AOBJS): %$(OBJEXT): %.S
$(call ASSEMBLE, $<, $@)
$(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

View file

@ -0,0 +1,180 @@
/************************************************************************************
* configs/tm4c1294-launchpad/src/ek-tm4c1294xl.h
*
* Copyright (C) 2014 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
* 3. Neither the name NuttX nor the names of its contributors may be
* used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
************************************************************************************/
#ifndef __CONFIGS_TM4C1294_LAUNCHPAD_TM4C1294_LAUNCHPAD_H
#define __CONFIGS_TM4C1294_LAUNCHPAD_TM4C1294_LAUNCHPAD_H
/************************************************************************************
* Included Files
************************************************************************************/
#include <nuttx/config.h>
#include <nuttx/compiler.h>
#include "chip.h"
#include "tiva_gpio.h"
/************************************************************************************
* Pre-processor Definitions
************************************************************************************/
/* Configuration ********************************************************************/
/* How many SSI modules does this chip support? */
#if TIVA_NSSI < 1
# undef CONFIG_TIVA_SSI0
# undef CONFIG_TIVA_SSI0
#elif TIVA_NSSI < 2
# undef CONFIG_TIVA_SSI0
#endif
/* LED definitions ******************************************************************/
/* The EK-TM4C1294XL has a four green LEDs.
*
* --- ------------
* Pin Pin Function
* --- ------------
* PN1 Green LED D1
* PN0 Green LED D2
* PF4 Green LED D3
* PF0 Green LED D4
* --- ------------
*
* A high output illuminates the LED.
*/
#define GPIO_LED_D1 (GPIO_FUNC_OUTPUT | GPIO_VALUE_ZERO | GPIO_PORTN | GPIO_PIN_1)
#define GPIO_LED_D2 (GPIO_FUNC_OUTPUT | GPIO_VALUE_ZERO | GPIO_PORTN | GPIO_PIN_0)
#define GPIO_LED_D3 (GPIO_FUNC_OUTPUT | GPIO_VALUE_ZERO | GPIO_PORTF | GPIO_PIN_4)
#define GPIO_LED_D4 (GPIO_FUNC_OUTPUT | GPIO_VALUE_ZERO | GPIO_PORTF | GPIO_PIN_0)
/* Button definitions ***************************************************************/
/* There are four push buttons on the board. Two of them are user controllable.
* The others are RESET and WAKE
*
* --- ------------
* Pin Pin Function
* --- ------------
* PJ0 USR_SW1
* PJ1 USR_SW2
* --- ------------
*/
#define GPIO_SW1 (GPIO_FUNC_INPUT | GPIO_PORTJ | GPIO_PIN_0)
#define GPIO_SW2 (GPIO_FUNC_INPUT | GPIO_PORTJ | GPIO_PIN_1)
/* SPI Chip selects ****************************************************************/
/* SSI0: PA3 is used for SSI0 chip select to the second booster pack (No pull-
* ups)
* SSI3: PH4 selects the SD card and PQ1 selects the on-board SPI flash. Both
* pulled up on board.
*/
#define GPIO_BSTR2_CS (GPIO_FUNC_OUTPUT | GPIO_PADTYPE_STDWPU | GPIO_STRENGTH_4MA | \
GPIO_VALUE_ONE | GPIO_PORTA | GPIO_PIN_3)
#define GPIO_FLASH_CS (GPIO_FUNC_OUTPUT | GPIO_PADTYPE_STD | GPIO_STRENGTH_4MA | \
GPIO_VALUE_ONE | GPIO_PORTH | GPIO_PIN_4)
#define GPIO_SD_CS (GPIO_FUNC_OUTPUT | GPIO_PADTYPE_STD | GPIO_STRENGTH_4MA | \
GPIO_VALUE_ONE | GPIO_PORTH | GPIO_PIN_4)
/* I2C *****************************************************************************/
/* I2C3: PG4-5 are provide to the BoostPack 1 interface
* I2C7: PA4-5 are provide to the BoostPack 2 interface
* I2C6: PB6-7 are used for I2C to the TMP100 and the EM connector.
* J18 and J20 must be closed to connect the TMP100.
* I2C address is 0x4A
*/
#define TMP100_I2CBUS 6
#define TMP100_I2CADDR 0x4a
/* Speaker outputs *****************************************************************/
/* PB2/PD4 are used for the speaker output */
/* Touchscreen *********************************************************************/
/* PE7/PP7/PT2-3 are used for the touch screen */
/************************************************************************************
* Public Functions
************************************************************************************/
#ifndef __ASSEMBLY__
/************************************************************************************
* Name: tm4c_ssiinitialize
*
* Description:
* Called to configure SPI chip select GPIO pins for the EK-TM4C1294XL.
*
************************************************************************************/
void weak_function tm4c_ssiinitialize(void);
/****************************************************************************
* Name: tm4c_ledinit
*
* Description:
* Called to initialize the on-board LEDs.
*
****************************************************************************/
#ifdef CONFIG_ARCH_LEDS
void tm4c_ledinit(void);
#endif
/****************************************************************************
* Name: tm4c_bringup
*
* Description:
* Bring up board features
*
****************************************************************************/
int tm4c_bringup(void);
/****************************************************************************
* Name: tiva_timer_initialize
*
* Description:
* Configure the timer driver
*
****************************************************************************/
#ifdef CONFIG_TM4C1294_LAUNCHPAD_TIMER
int tiva_timer_initialize(void);
#endif
#endif /* __ASSEMBLY__ */
#endif /* __CONFIGS_TM4C1294_LAUNCHPAD_TM4C1294_LAUNCHPAD_H */

View file

@ -0,0 +1,161 @@
/****************************************************************************
* configs/tm4c1294-launchpad/src/tm4c_autoleds.c
*
* Copyright (C) 2014 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
* 3. Neither the name NuttX nor the names of its contributors may be
* used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
****************************************************************************/
/****************************************************************************
* Included Files
****************************************************************************/
#include <nuttx/config.h>
#include <debug.h>
#include <arch/board/board.h>
#include "tiva_gpio.h"
#include "tm4c1294-launchpad.h"
/****************************************************************************
* Public Functions
****************************************************************************/
/****************************************************************************
* Name: tm4c_ledinit
*
* Description:
* Called to initialize the on-board LEDs.
*
****************************************************************************/
#ifdef CONFIG_ARCH_LEDS
void tm4c_ledinit(void)
{
/* Configure LED PIOs for output */
// FIXME: sauttefk
tiva_configgpio(GPIO_LED_D1);
tiva_configgpio(GPIO_LED_D2);
tiva_configgpio(GPIO_LED_D3);
tiva_configgpio(GPIO_LED_D4);
}
/****************************************************************************
* Name: board_led_on
****************************************************************************/
void board_led_on(int led)
{
/* --------------- ------- ---- ----- --------------------
* STATE VALUE RED GREEN BLUE
* --------------- ------- ---- ----- --------------------
* LED_STARTED 0 OFF OFF ON
* LED_HEAPALLOCATE 1 NC NC NC
* LED_IRQSENABLED 1 NC NC NC
* LED_STACKCREATED 2 OFF ON OFF
* LED_INIRQ 1 NC NC NC
* LED_SIGNAL 1 NC NC NC
* LED_ASSERTION 1 NC NC NC
* LED_PANIC 3 ON OFF OFF (flashing 2Hz)
* --------------- ------- ---- ----- --------------------
*
* A high output illuminates the LED.
*/
switch (led)
{
case 0: /* R=OFF, G=OFF, B=ON */
/* Previous state was all OFF */
tiva_gpiowrite(GPIO_LED_D1, true);
break;
default:
case 1: /* No change */
break;
case 2: /* R=OFF, G=ON, B=OFF */
/* Previous state was all: R=OFF, G=OFF, B=ON */
tiva_gpiowrite(GPIO_LED_D2, true);
tiva_gpiowrite(GPIO_LED_D3, false);
break;
case 3: /* R=ON, G=OFF, B=OFF */
/* Previous state was all: R=OFF, G=Unknown, B=Unknown */
tiva_gpiowrite(GPIO_LED_D1, true);
tiva_gpiowrite(GPIO_LED_D2, false);
tiva_gpiowrite(GPIO_LED_D3, false);
break;
}
}
/****************************************************************************
* Name: board_led_off
****************************************************************************/
void board_led_off(int led)
{
/* --------------- ------- ---- ----- --------------------
* STATE VALUE RED GREEN BLUE
* --------------- ------- ---- ----- --------------------
* LED_STARTED 0 OFF OFF ON
* LED_HEAPALLOCATE 1 NC NC NC
* LED_IRQSENABLED 1 NC NC NC
* LED_STACKCREATED 2 OFF ON OFF
* LED_INIRQ 1 NC NC NC
* LED_SIGNAL 1 NC NC NC
* LED_ASSERTION 1 NC NC NC
* LED_PANIC 3 ON OFF OFF (flashing 2Hz)
* --------------- ------- ---- ----- --------------------
*
* A high output illuminates the LED.
*/
switch (led)
{
case 0: /* Will not happen */
case 1: /* No change */
case 2: /* Will not happen */
default:
break;
case 3: /* R=OFF, G=OFF, B=OFF */
/* Previous state was all: R=ON, G=OFF, B=OFF */
tiva_gpiowrite(GPIO_LED_D1, false);
}
}
#endif /* CONFIG_ARCH_LEDS */

View file

@ -0,0 +1,114 @@
/************************************************************************************
* configs/tm4c1294xl/src/tm4c_boot.c
*
* Copyright (C) 2014 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
* 3. Neither the name NuttX nor the names of its contributors may be
* used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
************************************************************************************/
/************************************************************************************
* Included Files
************************************************************************************/
#include <nuttx/config.h>
#include <debug.h>
#include <arch/board/board.h>
#include "tm4c1294-launchpad.h"
#include "up_arch.h"
#include "up_internal.h"
/************************************************************************************
* Pre-processor Definitions
************************************************************************************/
/************************************************************************************
* Private Functions
************************************************************************************/
/************************************************************************************
* Public Functions
************************************************************************************/
/************************************************************************************
* Name: tiva_boardinitialize
*
* Description:
* All Tiva 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 tiva_boardinitialize(void)
{
/* Configure SPI chip selects if 1) SSI is not disabled, and 2) the weak function
* tm4c_ssiinitialize() has been brought into the link.
*/
/* The DK-TM4C129X microSD CS and OLED are on SSI0 */
#if defined(CONFIG_TIVA_SSI0) || defined(CONFIG_TIVA_SSI1)
if (tm4c_ssiinitialize)
{
tm4c_ssiinitialize();
}
#endif
/* Configure on-board LEDs if LED support has been selected. */
#ifdef CONFIG_ARCH_LEDS
tm4c_ledinit();
#endif
}
/****************************************************************************
* Name: board_initialize
*
* Description:
* If CONFIG_BOARD_INITIALIZE is selected, then an additional
* initialization call will be performed in the boot-up sequence to a
* function called board_initialize(). board_initialize() will be
* called immediately after up_intiialize() is called and just before the
* initial application is started. This additional initialization phase
* may be used, for example, to initialize board-specific device drivers.
*
****************************************************************************/
#ifdef CONFIG_BOARD_INITIALIZE
void board_initialize(void)
{
/* Perform board initialization */
(void)tm4c_bringup();
}
#endif /* CONFIG_BOARD_INITIALIZE */

View file

@ -0,0 +1,105 @@
/****************************************************************************
* config/tm4c1294-launchpad/src/tm4c_bringup.c
*
* Copyright (C) 2014 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
* 3. Neither the name NuttX nor the names of its contributors may be
* used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
****************************************************************************/
/****************************************************************************
* Included Files
****************************************************************************/
#include <nuttx/config.h>
#include <debug.h>
#include <arch/board/board.h>
#include "tm4c1294-launchpad.h"
/****************************************************************************
* Pre-Processor Definitions
****************************************************************************/
#if defined(CONFIG_I2C) && defined(CONFIG_I2C_LM75) && defined(CONFIG_TIVA_I2C6)
# define HAVE_TMP100
#endif
#ifdef CONFIG_DK_TM4C129X_TIMER
# define HAVE_TIMER
#endif
#ifdef CONFIG_SYSTEM_LM75_DEVNAME
# define TMP100_DEVNAME CONFIG_SYSTEM_LM75_DEVNAME
#else
# define TMP100_DEVNAME "/dev/temp"
#endif
/****************************************************************************
* Public Functions
****************************************************************************/
/****************************************************************************
* Name: tm4c_bringup
*
* Description:
* Bring up board features
*
****************************************************************************/
int tm4c_bringup(void)
{
#if defined(HAVE_TMP100) || defined(HAVE_TIMER)
int ret;
#endif
#ifdef HAVE_TMP100
/* Initialize and register the TMP-100 Temperature Sensor driver. */
ret = tiva_tmp100_initialize(TMP100_DEVNAME);
if (ret < 0)
{
dbg("ERROR: Failed to initialize TMP100 driver: %d\n", ret);
}
#endif
#ifdef HAVE_TIMER
/* Initialize the timer driver */
ret = tiva_timer_initialize();
if (ret < 0)
{
dbg("ERROR: Failed to initialize timer driver: %d\n", ret);
}
#endif
return OK;
}

View file

@ -0,0 +1,127 @@
/****************************************************************************
* configs/tm4c1294-launchpad/src/tm4c_buttons.c
*
* Copyright (C) 2014 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
* 3. Neither the name NuttX nor the names of its contributors may be
* used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
****************************************************************************/
/****************************************************************************
* Included Files
****************************************************************************/
#include <nuttx/config.h>
#include <stdint.h>
#include <nuttx/arch.h>
#include <arch/irq.h>
#include <arch/board/board.h>
#include "tm4c1294-launchpad.h"
#ifdef CONFIG_ARCH_BUTTONS
/****************************************************************************
* Definitions
****************************************************************************/
/****************************************************************************
* Private Data
****************************************************************************/
/* Pin configuration for each STM3210E-EVAL button. This array is indexed by
* the BUTTON_* and JOYSTICK_* definitions in board.h
*/
static const uint32_t g_buttons[NUM_BUTTONS] =
{
GPIO_SW1, GPIO_SW2
};
/****************************************************************************
* Private Functions
****************************************************************************/
/****************************************************************************
* Public Functions
****************************************************************************/
/****************************************************************************
* Name: board_button_initialize
*
* Description:
* board_button_initialize() must be called to initialize button resources.
* After that, board_buttons() may be called to collect the current state
* of all buttons or board_button_irq() may be called to register button
* interrupt handlers.
*
****************************************************************************/
void board_button_initialize(void)
{
int i;
/* Configure the GPIO pins as inputs. */
for (i = 0; i < NUM_BUTTONS; i++)
{
tiva_configgpio(g_buttons[i]);
}
}
/****************************************************************************
* Name: board_buttons
****************************************************************************/
uint8_t board_buttons(void)
{
uint8_t ret = 0;
int i;
/* Check that state of each key */
for (i = 0; i < NUM_BUTTONS; i++)
{
/* A LOW value means that the key is pressed. */
bool released = tiva_gpioread(g_buttons[i]);
/* Accumulate the set of depressed (not released) keys */
if (!released)
{
ret |= (1 << i);
}
}
return ret;
}
#endif /* CONFIG_ARCH_BUTTONS */

View file

@ -0,0 +1,99 @@
/************************************************************************************
* configs/tm4c1294-launchpad/src/tm4c_ethernet.c
*
* Copyright (C) 2015 Gregory Nutt. All rights reserved.
* Authors: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
* 3. Neither the name NuttX nor the names of its contributors may be
* used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
************************************************************************************/
/************************************************************************************
* Included Files
************************************************************************************/
#include <nuttx/config.h>
#include <stdint.h>
#include <debug.h>
#include <assert.h>
#include <arch/board/board.h>
#include <net/ethernet.h>
#include "up_arch.h"
#include "chip.h"
#include "chip/tiva_flash.h"
#include "tiva_ethernet.h"
/************************************************************************************
* Pre-processor Definitions
************************************************************************************/
/************************************************************************************
* Private Functions
************************************************************************************/
/************************************************************************************
* Public Functions
************************************************************************************/
/************************************************************************************
* Name: tiva_ethernetmac
*
* Description:
* For the Ethernet Eval Kits, the MAC address will be stored in the non-volatile
* USER0 and USER1 registers. If CONFIG_TIVA_BOARDMAC is defined, this function
* will obtain the MAC address from these registers.
*
************************************************************************************/
#ifdef CONFIG_TIVA_BOARDMAC
void tiva_ethernetmac(struct ether_addr *ethaddr)
{
uint32_t user0;
uint32_t user1;
/* Get the current value of the user registers */
user0 = getreg32(TIVA_FLASH_USERREG0);
user1 = getreg32(TIVA_FLASH_USERREG1);
nlldbg("user: %06x:%06x\n", user1 & 0x00ffffff, user0 & 0x00ffffff);
DEBUGASSERT(user0 != 0xffffffff && user1 != 0xffffffff);
/* Re-format that MAC address the way that uIP expects to see it */
ethaddr->ether_addr_octet[0] = ((user0 >> 0) & 0xff);
ethaddr->ether_addr_octet[1] = ((user0 >> 8) & 0xff);
ethaddr->ether_addr_octet[2] = ((user0 >> 16) & 0xff);
ethaddr->ether_addr_octet[3] = ((user1 >> 0) & 0xff);
ethaddr->ether_addr_octet[4] = ((user1 >> 8) & 0xff);
ethaddr->ether_addr_octet[5] = ((user1 >> 16) & 0xff);
}
#endif

View file

@ -0,0 +1,71 @@
/****************************************************************************
* config/tm4c1294-launchpad/src/tm4c_nsh.c
*
* Copyright (C) 2014 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
* 3. Neither the name NuttX nor the names of its contributors may be
* used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
****************************************************************************/
/****************************************************************************
* Included Files
****************************************************************************/
#include <nuttx/config.h>
#include "tm4c1294-launchpad.h"
/****************************************************************************
* Pre-Processor Definitions
****************************************************************************/
/****************************************************************************
* Public Functions
****************************************************************************/
/****************************************************************************
* Name: nsh_archinitialize
*
* Description:
* Perform architecture specific initialization
*
****************************************************************************/
int nsh_archinitialize(void)
{
/* If CONFIG_BOARD_INITIALIZE is selected then board initialization was
* already performed in board_initialize.
*/
#ifndef CONFIG_BOARD_INITIALIZE
return tm4c_bringup();
#else
return OK;
#endif
}

View file

@ -0,0 +1,132 @@
/************************************************************************************
* configs/tm4c1294-launchpad/src/tm4c_ssi.c
*
* Copyright (C) 2014 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
* 3. Neither the name NuttX nor the names of its contributors may be
* used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
************************************************************************************/
/************************************************************************************
* Included Files
************************************************************************************/
#include <nuttx/config.h>
#include <stdint.h>
#include <stdbool.h>
#include <debug.h>
#include <nuttx/spi/spi.h>
#include <arch/board/board.h>
#include "up_arch.h"
#include "chip.h"
#include "tiva_gpio.h"
#include "tm4c1294-launchpad.h"
/* The DK-TM4C129X microSD CS is on SSI0 */
#if defined(CONFIG_TIVA_SSI0) || defined(CONFIG_TIVA_SSI1)
/************************************************************************************
* Pre-processor Definitions
************************************************************************************/
/* CONFIG_DEBUG_SPI enables debug output from this file (needs CONFIG_DEBUG too) */
#ifdef CONFIG_DEBUG_SPI
# define ssidbg lldbg
#else
# define ssidbg(x...)
#endif
/* Dump GPIO registers */
#if defined(CONFIG_DEBUG_SPI) && defined(CONFIG_DEBUG_VERBOSE)
# define ssivdbg lldbg
# define ssi_dumpgpio(m) tiva_dumpgpio(SDCCS_GPIO, m)
#else
# define ssivdbg(x...)
# define ssi_dumpgpio(m)
#endif
/************************************************************************************
* Private Functions
************************************************************************************/
/************************************************************************************
* Public Functions
************************************************************************************/
/************************************************************************************
* Name: tm4c_ssiinitialize
*
* Description:
* Called to configure SPI chip select GPIO pins for the DK-TM4C129X.
*
************************************************************************************/
void weak_function tm4c_ssiinitialize(void)
{
}
/****************************************************************************
* The external functions, tiva_spiselect and tiva_spistatus must be provided
* by board-specific logic. The are implementations of the select and status
* methods SPI interface defined by struct spi_ops_s (see include/nuttx/spi/spi.h).
* All othermethods (including tiva_spiinitialize()) are provided by common
* logic. To use this common SPI logic on your board:
*
* 1. Provide tiva_spiselect() and tiva_spistatus() functions in your
* board-specific logic. This function will perform chip selection and
* status operations using GPIOs in the way your board is configured.
* 2. Add a call to tiva_spiinitialize() in your low level initialization
* logic
* 3. The handle returned by tiva_spiinitialize() may then be used to bind the
* SPI driver to higher level logic (e.g., calling
* mmcsd_spislotinitialize(), for example, will bind the SPI driver to
* the SPI MMC/SD driver).
*
****************************************************************************/
void tiva_spiselect(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool selected)
{
ssidbg("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert");
ssi_dumpgpio("tiva_spiselect() Entry");
ssi_dumpgpio("tiva_spiselect() Exit");
}
uint8_t tiva_spistatus(FAR struct spi_dev_s *dev, enum spi_dev_e devid)
{
ssidbg("Returning SPI_STATUS_PRESENT\n");
return SPI_STATUS_PRESENT;
}
#endif /* CONFIG_TIVA_SSI0 || CONFIG_TIVA_SSI1 */

View file

@ -0,0 +1,115 @@
/****************************************************************************
* config/tm4c1294-launchpad/src/tm4c_timer.c
*
* Copyright (C) 2015 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
* 3. Neither the name NuttX nor the names of its contributors may be
* used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
****************************************************************************/
/****************************************************************************
* Included Files
****************************************************************************/
#include <nuttx/config.h>
#include <debug.h>
#include "tiva_timer.h"
#include "tm4c1294-launchpad.h"
#ifdef CONFIG_TM4C1294_LAUNCHPAD_TIMER
/****************************************************************************
* Pre-Processor Definitions
****************************************************************************/
/* Configuration ************************************************************/
#ifndef CONFIG_TIMER
# error CONFIG_TIMER is not defined
#endif
#ifndef CONFIG_TIVA_TIMER32_PERIODIC
# error CONFIG_TIVA_TIMER32_PERIODIC is not defined
#endif
#if defined(CONFIG_DK_TM4CTM4C1294_LAUNCHPADX_TIMER0)
# define GPTM 0
#elif defined(CONFIG_TM4C1294_LAUNCHPAD_TIMER1)
# define GPTM 1
#elif defined(CONFIG_TM4C1294_LAUNCHPAD_TIMER2)
# define GPTM 2
#elif defined(CONFIG_TM4C1294_LAUNCHPAD_TIMER3)
# define GPTM 3
#elif defined(CONFIG_TM4C1294_LAUNCHPAD_TIMER4)
# define GPTM 4
#elif defined(CONFIG_TM4C1294_LAUNCHPAD_TIMER5)
# define GPTM 5
#elif defined(CONFIG_TM4C1294_LAUNCHPAD_TIMER6)
# define GPTM 6
#elif defined(CONFIG_TM4C1294_LAUNCHPAD_TIMER7)
# define GPTM 7
#else
# error No CONFIG_TM4C1294_LAUNCHPAD_TIMERn definition
#endif
#ifndef CONFIG_TM4C1294_LAUNCHPAD_TIMER_DEVNAME
# define CONFIG_TM4C1294_LAUNCHPAD_TIMER_DEVNAME "/dev/timer0"
#endif
#undef CONFIG_TM4C1294_LAUNCHPAD_TIMER_ALTCLK
#define ALTCLK false
/****************************************************************************
* Public Functions
****************************************************************************/
/****************************************************************************
* Name: tiva_timer_initialize
*
* Description:
* Configure the timer driver
*
****************************************************************************/
int tiva_timer_initialize(void)
{
int ret;
timvdbg("Registering TIMER%d at %s\n", GPTM, CONFIG_TM4C1294_LAUNCHPAD_TIMER_DEVNAME);
ret = tiva_timer_register(CONFIG_TM4C1294_LAUNCHPAD_TIMER_DEVNAME, GPTM, ALTCLK);
if (ret < 0)
{
timdbg("ERROR: Failed to register timer driver: %d\n", ret);
}
return ret;
}
#endif /* CONFIG_TM4C1294_LAUNCHPAD_TIMER */

View file

@ -0,0 +1,102 @@
/****************************************************************************
ħ * configs/tm4c1294-launchpad/src/tiva_tmp100.c
*
* Copyright (C) 2015 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
* 3. Neither the name NuttX nor the names of its contributors may be
* used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
****************************************************************************/
/****************************************************************************
* Included Files
****************************************************************************/
#include <nuttx/config.h>
#include <errno.h>
#include <nuttx/i2c.h>
#include <nuttx/sensors/lm75.h>
#include "tiva_i2c.h"
#include "tm4c1294-launchpad.h"
#if defined(CONFIG_I2C) && defined(CONFIG_I2C_LM75) && \
defined(CONFIG_TIVA_I2C6)
/****************************************************************************
* Pre-processor Definitions
****************************************************************************/
/****************************************************************************
* Private Functions
****************************************************************************/
/****************************************************************************
* Public Functions
****************************************************************************/
/****************************************************************************
* Name: tiva_tmp100_initialize
*
* Description:
* Initialize and register the LM-75 Temperature Sensor driver.
*
* Input parameters:
* devpath - The full path to the driver to register. E.g., "/dev/temp0"
*
* Returned Value:
* Zero (OK) on success; a negated errno value on failure.
*
****************************************************************************/
int tiva_tmp100_initialize(FAR const char *devpath)
{
FAR struct i2c_dev_s *i2c;
int ret;
/* Get an instance of the I2C6 interface */
i2c = up_i2cinitialize(TMP100_I2CBUS);
if (!i2c)
{
return -ENODEV;
}
/* Then register the temperature sensor */
ret = lm75_register(devpath, i2c, TMP100_I2CADDR);
if (ret < 0)
{
(void)up_i2cuninitialize(i2c);
}
return ret;
}
#endif /* CONFIG_I2C && CONFIG_I2C_LM75 && CONFIG_TIVA_I2C6 */

View file

@ -0,0 +1,153 @@
/****************************************************************************
* configs/tm4c1294-launchpad/src/tm4c_userleds.c
*
* Copyright (C) 2014 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
* 3. Neither the name NuttX nor the names of its contributors may be
* used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
****************************************************************************/
/* The EK-TM4C1294XL has a four green LEDs.
*
* --- ------------
* Pin Pin Function
* --- ------------
* PN1 Green LED D1
* PN0 Green LED D2
* PF4 Green LED D3
* PF0 Green LED D4
* --- ------------
*
* A high output illuminates the LED.
*/
/****************************************************************************
* Included Files
****************************************************************************/
#include <nuttx/config.h>
#include <stdint.h>
#include <stdbool.h>
#include <debug.h>
#include <arch/board/board.h>
#include "tiva_gpio.h"
#include "tm4c1294-launchpad.h"
#ifndef CONFIG_ARCH_LEDS
/****************************************************************************
* Pre-processor 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
/****************************************************************************
* Public Functions
****************************************************************************/
/****************************************************************************
* Name: tiva_ledinit
****************************************************************************/
void tiva_ledinit(void)
{
/* Configure LED PIOs for output */
tiva_configgpio(GPIO_LED_D1);
tiva_configgpio(GPIO_LED_D2);
tiva_configgpio(GPIO_LED_D3);
tiva_configgpio(GPIO_LED_D4);
}
/****************************************************************************
* Name: tiva_setled
****************************************************************************/
void tiva_setled(int led, bool ledon)
{
uint32_t ledcfg;
if (led == BOARD_LED_D1)
{
ledcfg = GPIO_LED_D1;
}
else if (led == BOARD_LED_D2)
{
ledcfg = GPIO_LED_D2;
}
else if (led == BOARD_LED_D3)
{
ledcfg = GPIO_LED_D3;
}
else if (led == BOARD_LED_D4)
{
ledcfg = GPIO_LED_D4;
}
else
{
return;
}
tiva_gpiowrite(ledcfg, ledon);
}
/****************************************************************************
* Name: tiva_setleds
****************************************************************************/
void tiva_setleds(uint8_t ledset)
{
bool ledon;
ledon = ((ledset & BOARD_LED_D1_BIT) != 0);
tiva_gpiowrite(GPIO_LED_D1, ledon);
ledon = ((ledset & BOARD_LED_D2_BIT) != 0);
tiva_gpiowrite(GPIO_LED_D2, ledon);
ledon = ((ledset & BOARD_LED_D3_BIT) != 0);
tiva_gpiowrite(GPIO_LED_D3, ledon);
ledon = ((ledset & BOARD_LED_D4_BIT) != 0);
tiva_gpiowrite(GPIO_LED_D4, ledon);
}
#endif /* !CONFIG_ARCH_LEDS */

View file

@ -5,8 +5,8 @@
#
source [find interface/ti-icdi.cfg]
transport select hla_jtag
set WORKAREASIZE 0x40000 # RAM size
set WORKAREASIZE 0x40000
set CHIPNAME tm4c1294ncpdt
source [find target/stellaris_icdi.cfg]
source [find target/stellaris.cfg]

View file

@ -0,0 +1,57 @@
#!/bin/sh
#
# See configs/tm4c1294-launchpad/README.txt for information about
# this file.
TOPDIR=$1
USAGE="$0 <TOPDIR> [-d]"
if [ -z "${TOPDIR}" ]; then
echo "Missing argument"
echo $USAGE
exit 1
fi
# Assume that OpenOCD was installed and at /usr/local/bin. Uncomment
# the following to run directly from the build directory
# OPENOCD_PATH="/home/OpenOCD/openocd/src"
OPENOCD_PATH="/usr/bin"
# OPENOCD_PATH="/usr/local/bin"
# TARGET_PATH="/home/OpenOCD/openocd/tcl"
TARGET_PATH="/usr/share/openocd/scripts"
# TARGET_PATH="/usr/local/share/openocd/scripts"
# Assume a Unix development environment. Uncomment to use a Windows
# like environment
# OPENOCD_EXE=openocd.exe
OPENOCD_EXE=openocd
OPENOCD_CFG="${TOPDIR}/configs/tm4c1294-launchpad/tools/ek-tm4c1294xl.cfg"
OPENOCD_ARGS="-f ${OPENOCD_CFG} -s ${TARGET_PATH}"
if [ "X$2" = "X-d" ]; then
OPENOCD_ARGS=$OPENOCD_ARGS" -d3"
set -x
fi
if [ ! -d ${OPENOCD_PATH} ]; thenf
echo "OpenOCD path does not exist: ${OPENOCD_PATH}"
exit 1
fi
if [ ! -x ${OPENOCD_PATH}/${OPENOCD_EXE} ]; then
echo "OpenOCD does not exist: ${OPENOCD_PATH}/${OPENOCD_EXE}"
exit 1
fi
if [ ! -f ${OPENOCD_CFG} ]; then
echo "OpenOCD config file does not exist: ${OPENOCD_CFG}"
exit 1
fi
echo "Starting OpenOCD"
cd ${OPENOCD_PATH} || { echo "Failed to CD to ${OPENOCD_PATH}"; exit 1; }
${OPENOCD_EXE} ${OPENOCD_ARGS} &
echo "OpenOCD daemon started"
ps -ef | grep openocd
echo "In GDB: target remote localhost:3333"