mirror of
https://github.com/apache/nuttx.git
synced 2026-05-21 04:52:02 +08:00
Add basic support for the CC3200 Launchpad. From Jim Ewing
This commit is contained in:
@@ -808,6 +808,15 @@ config ARCH_BOARD_TM4C123G_LAUNCHPAD
|
||||
---help---
|
||||
Tiva TM4C123G LaunchPad.
|
||||
|
||||
config ARCH_BOARD_CC3200_LAUNCHPAD
|
||||
bool "Tiva CC3200 Launchpad"
|
||||
depends on ARCH_CHIP_CC3200
|
||||
select ARCH_HAVE_LEDS
|
||||
select ARCH_HAVE_BUTTONS
|
||||
select ARCH_HAVE_IRQBUTTONS
|
||||
---help---
|
||||
Tiva CC3200 Launchpad.
|
||||
|
||||
config ARCH_BOARD_TWR_K60N512
|
||||
bool "FreeScale TWR-K60N512d evelopment board"
|
||||
depends on ARCH_CHIP_MK60N512VMD100
|
||||
@@ -1036,6 +1045,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 "cc3200-launchpad" if ARCH_BOARD_CC3200_LAUNCHPAD
|
||||
default "twr-k60n512" if ARCH_BOARD_TWR_K60N512
|
||||
default "ubw32" if ARCH_BOARD_UBW32
|
||||
default "us7032evb1" if ARCH_BOARD_US7032EVB1
|
||||
@@ -1339,6 +1349,9 @@ endif
|
||||
if ARCH_BOARD_TM4C123G_LAUNCHPAD
|
||||
source "configs/tm4c123g-launchpad/Kconfig"
|
||||
endif
|
||||
if ARCH_BOARD_CC3200_LAUNCHPAD
|
||||
source "configs/cc3200-launchpad/Kconfig"
|
||||
endif
|
||||
if ARCH_BOARD_TWR_K60N512
|
||||
source "configs/twr-k60n512/Kconfig"
|
||||
endif
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
#
|
||||
# For a description of the syntax of this configuration file,
|
||||
# see misc/tools/kconfig-language.txt.
|
||||
#
|
||||
|
||||
if ARCH_BOARD_CC3200_LAUNCHPAD
|
||||
endif
|
||||
@@ -0,0 +1,267 @@
|
||||
/************************************************************************************
|
||||
* configs/cc3200/include/board.h
|
||||
* include/arch/board/board.h
|
||||
*
|
||||
* Copyright (C) 2010 Gregory Nutt. All rights reserved.
|
||||
* Authors: Gregory Nutt <gnutt@nuttx.org>
|
||||
* Jim Ewing <jim@droidifi.com>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in
|
||||
* the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
* 3. Neither the name NuttX nor the names of its contributors may be
|
||||
* used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
|
||||
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
||||
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
||||
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
************************************************************************************/
|
||||
|
||||
#ifndef __CONFIGS_CC3200_LAUNCHPAD_INCLUDE_BOARD_H
|
||||
#define __CONFIGS_CC3200_LAUNCHPAD_INCLUDE_BOARD_H
|
||||
|
||||
/************************************************************************************
|
||||
* Included Files
|
||||
************************************************************************************/
|
||||
|
||||
/************************************************************************************
|
||||
* Definitions
|
||||
************************************************************************************/
|
||||
|
||||
/* Clocking *************************************************************************/
|
||||
|
||||
/* RCC settings. Crystal on-board the CC3200 LaunchPad include:
|
||||
*
|
||||
* 40MHz internal clock
|
||||
* 32.768kHz RTC clock
|
||||
*/
|
||||
|
||||
#define SYSCON_RCC_XTAL SYSCON_RCC_XTAL40000KHZ /* On-board crystal is 40 MHz */
|
||||
#define XTAL_FREQUENCY 40000000
|
||||
|
||||
/* Oscillator source is the main oscillator */
|
||||
|
||||
#define SYSCON_RCC_OSCSRC SYSCON_RCC_OSCSRC_MOSC
|
||||
#define SYSCON_RCC2_OSCSRC SYSCON_RCC2_OSCSRC2_MOSC
|
||||
#define OSCSRC_FREQUENCY XTAL_FREQUENCY
|
||||
|
||||
#define TIVA_SYSDIV 5
|
||||
#define SYSCLK_FREQUENCY 80000000 /* 80MHz */
|
||||
|
||||
/* Other RCC settings:
|
||||
*
|
||||
* - Main and internal oscillators enabled.
|
||||
* - PLL and sys dividers not bypassed
|
||||
* - PLL not powered down
|
||||
* - No auto-clock gating reset
|
||||
*/
|
||||
|
||||
#define TIVA_RCC_VALUE (SYSCON_RCC_OSCSRC | SYSCON_RCC_XTAL | \
|
||||
SYSCON_RCC_USESYSDIV | SYSCON_RCC_SYSDIV(TIVA_SYSDIV))
|
||||
|
||||
/* RCC2 settings
|
||||
*
|
||||
* - PLL and sys dividers not bypassed.
|
||||
* - PLL not powered down
|
||||
* - Not using RCC2
|
||||
*
|
||||
* When SYSCON_RCC2_DIV400 is not selected, SYSDIV2 is the divisor-1.
|
||||
* When SYSCON_RCC2_DIV400 is selected, SYSDIV2 is the divisor-1)/2, plus
|
||||
* the LSB:
|
||||
*
|
||||
* SYSDIV2 SYSDIV2LSB DIVISOR
|
||||
* 0 N/A 2
|
||||
* 1 0 3
|
||||
* " 1 4
|
||||
* 2 0 5
|
||||
* " 1 6
|
||||
* etc.
|
||||
*/
|
||||
|
||||
#if (TIVA_SYSDIV & 1) == 0
|
||||
# define TIVA_RCC2_VALUE (SYSCON_RCC2_OSCSRC | SYSCON_RCC2_SYSDIV2LSB | \
|
||||
SYSCON_RCC2_SYSDIV_DIV400(TIVA_SYSDIV) | \
|
||||
SYSCON_RCC2_DIV400 | SYSCON_RCC2_USERCC2)
|
||||
#else
|
||||
# define TIVA_RCC2_VALUE (SYSCON_RCC2_OSCSRC | SYSCON_RCC2_SYSDIV_DIV400(TIVA_SYSDIV) | \
|
||||
SYSCON_RCC2_DIV400 | SYSCON_RCC2_USERCC2)
|
||||
#endif
|
||||
|
||||
/* LED definitions ******************************************************************/
|
||||
/* The CC3200 LaunchPad has three RGB LEDs.
|
||||
*
|
||||
* BOARD_LED_R -- Connected to PF1
|
||||
* BOARD_LED_G -- Connected to PF3
|
||||
* BOARD_LED_Y -- Connected to PF2
|
||||
*/
|
||||
|
||||
/* LED index values for use with cc3200_setled() */
|
||||
|
||||
#define BOARD_LED_R 1
|
||||
#define BOARD_LED_G 2
|
||||
#define BOARD_LED_Y 3
|
||||
#define BOARD_NLEDS 3
|
||||
|
||||
/* LED bits for use with cc3200_setleds() */
|
||||
|
||||
#define BOARD_LED1_BIT (1 << BOARD_LED1)
|
||||
#define BOARD_LED2_BIT (1 << BOARD_LED2)
|
||||
|
||||
/* If CONFIG_ARCH_LEDS is defined, then automated support for the LaunchPad LEDs
|
||||
* will be included in the build:
|
||||
*
|
||||
* OFF:
|
||||
* - OFF means that the OS is still initializing. Initialization is very fast so
|
||||
* if you see this at all, it probably means that the system is hanging up
|
||||
* somewhere in the initialization phases.
|
||||
*
|
||||
* GREEN
|
||||
* - This means that the OS completed initialization.
|
||||
*
|
||||
* BLUE:
|
||||
* - Whenever and interrupt or signal handler is entered, the BLUE LED is
|
||||
* illuminated and extinguished when the interrupt or signal handler exits.
|
||||
*
|
||||
* RED:
|
||||
* - If a recovered assertion occurs, the RED LED will be illuminated
|
||||
* briefly while the assertion is handled. You will probably never see this.
|
||||
*
|
||||
* Flashing RED:
|
||||
* - In the event of a fatal crash,
|
||||
* extinguished and the RED component will FLASH at a 2Hz rate.
|
||||
*/
|
||||
/* RED GREEN BLUE */
|
||||
#define LED_STARTED 0 /* OFF OFF OFF */
|
||||
#define LED_HEAPALLOCATE 0 /* OFF OFF OFF */
|
||||
#define LED_IRQSENABLED 0 /* OFF OFF OFF */
|
||||
#define LED_STACKCREATED 1 /* OFF ON OFF */
|
||||
#define LED_INIRQ 2 /* NC NC ON (momentary) */
|
||||
#define LED_SIGNAL 2 /* NC NC ON (momentary) */
|
||||
#define LED_ASSERTION 3 /* ON NC NC (momentary) */
|
||||
#define LED_PANIC 4 /* ON OFF OFF (flashing 2Hz) */
|
||||
|
||||
/* LED definitions ******************************************************************/
|
||||
/* The CC3200 LaunchPad has two buttons:
|
||||
*
|
||||
* BOARD_SW1 -- Connected to PF4
|
||||
* BOARD_SW2 -- Connected to PF0
|
||||
*/
|
||||
|
||||
#define BUTTON_SW1 0
|
||||
#define BUTTON_SW2 1
|
||||
#define BUTTON_SW3 2
|
||||
#define NUM_BUTTONS 3
|
||||
|
||||
#define BUTTON_SW1_BIT (1 << BUTTON_SW1)
|
||||
#define BUTTON_SW2_BIT (1 << BUTTON_SW2)
|
||||
#define BUTTON_SW3_BIT (1 << BUTTON_SW3)
|
||||
|
||||
/************************************************************************************
|
||||
* 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: cc3200_ledinit, cc3200_setled, and cc3200_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 cc3200_ledinit(void);
|
||||
void cc3200_setled(int led, unsigned char ledon);
|
||||
void cc3200_setleds(unsigned char ledset);
|
||||
#endif
|
||||
|
||||
/************************************************************************************
|
||||
* Name: up_buttoninit
|
||||
*
|
||||
* Description:
|
||||
* up_buttoninit() must be called to initialize button resources. After that,
|
||||
* up_buttons() may be called to collect the current state of all buttons or
|
||||
* up_irqbutton() may be called to register button interrupt handlers.
|
||||
*
|
||||
************************************************************************************/
|
||||
|
||||
#ifdef CONFIG_ARCH_BUTTONS
|
||||
void up_buttoninit(void);
|
||||
|
||||
/************************************************************************************
|
||||
* Name: up_buttons
|
||||
*
|
||||
* Description:
|
||||
* up_buttoninit() must be called to initialize button resources. After that,
|
||||
* up_buttons() may be called to collect the current state of all buttons.
|
||||
*
|
||||
* After up_buttoninit() has been called, up_buttons() may be called to collect
|
||||
* the state of all buttons. up_buttons() returns an 8-bit bit set with each bit
|
||||
* associated with a button. See the BOARD_BUTTON_*_BIT and BOARD_JOYSTICK_*_BIT
|
||||
* definitions above for the meaning of each bit.
|
||||
*
|
||||
************************************************************************************/
|
||||
|
||||
uint8_t up_buttons(void);
|
||||
|
||||
/************************************************************************************
|
||||
* Button support.
|
||||
*
|
||||
* Description:
|
||||
* up_buttoninit() must be called to initialize button resources. After that,
|
||||
* up_irqbutton() may be called to register button interrupt handlers.
|
||||
*
|
||||
* up_irqbutton() may be called to register an interrupt handler that will be called
|
||||
* when a button is depressed or released. The ID value is a button enumeration
|
||||
* value that uniquely identifies a button resource. See the BOARD_BUTTON_* and
|
||||
* BOARD_JOYSTICK_* definitions in above for the meaning of enumeration values
|
||||
* The previous interrupt handler address is returned (so that it may restored, if
|
||||
* so desired).
|
||||
*
|
||||
* Note that up_irqbutton() also enables button interrupts. Button interrupts
|
||||
* will remain enabled after the interrupt handler is attached. Interrupts may
|
||||
* be disabled (and detached) by calling up_irqbutton with irqhandler equal to
|
||||
* NULL.
|
||||
*
|
||||
************************************************************************************/
|
||||
|
||||
#if defined(CONFIG_ARCH_IRQBUTTONS) && defined(CONFIG_GPIO_IRQ)
|
||||
xcpt_t up_irqbutton(int id, xcpt_t irqhandler);
|
||||
#endif
|
||||
#endif /* CONFIG_ARCH_BUTTONS */
|
||||
|
||||
#endif /* __ASSEMBLY__ */
|
||||
#endif /* __CONFIGS_CC3200_LAUNCHPAD_INCLUDE_BOARD_H */
|
||||
@@ -0,0 +1,149 @@
|
||||
/************************************************************************************
|
||||
* configs/cc3200/include/cc3200_util.h
|
||||
*
|
||||
* Copyright (C) 2014 Droidifi LLC. All rights reserved.
|
||||
* Author: Jim Ewing <jim@droidifi.com>
|
||||
*
|
||||
* Adapted from code Copyright (C) 2014 Texas Instruments Incorporated
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
************************************************************************************/
|
||||
|
||||
#ifdef __CONFIGS_CC3200_INCLUDE_UTILS_H
|
||||
#define __CONFIGS_CC3200_INCLUDE_UTILS_H 1
|
||||
|
||||
/************************************************************************************
|
||||
* Pre-processor Definitions
|
||||
************************************************************************************/
|
||||
|
||||
#define HWREG(x) (*((volatile unsigned long *)(x)))
|
||||
|
||||
#define CONSOLE_BAUD_RATE 115200
|
||||
|
||||
#define PAD_CONFIG_BASE 0x4402E0A0
|
||||
|
||||
#define PIN_TYPE_STD 0x00000000
|
||||
#define PIN_STRENGTH_2MA 0x00000020
|
||||
#define PAD_MODE_MASK 0x0000000F
|
||||
#define PAD_STRENGTH_MASK 0x000000E0
|
||||
#define PAD_TYPE_MASK 0x00000310
|
||||
|
||||
#define PIN_MODE_0 0x00000000
|
||||
#define PIN_MODE_1 0x00000001
|
||||
#define PIN_MODE_2 0x00000002
|
||||
#define PIN_MODE_3 0x00000003
|
||||
#define PIN_MODE_4 0x00000004
|
||||
#define PIN_MODE_5 0x00000005
|
||||
#define PIN_MODE_6 0x00000006
|
||||
#define PIN_MODE_7 0x00000007
|
||||
#define PIN_MODE_8 0x00000008
|
||||
#define PIN_MODE_9 0x00000009
|
||||
#define PIN_MODE_10 0x0000000A
|
||||
#define PIN_MODE_11 0x0000000B
|
||||
#define PIN_MODE_12 0x0000000C
|
||||
#define PIN_MODE_13 0x0000000D
|
||||
#define PIN_MODE_14 0x0000000E
|
||||
#define PIN_MODE_15 0x0000000F
|
||||
|
||||
#define PIN_STRENGTH_2MA 0x00000020
|
||||
#define PIN_STRENGTH_4MA 0x00000040
|
||||
#define PIN_STRENGTH_6MA 0x00000060
|
||||
|
||||
#define PIN_TYPE_STD 0x00000000
|
||||
#define PIN_TYPE_STD_PU 0x00000100
|
||||
#define PIN_TYPE_STD_PD 0x00000200
|
||||
|
||||
#define PIN_TYPE_OD 0x00000010
|
||||
#define PIN_TYPE_OD_PU 0x00000110
|
||||
#define PIN_TYPE_OD_PD 0x00000210
|
||||
#define PIN_TYPE_ANALOG 0x10000000
|
||||
|
||||
#define PIN_01 0x00000000
|
||||
#define PIN_02 0x00000001
|
||||
#define PIN_03 0x00000002
|
||||
#define PIN_04 0x00000003
|
||||
#define PIN_05 0x00000004
|
||||
#define PIN_06 0x00000005
|
||||
#define PIN_07 0x00000006
|
||||
#define PIN_08 0x00000007
|
||||
#define PIN_11 0x0000000A
|
||||
#define PIN_12 0x0000000B
|
||||
#define PIN_13 0x0000000C
|
||||
#define PIN_14 0x0000000D
|
||||
#define PIN_15 0x0000000E
|
||||
#define PIN_16 0x0000000F
|
||||
#define PIN_17 0x00000010
|
||||
#define PIN_18 0x00000011
|
||||
#define PIN_19 0x00000012
|
||||
#define PIN_20 0x00000013
|
||||
#define PIN_21 0x00000014
|
||||
#define PIN_45 0x0000002C
|
||||
#define PIN_46 0x0000002D
|
||||
#define PIN_47 0x0000002E
|
||||
#define PIN_48 0x0000002F
|
||||
#define PIN_49 0x00000030
|
||||
#define PIN_50 0x00000031
|
||||
#define PIN_52 0x00000033
|
||||
#define PIN_53 0x00000034
|
||||
#define PIN_55 0x00000036
|
||||
#define PIN_56 0x00000037
|
||||
#define PIN_57 0x00000038
|
||||
#define PIN_58 0x00000039
|
||||
#define PIN_59 0x0000003A
|
||||
#define PIN_60 0x0000003B
|
||||
#define PIN_61 0x0000003C
|
||||
#define PIN_62 0x0000003D
|
||||
#define PIN_63 0x0000003E
|
||||
#define PIN_64 0x0000003F
|
||||
|
||||
/************************************************************************************
|
||||
* Private Data
|
||||
************************************************************************************/
|
||||
|
||||
static const unsigned long g_cc3200_pinmap[64] =
|
||||
{
|
||||
10, 11, 12, 13, 14, 15, 16, 17, 255, 255, 18,
|
||||
19, 20, 21, 22, 23, 24, 40, 28, 29, 25, 255,
|
||||
255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
|
||||
255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
|
||||
31, 255, 255, 255, 255, 0, 255, 32, 30, 255, 1,
|
||||
255, 2, 3, 4, 5, 6, 7, 8, 9
|
||||
};
|
||||
|
||||
/************************************************************************************
|
||||
* Public Functions
|
||||
************************************************************************************/
|
||||
|
||||
void cc3200_putc(char c);
|
||||
char cc3200_getc(void);
|
||||
void cc3200_print(char* str);
|
||||
void cc3200_pin_config_set(uint32_t pin, uint32_t pin_strength, uint32_t pin_type);
|
||||
void cc3200_pin_mode_set(uint32_t pin, uint32_t pin_mode);
|
||||
void cc3200_pin_type_uart(uint32_t pin, uint32_t pin_mode);
|
||||
void cc3200_init(void);
|
||||
void cc3200_uart_init(void);
|
||||
|
||||
#endif /* __CONFIGS_CC3200_INCLUDE_UTILS_H */
|
||||
@@ -0,0 +1,110 @@
|
||||
############################################################################
|
||||
# configs/cc3200-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
@@ -0,0 +1,74 @@
|
||||
#!/bin/bash
|
||||
# configs/cc3200-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"
|
||||
|
||||
# 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 cc3200-launchpad/tools directory
|
||||
export TOOL_DIR="${WD}/configs/cc3200-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}"
|
||||
@@ -0,0 +1,112 @@
|
||||
/****************************************************************************
|
||||
* configs/cc3200-launchpad/scripts/ld.script
|
||||
*
|
||||
* Copyright (C) 2013 Gregory Nutt. All rights reserved.
|
||||
* Authors: Gregory Nutt <gnutt@nuttx.org>
|
||||
* Jim Ewing <jim@droidifi.com>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in
|
||||
* the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
* 3. Neither the name NuttX nor the names of its contributors may be
|
||||
* used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
|
||||
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
||||
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
||||
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
MEMORY
|
||||
{
|
||||
flash (rx) : ORIGIN = 0x01000000, LENGTH = 0x00020000
|
||||
sram (rwx) : ORIGIN = 0x20004000, LENGTH = 0x0002C000
|
||||
}
|
||||
|
||||
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(.);
|
||||
} > sram
|
||||
|
||||
.init_section : {
|
||||
_sinit = ABSOLUTE(.);
|
||||
*(.init_array .init_array.*)
|
||||
_einit = ABSOLUTE(.);
|
||||
} > sram
|
||||
|
||||
.ARM.extab : {
|
||||
*(.ARM.extab*)
|
||||
} > sram
|
||||
|
||||
__exidx_start = ABSOLUTE(.);
|
||||
.ARM.exidx : {
|
||||
*(.ARM.exidx*)
|
||||
} > sram
|
||||
__exidx_end = ABSOLUTE(.);
|
||||
|
||||
_eronly = ABSOLUTE(.);
|
||||
|
||||
.data : {
|
||||
_sdata = ABSOLUTE(.);
|
||||
*(.data .data.*)
|
||||
*(.gnu.linkonce.d.*)
|
||||
CONSTRUCTORS
|
||||
_edata = ABSOLUTE(.);
|
||||
} > sram
|
||||
|
||||
.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) }
|
||||
}
|
||||
@@ -0,0 +1,89 @@
|
||||
############################################################################
|
||||
# configs/cc3200-launchpad/src/Makefile
|
||||
#
|
||||
# Copyright (C) 2014 Gregory Nutt. All rights reserved.
|
||||
# Authors: Gregory Nutt <gnutt@nuttx.org>
|
||||
# Jim Ewing <jim@droidifi.com>
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions
|
||||
# are met:
|
||||
#
|
||||
# 1. Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# 2. Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in
|
||||
# the documentation and/or other materials provided with the
|
||||
# distribution.
|
||||
# 3. Neither the name NuttX nor the names of its contributors may be
|
||||
# used to endorse or promote products derived from this software
|
||||
# without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||
# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||
# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||
# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
|
||||
# OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
||||
# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
||||
# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
# POSSIBILITY OF SUCH DAMAGE.
|
||||
#
|
||||
############################################################################
|
||||
|
||||
-include $(TOPDIR)/Make.defs
|
||||
|
||||
CFLAGS += -I$(TOPDIR)/sched -I../include
|
||||
|
||||
ASRCS =
|
||||
AOBJS = $(ASRCS:.S=$(OBJEXT))
|
||||
CSRCS = cc3200_boot.c cc3200_serial.c cc3200_utils.c
|
||||
#cc3200_leds.c
|
||||
|
||||
ifeq ($(CONFIG_ARCH_LEDS),y)
|
||||
CSRCS += cc3200_autoleds.c
|
||||
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
|
||||
@@ -0,0 +1,148 @@
|
||||
/****************************************************************************
|
||||
* configs/cc3200/src/cc3200_autoleds.c
|
||||
*
|
||||
* Copyright (C) 2013 Gregory Nutt. All rights reserved.
|
||||
* Authors: Gregory Nutt <gnutt@nuttx.org>
|
||||
* Jim Ewing <jim@droidifi.com>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in
|
||||
* the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
* 3. Neither the name NuttX nor the names of its contributors may be
|
||||
* used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
|
||||
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
||||
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
||||
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Included Files
|
||||
****************************************************************************/
|
||||
|
||||
#include <nuttx/config.h>
|
||||
|
||||
/****************************************************************************
|
||||
* Pre-processor Definitions
|
||||
****************************************************************************/
|
||||
|
||||
/* The CC3200 LaunchPad has three RGB LEDs.
|
||||
*
|
||||
* BOARD_LED_R -- Connected to PF1
|
||||
* BOARD_LED_G -- Connected to PF3
|
||||
* BOARD_LED_Y -- Connected to PF2
|
||||
*
|
||||
* If CONFIG_ARCH_LEDS is defined, then automated support for the LaunchPad LEDs
|
||||
* will be included in the build:
|
||||
*
|
||||
* OFF:
|
||||
* - OFF means that the OS is still initializing. Initialization is very fast so
|
||||
* if you see this at all, it probably means that the system is hanging up
|
||||
* somewhere in the initialization phases.
|
||||
*
|
||||
* GREEN
|
||||
* - This means that the OS completed initialization.
|
||||
*
|
||||
* YELLOW:
|
||||
* - Whenever and interrupt or signal handler is entered, the YELLOW LED is
|
||||
* illuminated and extinguished when the interrupt or signal handler exits.
|
||||
*
|
||||
* RED:
|
||||
* - If a recovered assertion occurs, the RED component will be illuminated
|
||||
* briefly while the assertion is handled. You will probably never see this.
|
||||
*
|
||||
* Flashing RED:
|
||||
* - In the event of a fatal crash, the BLUE and GREEN components will be
|
||||
* extinguished and the RED component will FLASH at a 2Hz rate.
|
||||
*
|
||||
* RED GREEN BLUE
|
||||
* LED_STARTED 0 OFF OFF OFF
|
||||
* LED_HEAPALLOCATE 0 OFF OFF OFF
|
||||
* LED_IRQSENABLED 0 OFF OFF OFF
|
||||
* LED_STACKCREATED 1 OFF ON OFF
|
||||
* LED_INIRQ 2 NC NC ON (momentary)
|
||||
* LED_SIGNAL 2 NC NC ON (momentary)
|
||||
* LED_ASSERTION 3 ON NC NC (momentary)
|
||||
* LED_PANIC 4 ON OFF OFF (flashing 2Hz)
|
||||
*/
|
||||
|
||||
/* 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
|
||||
|
||||
/* Dump GPIO registers */
|
||||
|
||||
#ifdef CONFIG_DEBUG_LEDS
|
||||
# define led_dumpgpio(m) lm_dumpgpio(LED_GPIO, m)
|
||||
#else
|
||||
# define led_dumpgpio(m)
|
||||
#endif
|
||||
|
||||
|
||||
/****************************************************************************
|
||||
* Private Data
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Private Functions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Name: cc3200_ledinit
|
||||
*
|
||||
* Description:
|
||||
* Called to initialize the on-board LEDs.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
#ifdef CONFIG_ARCH_LEDS
|
||||
|
||||
/****************************************************************************
|
||||
* Name: up_ledon
|
||||
****************************************************************************/
|
||||
|
||||
void board_led_on(int led)
|
||||
{
|
||||
// cc3200_ledon(led);
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
* Name: up_ledoff
|
||||
****************************************************************************/
|
||||
|
||||
void board_led_off(int led)
|
||||
{
|
||||
// cc3200_ledoff(led);
|
||||
}
|
||||
|
||||
#endif /* CONFIG_ARCH_LEDS */
|
||||
@@ -0,0 +1,128 @@
|
||||
/************************************************************************************
|
||||
* configs/cc3200-launchpad/src/cc3200_boot.c
|
||||
* arch/arm/src/board/cc3200_boot.c
|
||||
*
|
||||
* Copyright (C) 2014 Droidifi LLC. All rights reserved.
|
||||
* Author: Jim Ewing <jim@droidifi.com>
|
||||
*
|
||||
* Adapted for the cc3200 from code:
|
||||
*
|
||||
* Copyright (C) Gregory Nutt.
|
||||
* 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.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
|
||||
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
||||
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
||||
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
************************************************************************************/
|
||||
|
||||
/************************************************************************************
|
||||
* Included Files
|
||||
************************************************************************************/
|
||||
|
||||
#include <nuttx/config.h>
|
||||
#include <nuttx/kmalloc.h>
|
||||
|
||||
#include <debug.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#include <arch/board/board.h>
|
||||
#include <apps/nsh.h>
|
||||
|
||||
#include <cc3200_utils.h>
|
||||
|
||||
/************************************************************************************
|
||||
* Pre-processor Definitions
|
||||
************************************************************************************/
|
||||
|
||||
/************************************************************************************
|
||||
* Public Data
|
||||
************************************************************************************/
|
||||
|
||||
/************************************************************************************
|
||||
* Private Functions
|
||||
************************************************************************************/
|
||||
|
||||
/************************************************************************************
|
||||
* Public Functions
|
||||
************************************************************************************/
|
||||
/****************************************************************************
|
||||
* Name: nsh_archinitialize
|
||||
*
|
||||
* Description:
|
||||
* Perform architecture specific initialization
|
||||
*
|
||||
* CONFIG_NSH_ARCHINIT=y :
|
||||
* Called from the NSH library
|
||||
*
|
||||
* CONFIG_BOARD_INITIALIZE=y, CONFIG_NSH_LIBRARY=y, &&
|
||||
* CONFIG_NSH_ARCHINIT=n :
|
||||
* Called from board_initialize().
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
int nsh_archinitialize(void)
|
||||
{
|
||||
return OK;
|
||||
}
|
||||
|
||||
/************************************************************************************
|
||||
* 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)
|
||||
{
|
||||
cc3200_init();
|
||||
cc3200_uart_init();
|
||||
|
||||
cc3200_print("\r\nCC3200 init\r\n");
|
||||
|
||||
// cc3200_ledinit();
|
||||
}
|
||||
|
||||
/************************************************************************
|
||||
* Name: up_addregion
|
||||
*
|
||||
* Description:
|
||||
* Memory may be added in non-contiguous chunks. Additional chunks are
|
||||
* added by calling this function.
|
||||
*
|
||||
************************************************************************/
|
||||
|
||||
#if CONFIG_MM_REGIONS > 1
|
||||
|
||||
#define CC3200_SRAM1_BASE 0x20000000
|
||||
#define CC3200_SRAM1_SIZE 0x4000
|
||||
|
||||
void up_addregion(void)
|
||||
{
|
||||
kumm_addregion((FAR void*)CC3200_SRAM1_BASE, CC3200_SRAM1_SIZE);
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,124 @@
|
||||
/************************************************************************************
|
||||
* configs/cc3200/src/cc3200_serial.c
|
||||
*
|
||||
* Copyright (C) 2013 Droidifi LLC. All rights reserved.
|
||||
* Author: Jim Ewing <jim@droidifi.com>
|
||||
*
|
||||
* Adapted for the cc3200 from code:
|
||||
*
|
||||
* Copyright (C) Gregory Nutt.
|
||||
* 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.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
|
||||
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
||||
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
||||
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
************************************************************************************/
|
||||
|
||||
/************************************************************************************
|
||||
* Included Files
|
||||
************************************************************************************/
|
||||
|
||||
#include <nuttx/config.h>
|
||||
#include <nuttx/arch.h>
|
||||
#include <cc3200_utils.h>
|
||||
#include "chip/cc3200_memorymap.h"
|
||||
#include "up_internal.h"
|
||||
|
||||
#if !defined(HAVE_SERIALCONSOLE)
|
||||
|
||||
/************************************************************************************
|
||||
* Private Data
|
||||
************************************************************************************/
|
||||
|
||||
/************************************************************************************
|
||||
* Private Functions
|
||||
************************************************************************************/
|
||||
void cc3200_uart0_init(void)
|
||||
{
|
||||
HWREG(0x44025048) |= 0x01;
|
||||
|
||||
cc3200_pin_type_uart(PIN_55, PIN_MODE_3);
|
||||
cc3200_pin_type_uart(PIN_57, PIN_MODE_3);
|
||||
|
||||
while(HWREG(0x4000C018) & 0x08)
|
||||
{
|
||||
}
|
||||
|
||||
HWREG(0x4000C02C) &= ~(0x00000010);
|
||||
HWREG(0x4000C030) &= ~(0x01 | 0x100 | 0x200);
|
||||
HWREG(0x4000C030) &= ~(0x20);
|
||||
|
||||
HWREG(0x4000C024) = ((((80000000 * 8) / 115200) + 1) / 2) / 64;
|
||||
HWREG(0x4000C028) = ((((80000000 * 8) / 115200) + 1) / 2) % 64;
|
||||
|
||||
HWREG(0x4000C02C) = (0x60 | 0x82 | 0x10);
|
||||
HWREG(0x4000C030) |= (0x01 | 0x100 | 0x200);
|
||||
}
|
||||
|
||||
/************************************************************************************
|
||||
* Public Functions
|
||||
************************************************************************************/
|
||||
|
||||
/************************************************************************************
|
||||
* Name: up_earlyconsoleinit
|
||||
*
|
||||
* Description:
|
||||
* Performs the low level UART initialization early in debug so that the serial
|
||||
* console will be available during bootup. This must be called before
|
||||
* up_consoleinit.
|
||||
*
|
||||
************************************************************************************/
|
||||
|
||||
#ifdef USE_EARLYSERIALINIT
|
||||
void up_earlyconsoleinit(void)
|
||||
{
|
||||
cc3200_init();
|
||||
cc3200_uart0_init();
|
||||
}
|
||||
#endif
|
||||
|
||||
/************************************************************************************
|
||||
* Name: up_consoleinit
|
||||
*
|
||||
* Description:
|
||||
* Register serial console and serial ports. This assumes that
|
||||
* up_earlyconsoleinit was called previously.
|
||||
*
|
||||
************************************************************************************/
|
||||
|
||||
#if USE_SERIALDRIVER
|
||||
void up_consoleinit(void)
|
||||
{
|
||||
/* There is probably a problem if we are here */
|
||||
|
||||
lowconsole_init();
|
||||
}
|
||||
#endif
|
||||
|
||||
void cc3200_uart_init(void)
|
||||
{
|
||||
cc3200_uart0_init();
|
||||
}
|
||||
|
||||
#endif /* !HAVE_SERIALCONSOLE && CONFIG_ARCH_LCD */
|
||||
@@ -0,0 +1,136 @@
|
||||
/************************************************************************************
|
||||
* configs/cc3200/src/cc3200_util.c
|
||||
*
|
||||
* Copyright (C) 2014 Droidifi LLC. All rights reserved.
|
||||
* Author: Jim Ewing <jim@droidifi.com>
|
||||
*
|
||||
* Adapted from code Copyright (C) 2014 Texas Instruments Incorporated
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* 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 <sys/types.h>
|
||||
#include <cc3200_utils.h>
|
||||
|
||||
void cc3200_putc(char c)
|
||||
{
|
||||
while(HWREG(0x4000C000 + 0x00000018) & 0x00000020)
|
||||
;
|
||||
|
||||
HWREG(0x4000C000) = c;
|
||||
}
|
||||
|
||||
char cc3200_getc(void)
|
||||
{
|
||||
if (!(HWREG(0x4000C000 + 0x00000018) & 0x00000010))
|
||||
{
|
||||
return HWREG(0x4000C000);
|
||||
}
|
||||
else
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
void cc3200_print(char* str)
|
||||
{
|
||||
while (str && *str != '\0')
|
||||
{
|
||||
cc3200_putc(*str++);
|
||||
}
|
||||
}
|
||||
|
||||
void cc3200_pin_config_set(uint32_t pin, uint32_t pin_strength, uint32_t pin_type)
|
||||
{
|
||||
uint32_t pad;
|
||||
|
||||
pad = g_cc3200_pinmap[pin & 0x3F];
|
||||
|
||||
switch (pin_type)
|
||||
{
|
||||
case PIN_TYPE_ANALOG:
|
||||
HWREG(0x4402E144) |= ((0x80 << pad) & (0x1E << 8));
|
||||
pad = ((pad << 2) + PAD_CONFIG_BASE);
|
||||
HWREG(pad) |= 0xC00;
|
||||
break;
|
||||
|
||||
default:
|
||||
HWREG(0x4402E144) &= ~((0x80 << pad) & (0x1E << 8));
|
||||
pad = ((pad << 2) + PAD_CONFIG_BASE);
|
||||
HWREG(pad) = ((HWREG(pad) & ~(PAD_STRENGTH_MASK | PAD_TYPE_MASK)) | (pin_strength | pin_type ));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void cc3200_pin_mode_set(uint32_t pin, uint32_t pin_mode)
|
||||
{
|
||||
uint32_t pad;
|
||||
|
||||
pad = g_cc3200_pinmap[pin & 0x3F];
|
||||
pad = ((pad << 2) + PAD_CONFIG_BASE);
|
||||
HWREG(pad) = (((HWREG(pad) & ~PAD_MODE_MASK) | pin_mode) & ~(3<<10));
|
||||
}
|
||||
|
||||
void cc3200_pin_type_uart(uint32_t pin, uint32_t pin_mode)
|
||||
{
|
||||
cc3200_pin_mode_set(pin, pin_mode);
|
||||
cc3200_pin_config_set(pin, PIN_STRENGTH_2MA, PIN_TYPE_STD);
|
||||
}
|
||||
|
||||
void cc3200_init(void)
|
||||
{
|
||||
HWREG(0x4402F064) |= 0x800000;
|
||||
HWREG(0x4402F800 + 0x00000418) |= (1<<4);
|
||||
HWREG(0x4402E16C) |= 0x3C;
|
||||
HWREG(0x4402F804) = 0x0;
|
||||
HWREG(0x4402F804) = 0x0;
|
||||
|
||||
if (((HWREG(0x4402F0C8) & 0xFF) == 0x2))
|
||||
{
|
||||
HWREG(0x4402E110) = ((HWREG(0x4402E110) & ~0xC0F) | 0x2);
|
||||
HWREG(0x4402E114) = ((HWREG(0x4402E110) & ~0xC0F) | 0x2);
|
||||
HWREG(0x4402E184) |= 0x2;
|
||||
}
|
||||
|
||||
if ((HWREG(0x4402E0A4) & 0xF) == 0x1)
|
||||
{
|
||||
HWREG(0x4402E0A4) = ((HWREG(0x4402E0A4) & ~0xF));
|
||||
}
|
||||
|
||||
if ((HWREG(0x4402E0A8) & 0xF) == 0x1)
|
||||
{
|
||||
HWREG(0x4402E0A8) = ((HWREG(0x4402E0A8) & ~0xF));
|
||||
}
|
||||
|
||||
if (((HWREG(0x4402DC78) >> 22) & 0xF) == 0xE)
|
||||
{
|
||||
HWREG(0x4402F0B0) = ((HWREG(0x4402F0B0) & ~(0x00FC0000))|(0x32 << 18));
|
||||
}
|
||||
else
|
||||
{
|
||||
HWREG(0x4402F0B0) = ((HWREG(0x4402F0B0) & ~(0x00FC0000))|(0x29 << 18));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,83 @@
|
||||
#******************************************************************************************
|
||||
#
|
||||
# CC3200 OpenOCD configuration file
|
||||
#
|
||||
# Copyright (C) 2014 Droidifi LLC. All rights reserved.
|
||||
# Author: Jim Ewing <jim@droidifi.com>
|
||||
#
|
||||
# Redistributions must retain the above copyright notice and the
|
||||
# following disclaimer.
|
||||
#
|
||||
# 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.
|
||||
#
|
||||
|
||||
interface ft2232
|
||||
ft2232_layout luminary_icdi
|
||||
ft2232_device_desc "USB <-> JTAG/SWD"
|
||||
ft2232_vid_pid 0x0451 0xc32a
|
||||
adapter_khz 1000
|
||||
set _ENDIAN little
|
||||
|
||||
if { [info exists CHIPNAME] } {
|
||||
set _CHIPNAME $CHIPNAME
|
||||
} else {
|
||||
set _CHIPNAME cc3200
|
||||
}
|
||||
|
||||
source [find target/icepick.cfg]
|
||||
|
||||
if { [info exists DAP_TAPID] } {
|
||||
set _DAP_TAPID $DAP_TAPID
|
||||
} else {
|
||||
set _DAP_TAPID 0x0b97c02f
|
||||
}
|
||||
|
||||
jtag newtap $_CHIPNAME dap -irlen 4 -ircapture 0x1 -irmask 0xf -expected-id $_DAP_TAPID -disable
|
||||
|
||||
# APP m4
|
||||
jtag configure $_CHIPNAME.dap -event tap-enable "icepick_c_tapenable $_CHIPNAME.jrc 0"
|
||||
|
||||
# ICEpick-C (JTAG route controller)
|
||||
if { [info exists JRC_TAPID] } {
|
||||
set _JRC_TAPID $JRC_TAPID
|
||||
} else {
|
||||
set _JRC_TAPID $_DAP_TAPID
|
||||
}
|
||||
|
||||
jtag newtap $_CHIPNAME jrc -irlen 6 -ircapture 0x1 -irmask 0x3f -expected-id $_JRC_TAPID -ignore-version
|
||||
jtag configure $_CHIPNAME.jrc -event setup "jtag tapenable $_CHIPNAME.dap"
|
||||
jtag configure $_CHIPNAME.jrc -event post-reset "runtest 100"
|
||||
|
||||
set _TARGETNAME $_CHIPNAME.cpu
|
||||
|
||||
target create $_CHIPNAME.cpu cortex_m -endian little -chain-position $_CHIPNAME.dap
|
||||
$_CHIPNAME.cpu configure -work-area-phys 0x20000000 -work-area-size 0x30000 -work-area-backup 0 -coreid 0
|
||||
|
||||
source [find mem_helper.tcl]
|
||||
|
||||
$_TARGETNAME configure -event gdb-attach {
|
||||
# cortex_m dbginit
|
||||
halt
|
||||
}
|
||||
|
||||
$_TARGETNAME configure -event "reset-start" { adapter_khz 1000 }
|
||||
$_TARGETNAME configure -event "reset-assert" {
|
||||
|
||||
global _CHIPNAME
|
||||
|
||||
# assert warm system reset through ICEPick
|
||||
icepick_c_wreset $_CHIPNAME.jrc
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user