mirror of https://github.com/ARMmbed/mbed-os.git
Remove TEENSY3_1 target
parent
a3538f7047
commit
4f3a621569
|
@ -1,86 +0,0 @@
|
|||
/* mbed Microcontroller Library
|
||||
* Copyright (c) 2006-2015 ARM Limited
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
#ifndef MBED_PERIPHERALNAMES_H
|
||||
#define MBED_PERIPHERALNAMES_H
|
||||
|
||||
#include "cmsis.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef enum {
|
||||
UART_0 = (int)UART0_BASE,
|
||||
UART_1 = (int)UART1_BASE,
|
||||
UART_2 = (int)UART2_BASE
|
||||
} UARTName;
|
||||
#define STDIO_UART_TX USBTX
|
||||
#define STDIO_UART_RX USBRX
|
||||
#define STDIO_UART UART_0
|
||||
|
||||
typedef enum {
|
||||
I2C_0 = (int)I2C0_BASE,
|
||||
I2C_1 = (int)I2C1_BASE,
|
||||
} I2CName;
|
||||
|
||||
#define TPM_SHIFT 8
|
||||
typedef enum {
|
||||
PWM_1 = (0 << TPM_SHIFT) | (0), // FTM0 CH0
|
||||
PWM_2 = (0 << TPM_SHIFT) | (1), // FTM0 CH1
|
||||
PWM_3 = (0 << TPM_SHIFT) | (2), // FTM0 CH2
|
||||
PWM_4 = (0 << TPM_SHIFT) | (3), // FTM0 CH3
|
||||
PWM_5 = (0 << TPM_SHIFT) | (4), // FTM0 CH4
|
||||
PWM_6 = (0 << TPM_SHIFT) | (5), // FTM0 CH5
|
||||
PWM_7 = (0 << TPM_SHIFT) | (6), // FTM0 CH6
|
||||
PWM_8 = (0 << TPM_SHIFT) | (7), // FTM0 CH7
|
||||
PWM_9 = (1 << TPM_SHIFT) | (0), // FTM1 CH0
|
||||
PWM_10 = (1 << TPM_SHIFT) | (1), // FTM1 CH1
|
||||
} PWMName;
|
||||
|
||||
typedef enum {
|
||||
ADC0_SE4b = 4,
|
||||
ADC0_SE5b = 5,
|
||||
ADC0_SE6b = 6,
|
||||
ADC0_SE7b = 7,
|
||||
ADC0_SE8 = 8,
|
||||
ADC0_SE9 = 9,
|
||||
ADC0_SE12 = 12,
|
||||
ADC0_SE13 = 13,
|
||||
ADC0_SE14 = 14,
|
||||
ADC0_SE15 = 15,
|
||||
ADC1_SE4b = 16,
|
||||
ADC1_SE5b = 17,
|
||||
ADC1_SE6b = 18,
|
||||
ADC1_SE7b = 19,
|
||||
} ADCName;
|
||||
|
||||
typedef enum {
|
||||
DAC_0 = 0
|
||||
} DACName;
|
||||
|
||||
typedef enum {
|
||||
SPI_0 = (int)SPI0_BASE,
|
||||
SPI_1 = (int)SPI0_BASE,
|
||||
SPI_2 = (int)SPI0_BASE,
|
||||
SPI_3 = (int)SPI0_BASE,
|
||||
SPI_4 = (int)SPI0_BASE,
|
||||
} SPIName;
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
|
@ -1,137 +0,0 @@
|
|||
|
||||
/* mbed Microcontroller Library
|
||||
* Copyright (c) 2006-2015 ARM Limited
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include "PeripheralPins.h"
|
||||
|
||||
/************ADC***************/
|
||||
const PinMap PinMap_ADC[] = {
|
||||
{PTC2, ADC0_SE4b, 0},
|
||||
{PTD1, ADC0_SE5b, 0},
|
||||
{PTD5, ADC0_SE6b, 0},
|
||||
{PTD6, ADC0_SE7b, 0},
|
||||
{PTB0, ADC0_SE8, 0},
|
||||
{PTB1, ADC0_SE9, 0},
|
||||
{PTB2, ADC0_SE12, 0},
|
||||
{PTB3, ADC0_SE13, 0},
|
||||
{PTC0, ADC0_SE14, 0},
|
||||
{PTC1, ADC0_SE15, 0},
|
||||
{PTC8, ADC1_SE4b, 0},
|
||||
{PTC9, ADC1_SE5b, 0},
|
||||
{PTC10,ADC1_SE6b, 0},
|
||||
{PTC11,ADC1_SE7b, 0},
|
||||
{NC, NC, 0}
|
||||
};
|
||||
|
||||
/************DAC***************/
|
||||
const PinMap PinMap_DAC[] = {
|
||||
{DAC0_OUT, DAC_0, 0},
|
||||
{NC , NC , 0}
|
||||
};
|
||||
|
||||
/************I2C***************/
|
||||
const PinMap PinMap_I2C_SDA[] = {
|
||||
{PTB1, I2C_0, 2},
|
||||
{PTB3, I2C_0, 2},
|
||||
{PTE0, I2C_1, 2},
|
||||
{PTC11, I2C_1, 2},
|
||||
{NC , NC , 0}
|
||||
};
|
||||
|
||||
const PinMap PinMap_I2C_SCL[] = {
|
||||
{PTB0, I2C_0, 2},
|
||||
{PTB2, I2C_0, 2},
|
||||
{PTE1, I2C_1, 2},
|
||||
{PTC10, I2C_1, 2},
|
||||
{NC , NC, 0}
|
||||
};
|
||||
|
||||
/************UART***************/
|
||||
const PinMap PinMap_UART_TX[] = {
|
||||
{PTB17, UART_0, 3},
|
||||
{PTC4 , UART_1, 3},
|
||||
{PTD3 , UART_2, 3},
|
||||
{PTD7 , UART_0, 3},
|
||||
{PTE0 , UART_1, 3},
|
||||
{NC , NC , 0}
|
||||
};
|
||||
|
||||
const PinMap PinMap_UART_RX[] = {
|
||||
{PTB16, UART_0, 3},
|
||||
{PTC3 , UART_1, 3},
|
||||
{PTD2 , UART_2, 3},
|
||||
{PTD6 , UART_0, 3},
|
||||
{PTE1 , UART_1, 3},
|
||||
{NC , NC , 0}
|
||||
};
|
||||
|
||||
/************SPI***************/
|
||||
const PinMap PinMap_SPI_SCLK[] = { // SCK
|
||||
{PTC5, SPI_0, 2},
|
||||
{PTD1, SPI_0, 2},
|
||||
{NC , NC , 0}
|
||||
};
|
||||
|
||||
const PinMap PinMap_SPI_MOSI[] = { // DOUT
|
||||
{PTD2, SPI_0, 2},
|
||||
{PTC6, SPI_0, 2},
|
||||
{NC , NC , 0}
|
||||
};
|
||||
|
||||
const PinMap PinMap_SPI_MISO[] = { // DIN
|
||||
{PTD3, SPI_0, 2},
|
||||
{PTC7, SPI_0, 2},
|
||||
{NC , NC , 0}
|
||||
};
|
||||
|
||||
const PinMap PinMap_SPI_SSEL[] = { // CS
|
||||
{PTD0, SPI_0, 2},
|
||||
{PTC4, SPI_0, 2},
|
||||
{PTD4, SPI_0, 2},
|
||||
{PTC3, SPI_0, 2},
|
||||
{PTC2, SPI_0, 2},
|
||||
{PTD5, SPI_0, 2},
|
||||
{PTD6, SPI_0, 2},
|
||||
{PTC1, SPI_0, 2},
|
||||
{PTC0, SPI_0, 2}
|
||||
};
|
||||
|
||||
/************PWM***************/
|
||||
const PinMap PinMap_PWM[] = {
|
||||
// LEDs
|
||||
{LED_RED , PWM_3 , 4}, // PTC3, FTM0 CH2
|
||||
{LED_GREEN, PWM_5, 4}, // PTD4, FTM0 CH4
|
||||
{LED_BLUE , PWM_8 , 3}, // PTA2, FTM0 CH7
|
||||
|
||||
{PTA0, PWM_6 , 3}, // PTA0, FTM0 CH5
|
||||
{PTA1, PWM_7 , 3}, // PTA1, FTM0 CH6
|
||||
{PTA3, PWM_1 , 3}, // PTA3, FTM0 CH0
|
||||
{PTA4, PWM_2 , 3}, // PTA4, FTM0 CH1
|
||||
{PTA5, PWM_3 , 3}, // PTA5, FTM0 CH2
|
||||
{PTA12, PWM_9 , 3}, // PTA12, FTM1 CH0
|
||||
{PTA13, PWM_10, 3}, // PTA13, FTM1 CH1
|
||||
{PTB0, PWM_9 , 3}, // PTB0, FTM1 CH0
|
||||
{PTB1, PWM_10, 3}, // PTB1, FTM1 CH1
|
||||
{PTC1, PWM_1 , 4}, // PTC1, FTM0 CH0
|
||||
{PTC2, PWM_2 , 4}, // PTC2, FTM0 CH1
|
||||
{PTC3, PWM_3 , 4}, // PTC3, FTM0 CH2
|
||||
{PTD4, PWM_4 , 4}, // PTD4, FTM0 CH3
|
||||
{PTD5, PWM_6 , 4}, // PTD5, FTM0 CH6
|
||||
{PTD6, PWM_7 , 4}, // PTD6, FTM0 CH6
|
||||
{PTD7, PWM_8 , 4}, // PTD7, FTM0 CH7
|
||||
|
||||
{NC , NC , 0}
|
||||
};
|
|
@ -1,310 +0,0 @@
|
|||
/* mbed Microcontroller Library
|
||||
* Copyright (c) 2006-2015 ARM Limited
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
#ifndef MBED_PINNAMES_H
|
||||
#define MBED_PINNAMES_H
|
||||
|
||||
#include "cmsis.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef enum {
|
||||
PIN_INPUT,
|
||||
PIN_OUTPUT
|
||||
} PinDirection;
|
||||
|
||||
/* PCR - 0x1000 */
|
||||
#define PORT_SHIFT 12
|
||||
|
||||
typedef enum {
|
||||
PTA0 = 0x0,
|
||||
PTA1 = 0x4,
|
||||
PTA2 = 0x8,
|
||||
PTA3 = 0xc,
|
||||
PTA4 = 0x10,
|
||||
PTA5 = 0x14,
|
||||
PTA6 = 0x18,
|
||||
PTA7 = 0x1c,
|
||||
PTA8 = 0x20,
|
||||
PTA9 = 0x24,
|
||||
PTA10 = 0x28,
|
||||
PTA11 = 0x2c,
|
||||
PTA12 = 0x30,
|
||||
PTA13 = 0x34,
|
||||
PTA14 = 0x38,
|
||||
PTA15 = 0x3c,
|
||||
PTA16 = 0x40,
|
||||
PTA17 = 0x44,
|
||||
PTA18 = 0x48,
|
||||
PTA19 = 0x4c,
|
||||
PTA20 = 0x50,
|
||||
PTA21 = 0x54,
|
||||
PTA22 = 0x58,
|
||||
PTA23 = 0x5c,
|
||||
PTA24 = 0x60,
|
||||
PTA25 = 0x64,
|
||||
PTA26 = 0x68,
|
||||
PTA27 = 0x6c,
|
||||
PTA28 = 0x70,
|
||||
PTA29 = 0x74,
|
||||
PTA30 = 0x78,
|
||||
PTA31 = 0x7c,
|
||||
PTB0 = 0x1000,
|
||||
PTB1 = 0x1004,
|
||||
PTB2 = 0x1008,
|
||||
PTB3 = 0x100c,
|
||||
PTB4 = 0x1010,
|
||||
PTB5 = 0x1014,
|
||||
PTB6 = 0x1018,
|
||||
PTB7 = 0x101c,
|
||||
PTB8 = 0x1020,
|
||||
PTB9 = 0x1024,
|
||||
PTB10 = 0x1028,
|
||||
PTB11 = 0x102c,
|
||||
PTB12 = 0x1030,
|
||||
PTB13 = 0x1034,
|
||||
PTB14 = 0x1038,
|
||||
PTB15 = 0x103c,
|
||||
PTB16 = 0x1040,
|
||||
PTB17 = 0x1044,
|
||||
PTB18 = 0x1048,
|
||||
PTB19 = 0x104c,
|
||||
PTB20 = 0x1050,
|
||||
PTB21 = 0x1054,
|
||||
PTB22 = 0x1058,
|
||||
PTB23 = 0x105c,
|
||||
PTB24 = 0x1060,
|
||||
PTB25 = 0x1064,
|
||||
PTB26 = 0x1068,
|
||||
PTB27 = 0x106c,
|
||||
PTB28 = 0x1070,
|
||||
PTB29 = 0x1074,
|
||||
PTB30 = 0x1078,
|
||||
PTB31 = 0x107c,
|
||||
PTC0 = 0x2000,
|
||||
PTC1 = 0x2004,
|
||||
PTC2 = 0x2008,
|
||||
PTC3 = 0x200c,
|
||||
PTC4 = 0x2010,
|
||||
PTC5 = 0x2014,
|
||||
PTC6 = 0x2018,
|
||||
PTC7 = 0x201c,
|
||||
PTC8 = 0x2020,
|
||||
PTC9 = 0x2024,
|
||||
PTC10 = 0x2028,
|
||||
PTC11 = 0x202c,
|
||||
PTC12 = 0x2030,
|
||||
PTC13 = 0x2034,
|
||||
PTC14 = 0x2038,
|
||||
PTC15 = 0x203c,
|
||||
PTC16 = 0x2040,
|
||||
PTC17 = 0x2044,
|
||||
PTC18 = 0x2048,
|
||||
PTC19 = 0x204c,
|
||||
PTC20 = 0x2050,
|
||||
PTC21 = 0x2054,
|
||||
PTC22 = 0x2058,
|
||||
PTC23 = 0x205c,
|
||||
PTC24 = 0x2060,
|
||||
PTC25 = 0x2064,
|
||||
PTC26 = 0x2068,
|
||||
PTC27 = 0x206c,
|
||||
PTC28 = 0x2070,
|
||||
PTC29 = 0x2074,
|
||||
PTC30 = 0x2078,
|
||||
PTC31 = 0x207c,
|
||||
PTD0 = 0x3000,
|
||||
PTD1 = 0x3004,
|
||||
PTD2 = 0x3008,
|
||||
PTD3 = 0x300c,
|
||||
PTD4 = 0x3010,
|
||||
PTD5 = 0x3014,
|
||||
PTD6 = 0x3018,
|
||||
PTD7 = 0x301c,
|
||||
PTD8 = 0x3020,
|
||||
PTD9 = 0x3024,
|
||||
PTD10 = 0x3028,
|
||||
PTD11 = 0x302c,
|
||||
PTD12 = 0x3030,
|
||||
PTD13 = 0x3034,
|
||||
PTD14 = 0x3038,
|
||||
PTD15 = 0x303c,
|
||||
PTD16 = 0x3040,
|
||||
PTD17 = 0x3044,
|
||||
PTD18 = 0x3048,
|
||||
PTD19 = 0x304c,
|
||||
PTD20 = 0x3050,
|
||||
PTD21 = 0x3054,
|
||||
PTD22 = 0x3058,
|
||||
PTD23 = 0x305c,
|
||||
PTD24 = 0x3060,
|
||||
PTD25 = 0x3064,
|
||||
PTD26 = 0x3068,
|
||||
PTD27 = 0x306c,
|
||||
PTD28 = 0x3070,
|
||||
PTD29 = 0x3074,
|
||||
PTD30 = 0x3078,
|
||||
PTD31 = 0x307c,
|
||||
PTE0 = 0x4000,
|
||||
PTE1 = 0x4004,
|
||||
PTE2 = 0x4008,
|
||||
PTE3 = 0x400c,
|
||||
PTE4 = 0x4010,
|
||||
PTE5 = 0x4014,
|
||||
PTE6 = 0x4018,
|
||||
PTE7 = 0x401c,
|
||||
PTE8 = 0x4020,
|
||||
PTE9 = 0x4024,
|
||||
PTE10 = 0x4028,
|
||||
PTE11 = 0x402c,
|
||||
PTE12 = 0x4030,
|
||||
PTE13 = 0x4034,
|
||||
PTE14 = 0x4038,
|
||||
PTE15 = 0x403c,
|
||||
PTE16 = 0x4040,
|
||||
PTE17 = 0x4044,
|
||||
PTE18 = 0x4048,
|
||||
PTE19 = 0x404c,
|
||||
PTE20 = 0x4050,
|
||||
PTE21 = 0x4054,
|
||||
PTE22 = 0x4058,
|
||||
PTE23 = 0x405c,
|
||||
PTE24 = 0x4060,
|
||||
PTE25 = 0x4064,
|
||||
PTE26 = 0x4068,
|
||||
PTE27 = 0x406c,
|
||||
PTE28 = 0x4070,
|
||||
PTE29 = 0x4074,
|
||||
PTE30 = 0x4078,
|
||||
PTE31 = 0x407c,
|
||||
|
||||
LED_RED = PTC5, // set these to the only led on board
|
||||
LED_GREEN = PTC5, //
|
||||
LED_BLUE = PTC5, //
|
||||
|
||||
// mbed original LED naming
|
||||
LED1 = LED_RED,
|
||||
LED2 = LED_GREEN,
|
||||
LED3 = LED_BLUE,
|
||||
LED4 = LED_BLUE,
|
||||
|
||||
// USB Pins
|
||||
USBTX = PTB17,
|
||||
USBRX = PTB16,
|
||||
|
||||
// DAC Pins
|
||||
DAC0_OUT = 0xFEFE, /* DAC does not have Pin Name in RM */
|
||||
|
||||
// Teensy3.1 Headers
|
||||
D0 = PTB16,
|
||||
D1 = PTB17,
|
||||
D2 = PTD0,
|
||||
D3 = PTA12,
|
||||
D4 = PTA13,
|
||||
D5 = PTD7,
|
||||
D6 = PTD4,
|
||||
D7 = PTD2,
|
||||
D8 = PTD3,
|
||||
D9 = PTC3,
|
||||
D10 = PTC4,
|
||||
D11 = PTC6,
|
||||
D12 = PTC7,
|
||||
D13 = PTC5,
|
||||
D14 = PTD1,
|
||||
D15 = PTC0,
|
||||
D16 = PTB0,
|
||||
D17 = PTB1,
|
||||
D18 = PTB3,
|
||||
D19 = PTB2,
|
||||
D20 = PTD5,
|
||||
D21 = PTD6,
|
||||
D22 = PTC1,
|
||||
D23 = PTC2,
|
||||
D24 = PTA5,
|
||||
D25 = PTB19,
|
||||
D26 = PTE1,
|
||||
D27 = PTC9,
|
||||
D28 = PTC8,
|
||||
D29 = PTC10,
|
||||
D30 = PTC11,
|
||||
D31 = PTE0,
|
||||
D32 = PTB18,
|
||||
D33 = PTA4,
|
||||
|
||||
A0 = PTD1,
|
||||
A1 = PTC0,
|
||||
A2 = PTB0,
|
||||
A3 = PTB1,
|
||||
A4 = PTB3,
|
||||
A5 = PTB2,
|
||||
A6 = PTD5,
|
||||
A7 = PTD6,
|
||||
A8 = PTC1,
|
||||
A9 = PTC2,
|
||||
A15 = PTE1,
|
||||
A16 = PTC9,
|
||||
A17 = PTC8,
|
||||
A18 = PTC10,
|
||||
A19 = PTC11,
|
||||
A20 = PTE0,
|
||||
|
||||
I2C_SCL = PTB2,
|
||||
I2C_SDA = PTB3,
|
||||
|
||||
SPI_SCK = PTC5, // sclk
|
||||
SPI_DOUT = PTC6, // mosi
|
||||
SPI_DIN = PTC7, // miso
|
||||
SPI_CS = PTC4, // ssel
|
||||
|
||||
SERIAL_TX = PTB17,
|
||||
SERIAL_RX = PTB16,
|
||||
|
||||
PWM = PTA12,
|
||||
PWM1 = PTA13,
|
||||
PWM2 = PTD7,
|
||||
PWM3 = PTD4,
|
||||
PWM4 = PTC3,
|
||||
PWM5 = PTC4,
|
||||
PWM6 = PTD5,
|
||||
PWM7 = PTD6,
|
||||
PWM8 = PTC1,
|
||||
PWM9 = PTC2,
|
||||
PWM10 = PTB19,
|
||||
PWM11 = PTB18,
|
||||
|
||||
DAC = DAC0_OUT,
|
||||
|
||||
TSI_ELEC0 = PTC1,
|
||||
TSI_ELEC1 = PTC2,
|
||||
|
||||
// Not connected
|
||||
NC = (int)0xFFFFFFFF
|
||||
} PinName;
|
||||
|
||||
|
||||
typedef enum {
|
||||
PullNone = 0,
|
||||
PullDown = 2,
|
||||
PullUp = 3,
|
||||
PullDefault = PullUp
|
||||
} PinMode;
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
|
@ -1,39 +0,0 @@
|
|||
// The 'features' section in 'target.json' is now used to create the device's hardware preprocessor switches.
|
||||
// Check the 'features' section of the target description in 'targets.json' for more details.
|
||||
/* mbed Microcontroller Library
|
||||
* Copyright (c) 2006-2015 ARM Limited
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
#ifndef MBED_DEVICE_H
|
||||
#define MBED_DEVICE_H
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#define DEVICE_ID_LENGTH 24
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#include "objects.h"
|
||||
|
||||
#endif
|
File diff suppressed because it is too large
Load Diff
|
@ -1,26 +0,0 @@
|
|||
#! armcc -E
|
||||
|
||||
#if !defined(MBED_BOOT_STACK_SIZE)
|
||||
#define MBED_BOOT_STACK_SIZE 0x400
|
||||
#endif
|
||||
|
||||
#define Stack_Size MBED_BOOT_STACK_SIZE
|
||||
|
||||
LR_IROM1 0x00000000 0x40000 { ; load region size_region (256k)
|
||||
ER_IROM1 0x00000000 0x40000 { ; load address = execution address
|
||||
*.o (RESET, +First)
|
||||
*(InRoot$$Sections)
|
||||
.ANY (+RO)
|
||||
}
|
||||
; 8_byte_aligned(112 vect * 4 bytes) = 8_byte_aligned(0x1C0) = 0x1C0
|
||||
; 0x10000 - 0x1C0 = 0xFE40
|
||||
RW_IRAM1 0x1FFF81C0 0xFE40 {
|
||||
.ANY (+RW +ZI)
|
||||
}
|
||||
|
||||
ARM_LIB_HEAP AlignExpr(+0, 16) EMPTY (0x1FFF8000+0x10000-Stack_Size-AlignExpr(ImageLimit(RW_IRAM1), 16)) { ; Heap region growing up
|
||||
}
|
||||
|
||||
ARM_LIB_STACK 0x1FFF8000+0x10000 EMPTY -Stack_Size { ; Stack region growing down
|
||||
}
|
||||
}
|
|
@ -1,558 +0,0 @@
|
|||
;/*****************************************************************************
|
||||
; * @file: startup_MK20DX256.s
|
||||
; * @purpose: CMSIS Cortex-M4 Core Device Startup File for the
|
||||
; * MK20DX256
|
||||
; * @version: 1.0
|
||||
; * @date: 2011-12-15
|
||||
; *
|
||||
; * Copyright: 1997 - 2015 Freescale Semiconductor, Inc. All Rights Reserved.
|
||||
;*
|
||||
; *------- <<< Use Configuration Wizard in Context Menu >>> ------------------
|
||||
; *
|
||||
; *****************************************************************************/
|
||||
|
||||
|
||||
PRESERVE8
|
||||
THUMB
|
||||
|
||||
|
||||
; Vector Table Mapped to Address 0 at Reset
|
||||
|
||||
AREA RESET, DATA, READONLY
|
||||
EXPORT __Vectors
|
||||
EXPORT __Vectors_End
|
||||
EXPORT __Vectors_Size
|
||||
IMPORT |Image$$ARM_LIB_STACK$$ZI$$Limit|
|
||||
|
||||
__Vectors DCD |Image$$ARM_LIB_STACK$$ZI$$Limit| ; Top of Stack
|
||||
DCD Reset_Handler ; Reset Handler
|
||||
DCD NMI_Handler ; NMI Handler
|
||||
DCD HardFault_Handler ; Hard Fault Handler
|
||||
DCD MemManage_Handler ; MPU Fault Handler
|
||||
DCD BusFault_Handler ; Bus Fault Handler
|
||||
DCD UsageFault_Handler ; Usage Fault Handler
|
||||
DCD 0 ; Reserved
|
||||
DCD 0 ; Reserved
|
||||
DCD 0 ; Reserved
|
||||
DCD 0 ; Reserved
|
||||
DCD SVC_Handler ; SVCall Handler
|
||||
DCD DebugMon_Handler ; Debug Monitor Handler
|
||||
DCD 0 ; Reserved
|
||||
DCD PendSV_Handler ; PendSV Handler
|
||||
DCD SysTick_Handler ; SysTick Handler
|
||||
|
||||
; External Interrupts
|
||||
DCD DMA0_IRQHandler ; DMA channel 0 transfer complete interrupt
|
||||
DCD DMA1_IRQHandler ; DMA channel 1 transfer complete interrupt
|
||||
DCD DMA2_IRQHandler ; DMA channel 2 transfer complete interrupt
|
||||
DCD DMA3_IRQHandler ; DMA channel 3 transfer complete interrupt
|
||||
DCD DMA4_IRQHandler ; DMA channel 4 transfer complete interrupt
|
||||
DCD DMA5_IRQHandler ; DMA channel 5 transfer complete interrupt
|
||||
DCD DMA6_IRQHandler ; DMA channel 6 transfer complete interrupt
|
||||
DCD DMA7_IRQHandler ; DMA channel 7 transfer complete interrupt
|
||||
DCD DMA8_IRQHandler ; DMA channel 8 transfer complete interrupt
|
||||
DCD DMA9_IRQHandler ; DMA channel 9 transfer complete interrupt
|
||||
DCD DMA10_IRQHandler ; DMA channel 10 transfer complete interrupt
|
||||
DCD DMA11_IRQHandler ; DMA channel 11 transfer complete interrupt
|
||||
DCD DMA12_IRQHandler ; DMA channel 12 transfer complete interrupt
|
||||
DCD DMA13_IRQHandler ; DMA channel 13 transfer complete interrupt
|
||||
DCD DMA14_IRQHandler ; DMA channel 14 transfer complete interrupt
|
||||
DCD DMA15_IRQHandler ; DMA channel 15 transfer complete interrupt
|
||||
DCD DMA_Error_IRQHandler ; DMA error interrupt
|
||||
DCD Reserved33_IRQHandler ; Reserved interrupt 33
|
||||
DCD FTFL_IRQHandler ; FTFL interrupt
|
||||
DCD Read_Collision_IRQHandler ; Read collision interrupt
|
||||
DCD LVD_LVW_IRQHandler ; Low Voltage Detect, Low Voltage Warning
|
||||
DCD LLW_IRQHandler ; Low Leakage Wakeup
|
||||
DCD Watchdog_IRQHandler ; WDOG interrupt
|
||||
DCD Reserved39_IRQHandler ; Reserved interrupt 39
|
||||
DCD I2C0_IRQHandler ; I2C0 interrupt
|
||||
DCD I2C1_IRQHandler ; I2C1 interrupt
|
||||
DCD SPI0_IRQHandler ; SPI0 interrupt
|
||||
DCD SPI1_IRQHandler ; SPI1 interrupt
|
||||
DCD Reserved44_IRQHandler ; Reserved interrupt 44
|
||||
DCD CAN0_ORed_Message_buffer_IRQHandler ; CAN0 OR'd message buffers interrupt
|
||||
DCD CAN0_Bus_Off_IRQHandler ; CAN0 bus off interrupt
|
||||
DCD CAN0_Error_IRQHandler ; CAN0 error interrupt
|
||||
DCD CAN0_Tx_Warning_IRQHandler ; CAN0 Tx warning interrupt
|
||||
DCD CAN0_Rx_Warning_IRQHandler ; CAN0 Rx warning interrupt
|
||||
DCD CAN0_Wake_Up_IRQHandler ; CAN0 wake up interrupt
|
||||
DCD I2S0_Tx_IRQHandler ; I2S0 transmit interrupt
|
||||
DCD I2S0_Rx_IRQHandler ; I2S0 receive interrupt
|
||||
DCD Reserved53_IRQHandler ; Reserved interrupt 53
|
||||
DCD Reserved54_IRQHandler ; Reserved interrupt 54
|
||||
DCD Reserved55_IRQHandler ; Reserved interrupt 55
|
||||
DCD Reserved56_IRQHandler ; Reserved interrupt 56
|
||||
DCD Reserved57_IRQHandler ; Reserved interrupt 57
|
||||
DCD Reserved58_IRQHandler ; Reserved interrupt 58
|
||||
DCD Reserved59_IRQHandler ; Reserved interrupt 59
|
||||
DCD UART0_LON_IRQHandler ; UART0 LON interrupt
|
||||
DCD UART0_RX_TX_IRQHandler ; UART0 receive/transmit interrupt
|
||||
DCD UART0_ERR_IRQHandler ; UART0 error interrupt
|
||||
DCD UART1_RX_TX_IRQHandler ; UART1 receive/transmit interrupt
|
||||
DCD UART1_ERR_IRQHandler ; UART1 error interrupt
|
||||
DCD UART2_RX_TX_IRQHandler ; UART2 receive/transmit interrupt
|
||||
DCD UART2_ERR_IRQHandler ; UART2 error interrupt
|
||||
DCD Reserved67_IRQHandler ; Reserved interrupt 67
|
||||
DCD Reserved68_IRQHandler ; Reserved interrupt 68
|
||||
DCD Reserved69_IRQHandler ; Reserved interrupt 69
|
||||
DCD Reserved70_IRQHandler ; Reserved interrupt 70
|
||||
DCD Reserved71_IRQHandler ; Reserved interrupt 71
|
||||
DCD Reserved72_IRQHandler ; Reserved interrupt 72
|
||||
DCD ADC0_IRQHandler ; ADC0 interrupt
|
||||
DCD ADC1_IRQHandler ; ADC1 interrupt
|
||||
DCD CMP0_IRQHandler ; CMP0 interrupt
|
||||
DCD CMP1_IRQHandler ; CMP1 interrupt
|
||||
DCD CMP2_IRQHandler ; CMP2 interrupt
|
||||
DCD FTM0_IRQHandler ; FTM0 fault, overflow and channels interrupt
|
||||
DCD FTM1_IRQHandler ; FTM1 fault, overflow and channels interrupt
|
||||
DCD FTM2_IRQHandler ; FTM2 fault, overflow and channels interrupt
|
||||
DCD CMT_IRQHandler ; CMT interrupt
|
||||
DCD RTC_IRQHandler ; RTC interrupt
|
||||
DCD RTC_Seconds_IRQHandler ; RTC seconds interrupt
|
||||
DCD PIT0_IRQHandler ; PIT timer channel 0 interrupt
|
||||
DCD PIT1_IRQHandler ; PIT timer channel 1 interrupt
|
||||
DCD PIT2_IRQHandler ; PIT timer channel 2 interrupt
|
||||
DCD PIT3_IRQHandler ; PIT timer channel 3 interrupt
|
||||
DCD PDB0_IRQHandler ; PDB0 interrupt
|
||||
DCD USB0_IRQHandler ; USB0 interrupt
|
||||
DCD USBDCD_IRQHandler ; USBDCD interrupt
|
||||
DCD Reserved91_IRQHandler ; Reserved interrupt 91
|
||||
DCD Reserved92_IRQHandler ; Reserved interrupt 92
|
||||
DCD Reserved93_IRQHandler ; Reserved interrupt 93
|
||||
DCD Reserved94_IRQHandler ; Reserved interrupt 94
|
||||
DCD Reserved95_IRQHandler ; Reserved interrupt 95
|
||||
DCD Reserved96_IRQHandler ; Reserved interrupt 96
|
||||
DCD DAC0_IRQHandler ; DAC0 interrupt
|
||||
DCD Reserved98_IRQHandler ; Reserved interrupt 98
|
||||
DCD TSI0_IRQHandler ; TSI0 interrupt
|
||||
DCD MCG_IRQHandler ; MCG interrupt
|
||||
DCD LPTimer_IRQHandler ; LPTimer interrupt
|
||||
DCD Reserved102_IRQHandler ; Reserved interrupt 102
|
||||
DCD PORTA_IRQHandler ; Port A interrupt
|
||||
DCD PORTB_IRQHandler ; Port B interrupt
|
||||
DCD PORTC_IRQHandler ; Port C interrupt
|
||||
DCD PORTD_IRQHandler ; Port D interrupt
|
||||
DCD PORTE_IRQHandler ; Port E interrupt
|
||||
DCD Reserved108_IRQHandler ; Reserved interrupt 108
|
||||
DCD Reserved109_IRQHandler ; Reserved interrupt 109
|
||||
DCD SWI_IRQHandler ; Software interrupt
|
||||
__Vectors_End
|
||||
|
||||
__Vectors_Size EQU __Vectors_End - __Vectors
|
||||
|
||||
; <h> Flash Configuration
|
||||
; <i> 16-byte flash configuration field that stores default protection settings (loaded on reset)
|
||||
; <i> and security information that allows the MCU to restrict acces to the FTFL module.
|
||||
; <h> Backdoor Comparison Key
|
||||
; <o0> Backdoor Key 0 <0x0-0xFF:2>
|
||||
; <o1> Backdoor Key 1 <0x0-0xFF:2>
|
||||
; <o2> Backdoor Key 2 <0x0-0xFF:2>
|
||||
; <o3> Backdoor Key 3 <0x0-0xFF:2>
|
||||
; <o4> Backdoor Key 4 <0x0-0xFF:2>
|
||||
; <o5> Backdoor Key 5 <0x0-0xFF:2>
|
||||
; <o6> Backdoor Key 6 <0x0-0xFF:2>
|
||||
; <o7> Backdoor Key 7 <0x0-0xFF:2>
|
||||
BackDoorK0 EQU 0xFF
|
||||
BackDoorK1 EQU 0xFF
|
||||
BackDoorK2 EQU 0xFF
|
||||
BackDoorK3 EQU 0xFF
|
||||
BackDoorK4 EQU 0xFF
|
||||
BackDoorK5 EQU 0xFF
|
||||
BackDoorK6 EQU 0xFF
|
||||
BackDoorK7 EQU 0xFF
|
||||
; </h>
|
||||
; <h> Program flash protection bytes (FPROT)
|
||||
; <i> Each program flash region can be protected from program and erase operation by setting the associated PROT bit.
|
||||
; <i> Each bit protects a 1/32 region of the program flash memory.
|
||||
; <h> FPROT0
|
||||
; <i> Program flash protection bytes
|
||||
; <i> 1/32 - 8/32 region
|
||||
; <o.0> FPROT0.0
|
||||
; <o.1> FPROT0.1
|
||||
; <o.2> FPROT0.2
|
||||
; <o.3> FPROT0.3
|
||||
; <o.4> FPROT0.4
|
||||
; <o.5> FPROT0.5
|
||||
; <o.6> FPROT0.6
|
||||
; <o.7> FPROT0.7
|
||||
nFPROT0 EQU 0x00
|
||||
FPROT0 EQU nFPROT0:EOR:0xFF
|
||||
; </h>
|
||||
; <h> FPROT1
|
||||
; <i> Program Flash Region Protect Register 1
|
||||
; <i> 9/32 - 16/32 region
|
||||
; <o.0> FPROT1.0
|
||||
; <o.1> FPROT1.1
|
||||
; <o.2> FPROT1.2
|
||||
; <o.3> FPROT1.3
|
||||
; <o.4> FPROT1.4
|
||||
; <o.5> FPROT1.5
|
||||
; <o.6> FPROT1.6
|
||||
; <o.7> FPROT1.7
|
||||
nFPROT1 EQU 0x00
|
||||
FPROT1 EQU nFPROT1:EOR:0xFF
|
||||
; </h>
|
||||
; <h> FPROT2
|
||||
; <i> Program Flash Region Protect Register 2
|
||||
; <i> 17/32 - 24/32 region
|
||||
; <o.0> FPROT2.0
|
||||
; <o.1> FPROT2.1
|
||||
; <o.2> FPROT2.2
|
||||
; <o.3> FPROT2.3
|
||||
; <o.4> FPROT2.4
|
||||
; <o.5> FPROT2.5
|
||||
; <o.6> FPROT2.6
|
||||
; <o.7> FPROT2.7
|
||||
nFPROT2 EQU 0x00
|
||||
FPROT2 EQU nFPROT2:EOR:0xFF
|
||||
; </h>
|
||||
; <h> FPROT3
|
||||
; <i> Program Flash Region Protect Register 3
|
||||
; <i> 25/32 - 32/32 region
|
||||
; <o.0> FPROT3.0
|
||||
; <o.1> FPROT3.1
|
||||
; <o.2> FPROT3.2
|
||||
; <o.3> FPROT3.3
|
||||
; <o.4> FPROT3.4
|
||||
; <o.5> FPROT3.5
|
||||
; <o.6> FPROT3.6
|
||||
; <o.7> FPROT3.7
|
||||
nFPROT3 EQU 0x00
|
||||
FPROT3 EQU nFPROT3:EOR:0xFF
|
||||
; </h>
|
||||
; </h>
|
||||
; <h> Data flash protection byte (FDPROT)
|
||||
; <i> Each bit protects a 1/8 region of the data flash memory.
|
||||
; <i> (Program flash only devices: Reserved)
|
||||
; <o.0> FDPROT.0
|
||||
; <o.1> FDPROT.1
|
||||
; <o.2> FDPROT.2
|
||||
; <o.3> FDPROT.3
|
||||
; <o.4> FDPROT.4
|
||||
; <o.5> FDPROT.5
|
||||
; <o.6> FDPROT.6
|
||||
; <o.7> FDPROT.7
|
||||
nFDPROT EQU 0x00
|
||||
FDPROT EQU nFDPROT:EOR:0xFF
|
||||
; </h>
|
||||
; <h> EEPROM protection byte (FEPROT)
|
||||
; <i> FlexNVM devices: Each bit protects a 1/8 region of the EEPROM.
|
||||
; <i> (Program flash only devices: Reserved)
|
||||
; <o.0> FEPROT.0
|
||||
; <o.1> FEPROT.1
|
||||
; <o.2> FEPROT.2
|
||||
; <o.3> FEPROT.3
|
||||
; <o.4> FEPROT.4
|
||||
; <o.5> FEPROT.5
|
||||
; <o.6> FEPROT.6
|
||||
; <o.7> FEPROT.7
|
||||
nFEPROT EQU 0x00
|
||||
FEPROT EQU nFEPROT:EOR:0xFF
|
||||
; </h>
|
||||
; <h> Flash nonvolatile option byte (FOPT)
|
||||
; <i> Allows the user to customize the operation of the MCU at boot time.
|
||||
; <o.0> LPBOOT
|
||||
; <0=> Low-power boot
|
||||
; <1=> normal boot
|
||||
; <o.1> EZPORT_DIS
|
||||
; <0=> EzPort operation is enabled
|
||||
; <1=> EzPort operation is disabled
|
||||
FOPT EQU 0xFF
|
||||
; </h>
|
||||
; <h> Flash security byte (FSEC)
|
||||
; <i> WARNING: If SEC field is configured as "MCU security status is secure" and MEEN field is configured as "Mass erase is disabled",
|
||||
; <i> MCU's security status cannot be set back to unsecure state since Mass erase via the debugger is blocked !!!
|
||||
; <o.0..1> SEC
|
||||
; <2=> MCU security status is unsecure
|
||||
; <3=> MCU security status is secure
|
||||
; <i> Flash Security
|
||||
; <i> This bits define the security state of the MCU.
|
||||
; <o.2..3> FSLACC
|
||||
; <2=> Freescale factory access denied
|
||||
; <3=> Freescale factory access granted
|
||||
; <i> Freescale Failure Analysis Access Code
|
||||
; <i> This bits define the security state of the MCU.
|
||||
; <o.4..5> MEEN
|
||||
; <2=> Mass erase is disabled
|
||||
; <3=> Mass erase is enabled
|
||||
; <i> Mass Erase Enable Bits
|
||||
; <i> Enables and disables mass erase capability of the FTFL module
|
||||
; <o.6..7> KEYEN
|
||||
; <2=> Backdoor key access enabled
|
||||
; <3=> Backdoor key access disabled
|
||||
; <i> Backdoor key Security Enable
|
||||
; <i> These bits enable and disable backdoor key access to the FTFL module.
|
||||
FSEC EQU 0xFE
|
||||
; </h>
|
||||
; </h>
|
||||
IF :LNOT::DEF:RAM_TARGET
|
||||
AREA |.ARM.__at_0x400|, CODE, READONLY
|
||||
DCB BackDoorK0, BackDoorK1, BackDoorK2, BackDoorK3
|
||||
DCB BackDoorK4, BackDoorK5, BackDoorK6, BackDoorK7
|
||||
DCB FPROT0, FPROT1, FPROT2, FPROT3
|
||||
DCB FSEC, FOPT, FEPROT, FDPROT
|
||||
ENDIF
|
||||
|
||||
AREA |.text|, CODE, READONLY
|
||||
|
||||
|
||||
; Reset Handler
|
||||
|
||||
Reset_Handler PROC
|
||||
EXPORT Reset_Handler [WEAK]
|
||||
IMPORT SystemInit
|
||||
IMPORT __main
|
||||
LDR R0, =SystemInit
|
||||
BLX R0
|
||||
LDR R0, =__main
|
||||
BX R0
|
||||
ENDP
|
||||
|
||||
|
||||
; Dummy Exception Handlers (infinite loops which can be modified)
|
||||
|
||||
NMI_Handler PROC
|
||||
EXPORT NMI_Handler [WEAK]
|
||||
B .
|
||||
ENDP
|
||||
HardFault_Handler\
|
||||
PROC
|
||||
EXPORT HardFault_Handler [WEAK]
|
||||
B .
|
||||
ENDP
|
||||
MemManage_Handler\
|
||||
PROC
|
||||
EXPORT MemManage_Handler [WEAK]
|
||||
B .
|
||||
ENDP
|
||||
BusFault_Handler\
|
||||
PROC
|
||||
EXPORT BusFault_Handler [WEAK]
|
||||
B .
|
||||
ENDP
|
||||
UsageFault_Handler\
|
||||
PROC
|
||||
EXPORT UsageFault_Handler [WEAK]
|
||||
B .
|
||||
ENDP
|
||||
SVC_Handler PROC
|
||||
EXPORT SVC_Handler [WEAK]
|
||||
B .
|
||||
ENDP
|
||||
DebugMon_Handler\
|
||||
PROC
|
||||
EXPORT DebugMon_Handler [WEAK]
|
||||
B .
|
||||
ENDP
|
||||
PendSV_Handler PROC
|
||||
EXPORT PendSV_Handler [WEAK]
|
||||
B .
|
||||
ENDP
|
||||
SysTick_Handler PROC
|
||||
EXPORT SysTick_Handler [WEAK]
|
||||
B .
|
||||
ENDP
|
||||
|
||||
Default_Handler PROC
|
||||
EXPORT DMA0_IRQHandler [WEAK]
|
||||
EXPORT DMA1_IRQHandler [WEAK]
|
||||
EXPORT DMA2_IRQHandler [WEAK]
|
||||
EXPORT DMA3_IRQHandler [WEAK]
|
||||
EXPORT DMA4_IRQHandler [WEAK]
|
||||
EXPORT DMA5_IRQHandler [WEAK]
|
||||
EXPORT DMA6_IRQHandler [WEAK]
|
||||
EXPORT DMA7_IRQHandler [WEAK]
|
||||
EXPORT DMA8_IRQHandler [WEAK]
|
||||
EXPORT DMA9_IRQHandler [WEAK]
|
||||
EXPORT DMA10_IRQHandler [WEAK]
|
||||
EXPORT DMA11_IRQHandler [WEAK]
|
||||
EXPORT DMA12_IRQHandler [WEAK]
|
||||
EXPORT DMA13_IRQHandler [WEAK]
|
||||
EXPORT DMA14_IRQHandler [WEAK]
|
||||
EXPORT DMA15_IRQHandler [WEAK]
|
||||
EXPORT DMA_Error_IRQHandler [WEAK]
|
||||
EXPORT Reserved33_IRQHandler [WEAK]
|
||||
EXPORT FTFL_IRQHandler [WEAK]
|
||||
EXPORT Read_Collision_IRQHandler [WEAK]
|
||||
EXPORT LVD_LVW_IRQHandler [WEAK]
|
||||
EXPORT LLW_IRQHandler [WEAK]
|
||||
EXPORT Watchdog_IRQHandler [WEAK]
|
||||
EXPORT Reserved39_IRQHandler [WEAK]
|
||||
EXPORT I2C0_IRQHandler [WEAK]
|
||||
EXPORT I2C1_IRQHandler [WEAK]
|
||||
EXPORT SPI0_IRQHandler [WEAK]
|
||||
EXPORT SPI1_IRQHandler [WEAK]
|
||||
EXPORT Reserved44_IRQHandler [WEAK]
|
||||
EXPORT CAN0_ORed_Message_buffer_IRQHandler [WEAK]
|
||||
EXPORT CAN0_Bus_Off_IRQHandler [WEAK]
|
||||
EXPORT CAN0_Error_IRQHandler [WEAK]
|
||||
EXPORT CAN0_Tx_Warning_IRQHandler [WEAK]
|
||||
EXPORT CAN0_Rx_Warning_IRQHandler [WEAK]
|
||||
EXPORT CAN0_Wake_Up_IRQHandler [WEAK]
|
||||
EXPORT I2S0_Tx_IRQHandler [WEAK]
|
||||
EXPORT I2S0_Rx_IRQHandler [WEAK]
|
||||
EXPORT Reserved53_IRQHandler [WEAK]
|
||||
EXPORT Reserved54_IRQHandler [WEAK]
|
||||
EXPORT Reserved55_IRQHandler [WEAK]
|
||||
EXPORT Reserved56_IRQHandler [WEAK]
|
||||
EXPORT Reserved57_IRQHandler [WEAK]
|
||||
EXPORT Reserved58_IRQHandler [WEAK]
|
||||
EXPORT Reserved59_IRQHandler [WEAK]
|
||||
EXPORT UART0_LON_IRQHandler [WEAK]
|
||||
EXPORT UART0_RX_TX_IRQHandler [WEAK]
|
||||
EXPORT UART0_ERR_IRQHandler [WEAK]
|
||||
EXPORT UART1_RX_TX_IRQHandler [WEAK]
|
||||
EXPORT UART1_ERR_IRQHandler [WEAK]
|
||||
EXPORT UART2_RX_TX_IRQHandler [WEAK]
|
||||
EXPORT UART2_ERR_IRQHandler [WEAK]
|
||||
EXPORT Reserved67_IRQHandler [WEAK]
|
||||
EXPORT Reserved68_IRQHandler [WEAK]
|
||||
EXPORT Reserved69_IRQHandler [WEAK]
|
||||
EXPORT Reserved70_IRQHandler [WEAK]
|
||||
EXPORT Reserved71_IRQHandler [WEAK]
|
||||
EXPORT Reserved72_IRQHandler [WEAK]
|
||||
EXPORT ADC0_IRQHandler [WEAK]
|
||||
EXPORT ADC1_IRQHandler [WEAK]
|
||||
EXPORT CMP0_IRQHandler [WEAK]
|
||||
EXPORT CMP1_IRQHandler [WEAK]
|
||||
EXPORT CMP2_IRQHandler [WEAK]
|
||||
EXPORT FTM0_IRQHandler [WEAK]
|
||||
EXPORT FTM1_IRQHandler [WEAK]
|
||||
EXPORT FTM2_IRQHandler [WEAK]
|
||||
EXPORT CMT_IRQHandler [WEAK]
|
||||
EXPORT RTC_IRQHandler [WEAK]
|
||||
EXPORT RTC_Seconds_IRQHandler [WEAK]
|
||||
EXPORT PIT0_IRQHandler [WEAK]
|
||||
EXPORT PIT1_IRQHandler [WEAK]
|
||||
EXPORT PIT2_IRQHandler [WEAK]
|
||||
EXPORT PIT3_IRQHandler [WEAK]
|
||||
EXPORT PDB0_IRQHandler [WEAK]
|
||||
EXPORT USB0_IRQHandler [WEAK]
|
||||
EXPORT USBDCD_IRQHandler [WEAK]
|
||||
EXPORT Reserved91_IRQHandler [WEAK]
|
||||
EXPORT Reserved92_IRQHandler [WEAK]
|
||||
EXPORT Reserved93_IRQHandler [WEAK]
|
||||
EXPORT Reserved94_IRQHandler [WEAK]
|
||||
EXPORT Reserved95_IRQHandler [WEAK]
|
||||
EXPORT Reserved96_IRQHandler [WEAK]
|
||||
EXPORT DAC0_IRQHandler [WEAK]
|
||||
EXPORT Reserved98_IRQHandler [WEAK]
|
||||
EXPORT TSI0_IRQHandler [WEAK]
|
||||
EXPORT MCG_IRQHandler [WEAK]
|
||||
EXPORT LPTimer_IRQHandler [WEAK]
|
||||
EXPORT Reserved102_IRQHandler [WEAK]
|
||||
EXPORT PORTA_IRQHandler [WEAK]
|
||||
EXPORT PORTB_IRQHandler [WEAK]
|
||||
EXPORT PORTC_IRQHandler [WEAK]
|
||||
EXPORT PORTD_IRQHandler [WEAK]
|
||||
EXPORT PORTE_IRQHandler [WEAK]
|
||||
EXPORT Reserved108_IRQHandler [WEAK]
|
||||
EXPORT Reserved109_IRQHandler [WEAK]
|
||||
EXPORT SWI_IRQHandler [WEAK]
|
||||
EXPORT DefaultISR [WEAK]
|
||||
|
||||
DMA0_IRQHandler
|
||||
DMA1_IRQHandler
|
||||
DMA2_IRQHandler
|
||||
DMA3_IRQHandler
|
||||
DMA4_IRQHandler
|
||||
DMA5_IRQHandler
|
||||
DMA6_IRQHandler
|
||||
DMA7_IRQHandler
|
||||
DMA8_IRQHandler
|
||||
DMA9_IRQHandler
|
||||
DMA10_IRQHandler
|
||||
DMA11_IRQHandler
|
||||
DMA12_IRQHandler
|
||||
DMA13_IRQHandler
|
||||
DMA14_IRQHandler
|
||||
DMA15_IRQHandler
|
||||
DMA_Error_IRQHandler
|
||||
Reserved33_IRQHandler
|
||||
FTFL_IRQHandler
|
||||
Read_Collision_IRQHandler
|
||||
LVD_LVW_IRQHandler
|
||||
LLW_IRQHandler
|
||||
Watchdog_IRQHandler
|
||||
Reserved39_IRQHandler
|
||||
I2C0_IRQHandler
|
||||
I2C1_IRQHandler
|
||||
SPI0_IRQHandler
|
||||
SPI1_IRQHandler
|
||||
Reserved44_IRQHandler
|
||||
CAN0_ORed_Message_buffer_IRQHandler
|
||||
CAN0_Bus_Off_IRQHandler
|
||||
CAN0_Error_IRQHandler
|
||||
CAN0_Tx_Warning_IRQHandler
|
||||
CAN0_Rx_Warning_IRQHandler
|
||||
CAN0_Wake_Up_IRQHandler
|
||||
I2S0_Tx_IRQHandler
|
||||
I2S0_Rx_IRQHandler
|
||||
Reserved53_IRQHandler
|
||||
Reserved54_IRQHandler
|
||||
Reserved55_IRQHandler
|
||||
Reserved56_IRQHandler
|
||||
Reserved57_IRQHandler
|
||||
Reserved58_IRQHandler
|
||||
Reserved59_IRQHandler
|
||||
UART0_LON_IRQHandler
|
||||
UART0_RX_TX_IRQHandler
|
||||
UART0_ERR_IRQHandler
|
||||
UART1_RX_TX_IRQHandler
|
||||
UART1_ERR_IRQHandler
|
||||
UART2_RX_TX_IRQHandler
|
||||
UART2_ERR_IRQHandler
|
||||
Reserved67_IRQHandler
|
||||
Reserved68_IRQHandler
|
||||
Reserved69_IRQHandler
|
||||
Reserved70_IRQHandler
|
||||
Reserved71_IRQHandler
|
||||
Reserved72_IRQHandler
|
||||
ADC0_IRQHandler
|
||||
ADC1_IRQHandler
|
||||
CMP0_IRQHandler
|
||||
CMP1_IRQHandler
|
||||
CMP2_IRQHandler
|
||||
FTM0_IRQHandler
|
||||
FTM1_IRQHandler
|
||||
FTM2_IRQHandler
|
||||
CMT_IRQHandler
|
||||
RTC_IRQHandler
|
||||
RTC_Seconds_IRQHandler
|
||||
PIT0_IRQHandler
|
||||
PIT1_IRQHandler
|
||||
PIT2_IRQHandler
|
||||
PIT3_IRQHandler
|
||||
PDB0_IRQHandler
|
||||
USB0_IRQHandler
|
||||
USBDCD_IRQHandler
|
||||
Reserved91_IRQHandler
|
||||
Reserved92_IRQHandler
|
||||
Reserved93_IRQHandler
|
||||
Reserved94_IRQHandler
|
||||
Reserved95_IRQHandler
|
||||
Reserved96_IRQHandler
|
||||
DAC0_IRQHandler
|
||||
Reserved98_IRQHandler
|
||||
TSI0_IRQHandler
|
||||
MCG_IRQHandler
|
||||
LPTimer_IRQHandler
|
||||
Reserved102_IRQHandler
|
||||
PORTA_IRQHandler
|
||||
PORTB_IRQHandler
|
||||
PORTC_IRQHandler
|
||||
PORTD_IRQHandler
|
||||
PORTE_IRQHandler
|
||||
Reserved108_IRQHandler
|
||||
Reserved109_IRQHandler
|
||||
SWI_IRQHandler
|
||||
DefaultISR
|
||||
|
||||
B .
|
||||
|
||||
ENDP
|
||||
|
||||
|
||||
ALIGN
|
||||
END
|
|
@ -1,171 +0,0 @@
|
|||
/*
|
||||
* K20DX256 ARM GCC linker script file
|
||||
*/
|
||||
|
||||
#if !defined(MBED_BOOT_STACK_SIZE)
|
||||
#define MBED_BOOT_STACK_SIZE 0x400
|
||||
#endif
|
||||
|
||||
STACK_SIZE = MBED_BOOT_STACK_SIZE;
|
||||
|
||||
MEMORY
|
||||
{
|
||||
VECTORS (rx) : ORIGIN = 0x00000000, LENGTH = 0x00000400
|
||||
FLASH_PROTECTION (rx) : ORIGIN = 0x00000400, LENGTH = 0x00000010
|
||||
FLASH (rx) : ORIGIN = 0x00000410, LENGTH = 256K - 0x00000410
|
||||
RAM (rwx) : ORIGIN = 0x1FFF81C0, LENGTH = 64K - 0x1C0
|
||||
}
|
||||
|
||||
/* Linker script to place sections and symbol values. Should be used together
|
||||
* with other linker script that defines memory regions FLASH and RAM.
|
||||
* It references following symbols, which must be defined in code:
|
||||
* _reset_init : Entry of reset handler
|
||||
*
|
||||
* It defines following symbols, which code can use without definition:
|
||||
* __exidx_start
|
||||
* __exidx_end
|
||||
* __etext
|
||||
* __data_start__
|
||||
* __preinit_array_start
|
||||
* __preinit_array_end
|
||||
* __init_array_start
|
||||
* __init_array_end
|
||||
* __fini_array_start
|
||||
* __fini_array_end
|
||||
* __data_end__
|
||||
* __bss_start__
|
||||
* __bss_end__
|
||||
* __end__
|
||||
* end
|
||||
* __HeapLimit
|
||||
* __StackLimit
|
||||
* __StackTop
|
||||
* __stack
|
||||
*/
|
||||
ENTRY(Reset_Handler)
|
||||
|
||||
SECTIONS
|
||||
{
|
||||
.isr_vector :
|
||||
{
|
||||
. = 0;
|
||||
__isr_vector = .;
|
||||
KEEP(*(.isr_vector))
|
||||
*(.text.Reset_Handler)
|
||||
*(.text.SystemInit)
|
||||
. = ALIGN(8);
|
||||
} > VECTORS
|
||||
|
||||
.flash_protect :
|
||||
{
|
||||
KEEP(*(.kinetis_flash_config_field))
|
||||
. = ALIGN(8);
|
||||
} > FLASH_PROTECTION
|
||||
|
||||
.text :
|
||||
{
|
||||
*(.text*)
|
||||
|
||||
KEEP(*(.init))
|
||||
KEEP(*(.fini))
|
||||
|
||||
/* .ctors */
|
||||
*crtbegin.o(.ctors)
|
||||
*crtbegin?.o(.ctors)
|
||||
*(EXCLUDE_FILE(*crtend?.o *crtend.o) .ctors)
|
||||
*(SORT(.ctors.*))
|
||||
*(.ctors)
|
||||
|
||||
/* .dtors */
|
||||
*crtbegin.o(.dtors)
|
||||
*crtbegin?.o(.dtors)
|
||||
*(EXCLUDE_FILE(*crtend?.o *crtend.o) .dtors)
|
||||
*(SORT(.dtors.*))
|
||||
*(.dtors)
|
||||
|
||||
*(.rodata*)
|
||||
|
||||
KEEP(*(.eh_frame*))
|
||||
} > FLASH
|
||||
|
||||
.ARM.extab :
|
||||
{
|
||||
*(.ARM.extab* .gnu.linkonce.armextab.*)
|
||||
} > FLASH
|
||||
|
||||
__exidx_start = .;
|
||||
.ARM.exidx :
|
||||
{
|
||||
*(.ARM.exidx* .gnu.linkonce.armexidx.*)
|
||||
} > FLASH
|
||||
__exidx_end = .;
|
||||
|
||||
__etext = .;
|
||||
|
||||
.data : AT (__etext)
|
||||
{
|
||||
__data_start__ = .;
|
||||
*(vtable)
|
||||
*(.data*)
|
||||
|
||||
. = ALIGN(8);
|
||||
/* preinit data */
|
||||
PROVIDE_HIDDEN (__preinit_array_start = .);
|
||||
KEEP(*(.preinit_array))
|
||||
PROVIDE_HIDDEN (__preinit_array_end = .);
|
||||
|
||||
. = ALIGN(8);
|
||||
/* init data */
|
||||
PROVIDE_HIDDEN (__init_array_start = .);
|
||||
KEEP(*(SORT(.init_array.*)))
|
||||
KEEP(*(.init_array))
|
||||
PROVIDE_HIDDEN (__init_array_end = .);
|
||||
|
||||
|
||||
. = ALIGN(8);
|
||||
/* finit data */
|
||||
PROVIDE_HIDDEN (__fini_array_start = .);
|
||||
KEEP(*(SORT(.fini_array.*)))
|
||||
KEEP(*(.fini_array))
|
||||
PROVIDE_HIDDEN (__fini_array_end = .);
|
||||
|
||||
. = ALIGN(8);
|
||||
/* All data end */
|
||||
__data_end__ = .;
|
||||
|
||||
} > RAM
|
||||
|
||||
.bss :
|
||||
{
|
||||
__bss_start__ = .;
|
||||
*(.bss*)
|
||||
*(COMMON)
|
||||
__bss_end__ = .;
|
||||
} > RAM
|
||||
|
||||
.heap :
|
||||
{
|
||||
__end__ = .;
|
||||
end = __end__;
|
||||
*(.heap*)
|
||||
. = ORIGIN(RAM) + LENGTH(RAM) - STACK_SIZE;
|
||||
__HeapLimit = .;
|
||||
} > RAM
|
||||
|
||||
/* .stack_dummy section doesn't contains any symbols. It is only
|
||||
* used for linker to calculate size of stack sections, and assign
|
||||
* values to stack symbols later */
|
||||
.stack_dummy :
|
||||
{
|
||||
*(.stack)
|
||||
} > RAM
|
||||
|
||||
/* Set stack top to end of RAM, and stack limit move down by
|
||||
* size of stack_dummy section */
|
||||
__StackTop = ORIGIN(RAM) + LENGTH(RAM);
|
||||
__StackLimit = __StackTop - STACK_SIZE;
|
||||
PROVIDE(__stack = __StackTop);
|
||||
|
||||
/* Check if data + heap + stack exceeds RAM limit */
|
||||
ASSERT(__StackLimit >= __HeapLimit, "region RAM overflowed with stack")
|
||||
}
|
|
@ -1,366 +0,0 @@
|
|||
/* File: startup_MK20DX256.s
|
||||
* Purpose: startup file for Cortex-M4 devices. Should use with
|
||||
* GCC for ARM Embedded Processors
|
||||
* Version: V1.3
|
||||
* Date: 08 Feb 2012
|
||||
*
|
||||
* Copyright (c) 2015, ARM Limited
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
* Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
* 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.
|
||||
* Neither the name of the ARM Limited 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 ARM LIMITED 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.
|
||||
*/
|
||||
.syntax unified
|
||||
.arch armv7-m
|
||||
|
||||
.section .stack
|
||||
.align 3
|
||||
#ifdef __STACK_SIZE
|
||||
.equ Stack_Size, __STACK_SIZE
|
||||
#else
|
||||
.equ Stack_Size, 0x400
|
||||
#endif
|
||||
.globl __StackTop
|
||||
.globl __StackLimit
|
||||
__StackLimit:
|
||||
.space Stack_Size
|
||||
.size __StackLimit, . - __StackLimit
|
||||
__StackTop:
|
||||
.size __StackTop, . - __StackTop
|
||||
|
||||
.section .heap
|
||||
.align 3
|
||||
#ifdef __HEAP_SIZE
|
||||
.equ Heap_Size, __HEAP_SIZE
|
||||
#else
|
||||
.equ Heap_Size, 0xC00
|
||||
#endif
|
||||
.globl __HeapBase
|
||||
.globl __HeapLimit
|
||||
__HeapBase:
|
||||
.if Heap_Size
|
||||
.space Heap_Size
|
||||
.endif
|
||||
.size __HeapBase, . - __HeapBase
|
||||
__HeapLimit:
|
||||
.size __HeapLimit, . - __HeapLimit
|
||||
|
||||
.section .isr_vector
|
||||
.align 2
|
||||
.globl __isr_vector
|
||||
|
||||
__isr_vector:
|
||||
.long __StackTop /* Top of Stack */
|
||||
.long Reset_Handler /* Reset Handler */
|
||||
.long NMI_Handler /* NMI Handler */
|
||||
.long HardFault_Handler /* Hard Fault Handler */
|
||||
.long MemManage_Handler /* MPU Fault Handler */
|
||||
.long BusFault_Handler /* Bus Fault Handler */
|
||||
.long UsageFault_Handler /* Usage Fault Handler */
|
||||
.long 0 /* Reserved */
|
||||
.long 0 /* Reserved */
|
||||
.long 0 /* Reserved */
|
||||
.long 0 /* Reserved */
|
||||
.long SVC_Handler /* SVCall Handler */
|
||||
.long DebugMon_Handler /* Debug Monitor Handler */
|
||||
.long 0 /* Reserved */
|
||||
.long PendSV_Handler /* PendSV Handler */
|
||||
.long SysTick_Handler /* SysTick Handler */
|
||||
|
||||
/* External interrupts */
|
||||
.long DMA0_IRQHandler // DMA channel 0 transfer complete interrupt
|
||||
.long DMA1_IRQHandler // DMA channel 0 transfer complete interrupt
|
||||
.long DMA2_IRQHandler // DMA channel 0 transfer complete interrupt
|
||||
.long DMA3_IRQHandler // DMA channel 0 transfer complete interrupt
|
||||
.long DMA4_IRQHandler // DMA channel 0 transfer complete interrupt
|
||||
.long DMA5_IRQHandler // DMA channel 0 transfer complete interrupt
|
||||
.long DMA6_IRQHandler // DMA channel 0 transfer complete interrupt
|
||||
.long DMA7_IRQHandler // DMA channel 0 transfer complete interrupt
|
||||
.long DMA8_IRQHandler // DMA channel 0 transfer complete interrupt
|
||||
.long DMA9_IRQHandler // DMA channel 0 transfer complete interrupt
|
||||
.long DMA10_IRQHandler // DMA channel 0 transfer complete interrupt
|
||||
.long DMA11_IRQHandler // DMA channel 0 transfer complete interrupt
|
||||
.long DMA12_IRQHandler // DMA channel 0 transfer complete interrupt
|
||||
.long DMA13_IRQHandler // DMA channel 0 transfer complete interrupt
|
||||
.long DMA14_IRQHandler // DMA channel 0 transfer complete interrupt
|
||||
.long DMA15_IRQHandler // DMA channel 0 transfer complete interrupt
|
||||
.long DMA_Error_IRQHandler // DMA error interrupt
|
||||
.long Reserved33_IRQHandler // Reserved interrupt 33
|
||||
.long FTFL_IRQHandler // FTFL interrupt
|
||||
.long Read_Collision_IRQHandler // Read collision interrupt
|
||||
.long LVD_LVW_IRQHandler // Low Voltage Detect, Low Voltage Warning
|
||||
.long LLW_IRQHandler // Low Leakage Wakeup
|
||||
.long Watchdog_IRQHandler // WDOG interrupt
|
||||
.long Reserved39_IRQHandler // Reserved interrupt 39
|
||||
.long I2C0_IRQHandler // I2C0 interrupt
|
||||
.long I2C1_IRQHandler // I2C1 interrupt
|
||||
.long SPI0_IRQHandler // SPI0 interrupt
|
||||
.long SPI1_IRQHandler // SPI1 interrupt
|
||||
.long Reserved44_IRQHandler // Reserved interrupt 44
|
||||
.long CAN0_ORed_Message_buffer_IRQHandler // CAN0 OR'd message buffers interrupt
|
||||
.long CAN0_Bus_Off_IRQHandler // CAN0 bus off interrupt
|
||||
.long CAN0_Error_IRQHandler // CAN0 error interrupt
|
||||
.long CAN0_Tx_Warning_IRQHandler // CAN0 Tx warning interrupt
|
||||
.long CAN0_Rx_Warning_IRQHandler // CAN0 Rx warning interrupt
|
||||
.long CAN0_Wake_Up_IRQHandler // CAN0 wake up interrupt
|
||||
.long I2S0_Tx_IRQHandler // I2S0 transmit interrupt
|
||||
.long I2S0_Rx_IRQHandler // I2S0 receive interrupt
|
||||
.long Reserved53_IRQHandler // Reserved interrupt 53
|
||||
.long Reserved54_IRQHandler // Reserved interrupt 54
|
||||
.long Reserved55_IRQHandler // Reserved interrupt 55
|
||||
.long Reserved56_IRQHandler // Reserved interrupt 56
|
||||
.long Reserved57_IRQHandler // Reserved interrupt 57
|
||||
.long Reserved58_IRQHandler // Reserved interrupt 58
|
||||
.long Reserved59_IRQHandler // Reserved interrupt 59
|
||||
.long UART0_LON_IRQHandler // UART0 LON interrupt
|
||||
.long UART0_RX_TX_IRQHandler // UART0 receive/transmit interrupt
|
||||
.long UART0_ERR_IRQHandler // UART0 error interrupt
|
||||
.long UART1_RX_TX_IRQHandler // UART1 receive/transmit interrupt
|
||||
.long UART1_ERR_IRQHandler // UART1 error interrupt
|
||||
.long UART2_RX_TX_IRQHandler // UART2 receive/transmit interrupt
|
||||
.long UART2_ERR_IRQHandler // UART2 error interrupt
|
||||
.long Reserved67_IRQHandler // Reserved interrupt 67
|
||||
.long Reserved68_IRQHandler // Reserved interrupt 68
|
||||
.long Reserved69_IRQHandler // Reserved interrupt 69
|
||||
.long Reserved70_IRQHandler // Reserved interrupt 70
|
||||
.long Reserved71_IRQHandler // Reserved interrupt 71
|
||||
.long Reserved72_IRQHandler // Reserved interrupt 72
|
||||
.long ADC0_IRQHandler // ADC0 interrupt
|
||||
.long ADC1_IRQHandler // ADC1 interrupt
|
||||
.long CMP0_IRQHandler // CMP0 interrupt
|
||||
.long CMP1_IRQHandler // CMP1 interrupt
|
||||
.long CMP2_IRQHandler // CMP2 interrupt
|
||||
.long FTM0_IRQHandler // FTM0 fault, overflow and channels interrupt
|
||||
.long FTM1_IRQHandler // FTM1 fault, overflow and channels interrupt
|
||||
.long FTM2_IRQHandler // FTM2 fault, overflow and channels interrupt
|
||||
.long CMT_IRQHandler // CMT interrupt
|
||||
.long RTC_IRQHandler // RTC interrupt
|
||||
.long RTC_Seconds_IRQHandler // RTC seconds interrupt
|
||||
.long PIT0_IRQHandler // PIT timer channel 0 interrupt
|
||||
.long PIT1_IRQHandler // PIT timer channel 1 interrupt
|
||||
.long PIT2_IRQHandler // PIT timer channel 2 interrupt
|
||||
.long PIT3_IRQHandler // PIT timer channel 3 interrupt
|
||||
.long PDB0_IRQHandler // PDB0 interrupt
|
||||
.long USB0_IRQHandler // USB0 interrupt
|
||||
.long USBDCD_IRQHandler // USBDCD interrupt
|
||||
.long Reserved91_IRQHandler // Reserved interrupt 91
|
||||
.long Reserved92_IRQHandler // Reserved interrupt 92
|
||||
.long Reserved93_IRQHandler // Reserved interrupt 93
|
||||
.long Reserved94_IRQHandler // Reserved interrupt 94
|
||||
.long Reserved95_IRQHandler // Reserved interrupt 95
|
||||
.long Reserved96_IRQHandler // Reserved interrupt 96
|
||||
.long DAC0_IRQHandler // DAC0 interrupt
|
||||
.long Reserved98_IRQHandler // Reserved interrupt 98
|
||||
.long TSI0_IRQHandler // TSI0 interrupt
|
||||
.long MCG_IRQHandler // MCG interrupt
|
||||
.long LPTimer_IRQHandler // LPTimer interrupt
|
||||
.long Reserved102_IRQHandler // Reserved interrupt 102
|
||||
.long PORTA_IRQHandler // Port A interrupt
|
||||
.long PORTB_IRQHandler // Port B interrupt
|
||||
.long PORTC_IRQHandler // Port C interrupt
|
||||
.long PORTD_IRQHandler // Port D interrupt
|
||||
.long PORTE_IRQHandler // Port E interrupt
|
||||
.long Reserved108_IRQHandler // Reserved interrupt 108
|
||||
.long Reserved109_IRQHandler // Reserved interrupt 109
|
||||
.long SWI_IRQHandler // Software interrupt
|
||||
|
||||
.size __isr_vector, . - __isr_vector
|
||||
|
||||
.section .text.Reset_Handler
|
||||
.thumb
|
||||
.thumb_func
|
||||
.align 2
|
||||
.globl Reset_Handler
|
||||
.type Reset_Handler, %function
|
||||
Reset_Handler:
|
||||
/*
|
||||
* Call SystemInit before loading the .data section to prevent the watchdog
|
||||
* from resetting the board.
|
||||
*/
|
||||
ldr r0, =SystemInit
|
||||
blx r0
|
||||
|
||||
/* Loop to copy data from read only memory to RAM. The ranges
|
||||
* of copy from/to are specified by following symbols evaluated in
|
||||
* linker script.
|
||||
* __etext: End of code section, i.e., begin of data sections to copy from.
|
||||
* __data_start__/__data_end__: RAM address range that data should be
|
||||
* copied to. Both must be aligned to 4 bytes boundary. */
|
||||
|
||||
ldr r1, =__etext
|
||||
ldr r2, =__data_start__
|
||||
ldr r3, =__data_end__
|
||||
|
||||
.Lflash_to_ram_loop:
|
||||
cmp r2, r3
|
||||
ittt lt
|
||||
ldrlt r0, [r1], #4
|
||||
strlt r0, [r2], #4
|
||||
blt .Lflash_to_ram_loop
|
||||
|
||||
.Lflash_to_ram_loop_end:
|
||||
|
||||
ldr r0, =_start
|
||||
bx r0
|
||||
.pool
|
||||
.size Reset_Handler, . - Reset_Handler
|
||||
|
||||
.text
|
||||
/* Macro to define default handlers. Default handler
|
||||
* will be weak symbol and just dead loops. They can be
|
||||
* overwritten by other handlers */
|
||||
.macro def_default_handler handler_name
|
||||
.align 1
|
||||
.thumb_func
|
||||
.weak \handler_name
|
||||
.type \handler_name, %function
|
||||
\handler_name :
|
||||
b .
|
||||
.size \handler_name, . - \handler_name
|
||||
.endm
|
||||
|
||||
def_default_handler NMI_Handler
|
||||
def_default_handler HardFault_Handler
|
||||
def_default_handler MemManage_Handler
|
||||
def_default_handler BusFault_Handler
|
||||
def_default_handler UsageFault_Handler
|
||||
def_default_handler SVC_Handler
|
||||
def_default_handler DebugMon_Handler
|
||||
def_default_handler PendSV_Handler
|
||||
def_default_handler SysTick_Handler
|
||||
def_default_handler Default_Handler
|
||||
|
||||
.macro def_irq_default_handler handler_name
|
||||
.weak \handler_name
|
||||
.set \handler_name, Default_Handler
|
||||
.endm
|
||||
|
||||
|
||||
def_irq_default_handler DMA0_IRQHandler
|
||||
def_irq_default_handler DMA1_IRQHandler
|
||||
def_irq_default_handler DMA2_IRQHandler
|
||||
def_irq_default_handler DMA3_IRQHandler
|
||||
def_irq_default_handler DMA4_IRQHandler
|
||||
def_irq_default_handler DMA5_IRQHandler
|
||||
def_irq_default_handler DMA6_IRQHandler
|
||||
def_irq_default_handler DMA7_IRQHandler
|
||||
def_irq_default_handler DMA8_IRQHandler
|
||||
def_irq_default_handler DMA9_IRQHandler
|
||||
def_irq_default_handler DMA10_IRQHandler
|
||||
def_irq_default_handler DMA11_IRQHandler
|
||||
def_irq_default_handler DMA12_IRQHandler
|
||||
def_irq_default_handler DMA13_IRQHandler
|
||||
def_irq_default_handler DMA14_IRQHandler
|
||||
def_irq_default_handler DMA15_IRQHandler
|
||||
def_irq_default_handler DMA_Error_IRQHandler
|
||||
def_irq_default_handler Reserved33_IRQHandler
|
||||
def_irq_default_handler FTFL_IRQHandler
|
||||
def_irq_default_handler Read_Collision_IRQHandler
|
||||
def_irq_default_handler LVD_LVW_IRQHandler
|
||||
def_irq_default_handler LLW_IRQHandler
|
||||
def_irq_default_handler Watchdog_IRQHandler
|
||||
def_irq_default_handler Reserved39_IRQHandler
|
||||
def_irq_default_handler I2C0_IRQHandler
|
||||
def_irq_default_handler I2C1_IRQHandler
|
||||
def_irq_default_handler SPI0_IRQHandler
|
||||
def_irq_default_handler SPI1_IRQHandler
|
||||
def_irq_default_handler Reserved44_IRQHandler
|
||||
def_irq_default_handler CAN0_ORed_Message_buffer_IRQHandler
|
||||
def_irq_default_handler CAN0_Bus_Off_IRQHandler
|
||||
def_irq_default_handler CAN0_Error_IRQHandler
|
||||
def_irq_default_handler CAN0_Tx_Warning_IRQHandler
|
||||
def_irq_default_handler CAN0_Rx_Warning_IRQHandler
|
||||
def_irq_default_handler CAN0_Wake_Up_IRQHandler
|
||||
def_irq_default_handler I2S0_Tx_IRQHandler
|
||||
def_irq_default_handler I2S0_Rx_IRQHandler
|
||||
def_irq_default_handler Reserved53_IRQHandler
|
||||
def_irq_default_handler Reserved54_IRQHandler
|
||||
def_irq_default_handler Reserved55_IRQHandler
|
||||
def_irq_default_handler Reserved56_IRQHandler
|
||||
def_irq_default_handler Reserved57_IRQHandler
|
||||
def_irq_default_handler Reserved58_IRQHandler
|
||||
def_irq_default_handler Reserved59_IRQHandler
|
||||
def_irq_default_handler UART0_LON_IRQHandler
|
||||
def_irq_default_handler UART0_RX_TX_IRQHandler
|
||||
def_irq_default_handler UART0_ERR_IRQHandler
|
||||
def_irq_default_handler UART1_RX_TX_IRQHandler
|
||||
def_irq_default_handler UART1_ERR_IRQHandler
|
||||
def_irq_default_handler UART2_RX_TX_IRQHandler
|
||||
def_irq_default_handler UART2_ERR_IRQHandler
|
||||
def_irq_default_handler Reserved67_IRQHandler
|
||||
def_irq_default_handler Reserved68_IRQHandler
|
||||
def_irq_default_handler Reserved69_IRQHandler
|
||||
def_irq_default_handler Reserved70_IRQHandler
|
||||
def_irq_default_handler Reserved71_IRQHandler
|
||||
def_irq_default_handler Reserved72_IRQHandler
|
||||
def_irq_default_handler ADC0_IRQHandler
|
||||
def_irq_default_handler ADC1_IRQHandler
|
||||
def_irq_default_handler CMP0_IRQHandler
|
||||
def_irq_default_handler CMP1_IRQHandler
|
||||
def_irq_default_handler CMP2_IRQHandler
|
||||
def_irq_default_handler FTM0_IRQHandler
|
||||
def_irq_default_handler FTM1_IRQHandler
|
||||
def_irq_default_handler FTM2_IRQHandler
|
||||
def_irq_default_handler CMT_IRQHandler
|
||||
def_irq_default_handler RTC_IRQHandler
|
||||
def_irq_default_handler RTC_Seconds_IRQHandler
|
||||
def_irq_default_handler PIT0_IRQHandler
|
||||
def_irq_default_handler PIT1_IRQHandler
|
||||
def_irq_default_handler PIT2_IRQHandler
|
||||
def_irq_default_handler PIT3_IRQHandler
|
||||
def_irq_default_handler PDB0_IRQHandler
|
||||
def_irq_default_handler USB0_IRQHandler
|
||||
def_irq_default_handler USBDCD_IRQHandler
|
||||
def_irq_default_handler Reserved91_IRQHandler
|
||||
def_irq_default_handler Reserved92_IRQHandler
|
||||
def_irq_default_handler Reserved93_IRQHandler
|
||||
def_irq_default_handler Reserved94_IRQHandler
|
||||
def_irq_default_handler Reserved95_IRQHandler
|
||||
def_irq_default_handler Reserved96_IRQHandler
|
||||
def_irq_default_handler DAC0_IRQHandler
|
||||
def_irq_default_handler Reserved98_IRQHandler
|
||||
def_irq_default_handler TSI0_IRQHandler
|
||||
def_irq_default_handler MCG_IRQHandler
|
||||
def_irq_default_handler LPTimer_IRQHandler
|
||||
def_irq_default_handler Reserved102_IRQHandler
|
||||
def_irq_default_handler PORTA_IRQHandler
|
||||
def_irq_default_handler PORTB_IRQHandler
|
||||
def_irq_default_handler PORTC_IRQHandler
|
||||
def_irq_default_handler PORTD_IRQHandler
|
||||
def_irq_default_handler PORTE_IRQHandler
|
||||
def_irq_default_handler Reserved108_IRQHandler
|
||||
def_irq_default_handler Reserved109_IRQHandler
|
||||
def_irq_default_handler SWI_IRQHandler
|
||||
def_irq_default_handler DefaultISR
|
||||
|
||||
/* Flash protection region, placed at 0x400 */
|
||||
.text
|
||||
.thumb
|
||||
.align 2
|
||||
.section .kinetis_flash_config_field,"a",%progbits
|
||||
kinetis_flash_config:
|
||||
.long 0xffffffff
|
||||
.long 0xffffffff
|
||||
.long 0xffffffff
|
||||
.long 0xfffffffe
|
||||
|
||||
.end
|
|
@ -1,13 +0,0 @@
|
|||
/* mbed Microcontroller Library - CMSIS
|
||||
* Copyright (C) 2009-2015 ARM Limited. All rights reserved.
|
||||
*
|
||||
* A generic CMSIS include header, pulling in LPC11U24 specifics
|
||||
*/
|
||||
|
||||
#ifndef MBED_CMSIS_H
|
||||
#define MBED_CMSIS_H
|
||||
|
||||
#include "MK20DX256.h"
|
||||
#include "cmsis_nvic.h"
|
||||
|
||||
#endif
|
|
@ -1,37 +0,0 @@
|
|||
/* mbed Microcontroller Library
|
||||
*******************************************************************************
|
||||
* Copyright (c) 2015 ARM Limited. All rights reserved.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
* this list of conditions and the following disclaimer in the documentation
|
||||
* and/or other materials provided with the distribution.
|
||||
* 3. Neither the name of ARM Limited 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 HOLDER 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 MBED_CMSIS_NVIC_H
|
||||
#define MBED_CMSIS_NVIC_H
|
||||
|
||||
#define NVIC_NUM_VECTORS (16 + 95) // CORE + MCU Peripherals
|
||||
#define NVIC_RAM_VECTOR_ADDRESS 0x1FFF8000 // Vectors positioned at start of RAM
|
||||
|
||||
#endif
|
|
@ -1,280 +0,0 @@
|
|||
/*
|
||||
** ###################################################################
|
||||
** Compilers: ARM Compiler
|
||||
** Freescale C/C++ for Embedded ARM
|
||||
** GNU C Compiler
|
||||
** IAR ANSI C/C++ Compiler for ARM
|
||||
**
|
||||
**
|
||||
**
|
||||
** Version: rev. 1.0, 2011-12-15
|
||||
**
|
||||
** Abstract:
|
||||
** Provides a system configuration function and a global variable that
|
||||
** contains the system frequency. It configures the device and initializes
|
||||
** the oscillator (PLL) that is part of the microcontroller device.
|
||||
**
|
||||
** Copyright: 2015 Freescale Semiconductor, Inc. All Rights Reserved.
|
||||
**
|
||||
** http: www.freescale.com
|
||||
** mail: support@freescale.com
|
||||
**
|
||||
** Revisions:
|
||||
** - rev. 1.0 (2011-12-15)
|
||||
** Initial version
|
||||
**
|
||||
** ###################################################################
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file MK20DX256
|
||||
* @version 1.0
|
||||
* @date 2011-12-15
|
||||
* @brief Device specific configuration file for MK20DX256 (implementation file)
|
||||
*
|
||||
* Provides a system configuration function and a global variable that contains
|
||||
* the system frequency. It configures the device and initializes the oscillator
|
||||
* (PLL) that is part of the microcontroller device.
|
||||
*/
|
||||
|
||||
#include <stdint.h>
|
||||
#include "MK20DX256.h"
|
||||
|
||||
#define DISABLE_WDOG 1
|
||||
|
||||
#define CLOCK_SETUP 1
|
||||
/* Predefined clock setups
|
||||
0 ... Multipurpose Clock Generator (MCG) in FLL Engaged Internal (FEI) mode
|
||||
Reference clock source for MCG module is the slow internal clock source 32.768kHz
|
||||
Core clock = 41.94MHz, BusClock = 41.94MHz
|
||||
Works on Teensy3.1 but no USB support
|
||||
1 ... Multipurpose Clock Generator (MCG) in PLL Engaged External (PEE) mode
|
||||
Reference clock source for MCG module is an external crystal 16MHz
|
||||
Core clock = 96MHz, BusClock = 48MHz
|
||||
Default high speed Teensy3.1 96Mhz set up
|
||||
2 ... Multipurpose Clock Generator (MCG) in PLL Engaged External (PEE) mode
|
||||
Reference clock source for MCG module is an external crystal 16MHz
|
||||
Core clock = 72MHz, BusClock = 36MHz
|
||||
Alternative standard 'slower' Teensy3.1 72Mhz set up
|
||||
*/
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
Define clock source values
|
||||
*----------------------------------------------------------------------------*/
|
||||
#if (CLOCK_SETUP == 0)
|
||||
#define CPU_XTAL_CLK_HZ 8000000u /* Value of the external crystal or oscillator clock frequency in Hz */
|
||||
#define CPU_XTAL32k_CLK_HZ 32768u /* Value of the external 32k crystal or oscillator clock frequency in Hz */
|
||||
#define CPU_INT_SLOW_CLK_HZ 32768u /* Value of the slow internal oscillator clock frequency in Hz */
|
||||
#define CPU_INT_FAST_CLK_HZ 4000000u /* Value of the fast internal oscillator clock frequency in Hz */
|
||||
#define DEFAULT_SYSTEM_CLOCK 41943040u /* Default System clock value */
|
||||
#elif (CLOCK_SETUP == 1)
|
||||
#define CPU_XTAL_CLK_HZ 16000000u /* Value of the external crystal or oscillator clock frequency in Hz */
|
||||
#define CPU_XTAL32k_CLK_HZ 32768u /* Value of the external 32k crystal or oscillator clock frequency in Hz */
|
||||
#define CPU_INT_SLOW_CLK_HZ 32768u /* Value of the slow internal oscillator clock frequency in Hz */
|
||||
#define CPU_INT_FAST_CLK_HZ 4000000u /* Value of the fast internal oscillator clock frequency in Hz */
|
||||
#define DEFAULT_SYSTEM_CLOCK 96000000u /* Default System clock value */
|
||||
#elif (CLOCK_SETUP == 2)
|
||||
#define CPU_XTAL_CLK_HZ 16000000u /* Value of the external crystal or oscillator clock frequency in Hz */
|
||||
#define CPU_XTAL32k_CLK_HZ 32768u /* Value of the external 32k crystal or oscillator clock frequency in Hz */
|
||||
#define CPU_INT_SLOW_CLK_HZ 32768u /* Value of the slow internal oscillator clock frequency in Hz */
|
||||
#define CPU_INT_FAST_CLK_HZ 4000000u /* Value of the fast internal oscillator clock frequency in Hz */
|
||||
#define DEFAULT_SYSTEM_CLOCK 72000000u /* Default System clock value */
|
||||
#endif /* (CLOCK_SETUP == 2) */
|
||||
|
||||
|
||||
/* ----------------------------------------------------------------------------
|
||||
-- Core clock
|
||||
---------------------------------------------------------------------------- */
|
||||
|
||||
uint32_t SystemCoreClock = DEFAULT_SYSTEM_CLOCK;
|
||||
|
||||
/* ----------------------------------------------------------------------------
|
||||
-- SystemInit()
|
||||
---------------------------------------------------------------------------- */
|
||||
void SystemInit (void) {
|
||||
/* SystemInit MUST NOT use any variables from the .data section, as this section is not loaded yet! */
|
||||
|
||||
#if (DISABLE_WDOG)
|
||||
/* Disable the WDOG module */
|
||||
/* WDOG_UNLOCK: WDOGUNLOCK=0xC520 */
|
||||
WDOG->UNLOCK = (uint16_t)0xC520u; /* Key 1 */
|
||||
/* WDOG_UNLOCK : WDOGUNLOCK=0xD928 */
|
||||
WDOG->UNLOCK = (uint16_t)0xD928u; /* Key 2 */
|
||||
/* WDOG_STCTRLH: DISTESTWDOG=0,BYTESEL=0,TESTSEL=0,TESTWDOG=0,STNDBYEN=1,WAITEN=1,STOPEN=1,DBGEN=0,ALLOWUPDATE=1,WINEN=0,IRQRSTEN=0,CLKSRC=1,WDOGEN=0 */
|
||||
WDOG->STCTRLH = (uint16_t)0x01D2u;
|
||||
#endif /* (DISABLE_WDOG) */
|
||||
|
||||
#if (CLOCK_SETUP == 0)
|
||||
/* SIM->CLKDIV1: OUTDIV1=0,OUTDIV2=0,OUTDIV4=1 Set Prescalers 41.94MHz cpu, 41.94MHz system, 20.97MHz flash*/
|
||||
SIM->CLKDIV1 = SIM_CLKDIV1_OUTDIV4(1);
|
||||
/* Switch to FEI Mode */
|
||||
/* MCG->C1: CLKS=0,FRDIV=0,IREFS=1,IRCLKEN=1,IREFSTEN=0 */
|
||||
MCG->C1 = MCG_C1_IREFS_MASK | MCG_C1_IRCLKEN_MASK;
|
||||
/* MCG->C2: LOCKRE0=0,RANGE0=0,HGO=0,EREFS=0,LP=0,IRCS=0 */
|
||||
MCG->C2 = (uint8_t)0x00u;
|
||||
/* MCG_C4: DMX32=0,DRST_DRS=1 */
|
||||
MCG->C4 = (uint8_t)((MCG->C4 & (uint8_t)~(uint8_t)0xC0u) | (uint8_t)0x20u);
|
||||
/* MCG->C5: PLLCLKEN=0,PLLSTEN=0,PRDIV0=0 */
|
||||
MCG->C5 = (uint8_t)0x00u;
|
||||
/* MCG->C6: LOLIE=0,PLLS=0,CME=0,VDIV0=0 */
|
||||
MCG->C6 = (uint8_t)0x00u;
|
||||
while((MCG->S & MCG_S_IREFST_MASK) == 0u) { } /* Check that the source of the FLL reference clock is the internal reference clock. */
|
||||
while((MCG->S & 0x0Cu) != 0x00u) { } /* Wait until output of the FLL is selected */
|
||||
|
||||
#elif (CLOCK_SETUP == 1)
|
||||
/* SIM->CLKDIV1: OUTDIV1=0,OUTDIV2=1,OUTDIV4=3 Set Prescalers 96MHz cpu, 48MHz bus, 24MHz flash*/
|
||||
SIM->CLKDIV1 = SIM_CLKDIV1_OUTDIV1(0) | SIM_CLKDIV1_OUTDIV2(1) | SIM_CLKDIV1_OUTDIV4(3);
|
||||
/* SIM->CLKDIV2: USBDIV=2, Divide 96MHz system clock for USB 48MHz */
|
||||
SIM->CLKDIV2 = SIM_CLKDIV2_USBDIV(1);
|
||||
/* OSC0->CR: ERCLKEN=0,EREFSTEN=0,SC2P=1,SC4P=0,SC8P=1,SC16P=0 10pF loading capacitors for 16MHz system oscillator*/
|
||||
OSC0->CR = OSC_CR_SC8P_MASK | OSC_CR_SC2P_MASK;
|
||||
/* Switch to FBE Mode */
|
||||
/* MCG->C7: OSCSEL=0 */
|
||||
MCG->C7 = (uint8_t)0x00u;
|
||||
/* MCG->C2: LOCKRE0=0,RANGE0=2,HGO=0,EREFS=1,LP=0,IRCS=0 */
|
||||
MCG->C2 = MCG_C2_RANGE0(2) | MCG_C2_EREFS0_MASK;
|
||||
//MCG->C2 = (uint8_t)0x24u;
|
||||
/* MCG->C1: CLKS=2,FRDIV=3,IREFS=0,IRCLKEN=1,IREFSTEN=0 */
|
||||
MCG->C1 = MCG_C1_CLKS(2) | MCG_C1_FRDIV(3) | MCG_C1_IRCLKEN_MASK;
|
||||
/* MCG->C4: DMX32=0,DRST_DRS=0,FCTRIM=0,SCFTRIM=0 */
|
||||
MCG->C4 &= (uint8_t)~(uint8_t)0xE0u;
|
||||
/* MCG->C5: PLLCLKEN=0,PLLSTEN=0,PRDIV0=7 */
|
||||
MCG->C5 = MCG_C5_PRDIV0(7);
|
||||
/* MCG->C6: LOLIE=0,PLLS=0,CME=0,VDIV0=0 */
|
||||
MCG->C6 = (uint8_t)0x00u;
|
||||
while((MCG->S & MCG_S_OSCINIT0_MASK) == 0u) { } /* Check that the oscillator is running */
|
||||
while((MCG->S & 0x0Cu) != 0x08u) { } /* Wait until external reference clock is selected as MCG output */
|
||||
/* Switch to PBE Mode */
|
||||
/* MCG_C5: PLLCLKEN=0,PLLSTEN=0,PRDIV0=5 */
|
||||
MCG->C5 = MCG_C5_PRDIV0(3); // config PLL input for 16 MHz Crystal / 4 = 4 MHz
|
||||
/* MCG->C6: LOLIE=0,PLLS=1,CME=0,VDIV0=3 */
|
||||
MCG->C6 = MCG_C6_PLLS_MASK | MCG_C6_VDIV0(0);// config PLL for 96 MHz output
|
||||
while((MCG->S & MCG_S_PLLST_MASK) == 0u) { } /* Wait until the source of the PLLS clock has switched to the PLL */
|
||||
while((MCG->S & MCG_S_LOCK0_MASK) == 0u) { } /* Wait until locked */
|
||||
/* Switch to PEE Mode */
|
||||
/* MCG->C1: CLKS=0,FRDIV=2,IREFS=0,IRCLKEN=1,IREFSTEN=0 */
|
||||
MCG->C1 = MCG_C1_FRDIV(2) | MCG_C1_IRCLKEN_MASK;
|
||||
while((MCG->S & 0x0Cu) != 0x0Cu) { } /* Wait until output of the PLL is selected */
|
||||
while((MCG->S & MCG_S_LOCK0_MASK) == 0u) { } /* Wait until locked */
|
||||
|
||||
#elif (CLOCK_SETUP == 2)
|
||||
/* SIM->CLKDIV1: OUTDIV1=0,OUTDIV2=0,OUTDIV4=1 Set Prescalers 72MHz cpu, 36MHz bus, 24MHz flash*/
|
||||
SIM->CLKDIV1 = SIM_CLKDIV1_OUTDIV2(1) | SIM_CLKDIV1_OUTDIV4(2);
|
||||
/* SIM->CLKDIV2: USBDIV=2,USBFRAC=1 Divide 72MHz system clock for USB 48MHz */
|
||||
SIM->CLKDIV2 = SIM_CLKDIV2_USBDIV(2) | SIM_CLKDIV2_USBFRAC_MASK;
|
||||
/* OSC0->CR: ERCLKEN=0,EREFSTEN=0,SC2P=1,SC4P=0,SC8P=1,SC16P=0 10pF loading capacitors for 16MHz system oscillator*/
|
||||
OSC0->CR = OSC_CR_SC8P_MASK | OSC_CR_SC2P_MASK;
|
||||
/* Switch to FBE Mode */
|
||||
/* MCG->C7: OSCSEL=0 */
|
||||
MCG->C7 = (uint8_t)0x00u;
|
||||
/* MCG->C2: LOCKRE0=0,RANGE0=2,HGO=0,EREFS=1,LP=0,IRCS=0 */
|
||||
MCG->C2 = MCG_C2_RANGE0(2) | MCG_C2_EREFS0_MASK;
|
||||
//MCG->C2 = (uint8_t)0x24u;
|
||||
/* MCG->C1: CLKS=2,FRDIV=3,IREFS=0,IRCLKEN=1,IREFSTEN=0 */
|
||||
MCG->C1 = MCG_C1_CLKS(2) | MCG_C1_FRDIV(3) | MCG_C1_IRCLKEN_MASK;
|
||||
/* MCG->C4: DMX32=0,DRST_DRS=0,FCTRIM=0,SCFTRIM=0 */
|
||||
MCG->C4 &= (uint8_t)~(uint8_t)0xE0u;
|
||||
/* MCG->C5: PLLCLKEN=0,PLLSTEN=0,PRDIV0=7 */
|
||||
MCG->C5 = MCG_C5_PRDIV0(7);
|
||||
/* MCG->C6: LOLIE=0,PLLS=0,CME=0,VDIV0=0 */
|
||||
MCG->C6 = (uint8_t)0x00u;
|
||||
while((MCG->S & MCG_S_OSCINIT0_MASK) == 0u) { } /* Check that the oscillator is running */
|
||||
while((MCG->S & 0x0Cu) != 0x08u) { } /* Wait until external reference clock is selected as MCG output */
|
||||
/* Switch to PBE Mode */
|
||||
/* MCG_C5: PLLCLKEN=0,PLLSTEN=0,PRDIV0=5 */
|
||||
MCG->C5 = MCG_C5_PRDIV0(5);
|
||||
/* MCG->C6: LOLIE=0,PLLS=1,CME=0,VDIV0=3 */
|
||||
MCG->C6 = MCG_C6_PLLS_MASK | MCG_C6_VDIV0(3);
|
||||
while((MCG->S & MCG_S_PLLST_MASK) == 0u) { } /* Wait until the source of the PLLS clock has switched to the PLL */
|
||||
while((MCG->S & MCG_S_LOCK0_MASK) == 0u) { } /* Wait until locked */
|
||||
/* Switch to PEE Mode */
|
||||
/* MCG->C1: CLKS=0,FRDIV=2,IREFS=0,IRCLKEN=1,IREFSTEN=0 */
|
||||
MCG->C1 = MCG_C1_FRDIV(2) | MCG_C1_IRCLKEN_MASK;
|
||||
while((MCG->S & 0x0Cu) != 0x0Cu) { } /* Wait until output of the PLL is selected */
|
||||
while((MCG->S & MCG_S_LOCK0_MASK) == 0u) { } /* Wait until locked */
|
||||
#endif /* (CLOCK_SETUP) */
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------------------
|
||||
-- SystemCoreClockUpdate()
|
||||
---------------------------------------------------------------------------- */
|
||||
|
||||
void SystemCoreClockUpdate (void) {
|
||||
uint32_t MCGOUTClock; /* Variable to store output clock frequency of the MCG module */
|
||||
uint8_t Divider;
|
||||
|
||||
if ((MCG->C1 & MCG_C1_CLKS_MASK) == 0x0u) {
|
||||
/* Output of FLL or PLL is selected */
|
||||
if ((MCG->C6 & MCG_C6_PLLS_MASK) == 0x0u) {
|
||||
/* FLL is selected */
|
||||
if ((MCG->C1 & MCG_C1_IREFS_MASK) == 0x0u) {
|
||||
/* External reference clock is selected */
|
||||
if ((MCG->C7 & MCG_C7_OSCSEL_MASK) == 0x0u) {
|
||||
MCGOUTClock = CPU_XTAL_CLK_HZ; /* System oscillator drives MCG clock */
|
||||
} else { /* (!((MCG->C7 & MCG_C7_OSCSEL_MASK) == 0x0u)) */
|
||||
MCGOUTClock = CPU_XTAL32k_CLK_HZ; /* RTC 32 kHz oscillator drives MCG clock */
|
||||
} /* (!((MCG->C7 & MCG_C7_OSCSEL_MASK) == 0x0u)) */
|
||||
Divider = (uint8_t)(1u << ((MCG->C1 & MCG_C1_FRDIV_MASK) >> MCG_C1_FRDIV_SHIFT));
|
||||
MCGOUTClock = (MCGOUTClock / Divider); /* Calculate the divided FLL reference clock */
|
||||
if ((MCG->C2 & MCG_C2_RANGE0_MASK) != 0x0u) {
|
||||
MCGOUTClock /= 32u; /* If high range is enabled, additional 32 divider is active */
|
||||
} /* ((MCG->C2 & MCG_C2_RANGE0_MASK) != 0x0u) */
|
||||
} else { /* (!((MCG->C1 & MCG_C1_IREFS_MASK) == 0x0u)) */
|
||||
MCGOUTClock = CPU_INT_SLOW_CLK_HZ; /* The slow internal reference clock is selected */
|
||||
} /* (!((MCG->C1 & MCG_C1_IREFS_MASK) == 0x0u)) */
|
||||
/* Select correct multiplier to calculate the MCG output clock */
|
||||
switch (MCG->C4 & (MCG_C4_DMX32_MASK | MCG_C4_DRST_DRS_MASK)) {
|
||||
case 0x0u:
|
||||
MCGOUTClock *= 640u;
|
||||
break;
|
||||
case 0x20u:
|
||||
MCGOUTClock *= 1280u;
|
||||
break;
|
||||
case 0x40u:
|
||||
MCGOUTClock *= 1920u;
|
||||
break;
|
||||
case 0x60u:
|
||||
MCGOUTClock *= 2560u;
|
||||
break;
|
||||
case 0x80u:
|
||||
MCGOUTClock *= 732u;
|
||||
break;
|
||||
case 0xA0u:
|
||||
MCGOUTClock *= 1464u;
|
||||
break;
|
||||
case 0xC0u:
|
||||
MCGOUTClock *= 2197u;
|
||||
break;
|
||||
case 0xE0u:
|
||||
MCGOUTClock *= 2929u;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
} else { /* (!((MCG->C6 & MCG_C6_PLLS_MASK) == 0x0u)) */
|
||||
/* PLL is selected */
|
||||
Divider = (1u + (MCG->C5 & MCG_C5_PRDIV0_MASK));
|
||||
MCGOUTClock = (uint32_t)(CPU_XTAL_CLK_HZ / Divider); /* Calculate the PLL reference clock */
|
||||
Divider = ((MCG->C6 & MCG_C6_VDIV0_MASK) + 24u);
|
||||
MCGOUTClock *= Divider; /* Calculate the MCG output clock */
|
||||
} /* (!((MCG->C6 & MCG_C6_PLLS_MASK) == 0x0u)) */
|
||||
} else if ((MCG->C1 & MCG_C1_CLKS_MASK) == 0x40u) {
|
||||
/* Internal reference clock is selected */
|
||||
if ((MCG->C2 & MCG_C2_IRCS_MASK) == 0x0u) {
|
||||
MCGOUTClock = CPU_INT_SLOW_CLK_HZ; /* Slow internal reference clock selected */
|
||||
} else { /* (!((MCG->C2 & MCG_C2_IRCS_MASK) == 0x0u)) */
|
||||
MCGOUTClock = CPU_INT_FAST_CLK_HZ / (1 << ((MCG->SC & MCG_SC_FCRDIV_MASK) >> MCG_SC_FCRDIV_SHIFT)); /* Fast internal reference clock selected */
|
||||
} /* (!((MCG->C2 & MCG_C2_IRCS_MASK) == 0x0u)) */
|
||||
} else if ((MCG->C1 & MCG_C1_CLKS_MASK) == 0x80u) {
|
||||
/* External reference clock is selected */
|
||||
if ((MCG->C7 & MCG_C7_OSCSEL_MASK) == 0x0u) {
|
||||
MCGOUTClock = CPU_XTAL_CLK_HZ; /* System oscillator drives MCG clock */
|
||||
} else { /* (!((MCG->C7 & MCG_C7_OSCSEL_MASK) == 0x0u)) */
|
||||
MCGOUTClock = CPU_XTAL32k_CLK_HZ; /* RTC 32 kHz oscillator drives MCG clock */
|
||||
} /* (!((MCG->C7 & MCG_C7_OSCSEL_MASK) == 0x0u)) */
|
||||
} else { /* (!((MCG->C1 & MCG_C1_CLKS_MASK) == 0x80u)) */
|
||||
/* Reserved value */
|
||||
return;
|
||||
} /* (!((MCG->C1 & MCG_C1_CLKS_MASK) == 0x80u)) */
|
||||
SystemCoreClock = (MCGOUTClock / (1u + ((SIM->CLKDIV1 & SIM_CLKDIV1_OUTDIV1_MASK) >> SIM_CLKDIV1_OUTDIV1_SHIFT)));
|
||||
}
|
|
@ -1,85 +0,0 @@
|
|||
/*
|
||||
** ###################################################################
|
||||
** Compilers: ARM Compiler
|
||||
** Freescale C/C++ for Embedded ARM
|
||||
** GNU C Compiler
|
||||
** IAR ANSI C/C++ Compiler for ARM
|
||||
**
|
||||
**
|
||||
**
|
||||
** Version: rev. 2.0, 2012-03-19
|
||||
**
|
||||
** Abstract:
|
||||
** Provides a system configuration function and a global variable that
|
||||
** contains the system frequency. It configures the device and initializes
|
||||
** the oscillator (PLL) that is part of the microcontroller device.
|
||||
**
|
||||
** Copyright: 2015 Freescale Semiconductor, Inc. All Rights Reserved.
|
||||
**
|
||||
** http: www.freescale.com
|
||||
** mail: support@freescale.com
|
||||
**
|
||||
** Revisions:
|
||||
** - rev. 1.0 (2011-12-15)
|
||||
** Initial version
|
||||
** - rev. 2.0 (2012-03-19)
|
||||
** PDB Peripheral register structure updated.
|
||||
** DMA Registers and bits for unsupported DMA channels removed.
|
||||
**
|
||||
** ###################################################################
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file MK20DX256
|
||||
* @version 2.0
|
||||
* @date 2012-03-19
|
||||
* @brief Device specific configuration file for MK20DX256 (header file)
|
||||
*
|
||||
* Provides a system configuration function and a global variable that contains
|
||||
* the system frequency. It configures the device and initializes the oscillator
|
||||
* (PLL) that is part of the microcontroller device.
|
||||
*/
|
||||
|
||||
#ifndef SYSTEM_MK20DX256_H_
|
||||
#define SYSTEM_MK20DX256_H_ /**< Symbol preventing repeated inclusion */
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
/**
|
||||
* @brief System clock frequency (core clock)
|
||||
*
|
||||
* The system clock frequency supplied to the SysTick timer and the processor
|
||||
* core clock. This variable can be used by the user application to setup the
|
||||
* SysTick timer or configure other parameters. It may also be used by debugger to
|
||||
* query the frequency of the debug timer or configure the trace clock speed
|
||||
* SystemCoreClock is initialized with a correct predefined value.
|
||||
*/
|
||||
extern uint32_t SystemCoreClock;
|
||||
|
||||
/**
|
||||
* @brief Setup the microcontroller system.
|
||||
*
|
||||
* Typically this function configures the oscillator (PLL) that is part of the
|
||||
* microcontroller device. For systems with variable clock speed it also updates
|
||||
* the variable SystemCoreClock. SystemInit is called from startup_device file.
|
||||
*/
|
||||
void SystemInit (void);
|
||||
|
||||
/**
|
||||
* @brief Updates the SystemCoreClock variable.
|
||||
*
|
||||
* It must be called whenever the core clock is changed during program
|
||||
* execution. SystemCoreClockUpdate() evaluates the clock register settings and calculates
|
||||
* the current core clock.
|
||||
*/
|
||||
void SystemCoreClockUpdate (void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* #if !defined(SYSTEM_MK20DX256_H_) */
|
|
@ -1,88 +0,0 @@
|
|||
/* mbed Microcontroller Library
|
||||
* Copyright (c) 2006-2015 ARM Limited
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
#include <stddef.h>
|
||||
#include "us_ticker_api.h"
|
||||
#include "PeripheralNames.h"
|
||||
#include "clk_freqs.h"
|
||||
|
||||
static int us_ticker_inited = 0;
|
||||
|
||||
void us_ticker_init(void) {
|
||||
if (us_ticker_inited)
|
||||
return;
|
||||
us_ticker_inited = 1;
|
||||
|
||||
SIM->SCGC6 |= SIM_SCGC6_PIT_MASK; // Clock PIT
|
||||
PIT->MCR = 0; // Enable PIT
|
||||
|
||||
//Timer on PIT0+1, ticker on PIT 2+3
|
||||
//Init timer
|
||||
PIT->CHANNEL[1].LDVAL = 0xFFFFFFFF;
|
||||
PIT->CHANNEL[1].TCTRL = PIT_TCTRL_CHN_MASK | PIT_TCTRL_TEN_MASK; // Start timer 1, chained to timer 0
|
||||
|
||||
// Use channel 0 as a prescaler for channel 1
|
||||
uint32_t ldval = (bus_frequency() + 500000) / 1000000 - 1;
|
||||
PIT->CHANNEL[0].LDVAL = ldval;
|
||||
PIT->CHANNEL[0].TCTRL = PIT_TCTRL_TEN_MASK; // Start timer
|
||||
|
||||
//Init ticker
|
||||
PIT->CHANNEL[2].LDVAL = ldval;
|
||||
PIT->CHANNEL[2].TCTRL = PIT_TCTRL_TEN_MASK; // Start timer 2 as prescaler
|
||||
|
||||
NVIC_SetVector(PIT3_IRQn, (uint32_t)us_ticker_irq_handler);
|
||||
NVIC_EnableIRQ(PIT3_IRQn);
|
||||
}
|
||||
|
||||
/******************************************************************************
|
||||
* Timer for us timing.
|
||||
******************************************************************************/
|
||||
|
||||
uint32_t us_ticker_read() {
|
||||
if (!us_ticker_inited)
|
||||
us_ticker_init();
|
||||
|
||||
return ~(PIT->CHANNEL[1].CVAL);
|
||||
}
|
||||
|
||||
/******************************************************************************
|
||||
* Ticker Event
|
||||
******************************************************************************/
|
||||
|
||||
void us_ticker_disable_interrupt(void) {
|
||||
PIT->CHANNEL[3].TCTRL &= ~PIT_TCTRL_TIE_MASK;
|
||||
}
|
||||
|
||||
void us_ticker_clear_interrupt(void) {
|
||||
PIT->CHANNEL[3].TFLG = 1;
|
||||
}
|
||||
|
||||
void us_ticker_set_interrupt(timestamp_t timestamp) {
|
||||
uint32_t delta = timestamp - us_ticker_read();
|
||||
PIT->CHANNEL[3].TCTRL = 0;
|
||||
PIT->CHANNEL[3].LDVAL = delta;
|
||||
PIT->CHANNEL[3].TCTRL = PIT_TCTRL_TIE_MASK | PIT_TCTRL_TEN_MASK | PIT_TCTRL_CHN_MASK;
|
||||
|
||||
}
|
||||
|
||||
void us_ticker_fire_interrupt(void)
|
||||
{
|
||||
NVIC_SetPendingIRQ(PIT3_IRQn);
|
||||
}
|
||||
|
||||
void us_ticker_free(void)
|
||||
{
|
||||
|
||||
}
|
|
@ -1267,55 +1267,6 @@
|
|||
],
|
||||
"device_name": "MK20DX128xxx5"
|
||||
},
|
||||
"TEENSY3_1": {
|
||||
"inherits": [
|
||||
"Target"
|
||||
],
|
||||
"core": "Cortex-M4",
|
||||
"extra_labels": [
|
||||
"Freescale",
|
||||
"K20XX",
|
||||
"K20DX256"
|
||||
],
|
||||
"OUTPUT_EXT": "hex",
|
||||
"is_disk_virtual": true,
|
||||
"supported_toolchains": [
|
||||
"GCC_ARM",
|
||||
"ARM"
|
||||
],
|
||||
"post_binary_hook": {
|
||||
"function": "TEENSY3_1Code.binary_hook",
|
||||
"toolchains": [
|
||||
"ARM_STD",
|
||||
"ARM_MICRO",
|
||||
"GCC_ARM"
|
||||
]
|
||||
},
|
||||
"detect_code": [
|
||||
"0230"
|
||||
],
|
||||
"device_has": [
|
||||
"ANALOGIN",
|
||||
"ANALOGOUT",
|
||||
"I2C",
|
||||
"I2CSLAVE",
|
||||
"INTERRUPTIN",
|
||||
"PORTIN",
|
||||
"PORTINOUT",
|
||||
"PORTOUT",
|
||||
"PWMOUT",
|
||||
"SEMIHOST",
|
||||
"SERIAL",
|
||||
"SLEEP",
|
||||
"SPI",
|
||||
"SPISLAVE",
|
||||
"STDIO_MESSAGES"
|
||||
],
|
||||
"release_versions": [
|
||||
"2"
|
||||
],
|
||||
"device_name": "MK20DX256xxx7"
|
||||
},
|
||||
"MCU_K22F512": {
|
||||
"core": "Cortex-M4F",
|
||||
"supported_toolchains": [
|
||||
|
|
Loading…
Reference in New Issue