Skip to content

Commit 7403503

Browse files
authored
Merge pull request ARMmbed#17 from linlingao/external_flash_bypass
Add dbghdr section to linker map to attempt to bypass external flash …
2 parents 889b7d7 + e852126 commit 7403503

File tree

8 files changed

+417
-96
lines changed

8 files changed

+417
-96
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
/*
2+
* Copyright (c) 2016-2018, Texas Instruments Incorporated
3+
* All rights reserved.
4+
*
5+
* Redistribution and use in source and binary forms, with or without
6+
* modification, are permitted provided that the following conditions
7+
* are met:
8+
*
9+
* * Redistributions of source code must retain the above copyright
10+
* notice, this list of conditions and the following disclaimer.
11+
*
12+
* * Redistributions in binary form must reproduce the above copyright
13+
* notice, this list of conditions and the following disclaimer in the
14+
* documentation and/or other materials provided with the distribution.
15+
*
16+
* * Neither the name of Texas Instruments Incorporated nor the names of
17+
* its contributors may be used to endorse or promote products derived
18+
* from this software without specific prior written permission.
19+
*
20+
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21+
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
22+
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
23+
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
24+
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
25+
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
26+
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
27+
* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
28+
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
29+
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
30+
* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31+
*/
32+
33+
/*
34+
* ======== CC3220SF_LAUNCHXL.c ========
35+
* This file is responsible for setting up the board specific items for the
36+
* CC3220SF_LAUNCHXL board.
37+
*/
38+
39+
#include <stdbool.h>
40+
#include <stddef.h>
41+
#include <stdint.h>
42+
43+
#include <ti/devices/cc32xx/inc/hw_ints.h>
44+
#include <ti/devices/cc32xx/inc/hw_memmap.h>
45+
#include <ti/devices/cc32xx/inc/hw_types.h>
46+
47+
#include <ti/devices/cc32xx/driverlib/rom.h>
48+
#include <ti/devices/cc32xx/driverlib/rom_map.h>
49+
#include <ti/devices/cc32xx/driverlib/adc.h>
50+
#include <ti/devices/cc32xx/driverlib/gpio.h>
51+
#include <ti/devices/cc32xx/driverlib/pin.h>
52+
#include <ti/devices/cc32xx/driverlib/prcm.h>
53+
#include <ti/devices/cc32xx/driverlib/spi.h>
54+
#include <ti/devices/cc32xx/driverlib/sdhost.h>
55+
#include <ti/devices/cc32xx/driverlib/timer.h>
56+
#include <ti/devices/cc32xx/driverlib/uart.h>
57+
#include <ti/devices/cc32xx/driverlib/udma.h>
58+
#include <ti/devices/cc32xx/driverlib/wdt.h>
59+
60+
#include "CC3220SF_LAUNCHXL.h"
61+
62+
/*
63+
* =============================== General ===============================
64+
*/
65+
/*
66+
* ======== CC3220SF_LAUNCHXL_initGeneral ========
67+
*/
68+
void CC3220SF_LAUNCHXL_initGeneral(void)
69+
{
70+
PRCMCC3200MCUInit();
71+
//Power_init();
72+
}
73+
74+
//TODO: Support other toolchains!
75+
//#if defined(__SF_DEBUG__)
76+
//#if defined TOOLCHAIN_ARM
77+
//__attribute__ ((section (FLASH_HDR)))
78+
//#elif defined TOOLCHAIN_IAR
79+
//#pragma data_location=".dbghdr"
80+
#if defined TOOLCHAIN_GCC_ARM
81+
__attribute__ ((section (".dbghdr")))
82+
#endif
83+
const unsigned long ulDebugHeader[]=
84+
{
85+
0x5AA5A55A,
86+
0x000FF800,
87+
0xEFA3247D
88+
};
89+
//#endif
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,220 @@
1+
/*
2+
* Copyright (c) 2016-2018, Texas Instruments Incorporated
3+
* All rights reserved.
4+
*
5+
* Redistribution and use in source and binary forms, with or without
6+
* modification, are permitted provided that the following conditions
7+
* are met:
8+
*
9+
* * Redistributions of source code must retain the above copyright
10+
* notice, this list of conditions and the following disclaimer.
11+
*
12+
* * Redistributions in binary form must reproduce the above copyright
13+
* notice, this list of conditions and the following disclaimer in the
14+
* documentation and/or other materials provided with the distribution.
15+
*
16+
* * Neither the name of Texas Instruments Incorporated nor the names of
17+
* its contributors may be used to endorse or promote products derived
18+
* from this software without specific prior written permission.
19+
*
20+
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21+
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
22+
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
23+
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
24+
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
25+
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
26+
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
27+
* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
28+
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
29+
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
30+
* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31+
*/
32+
/** ============================================================================
33+
* @file C3220SF_LAUNCHXL.h
34+
*
35+
* @brief CC3220 Board Specific APIs
36+
*
37+
* The CC3220SF_LAUNCHXL header file should be included in an application as
38+
* follows:
39+
* @code
40+
* #include <CC3220SF_LAUNCHXL.h>
41+
* @endcode
42+
*
43+
* ============================================================================
44+
*/
45+
#ifndef __CC3220SF_LAUNCHXL_H
46+
#define __CC3220SF_LAUNCHXL_H
47+
48+
#ifdef __cplusplus
49+
extern "C" {
50+
#endif
51+
52+
#define CC3220SF_LAUNCHXL_GPIO_LED_OFF (0)
53+
#define CC3220SF_LAUNCHXL_GPIO_LED_ON (1)
54+
55+
/*!
56+
* @def CC3220SF_LAUNCHXL_ADCName
57+
* @brief Enum of ADC names on the CC3220SF_LAUNCHXL dev board
58+
*/
59+
typedef enum CC3220SF_LAUNCHXL_ADCName {
60+
CC3220SF_LAUNCHXL_ADC0 = 0,
61+
CC3220SF_LAUNCHXL_ADC1,
62+
63+
CC3220SF_LAUNCHXL_ADCCOUNT
64+
} CC3220SF_LAUNCHXL_ADCName;
65+
66+
/*!
67+
* @def CC3220SF_LAUNCHXL_CaptureName
68+
* @brief Enum of Capture names on the CC3220SF_LAUNCHXL dev board
69+
*/
70+
typedef enum CC3220SF_LAUNCHXL_CaptureName {
71+
CC3220SF_LAUNCHXL_CAPTURE0 = 0,
72+
CC3220SF_LAUNCHXL_CAPTURE1,
73+
74+
CC3220SF_LAUNCHXL_CAPTURECOUNT
75+
} CC3220SF_LAUNCHXL_CaptureName;
76+
77+
/*!
78+
* @def CC3220SF_LAUNCHXL_CryptoName
79+
* @brief Enum of Crypto names on the CC3220SF_LAUNCHXL dev board
80+
*/
81+
typedef enum CC3220SF_LAUNCHXL_CryptoName {
82+
CC3220SF_LAUNCHXL_CRYPTO0 = 0,
83+
84+
CC3220SF_LAUNCHXL_CRYPTOCOUNT
85+
} CC3220SF_LAUNCHXL_CryptoName;
86+
87+
/*!
88+
* @def CC3220SF_LAUNCHXL_GPIOName
89+
* @brief Enum of GPIO names on the CC3220SF_LAUNCHXL dev board
90+
*/
91+
typedef enum CC3220SF_LAUNCHXL_GPIOName {
92+
CC3220SF_LAUNCHXL_GPIO_SW2 = 0,
93+
CC3220SF_LAUNCHXL_GPIO_SW3,
94+
CC3220SF_LAUNCHXL_SPI_MASTER_READY,
95+
CC3220SF_LAUNCHXL_SPI_SLAVE_READY,
96+
CC3220SF_LAUNCHXL_GPIO_LED_D7,
97+
98+
/*
99+
* CC3220SF_LAUNCHXL_GPIO_LED_D5 and CC3220SF_LAUNCHXL_GPIO_LED_D6 are shared with the
100+
* I2C and PWM peripherals. In order for those examples to work, these
101+
* LEDs are taken out of gpioPinCOnfig[]
102+
*/
103+
/* CC3220SF_LAUNCHXL_GPIO_LED_D6, */
104+
/* CC3220SF_LAUNCHXL_GPIO_LED_D5, */
105+
106+
/* Sharp 96x96 LCD Pins */
107+
CC3220SF_LAUNCHXL_LCD_CS,
108+
CC3220SF_LAUNCHXL_LCD_POWER,
109+
CC3220SF_LAUNCHXL_LCD_ENABLE,
110+
111+
CC3220SF_LAUNCHXL_GPIOCOUNT
112+
} CC3220SF_LAUNCHXL_GPIOName;
113+
114+
/*!
115+
* @def CC3220SF_LAUNCHXL_I2CName
116+
* @brief Enum of I2C names on the CC3220SF_LAUNCHXL dev board
117+
*/
118+
typedef enum CC3220SF_LAUNCHXL_I2CName {
119+
CC3220SF_LAUNCHXL_I2C0 = 0,
120+
121+
CC3220SF_LAUNCHXL_I2CCOUNT
122+
} CC3220SF_LAUNCHXL_I2CName;
123+
124+
/*!
125+
* @def CC3220SF_LAUNCHXL_I2SName
126+
* @brief Enum of I2S names on the CC3220SF_LAUNCHXL dev board
127+
*/
128+
typedef enum CC3220SF_LAUNCHXL_I2SName {
129+
CC3220SF_LAUNCHXL_I2S0 = 0,
130+
131+
CC3220SF_LAUNCHXL_I2SCOUNT
132+
} CC3220SF_LAUNCHXL_I2SName;
133+
134+
/*!
135+
* @def CC3220SF_LAUNCHXL_PWMName
136+
* @brief Enum of PWM names on the CC3220SF_LAUNCHXL dev board
137+
*/
138+
typedef enum CC3220SF_LAUNCHXL_PWMName {
139+
CC3220SF_LAUNCHXL_PWM6 = 0,
140+
CC3220SF_LAUNCHXL_PWM7,
141+
142+
CC3220SF_LAUNCHXL_PWMCOUNT
143+
} CC3220SF_LAUNCHXL_PWMName;
144+
145+
/*!
146+
* @def CC3220SF_LAUNCHXL_SDFatFSName
147+
* @brief Enum of SDFatFS names on the CC3220SF_LAUNCHXL dev board
148+
*/
149+
typedef enum CC3220SF_LAUNCHXL_SDFatFSName {
150+
CC3220SF_LAUNCHXL_SDFatFS0 = 0,
151+
152+
CC3220SF_LAUNCHXL_SDFatFSCOUNT
153+
} CC3220SF_LAUNCHXL_SDFatFSName;
154+
155+
/*!
156+
* @def CC3220SF_LAUNCHXL_SDName
157+
* @brief Enum of SD names on the CC3220SF_LAUNCHXL dev board
158+
*/
159+
typedef enum CC3220SF_LAUNCHXL_SDName {
160+
CC3220SF_LAUNCHXL_SD0 = 0,
161+
162+
CC3220SF_LAUNCHXL_SDCOUNT
163+
} CC3220SF_LAUNCHXL_SDName;
164+
165+
/*!
166+
* @def CC3220SF_LAUNCHXL_SPIName
167+
* @brief Enum of SPI names on the CC3220SF_LAUNCHXL dev board
168+
*/
169+
typedef enum CC3220SF_LAUNCHXL_SPIName {
170+
CC3220SF_LAUNCHXL_SPI0 = 0,
171+
CC3220SF_LAUNCHXL_SPI1,
172+
173+
CC3220SF_LAUNCHXL_SPICOUNT
174+
} CC3220SF_LAUNCHXL_SPIName;
175+
176+
/*!
177+
* @def CC3220SF_LAUNCHXL_TimerName
178+
* @brief Enum of Timer names on the CC3220SF_LAUNCHXL dev board
179+
*/
180+
typedef enum CC3220SF_LAUNCHXL_TimerName {
181+
CC3220SF_LAUNCHXL_TIMER0 = 0,
182+
CC3220SF_LAUNCHXL_TIMER1,
183+
CC3220SF_LAUNCHXL_TIMER2,
184+
185+
CC3220SF_LAUNCHXL_TIMERCOUNT
186+
} CC3220SF_LAUNCHXL_TimerName;
187+
188+
/*!
189+
* @def CC3220SF_LAUNCHXL_UARTName
190+
* @brief Enum of UARTs on the CC3220SF_LAUNCHXL dev board
191+
*/
192+
typedef enum CC3220SF_LAUNCHXL_UARTName {
193+
CC3220SF_LAUNCHXL_UART0 = 0,
194+
CC3220SF_LAUNCHXL_UART1,
195+
196+
CC3220SF_LAUNCHXL_UARTCOUNT
197+
} CC3220SF_LAUNCHXL_UARTName;
198+
199+
/*!
200+
* @def CC3220SF_LAUNCHXL_WatchdogName
201+
* @brief Enum of Watchdogs on the CC3220SF_LAUNCHXL dev board
202+
*/
203+
typedef enum CC3220SF_LAUNCHXL_WatchdogName {
204+
CC3220SF_LAUNCHXL_WATCHDOG0 = 0,
205+
206+
CC3220SF_LAUNCHXL_WATCHDOGCOUNT
207+
} CC3220SF_LAUNCHXL_WatchdogName;
208+
209+
/*!
210+
* @brief Initialize the general board specific settings
211+
*
212+
* This function initializes the general board specific settings.
213+
*/
214+
extern void CC3220SF_LAUNCHXL_initGeneral(void);
215+
216+
#ifdef __cplusplus
217+
}
218+
#endif
219+
220+
#endif /* __CC3220SF_LAUNCHXL_H */

0 commit comments

Comments
 (0)