Add KBOOT.

This commit is contained in:
László Monda
2016-08-10 01:45:15 +02:00
commit e6c1fce5b4
9392 changed files with 3751375 additions and 0 deletions
+1
View File
@@ -0,0 +1 @@
00112233445566778899aabbccddeeff
+28
View File
@@ -0,0 +1,28 @@
# No source file needed, keep this block empty
sources {
}
# The section block specifies the sequence of boot commands to be written to the SB file.
section (0) {
# Use the 'load ifr' statement to program the SB key to IFR memory.
# The SB key occupies IFR index 0x30-0x33.
# The SB key is 128-bit specifies as 4 little-endian long-word values.
# SB Key = {0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88, 0x99, 0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xff}
load ifr 0x33221100 > 0x30;
load ifr 0x77665544 > 0x31;
load ifr 0xbbaa9988 > 0x32;
load ifr 0xffeeddcc > 0x33;
# Use the 'load ifr' statement to program the OTFAD KEK to IFR memory.
# The KEK is used to unwrap(decrypt) the keyblob at boot time in order to correctly set up the OTFAD engine.
# The key is specified as 4 little-endian values, with the "least significant" key word going into the lowest IFR index
# KEK = {0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f}
load ifr 0x0f0e0d0c > 0x20;
load ifr 0x0b0a0908 > 0x21;
load ifr 0x07060504 > 0x22;
load ifr 0x03020100 > 0x23;
# Reset target in order to let these keys take effect.
reset;
}
+35
View File
@@ -0,0 +1,35 @@
# The sources block assigns file names to identifiers
sources {
# SREC File path
mySrecFile = "led_demo_qspi_0000.srec";
# QCB file path
qspiConfigBlock = "qspi_config_block.bin";
}
# The section block specifies the sequence of boot commands to be written to
# the SB file
section (0) {
#1. Erase the vector table and flash config field.
erase 0..0x800;
# Step 2 and Step 3 are optional if the QuadSPI is configured at startup.
#2. Load the QCB to RAM
load qspiConfigBlock > 0x20000000;
#3. Configure QuadSPI with the QCB above
enable qspi 0x20000000;
#4. Erase the QuadSPI memory region before programming.
erase 0x68000000..0x68004000;
#5.Load the QCB above to the start address of QuadSPI memory
load qspiConfigBlock > 0x68000000;
#6,7. Load all the RO data from srec file, including vector table, flash config field and codes.
load mySrecFile;
#8. Reset target.
reset;
}
+35
View File
@@ -0,0 +1,35 @@
# The sources block assigns file names to identifiers
sources {
# SREC File path
mySrecFile = "led_demo_qspi_a000.srec";
# QCB file path
qspiConfigBlock = "qspi_config_block.bin";
}
# The section block specifies the sequence of boot commands to be written to
# the SB file
section (0) {
#1. Erase the vector table and flash config field.
erase 0xa000..0xa800;
# Step 2 and Step 3 are optional if the QuadSPI is configured at startup.
#2. Load the QCB to RAM
load qspiConfigBlock > 0x20000000;
#3. Configure QuadSPI with the QCB above
enable qspi 0x20000000;
#4. Erase the QuadSPI memory region before programming.
erase 0x68000000..0x68004000;
#5.Load the QCB above to the start address of QuadSPI memory
load qspiConfigBlock > 0x68000000;
#6,7. Load all the RO data from srec file, including vector table, flash config field and codes.
load mySrecFile;
#8. Reset target.
reset;
}
@@ -0,0 +1,35 @@
# The sources block assigns file names to identifiers
sources {
# SREC File path
mySrecFile = "led_demo_qspi_alias_a000.srec";
# QCB file path
qspiConfigBlock = "qspi_config_block.bin";
}
# The section block specifies the sequence of boot commands to be written to
# the SB file
section (0) {
#1. Erase the vector table and flash config field.
erase 0xa000..0xa800;
# Step 2 and Step 3 are optional if the QuadSPI is configured at startup.
#2. Load the QCB to RAM
load qspiConfigBlock > 0x20000000;
#3. Configure QuadSPI with the QCB above
enable qspi 0x20000000;
#4. Erase the QuadSPI memory region before programming.
erase 0x04000000..0x04004000;
#5.Load the QCB above to the start address of QuadSPI memory
load qspiConfigBlock > 0x68000000;
#6. Load all boot_to_qspi_alias_memory applcation
load mySrecFile;
#7. Reset target.
reset;
}
@@ -0,0 +1,70 @@
# The sources block assigns file names to identifiers
sources {
# SREC File path
mySrecFile = "boot_to_qspi_alias_memory_rom.srec";
# QCB file path
qspiConfigBlock = "qspi_config_block.bin";
# Alias QSPI image file path
myBinFile = "led_demo_qspi_alias_rom.bin";
}
# The keyblob creates a structure with up to 4 keyblob entries.
# The empty parentheses syntax specifies an entry of all zeros (no encryption)
# Each entry consists of 4 parameters:
# start - start address of encrypted block.
# end - end address of encrypted block.
# key - AES-CTR mode encryption key for this range.
# counter - initial counter value for AES-CTR encryption for this range.
keyblob (0) {
(
start=0x68001000,
end = 0x68001fff,
key="000102030405060708090a0b0c0d0e0f",
counter="0123456789abcdef"
)
()
()
()
}
# The section block specifies the sequence of boot commands to be written to
# the SB file
section (0) {
#1. Erase the vector table and flash config field.
erase 0..0x800;
# Step 2 and Step 3 are optional if the QuadSPI is configured at startup.
#2. Load the QCB to RAM
load qspiConfigBlock > 0x20000000;
#3. Configure QuadSPI with the QCB above
enable qspi 0x20000000;
#4. Erase the QuadSPI memory region before programming.
erase 0x68000000..0x68004000;
#5.Load the QCB above to the start address of QuadSPI memory
load qspiConfigBlock > 0x68000000;
#6. Load all boot_to_qspi_alias_memory applcation
load mySrecFile;
#7. The encrypt argument (0) specifies the keyblob parameters range of one of the keyblob entries are left unencrypted.
encrypt(0) {
# Load alias QSPI image
load myBinFile > 0x68001000;
}
#8. Load the encrypted keyblob block to specified location.
# The keywrap statement wraps (encrypts) the keyblob specified in the argument (0) using the specified Key Encryption Key (KEK) and loads the keyblob to internal flas.
# The load destination (0x1000, which is defined via keyBlobPointer in BCA) must match the defualt location (0x410) or the keyblob pointer in the Bootloader Configuraion Area(BCA) contained in the SREC image.
# Make sure the sector at 0x1000 has not been written by the srec file load above, otherwise it will need to be erased again.
keywrap (0) {
load {{000102030405060708090a0b0c0d0e0f}} > 0x1000;
}
#9. Reset target.
reset;
}
@@ -0,0 +1,40 @@
# The sources block assigns file names to identifiers
sources {
# SREC File path
mySrecFile = "boot_to_qspi_alias_memory_rom.srec";
# QCB file path
qspiConfigBlock = "qspi_config_block.bin";
# Alias QSPI image file path
myBinFile = "led_demo_qspi_alias_rom.bin";
}
# The section block specifies the sequence of boot commands to be written to
# the SB file
section (0) {
#1. Erase the vector table and flash config field.
erase 0..0x800;
# Step 2 and Step 3 are optional if the QuadSPI is configured at startup.
#2. Load the QCB to RAM
load qspiConfigBlock > 0x20000000;
#3. Configure QuadSPI with the QCB above
enable qspi 0x20000000;
#4. Erase the QuadSPI memory region before programming.
erase 0x68000000..0x68004000;
#5.Load the QCB above to the start address of QuadSPI memory
load qspiConfigBlock > 0x68000000;
#. Load all boot_to_qspi_alias_memory applcation
load mySrecFile;
#7. Load Alias QSPI image
load myBinFile > 0x68001000;
#8. Reset target.
reset;
}
@@ -0,0 +1,67 @@
# The sources block assigns file names to identifiers
sources {
# SREC File path
mySrecFile = "led_demo_QSPI.srec";
# QCB file path
qspiConfigBlock = "qspi_config_block.bin";
}
# The keyblob creates a structure with up to 4 keyblob entries.
# The empty parentheses syntax specifies an entry of all zeros (no encryption)
# Each entry consists of 4 parameters:
# start - start address of encrypted block.
# end - end address of encrypted block.
# key - AES-CTR mode encryption key for this range.
# counter - initial counter value for AES-CTR encryption for this range.
keyblob (0) {
(
start=0x68001000,
end = 0x68001fff,
key="000102030405060708090a0b0c0d0e0f",
counter="0123456789abcdef"
)
()
()
()
}
# The section block specifies the sequence of boot commands to be written to
# the SB file
section (0) {
#1. Erase the vector table and flash config field.
erase 0..0x800;
# Step 2 and Step 3 are optional if the QuadSPI is configured at startup.
#2. Load the QCB to RAM
load qspiConfigBlock > 0x20000000;
#3. Configure QuadSPI with the QCB above
enable qspi 0x20000000;
#4. Erase the QuadSPI memory region before programming.
erase 0x68000000..0x68004000;
#5.Load the QCB above to the start address of QuadSPI memory
load qspiConfigBlock > 0x68000000;
#6,7. The encrypt statement indicates that load commands should encrypt load from the srec file using AES-CTR mode encrypteion.
# The encrypt argument (0) specifies the keyblob parameters range of one of the keyblob entries are left unencrypted.
encrypt(0) {
# Load all the RO data from SREC fiel.
load mySrecFile;
}
#8. Load the encrypted keyblob block to specified location.
# The keywrap statement wraps (encrypts) the keyblob specified in the argument (0) using the specified Key Encryption Key (KEK) and loads the keyblob to internal flas.
# The load destination (0x1000, which is defined via keyBlobPointer in BCA) must match the defualt location (0x410) or the keyblob pointer in the Bootloader Configuraion Area(BCA) contained in the SREC image.
# Make sure the sector at 0x1000 has not been written by the srec file load above, otherwise it will need to be erased again.
keywrap (0) {
load {{000102030405060708090a0b0c0d0e0f}} > 0x1000;
}
#9. Reset target.
reset;
}
@@ -0,0 +1,70 @@
# The sources block assigns file names to identifiers
sources {
# SREC File path
mySrecFile = "led_demo_qspi_a000.srec";
# QCB file path
qspiConfigBlock = "qspi_config_block.bin";
}
# The keyblob creates a structure with up to 4 keyblob entries.
# The empty parentheses syntax specifies an entry of all zeros (no encryption)
# Each entry consists of 4 parameters:
# start - start address of encrypted block.
# end - end address of encrypted block.
# key - AES-CTR mode encryption key for this range.
# counter - initial counter value for AES-CTR encryption for this range.
keyblob (0) {
(
start=0x68001000,
end = 0x68001fff,
key="000102030405060708090a0b0c0d0e0f",
counter="0123456789abcdef"
)
()
()
()
}
# The section block specifies the sequence of boot commands to be written to
# the SB file
section (0) {
#1. Erase the vector table and flash config field.
erase 0xa000..0xc000;
# Step 2 and Step 3 are optional if the QuadSPI is configured at startup.
#2. Load the QCB to RAM
load qspiConfigBlock > 0x20000000;
#3. Configure QuadSPI with the QCB above
enable qspi 0x20000000;
#4. Erase the QuadSPI memory region before programming.
erase 0x68000000..0x68004000;
#5.Load the QCB above to the start address of QuadSPI memory
load qspiConfigBlock > 0x68000000;
#6,7. The encrypt statement indicates that load commands should encrypt load from the srec file using AES-CTR mode encrypteion.
# The encrypt argument (0) specifies the keyblob parameters range of one of the keyblob entries are left unencrypted.
encrypt(0) {
# Load all the RO data from SREC field.
load mySrecFile;
}
#8. Load kek to 0xb000
load {{000102030405060708090a0b0c0d0e0f}} > 0xb000;
#9. Load the encrypted keyblob block to specified location.
# The keywrap statement wraps (encrypts) the keyblob specified in the argument (0) using the specified Key Encryption Key (KEK) and loads the keyblob to internal flash.
# The load destination (0xc000, which is defined via keyBlobPointer in BCA) must match the keyblob pointer in the Bootloader Configuraion Area(BCA) contained in the SREC image.
# Make sure the sector at 0xc000 has not been written by the srec file load above, otherwise it will need to be erased again.
keywrap (0) {
load {{000102030405060708090a0b0c0d0e0f}} > 0xc000;
}
#10. Reset target.
reset;
}
@@ -0,0 +1,43 @@
# The sources block assigns file names to identifiers
sources {
# SREC File path
mySrecFile = "led_demo_qspi_patch_rom.srec";
# QCB file path
qspiConfigBlock = "qspi_config_block.bin";
# ROM patch
rom_patch = "ROM_QSPI_patch.bin";
}
# The section block specifies the sequence of boot commands to be written to
# the SB file
section (0) {
#1. Erase the internal flash
erase 0..0x3000;
# Step 2 and Step 3 are optional if the QuadSPI is configured at startup.
#2. Load the QCB to RAM
load qspiConfigBlock > 0x20000000;
#3. Configure QuadSPI with the QCB above
enable qspi 0x20000000;
#4. Load patch to RAM
load rom_patch > 0x20000200;
#5. Call patch to invoke ROM workaround
call 0x20000201 (0x20000000);
#6. Erase the QuadSPI memory region before programming.
erase 0x68000000..0x68090000;
#7.Load the QCB above to the address specified by qspiConfigBlockPointer in BCA
load qspiConfigBlock > 0x2000;
#8. Load all the RO data from srec file, including vector table, flash config field and codes.
load mySrecFile;
#9. Reset target.
reset;
}
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,462 @@
/* ---------------------------------------------------------------------------------------*/
/* @file: startup_MK82F25615.s */
/* @purpose: CMSIS Cortex-M4 Core Device Startup File */
/* MK82F25615 */
/* @version: 1.1 */
/* @date: 2015-5-28 */
/* @build: b150626 */
/* ---------------------------------------------------------------------------------------*/
/* */
/* Copyright (c) 1997 - 2015 , Freescale Semiconductor, Inc. */
/* All rights reserved. */
/* */
/* Redistribution and use in source and binary forms, with or without modification, */
/* are permitted provided that the following conditions are met: */
/* */
/* o Redistributions of source code must retain the above copyright notice, this list */
/* of conditions and the following disclaimer. */
/* */
/* o 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. */
/* */
/* o Neither the name of Freescale Semiconductor, Inc. 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. */
/*****************************************************************************/
/* Version: GCC for ARM Embedded Processors */
/*****************************************************************************/
.syntax unified
.arch armv7-m
.section .isr_vector, "a"
.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_DMA16_IRQHandler /* DMA channel 0,16 transfer complete*/
.long DMA1_DMA17_IRQHandler /* DMA channel 1,17 transfer complete*/
.long DMA2_DMA18_IRQHandler /* DMA channel 2,18 transfer complete*/
.long DMA3_DMA19_IRQHandler /* DMA channel 3,19 transfer complete*/
.long DMA4_DMA20_IRQHandler /* DMA channel 4,20 transfer complete*/
.long DMA5_DMA21_IRQHandler /* DMA channel 5,21 transfer complete*/
.long DMA6_DMA22_IRQHandler /* DMA channel 6,22 transfer complete*/
.long DMA7_DMA23_IRQHandler /* DMA channel 7,23 transfer complete*/
.long DMA8_DMA24_IRQHandler /* DMA channel 8,24 transfer complete*/
.long DMA9_DMA25_IRQHandler /* DMA channel 9,25 transfer complete*/
.long DMA10_DMA26_IRQHandler /* DMA channel 10,26 transfer complete*/
.long DMA11_DMA27_IRQHandler /* DMA channel 11,27 transfer complete*/
.long DMA12_DMA28_IRQHandler /* DMA channel 12,28 transfer complete*/
.long DMA13_DMA29_IRQHandler /* DMA channel 13,29 transfer complete*/
.long DMA14_DMA30_IRQHandler /* DMA channel 14,30 transfer complete*/
.long DMA15_DMA31_IRQHandler /* DMA channel 15,31 transfer complete*/
.long DMA_Error_IRQHandler /* DMA channel 0 - 31 error*/
.long MCM_IRQHandler /* MCM normal interrupt*/
.long FTFA_IRQHandler /* FTFA command complete*/
.long Read_Collision_IRQHandler /* FTFA read collision*/
.long LVD_LVW_IRQHandler /* PMC controller low-voltage detect, low-voltage warning*/
.long LLWU_IRQHandler /* Low leakage wakeup unit*/
.long WDOG_EWM_IRQHandler /* Single interrupt vector for WDOG and EWM*/
.long TRNG0_IRQHandler /* True randon number generator*/
.long I2C0_IRQHandler /* Inter-integrated circuit 0*/
.long I2C1_IRQHandler /* Inter-integrated circuit 1*/
.long SPI0_IRQHandler /* Serial peripheral Interface 0*/
.long SPI1_IRQHandler /* Serial peripheral Interface 1*/
.long I2S0_Tx_IRQHandler /* Integrated interchip sound 0 transmit interrupt*/
.long I2S0_Rx_IRQHandler /* Integrated interchip sound 0 receive interrupt*/
.long LPUART0_IRQHandler /* LPUART0 receive/transmit/error interrupt*/
.long LPUART1_IRQHandler /* LPUART1 receive/transmit/error interrupt*/
.long LPUART2_IRQHandler /* LPUART2 receive/transmit/error interrupt*/
.long LPUART3_IRQHandler /* LPUART3 receive/transmit/error interrupt*/
.long LPUART4_IRQHandler /* LPUART4 receive/transmit/error interrupt*/
.long Reserved51_IRQHandler /* Reserved interrupt*/
.long Reserved52_IRQHandler /* Reserved interrupt*/
.long EMVSIM0_IRQHandler /* EMVSIM0 common interrupt*/
.long EMVSIM1_IRQHandler /* EMVSIM1 common interrupt*/
.long ADC0_IRQHandler /* Analog-to-digital converter 0*/
.long CMP0_IRQHandler /* Comparator 0*/
.long CMP1_IRQHandler /* Comparator 1*/
.long FTM0_IRQHandler /* FlexTimer module 0 fault, overflow and channels interrupt*/
.long FTM1_IRQHandler /* FlexTimer module 1 fault, overflow and channels interrupt*/
.long FTM2_IRQHandler /* FlexTimer module 2 fault, overflow and channels interrupt*/
.long CMT_IRQHandler /* Carrier modulator transmitter*/
.long RTC_IRQHandler /* Real time clock*/
.long RTC_Seconds_IRQHandler /* Real time clock seconds*/
.long PIT0CH0_IRQHandler /* Periodic interrupt timer 0 channel 0*/
.long PIT0CH1_IRQHandler /* Periodic interrupt timer 0 channel 1*/
.long PIT0CH2_IRQHandler /* Periodic interrupt timer 0 channel 2*/
.long PIT0CH3_IRQHandler /* Periodic interrupt timer 0 channel 3*/
.long PDB0_IRQHandler /* Programmable delay block*/
.long USB0_IRQHandler /* USB OTG interrupt*/
.long USBDCD_IRQHandler /* USB charger detect*/
.long Reserved71_IRQHandler /* Reserved interrupt*/
.long DAC0_IRQHandler /* Digital-to-analog converter 0*/
.long MCG_IRQHandler /* Multipurpose clock generator*/
.long LPTMR0_LPTMR1_IRQHandler /* Single interrupt vector for Low Power Timer 0 and 1*/
.long PORTA_IRQHandler /* Port A pin detect interrupt*/
.long PORTB_IRQHandler /* Port B pin detect interrupt*/
.long PORTC_IRQHandler /* Port C pin detect interrupt*/
.long PORTD_IRQHandler /* Port D pin detect interrupt*/
.long PORTE_IRQHandler /* Port E pin detect interrupt*/
.long SWI_IRQHandler /* Software interrupt*/
.long SPI2_IRQHandler /* Serial peripheral Interface 2*/
.long Reserved82_IRQHandler /* Reserved interrupt*/
.long Reserved83_IRQHandler /* Reserved interrupt*/
.long Reserved84_IRQHandler /* Reserved interrupt*/
.long Reserved85_IRQHandler /* Reserved interrupt*/
.long FLEXIO0_IRQHandler /* FLEXIO0*/
.long FTM3_IRQHandler /* FlexTimer module 3 fault, overflow and channels interrupt*/
.long Reserved88_IRQHandler /* Reserved interrupt*/
.long Reserved89_IRQHandler /* Reserved interrupt*/
.long I2C2_IRQHandler /* Inter-integrated circuit 2*/
.long Reserved91_IRQHandler /* Reserved interrupt*/
.long Reserved92_IRQHandler /* Reserved interrupt*/
.long Reserved93_IRQHandler /* Reserved interrupt*/
.long Reserved94_IRQHandler /* Reserved interrupt*/
.long Reserved95_IRQHandler /* Reserved interrupt*/
.long Reserved96_IRQHandler /* Reserved interrupt*/
.long SDHC_IRQHandler /* Secured digital host controller*/
.long Reserved98_IRQHandler /* Reserved interrupt*/
.long Reserved99_IRQHandler /* Reserved interrupt*/
.long Reserved100_IRQHandler /* Reserved interrupt*/
.long Reserved101_IRQHandler /* Reserved interrupt*/
.long Reserved102_IRQHandler /* Reserved interrupt*/
.long TSI0_IRQHandler /* Touch Sensing Input*/
.long TPM1_IRQHandler /* TPM1 single interrupt vector for all sources*/
.long TPM2_IRQHandler /* TPM2 single interrupt vector for all sources*/
.long Reserved106_IRQHandler /* Reserved interrupt*/
.long I2C3_IRQHandler /* Inter-integrated circuit 3*/
.long Reserved108_IRQHandler /* Reserved interrupt*/
.long Reserved109_IRQHandler /* Reserved interrupt*/
.long Reserved110_IRQHandler /* Reserved interrupt*/
.long Reserved111_IRQHandler /* Reserved interrupt*/
.long Reserved112_IRQHandler /* Reserved interrupt*/
.long Reserved113_IRQHandler /* Reserved interrupt*/
.long Reserved114_IRQHandler /* Reserved interrupt*/
.long Reserved115_IRQHandler /* Reserved interrupt*/
.long QuadSPI0_IRQHandler /* qspi*/
.long Reserved117_IRQHandler /* Reserved interrupt*/
.long Reserved118_IRQHandler /* Reserved interrupt*/
.long Reserved119_IRQHandler /* Reserved interrupt*/
.long LTC0_IRQHandler /* LP Trusted Cryptography*/
.long Reserved121_IRQHandler /* Reserved interrupt*/
.long Reserved122_IRQHandler /* Reserved interrupt*/
.long DefaultISR /* 123*/
.long DefaultISR /* 124*/
.long DefaultISR /* 125*/
.long DefaultISR /* 126*/
.long DefaultISR /* 127*/
.long DefaultISR /* 128*/
.long DefaultISR /* 129*/
.long DefaultISR /* 130*/
.long DefaultISR /* 131*/
.long DefaultISR /* 132*/
.long DefaultISR /* 133*/
.long DefaultISR /* 134*/
.long DefaultISR /* 135*/
.long DefaultISR /* 136*/
.long DefaultISR /* 137*/
.long DefaultISR /* 138*/
.long DefaultISR /* 139*/
.long DefaultISR /* 140*/
.long DefaultISR /* 141*/
.long DefaultISR /* 142*/
.long DefaultISR /* 143*/
.long DefaultISR /* 144*/
.long DefaultISR /* 145*/
.long DefaultISR /* 146*/
.long DefaultISR /* 147*/
.long DefaultISR /* 148*/
.long DefaultISR /* 149*/
.long DefaultISR /* 150*/
.long DefaultISR /* 151*/
.long DefaultISR /* 152*/
.long DefaultISR /* 153*/
.long DefaultISR /* 154*/
.long DefaultISR /* 155*/
.long DefaultISR /* 156*/
.long DefaultISR /* 157*/
.long DefaultISR /* 158*/
.long DefaultISR /* 159*/
.long DefaultISR /* 160*/
.long DefaultISR /* 161*/
.long DefaultISR /* 162*/
.long DefaultISR /* 163*/
.long DefaultISR /* 164*/
.long DefaultISR /* 165*/
.long DefaultISR /* 166*/
.long DefaultISR /* 167*/
.long DefaultISR /* 168*/
.long DefaultISR /* 169*/
.long DefaultISR /* 170*/
.long DefaultISR /* 171*/
.long DefaultISR /* 172*/
.long DefaultISR /* 173*/
.long DefaultISR /* 174*/
.long DefaultISR /* 175*/
.long DefaultISR /* 176*/
.long DefaultISR /* 177*/
.long DefaultISR /* 178*/
.long DefaultISR /* 179*/
.long DefaultISR /* 180*/
.long DefaultISR /* 181*/
.long DefaultISR /* 182*/
.long DefaultISR /* 183*/
.long DefaultISR /* 184*/
.long DefaultISR /* 185*/
.long DefaultISR /* 186*/
.long DefaultISR /* 187*/
.long DefaultISR /* 188*/
.long DefaultISR /* 189*/
.long DefaultISR /* 190*/
.long DefaultISR /* 191*/
.long DefaultISR /* 192*/
.long DefaultISR /* 193*/
.long DefaultISR /* 194*/
.long DefaultISR /* 195*/
.long DefaultISR /* 196*/
.long DefaultISR /* 197*/
.long DefaultISR /* 198*/
.long DefaultISR /* 199*/
.long DefaultISR /* 200*/
.long DefaultISR /* 201*/
.long DefaultISR /* 202*/
.long DefaultISR /* 203*/
.long DefaultISR /* 204*/
.long DefaultISR /* 205*/
.long DefaultISR /* 206*/
.long DefaultISR /* 207*/
.long DefaultISR /* 208*/
.long DefaultISR /* 209*/
.long DefaultISR /* 210*/
.long DefaultISR /* 211*/
.long DefaultISR /* 212*/
.long DefaultISR /* 213*/
.long DefaultISR /* 214*/
.long DefaultISR /* 215*/
.long DefaultISR /* 216*/
.long DefaultISR /* 217*/
.long DefaultISR /* 218*/
.long DefaultISR /* 219*/
.long DefaultISR /* 220*/
.long DefaultISR /* 221*/
.long DefaultISR /* 222*/
.long DefaultISR /* 223*/
.long DefaultISR /* 224*/
.long DefaultISR /* 225*/
.long DefaultISR /* 226*/
.long DefaultISR /* 227*/
.long DefaultISR /* 228*/
.long DefaultISR /* 229*/
.long DefaultISR /* 230*/
.long DefaultISR /* 231*/
.long DefaultISR /* 232*/
.long DefaultISR /* 233*/
.long DefaultISR /* 234*/
.long DefaultISR /* 235*/
.long DefaultISR /* 236*/
.long DefaultISR /* 237*/
.long DefaultISR /* 238*/
.long DefaultISR /* 239*/
.size __isr_vector, . - __isr_vector
/* Flash Configuration */
.section .FlashConfig, "a"
.long 0xFFFFFFFF
.long 0xFFFFFFFF
.long 0xFFFFFFFF
.long 0xFFFF3DFE
.text
.thumb
/* Reset Handler */
.thumb_func
.align 2
.globl Reset_Handler
.weak Reset_Handler
.type Reset_Handler, %function
Reset_Handler:
cpsid i /* Mask interrupts */
#ifndef __NO_SYSTEM_INIT
bl SystemInit
#endif
bl init_data_bss
cpsie i /* Unmask interrupts */
#ifndef __START
#define __START _start
#endif
#ifndef __ATOLLIC__
bl __START
#else
bl __libc_init_array
bl main
#endif
.pool
.size Reset_Handler, . - Reset_Handler
.align 1
.thumb_func
.weak DefaultISR
.type DefaultISR, %function
DefaultISR:
b DefaultISR
.size DefaultISR, . - DefaultISR
/* Macro to define default handlers. Default handler
* will be weak symbol and just dead loops. They can be
* overwritten by other handlers */
.macro def_irq_handler handler_name
.weak \handler_name
.set \handler_name, DefaultISR
.endm
/* Exception Handlers */
def_irq_handler NMI_Handler
def_irq_handler HardFault_Handler
def_irq_handler MemManage_Handler
def_irq_handler BusFault_Handler
def_irq_handler UsageFault_Handler
def_irq_handler SVC_Handler
def_irq_handler DebugMon_Handler
def_irq_handler PendSV_Handler
def_irq_handler SysTick_Handler
def_irq_handler DMA0_DMA16_IRQHandler
def_irq_handler DMA1_DMA17_IRQHandler
def_irq_handler DMA2_DMA18_IRQHandler
def_irq_handler DMA3_DMA19_IRQHandler
def_irq_handler DMA4_DMA20_IRQHandler
def_irq_handler DMA5_DMA21_IRQHandler
def_irq_handler DMA6_DMA22_IRQHandler
def_irq_handler DMA7_DMA23_IRQHandler
def_irq_handler DMA8_DMA24_IRQHandler
def_irq_handler DMA9_DMA25_IRQHandler
def_irq_handler DMA10_DMA26_IRQHandler
def_irq_handler DMA11_DMA27_IRQHandler
def_irq_handler DMA12_DMA28_IRQHandler
def_irq_handler DMA13_DMA29_IRQHandler
def_irq_handler DMA14_DMA30_IRQHandler
def_irq_handler DMA15_DMA31_IRQHandler
def_irq_handler DMA_Error_IRQHandler
def_irq_handler MCM_IRQHandler
def_irq_handler FTFA_IRQHandler
def_irq_handler Read_Collision_IRQHandler
def_irq_handler LVD_LVW_IRQHandler
def_irq_handler LLWU_IRQHandler
def_irq_handler WDOG_EWM_IRQHandler
def_irq_handler TRNG0_IRQHandler
def_irq_handler I2C0_IRQHandler
def_irq_handler I2C1_IRQHandler
def_irq_handler SPI0_IRQHandler
def_irq_handler SPI1_IRQHandler
def_irq_handler I2S0_Tx_IRQHandler
def_irq_handler I2S0_Rx_IRQHandler
def_irq_handler LPUART0_IRQHandler
def_irq_handler LPUART1_IRQHandler
def_irq_handler LPUART2_IRQHandler
def_irq_handler LPUART3_IRQHandler
def_irq_handler LPUART4_IRQHandler
def_irq_handler Reserved51_IRQHandler
def_irq_handler Reserved52_IRQHandler
def_irq_handler EMVSIM0_IRQHandler
def_irq_handler EMVSIM1_IRQHandler
def_irq_handler ADC0_IRQHandler
def_irq_handler CMP0_IRQHandler
def_irq_handler CMP1_IRQHandler
def_irq_handler FTM0_IRQHandler
def_irq_handler FTM1_IRQHandler
def_irq_handler FTM2_IRQHandler
def_irq_handler CMT_IRQHandler
def_irq_handler RTC_IRQHandler
def_irq_handler RTC_Seconds_IRQHandler
def_irq_handler PIT0CH0_IRQHandler
def_irq_handler PIT0CH1_IRQHandler
def_irq_handler PIT0CH2_IRQHandler
def_irq_handler PIT0CH3_IRQHandler
def_irq_handler PDB0_IRQHandler
def_irq_handler USB0_IRQHandler
def_irq_handler USBDCD_IRQHandler
def_irq_handler Reserved71_IRQHandler
def_irq_handler DAC0_IRQHandler
def_irq_handler MCG_IRQHandler
def_irq_handler LPTMR0_LPTMR1_IRQHandler
def_irq_handler PORTA_IRQHandler
def_irq_handler PORTB_IRQHandler
def_irq_handler PORTC_IRQHandler
def_irq_handler PORTD_IRQHandler
def_irq_handler PORTE_IRQHandler
def_irq_handler SWI_IRQHandler
def_irq_handler SPI2_IRQHandler
def_irq_handler Reserved82_IRQHandler
def_irq_handler Reserved83_IRQHandler
def_irq_handler Reserved84_IRQHandler
def_irq_handler Reserved85_IRQHandler
def_irq_handler FLEXIO0_IRQHandler
def_irq_handler FTM3_IRQHandler
def_irq_handler Reserved88_IRQHandler
def_irq_handler Reserved89_IRQHandler
def_irq_handler I2C2_IRQHandler
def_irq_handler Reserved91_IRQHandler
def_irq_handler Reserved92_IRQHandler
def_irq_handler Reserved93_IRQHandler
def_irq_handler Reserved94_IRQHandler
def_irq_handler Reserved95_IRQHandler
def_irq_handler Reserved96_IRQHandler
def_irq_handler SDHC_IRQHandler
def_irq_handler Reserved98_IRQHandler
def_irq_handler Reserved99_IRQHandler
def_irq_handler Reserved100_IRQHandler
def_irq_handler Reserved101_IRQHandler
def_irq_handler Reserved102_IRQHandler
def_irq_handler TSI0_IRQHandler
def_irq_handler TPM1_IRQHandler
def_irq_handler TPM2_IRQHandler
def_irq_handler Reserved106_IRQHandler
def_irq_handler I2C3_IRQHandler
def_irq_handler Reserved108_IRQHandler
def_irq_handler Reserved109_IRQHandler
def_irq_handler Reserved110_IRQHandler
def_irq_handler Reserved111_IRQHandler
def_irq_handler Reserved112_IRQHandler
def_irq_handler Reserved113_IRQHandler
def_irq_handler Reserved114_IRQHandler
def_irq_handler Reserved115_IRQHandler
def_irq_handler QuadSPI0_IRQHandler
def_irq_handler Reserved117_IRQHandler
def_irq_handler Reserved118_IRQHandler
def_irq_handler Reserved119_IRQHandler
def_irq_handler LTC0_IRQHandler
def_irq_handler Reserved121_IRQHandler
def_irq_handler Reserved122_IRQHandler
.end
@@ -0,0 +1,462 @@
/* ---------------------------------------------------------------------------------------*/
/* @file: startup_MK82F25615.s */
/* @purpose: CMSIS Cortex-M4 Core Device Startup File */
/* MK82F25615 */
/* @version: 1.1 */
/* @date: 2015-5-28 */
/* @build: b150626 */
/* ---------------------------------------------------------------------------------------*/
/* */
/* Copyright (c) 1997 - 2015 , Freescale Semiconductor, Inc. */
/* All rights reserved. */
/* */
/* Redistribution and use in source and binary forms, with or without modification, */
/* are permitted provided that the following conditions are met: */
/* */
/* o Redistributions of source code must retain the above copyright notice, this list */
/* of conditions and the following disclaimer. */
/* */
/* o 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. */
/* */
/* o Neither the name of Freescale Semiconductor, Inc. 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. */
/*****************************************************************************/
/* Version: GCC for ARM Embedded Processors */
/*****************************************************************************/
.syntax unified
.arch armv7-m
.section .isr_vector, "a"
.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_DMA16_IRQHandler /* DMA channel 0,16 transfer complete*/
.long DMA1_DMA17_IRQHandler /* DMA channel 1,17 transfer complete*/
.long DMA2_DMA18_IRQHandler /* DMA channel 2,18 transfer complete*/
.long DMA3_DMA19_IRQHandler /* DMA channel 3,19 transfer complete*/
.long DMA4_DMA20_IRQHandler /* DMA channel 4,20 transfer complete*/
.long DMA5_DMA21_IRQHandler /* DMA channel 5,21 transfer complete*/
.long DMA6_DMA22_IRQHandler /* DMA channel 6,22 transfer complete*/
.long DMA7_DMA23_IRQHandler /* DMA channel 7,23 transfer complete*/
.long DMA8_DMA24_IRQHandler /* DMA channel 8,24 transfer complete*/
.long DMA9_DMA25_IRQHandler /* DMA channel 9,25 transfer complete*/
.long DMA10_DMA26_IRQHandler /* DMA channel 10,26 transfer complete*/
.long DMA11_DMA27_IRQHandler /* DMA channel 11,27 transfer complete*/
.long DMA12_DMA28_IRQHandler /* DMA channel 12,28 transfer complete*/
.long DMA13_DMA29_IRQHandler /* DMA channel 13,29 transfer complete*/
.long DMA14_DMA30_IRQHandler /* DMA channel 14,30 transfer complete*/
.long DMA15_DMA31_IRQHandler /* DMA channel 15,31 transfer complete*/
.long DMA_Error_IRQHandler /* DMA channel 0 - 31 error*/
.long MCM_IRQHandler /* MCM normal interrupt*/
.long FTFA_IRQHandler /* FTFA command complete*/
.long Read_Collision_IRQHandler /* FTFA read collision*/
.long LVD_LVW_IRQHandler /* PMC controller low-voltage detect, low-voltage warning*/
.long LLWU_IRQHandler /* Low leakage wakeup unit*/
.long WDOG_EWM_IRQHandler /* Single interrupt vector for WDOG and EWM*/
.long TRNG0_IRQHandler /* True randon number generator*/
.long I2C0_IRQHandler /* Inter-integrated circuit 0*/
.long I2C1_IRQHandler /* Inter-integrated circuit 1*/
.long SPI0_IRQHandler /* Serial peripheral Interface 0*/
.long SPI1_IRQHandler /* Serial peripheral Interface 1*/
.long I2S0_Tx_IRQHandler /* Integrated interchip sound 0 transmit interrupt*/
.long I2S0_Rx_IRQHandler /* Integrated interchip sound 0 receive interrupt*/
.long LPUART0_IRQHandler /* LPUART0 receive/transmit/error interrupt*/
.long LPUART1_IRQHandler /* LPUART1 receive/transmit/error interrupt*/
.long LPUART2_IRQHandler /* LPUART2 receive/transmit/error interrupt*/
.long LPUART3_IRQHandler /* LPUART3 receive/transmit/error interrupt*/
.long LPUART4_IRQHandler /* LPUART4 receive/transmit/error interrupt*/
.long Reserved51_IRQHandler /* Reserved interrupt*/
.long Reserved52_IRQHandler /* Reserved interrupt*/
.long EMVSIM0_IRQHandler /* EMVSIM0 common interrupt*/
.long EMVSIM1_IRQHandler /* EMVSIM1 common interrupt*/
.long ADC0_IRQHandler /* Analog-to-digital converter 0*/
.long CMP0_IRQHandler /* Comparator 0*/
.long CMP1_IRQHandler /* Comparator 1*/
.long FTM0_IRQHandler /* FlexTimer module 0 fault, overflow and channels interrupt*/
.long FTM1_IRQHandler /* FlexTimer module 1 fault, overflow and channels interrupt*/
.long FTM2_IRQHandler /* FlexTimer module 2 fault, overflow and channels interrupt*/
.long CMT_IRQHandler /* Carrier modulator transmitter*/
.long RTC_IRQHandler /* Real time clock*/
.long RTC_Seconds_IRQHandler /* Real time clock seconds*/
.long PIT0CH0_IRQHandler /* Periodic interrupt timer 0 channel 0*/
.long PIT0CH1_IRQHandler /* Periodic interrupt timer 0 channel 1*/
.long PIT0CH2_IRQHandler /* Periodic interrupt timer 0 channel 2*/
.long PIT0CH3_IRQHandler /* Periodic interrupt timer 0 channel 3*/
.long PDB0_IRQHandler /* Programmable delay block*/
.long USB0_IRQHandler /* USB OTG interrupt*/
.long USBDCD_IRQHandler /* USB charger detect*/
.long Reserved71_IRQHandler /* Reserved interrupt*/
.long DAC0_IRQHandler /* Digital-to-analog converter 0*/
.long MCG_IRQHandler /* Multipurpose clock generator*/
.long LPTMR0_LPTMR1_IRQHandler /* Single interrupt vector for Low Power Timer 0 and 1*/
.long PORTA_IRQHandler /* Port A pin detect interrupt*/
.long PORTB_IRQHandler /* Port B pin detect interrupt*/
.long PORTC_IRQHandler /* Port C pin detect interrupt*/
.long PORTD_IRQHandler /* Port D pin detect interrupt*/
.long PORTE_IRQHandler /* Port E pin detect interrupt*/
.long SWI_IRQHandler /* Software interrupt*/
.long SPI2_IRQHandler /* Serial peripheral Interface 2*/
.long Reserved82_IRQHandler /* Reserved interrupt*/
.long Reserved83_IRQHandler /* Reserved interrupt*/
.long Reserved84_IRQHandler /* Reserved interrupt*/
.long Reserved85_IRQHandler /* Reserved interrupt*/
.long FLEXIO0_IRQHandler /* FLEXIO0*/
.long FTM3_IRQHandler /* FlexTimer module 3 fault, overflow and channels interrupt*/
.long Reserved88_IRQHandler /* Reserved interrupt*/
.long Reserved89_IRQHandler /* Reserved interrupt*/
.long I2C2_IRQHandler /* Inter-integrated circuit 2*/
.long Reserved91_IRQHandler /* Reserved interrupt*/
.long Reserved92_IRQHandler /* Reserved interrupt*/
.long Reserved93_IRQHandler /* Reserved interrupt*/
.long Reserved94_IRQHandler /* Reserved interrupt*/
.long Reserved95_IRQHandler /* Reserved interrupt*/
.long Reserved96_IRQHandler /* Reserved interrupt*/
.long SDHC_IRQHandler /* Secured digital host controller*/
.long Reserved98_IRQHandler /* Reserved interrupt*/
.long Reserved99_IRQHandler /* Reserved interrupt*/
.long Reserved100_IRQHandler /* Reserved interrupt*/
.long Reserved101_IRQHandler /* Reserved interrupt*/
.long Reserved102_IRQHandler /* Reserved interrupt*/
.long TSI0_IRQHandler /* Touch Sensing Input*/
.long TPM1_IRQHandler /* TPM1 single interrupt vector for all sources*/
.long TPM2_IRQHandler /* TPM2 single interrupt vector for all sources*/
.long Reserved106_IRQHandler /* Reserved interrupt*/
.long I2C3_IRQHandler /* Inter-integrated circuit 3*/
.long Reserved108_IRQHandler /* Reserved interrupt*/
.long Reserved109_IRQHandler /* Reserved interrupt*/
.long Reserved110_IRQHandler /* Reserved interrupt*/
.long Reserved111_IRQHandler /* Reserved interrupt*/
.long Reserved112_IRQHandler /* Reserved interrupt*/
.long Reserved113_IRQHandler /* Reserved interrupt*/
.long Reserved114_IRQHandler /* Reserved interrupt*/
.long Reserved115_IRQHandler /* Reserved interrupt*/
.long QuadSPI0_IRQHandler /* qspi*/
.long Reserved117_IRQHandler /* Reserved interrupt*/
.long Reserved118_IRQHandler /* Reserved interrupt*/
.long Reserved119_IRQHandler /* Reserved interrupt*/
.long LTC0_IRQHandler /* LP Trusted Cryptography*/
.long Reserved121_IRQHandler /* Reserved interrupt*/
.long Reserved122_IRQHandler /* Reserved interrupt*/
.long DefaultISR /* 123*/
.long DefaultISR /* 124*/
.long DefaultISR /* 125*/
.long DefaultISR /* 126*/
.long DefaultISR /* 127*/
.long DefaultISR /* 128*/
.long DefaultISR /* 129*/
.long DefaultISR /* 130*/
.long DefaultISR /* 131*/
.long DefaultISR /* 132*/
.long DefaultISR /* 133*/
.long DefaultISR /* 134*/
.long DefaultISR /* 135*/
.long DefaultISR /* 136*/
.long DefaultISR /* 137*/
.long DefaultISR /* 138*/
.long DefaultISR /* 139*/
.long DefaultISR /* 140*/
.long DefaultISR /* 141*/
.long DefaultISR /* 142*/
.long DefaultISR /* 143*/
.long DefaultISR /* 144*/
.long DefaultISR /* 145*/
.long DefaultISR /* 146*/
.long DefaultISR /* 147*/
.long DefaultISR /* 148*/
.long DefaultISR /* 149*/
.long DefaultISR /* 150*/
.long DefaultISR /* 151*/
.long DefaultISR /* 152*/
.long DefaultISR /* 153*/
.long DefaultISR /* 154*/
.long DefaultISR /* 155*/
.long DefaultISR /* 156*/
.long DefaultISR /* 157*/
.long DefaultISR /* 158*/
.long DefaultISR /* 159*/
.long DefaultISR /* 160*/
.long DefaultISR /* 161*/
.long DefaultISR /* 162*/
.long DefaultISR /* 163*/
.long DefaultISR /* 164*/
.long DefaultISR /* 165*/
.long DefaultISR /* 166*/
.long DefaultISR /* 167*/
.long DefaultISR /* 168*/
.long DefaultISR /* 169*/
.long DefaultISR /* 170*/
.long DefaultISR /* 171*/
.long DefaultISR /* 172*/
.long DefaultISR /* 173*/
.long DefaultISR /* 174*/
.long DefaultISR /* 175*/
.long DefaultISR /* 176*/
.long DefaultISR /* 177*/
.long DefaultISR /* 178*/
.long DefaultISR /* 179*/
.long DefaultISR /* 180*/
.long DefaultISR /* 181*/
.long DefaultISR /* 182*/
.long DefaultISR /* 183*/
.long DefaultISR /* 184*/
.long DefaultISR /* 185*/
.long DefaultISR /* 186*/
.long DefaultISR /* 187*/
.long DefaultISR /* 188*/
.long DefaultISR /* 189*/
.long DefaultISR /* 190*/
.long DefaultISR /* 191*/
.long DefaultISR /* 192*/
.long DefaultISR /* 193*/
.long DefaultISR /* 194*/
.long DefaultISR /* 195*/
.long DefaultISR /* 196*/
.long DefaultISR /* 197*/
.long DefaultISR /* 198*/
.long DefaultISR /* 199*/
.long DefaultISR /* 200*/
.long DefaultISR /* 201*/
.long DefaultISR /* 202*/
.long DefaultISR /* 203*/
.long DefaultISR /* 204*/
.long DefaultISR /* 205*/
.long DefaultISR /* 206*/
.long DefaultISR /* 207*/
.long DefaultISR /* 208*/
.long DefaultISR /* 209*/
.long DefaultISR /* 210*/
.long DefaultISR /* 211*/
.long DefaultISR /* 212*/
.long DefaultISR /* 213*/
.long DefaultISR /* 214*/
.long DefaultISR /* 215*/
.long DefaultISR /* 216*/
.long DefaultISR /* 217*/
.long DefaultISR /* 218*/
.long DefaultISR /* 219*/
.long DefaultISR /* 220*/
.long DefaultISR /* 221*/
.long DefaultISR /* 222*/
.long DefaultISR /* 223*/
.long DefaultISR /* 224*/
.long DefaultISR /* 225*/
.long DefaultISR /* 226*/
.long DefaultISR /* 227*/
.long DefaultISR /* 228*/
.long DefaultISR /* 229*/
.long DefaultISR /* 230*/
.long DefaultISR /* 231*/
.long DefaultISR /* 232*/
.long DefaultISR /* 233*/
.long DefaultISR /* 234*/
.long DefaultISR /* 235*/
.long DefaultISR /* 236*/
.long DefaultISR /* 237*/
.long DefaultISR /* 238*/
.long DefaultISR /* 239*/
.size __isr_vector, . - __isr_vector
/* Flash Configuration */
.section .FlashConfig, "a"
.long 0xFFFFFFFF
.long 0xFFFFFFFF
.long 0xFFFFFFFF
.long 0xFFFFBDFE
.text
.thumb
/* Reset Handler */
.thumb_func
.align 2
.globl Reset_Handler
.weak Reset_Handler
.type Reset_Handler, %function
Reset_Handler:
cpsid i /* Mask interrupts */
#ifndef __NO_SYSTEM_INIT
bl SystemInit
#endif
bl init_data_bss
cpsie i /* Unmask interrupts */
#ifndef __START
#define __START _start
#endif
#ifndef __ATOLLIC__
bl __START
#else
bl __libc_init_array
bl main
#endif
.pool
.size Reset_Handler, . - Reset_Handler
.align 1
.thumb_func
.weak DefaultISR
.type DefaultISR, %function
DefaultISR:
b DefaultISR
.size DefaultISR, . - DefaultISR
/* Macro to define default handlers. Default handler
* will be weak symbol and just dead loops. They can be
* overwritten by other handlers */
.macro def_irq_handler handler_name
.weak \handler_name
.set \handler_name, DefaultISR
.endm
/* Exception Handlers */
def_irq_handler NMI_Handler
def_irq_handler HardFault_Handler
def_irq_handler MemManage_Handler
def_irq_handler BusFault_Handler
def_irq_handler UsageFault_Handler
def_irq_handler SVC_Handler
def_irq_handler DebugMon_Handler
def_irq_handler PendSV_Handler
def_irq_handler SysTick_Handler
def_irq_handler DMA0_DMA16_IRQHandler
def_irq_handler DMA1_DMA17_IRQHandler
def_irq_handler DMA2_DMA18_IRQHandler
def_irq_handler DMA3_DMA19_IRQHandler
def_irq_handler DMA4_DMA20_IRQHandler
def_irq_handler DMA5_DMA21_IRQHandler
def_irq_handler DMA6_DMA22_IRQHandler
def_irq_handler DMA7_DMA23_IRQHandler
def_irq_handler DMA8_DMA24_IRQHandler
def_irq_handler DMA9_DMA25_IRQHandler
def_irq_handler DMA10_DMA26_IRQHandler
def_irq_handler DMA11_DMA27_IRQHandler
def_irq_handler DMA12_DMA28_IRQHandler
def_irq_handler DMA13_DMA29_IRQHandler
def_irq_handler DMA14_DMA30_IRQHandler
def_irq_handler DMA15_DMA31_IRQHandler
def_irq_handler DMA_Error_IRQHandler
def_irq_handler MCM_IRQHandler
def_irq_handler FTFA_IRQHandler
def_irq_handler Read_Collision_IRQHandler
def_irq_handler LVD_LVW_IRQHandler
def_irq_handler LLWU_IRQHandler
def_irq_handler WDOG_EWM_IRQHandler
def_irq_handler TRNG0_IRQHandler
def_irq_handler I2C0_IRQHandler
def_irq_handler I2C1_IRQHandler
def_irq_handler SPI0_IRQHandler
def_irq_handler SPI1_IRQHandler
def_irq_handler I2S0_Tx_IRQHandler
def_irq_handler I2S0_Rx_IRQHandler
def_irq_handler LPUART0_IRQHandler
def_irq_handler LPUART1_IRQHandler
def_irq_handler LPUART2_IRQHandler
def_irq_handler LPUART3_IRQHandler
def_irq_handler LPUART4_IRQHandler
def_irq_handler Reserved51_IRQHandler
def_irq_handler Reserved52_IRQHandler
def_irq_handler EMVSIM0_IRQHandler
def_irq_handler EMVSIM1_IRQHandler
def_irq_handler ADC0_IRQHandler
def_irq_handler CMP0_IRQHandler
def_irq_handler CMP1_IRQHandler
def_irq_handler FTM0_IRQHandler
def_irq_handler FTM1_IRQHandler
def_irq_handler FTM2_IRQHandler
def_irq_handler CMT_IRQHandler
def_irq_handler RTC_IRQHandler
def_irq_handler RTC_Seconds_IRQHandler
def_irq_handler PIT0CH0_IRQHandler
def_irq_handler PIT0CH1_IRQHandler
def_irq_handler PIT0CH2_IRQHandler
def_irq_handler PIT0CH3_IRQHandler
def_irq_handler PDB0_IRQHandler
def_irq_handler USB0_IRQHandler
def_irq_handler USBDCD_IRQHandler
def_irq_handler Reserved71_IRQHandler
def_irq_handler DAC0_IRQHandler
def_irq_handler MCG_IRQHandler
def_irq_handler LPTMR0_LPTMR1_IRQHandler
def_irq_handler PORTA_IRQHandler
def_irq_handler PORTB_IRQHandler
def_irq_handler PORTC_IRQHandler
def_irq_handler PORTD_IRQHandler
def_irq_handler PORTE_IRQHandler
def_irq_handler SWI_IRQHandler
def_irq_handler SPI2_IRQHandler
def_irq_handler Reserved82_IRQHandler
def_irq_handler Reserved83_IRQHandler
def_irq_handler Reserved84_IRQHandler
def_irq_handler Reserved85_IRQHandler
def_irq_handler FLEXIO0_IRQHandler
def_irq_handler FTM3_IRQHandler
def_irq_handler Reserved88_IRQHandler
def_irq_handler Reserved89_IRQHandler
def_irq_handler I2C2_IRQHandler
def_irq_handler Reserved91_IRQHandler
def_irq_handler Reserved92_IRQHandler
def_irq_handler Reserved93_IRQHandler
def_irq_handler Reserved94_IRQHandler
def_irq_handler Reserved95_IRQHandler
def_irq_handler Reserved96_IRQHandler
def_irq_handler SDHC_IRQHandler
def_irq_handler Reserved98_IRQHandler
def_irq_handler Reserved99_IRQHandler
def_irq_handler Reserved100_IRQHandler
def_irq_handler Reserved101_IRQHandler
def_irq_handler Reserved102_IRQHandler
def_irq_handler TSI0_IRQHandler
def_irq_handler TPM1_IRQHandler
def_irq_handler TPM2_IRQHandler
def_irq_handler Reserved106_IRQHandler
def_irq_handler I2C3_IRQHandler
def_irq_handler Reserved108_IRQHandler
def_irq_handler Reserved109_IRQHandler
def_irq_handler Reserved110_IRQHandler
def_irq_handler Reserved111_IRQHandler
def_irq_handler Reserved112_IRQHandler
def_irq_handler Reserved113_IRQHandler
def_irq_handler Reserved114_IRQHandler
def_irq_handler Reserved115_IRQHandler
def_irq_handler QuadSPI0_IRQHandler
def_irq_handler Reserved117_IRQHandler
def_irq_handler Reserved118_IRQHandler
def_irq_handler Reserved119_IRQHandler
def_irq_handler LTC0_IRQHandler
def_irq_handler Reserved121_IRQHandler
def_irq_handler Reserved122_IRQHandler
.end
@@ -0,0 +1,470 @@
/* ---------------------------------------------------------------------------------------*/
/* @file: startup_MK82F25615.s */
/* @purpose: CMSIS Cortex-M4 Core Device Startup File */
/* MK82F25615 */
/* @version: 1.1 */
/* @date: 2015-5-28 */
/* @build: b150626 */
/* ---------------------------------------------------------------------------------------*/
/* */
/* Copyright (c) 1997 - 2015 , Freescale Semiconductor, Inc. */
/* All rights reserved. */
/* */
/* Redistribution and use in source and binary forms, with or without modification, */
/* are permitted provided that the following conditions are met: */
/* */
/* o Redistributions of source code must retain the above copyright notice, this list */
/* of conditions and the following disclaimer. */
/* */
/* o 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. */
/* */
/* o Neither the name of Freescale Semiconductor, Inc. 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. */
/*****************************************************************************/
/* Version: GCC for ARM Embedded Processors */
/*****************************************************************************/
.syntax unified
.arch armv7-m
.section .isr_vector, "a"
.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_DMA16_IRQHandler /* DMA channel 0,16 transfer complete*/
.long DMA1_DMA17_IRQHandler /* DMA channel 1,17 transfer complete*/
.long DMA2_DMA18_IRQHandler /* DMA channel 2,18 transfer complete*/
.long DMA3_DMA19_IRQHandler /* DMA channel 3,19 transfer complete*/
.long DMA4_DMA20_IRQHandler /* DMA channel 4,20 transfer complete*/
.long DMA5_DMA21_IRQHandler /* DMA channel 5,21 transfer complete*/
.long DMA6_DMA22_IRQHandler /* DMA channel 6,22 transfer complete*/
.long DMA7_DMA23_IRQHandler /* DMA channel 7,23 transfer complete*/
.long DMA8_DMA24_IRQHandler /* DMA channel 8,24 transfer complete*/
.long DMA9_DMA25_IRQHandler /* DMA channel 9,25 transfer complete*/
.long DMA10_DMA26_IRQHandler /* DMA channel 10,26 transfer complete*/
.long DMA11_DMA27_IRQHandler /* DMA channel 11,27 transfer complete*/
.long DMA12_DMA28_IRQHandler /* DMA channel 12,28 transfer complete*/
.long DMA13_DMA29_IRQHandler /* DMA channel 13,29 transfer complete*/
.long DMA14_DMA30_IRQHandler /* DMA channel 14,30 transfer complete*/
.long DMA15_DMA31_IRQHandler /* DMA channel 15,31 transfer complete*/
.long DMA_Error_IRQHandler /* DMA channel 0 - 31 error*/
.long MCM_IRQHandler /* MCM normal interrupt*/
.long FTFA_IRQHandler /* FTFA command complete*/
.long Read_Collision_IRQHandler /* FTFA read collision*/
.long LVD_LVW_IRQHandler /* PMC controller low-voltage detect, low-voltage warning*/
.long LLWU_IRQHandler /* Low leakage wakeup unit*/
.long WDOG_EWM_IRQHandler /* Single interrupt vector for WDOG and EWM*/
.long TRNG0_IRQHandler /* True randon number generator*/
.long I2C0_IRQHandler /* Inter-integrated circuit 0*/
.long I2C1_IRQHandler /* Inter-integrated circuit 1*/
.long SPI0_IRQHandler /* Serial peripheral Interface 0*/
.long SPI1_IRQHandler /* Serial peripheral Interface 1*/
.long I2S0_Tx_IRQHandler /* Integrated interchip sound 0 transmit interrupt*/
.long I2S0_Rx_IRQHandler /* Integrated interchip sound 0 receive interrupt*/
.long LPUART0_IRQHandler /* LPUART0 receive/transmit/error interrupt*/
.long LPUART1_IRQHandler /* LPUART1 receive/transmit/error interrupt*/
.long LPUART2_IRQHandler /* LPUART2 receive/transmit/error interrupt*/
.long LPUART3_IRQHandler /* LPUART3 receive/transmit/error interrupt*/
.long LPUART4_IRQHandler /* LPUART4 receive/transmit/error interrupt*/
.long Reserved51_IRQHandler /* Reserved interrupt*/
.long Reserved52_IRQHandler /* Reserved interrupt*/
.long EMVSIM0_IRQHandler /* EMVSIM0 common interrupt*/
.long EMVSIM1_IRQHandler /* EMVSIM1 common interrupt*/
.long ADC0_IRQHandler /* Analog-to-digital converter 0*/
.long CMP0_IRQHandler /* Comparator 0*/
.long CMP1_IRQHandler /* Comparator 1*/
.long FTM0_IRQHandler /* FlexTimer module 0 fault, overflow and channels interrupt*/
.long FTM1_IRQHandler /* FlexTimer module 1 fault, overflow and channels interrupt*/
.long FTM2_IRQHandler /* FlexTimer module 2 fault, overflow and channels interrupt*/
.long CMT_IRQHandler /* Carrier modulator transmitter*/
.long RTC_IRQHandler /* Real time clock*/
.long RTC_Seconds_IRQHandler /* Real time clock seconds*/
.long PIT0CH0_IRQHandler /* Periodic interrupt timer 0 channel 0*/
.long PIT0CH1_IRQHandler /* Periodic interrupt timer 0 channel 1*/
.long PIT0CH2_IRQHandler /* Periodic interrupt timer 0 channel 2*/
.long PIT0CH3_IRQHandler /* Periodic interrupt timer 0 channel 3*/
.long PDB0_IRQHandler /* Programmable delay block*/
.long USB0_IRQHandler /* USB OTG interrupt*/
.long USBDCD_IRQHandler /* USB charger detect*/
.long Reserved71_IRQHandler /* Reserved interrupt*/
.long DAC0_IRQHandler /* Digital-to-analog converter 0*/
.long MCG_IRQHandler /* Multipurpose clock generator*/
.long LPTMR0_LPTMR1_IRQHandler /* Single interrupt vector for Low Power Timer 0 and 1*/
.long PORTA_IRQHandler /* Port A pin detect interrupt*/
.long PORTB_IRQHandler /* Port B pin detect interrupt*/
.long PORTC_IRQHandler /* Port C pin detect interrupt*/
.long PORTD_IRQHandler /* Port D pin detect interrupt*/
.long PORTE_IRQHandler /* Port E pin detect interrupt*/
.long SWI_IRQHandler /* Software interrupt*/
.long SPI2_IRQHandler /* Serial peripheral Interface 2*/
.long Reserved82_IRQHandler /* Reserved interrupt*/
.long Reserved83_IRQHandler /* Reserved interrupt*/
.long Reserved84_IRQHandler /* Reserved interrupt*/
.long Reserved85_IRQHandler /* Reserved interrupt*/
.long FLEXIO0_IRQHandler /* FLEXIO0*/
.long FTM3_IRQHandler /* FlexTimer module 3 fault, overflow and channels interrupt*/
.long Reserved88_IRQHandler /* Reserved interrupt*/
.long Reserved89_IRQHandler /* Reserved interrupt*/
.long I2C2_IRQHandler /* Inter-integrated circuit 2*/
.long Reserved91_IRQHandler /* Reserved interrupt*/
.long Reserved92_IRQHandler /* Reserved interrupt*/
.long Reserved93_IRQHandler /* Reserved interrupt*/
.long Reserved94_IRQHandler /* Reserved interrupt*/
.long Reserved95_IRQHandler /* Reserved interrupt*/
.long Reserved96_IRQHandler /* Reserved interrupt*/
.long SDHC_IRQHandler /* Secured digital host controller*/
.long Reserved98_IRQHandler /* Reserved interrupt*/
.long Reserved99_IRQHandler /* Reserved interrupt*/
.long Reserved100_IRQHandler /* Reserved interrupt*/
.long Reserved101_IRQHandler /* Reserved interrupt*/
.long Reserved102_IRQHandler /* Reserved interrupt*/
.long TSI0_IRQHandler /* Touch Sensing Input*/
.long TPM1_IRQHandler /* TPM1 single interrupt vector for all sources*/
.long TPM2_IRQHandler /* TPM2 single interrupt vector for all sources*/
.long Reserved106_IRQHandler /* Reserved interrupt*/
.long I2C3_IRQHandler /* Inter-integrated circuit 3*/
.long Reserved108_IRQHandler /* Reserved interrupt*/
.long Reserved109_IRQHandler /* Reserved interrupt*/
.long Reserved110_IRQHandler /* Reserved interrupt*/
.long Reserved111_IRQHandler /* Reserved interrupt*/
.long Reserved112_IRQHandler /* Reserved interrupt*/
.long Reserved113_IRQHandler /* Reserved interrupt*/
.long Reserved114_IRQHandler /* Reserved interrupt*/
.long Reserved115_IRQHandler /* Reserved interrupt*/
.long QuadSPI0_IRQHandler /* qspi*/
.long Reserved117_IRQHandler /* Reserved interrupt*/
.long Reserved118_IRQHandler /* Reserved interrupt*/
.long Reserved119_IRQHandler /* Reserved interrupt*/
.long LTC0_IRQHandler /* LP Trusted Cryptography*/
.long Reserved121_IRQHandler /* Reserved interrupt*/
.long Reserved122_IRQHandler /* Reserved interrupt*/
.long DefaultISR /* 123*/
.long DefaultISR /* 124*/
.long DefaultISR /* 125*/
.long DefaultISR /* 126*/
.long DefaultISR /* 127*/
.long DefaultISR /* 128*/
.long DefaultISR /* 129*/
.long DefaultISR /* 130*/
.long DefaultISR /* 131*/
.long DefaultISR /* 132*/
.long DefaultISR /* 133*/
.long DefaultISR /* 134*/
.long DefaultISR /* 135*/
.long DefaultISR /* 136*/
.long DefaultISR /* 137*/
.long DefaultISR /* 138*/
.long DefaultISR /* 139*/
.long DefaultISR /* 140*/
.long DefaultISR /* 141*/
.long DefaultISR /* 142*/
.long DefaultISR /* 143*/
.long DefaultISR /* 144*/
.long DefaultISR /* 145*/
.long DefaultISR /* 146*/
.long DefaultISR /* 147*/
.long DefaultISR /* 148*/
.long DefaultISR /* 149*/
.long DefaultISR /* 150*/
.long DefaultISR /* 151*/
.long DefaultISR /* 152*/
.long DefaultISR /* 153*/
.long DefaultISR /* 154*/
.long DefaultISR /* 155*/
.long DefaultISR /* 156*/
.long DefaultISR /* 157*/
.long DefaultISR /* 158*/
.long DefaultISR /* 159*/
.long DefaultISR /* 160*/
.long DefaultISR /* 161*/
.long DefaultISR /* 162*/
.long DefaultISR /* 163*/
.long DefaultISR /* 164*/
.long DefaultISR /* 165*/
.long DefaultISR /* 166*/
.long DefaultISR /* 167*/
.long DefaultISR /* 168*/
.long DefaultISR /* 169*/
.long DefaultISR /* 170*/
.long DefaultISR /* 171*/
.long DefaultISR /* 172*/
.long DefaultISR /* 173*/
.long DefaultISR /* 174*/
.long DefaultISR /* 175*/
.long DefaultISR /* 176*/
.long DefaultISR /* 177*/
.long DefaultISR /* 178*/
.long DefaultISR /* 179*/
.long DefaultISR /* 180*/
.long DefaultISR /* 181*/
.long DefaultISR /* 182*/
.long DefaultISR /* 183*/
.long DefaultISR /* 184*/
.long DefaultISR /* 185*/
.long DefaultISR /* 186*/
.long DefaultISR /* 187*/
.long DefaultISR /* 188*/
.long DefaultISR /* 189*/
.long DefaultISR /* 190*/
.long DefaultISR /* 191*/
.long DefaultISR /* 192*/
.long DefaultISR /* 193*/
.long DefaultISR /* 194*/
.long DefaultISR /* 195*/
.long DefaultISR /* 196*/
.long DefaultISR /* 197*/
.long DefaultISR /* 198*/
.long DefaultISR /* 199*/
.long DefaultISR /* 200*/
.long DefaultISR /* 201*/
.long DefaultISR /* 202*/
.long DefaultISR /* 203*/
.long DefaultISR /* 204*/
.long DefaultISR /* 205*/
.long DefaultISR /* 206*/
.long DefaultISR /* 207*/
.long DefaultISR /* 208*/
.long DefaultISR /* 209*/
.long DefaultISR /* 210*/
.long DefaultISR /* 211*/
.long DefaultISR /* 212*/
.long DefaultISR /* 213*/
.long DefaultISR /* 214*/
.long DefaultISR /* 215*/
.long DefaultISR /* 216*/
.long DefaultISR /* 217*/
.long DefaultISR /* 218*/
.long DefaultISR /* 219*/
.long DefaultISR /* 220*/
.long DefaultISR /* 221*/
.long DefaultISR /* 222*/
.long DefaultISR /* 223*/
.long DefaultISR /* 224*/
.long DefaultISR /* 225*/
.long DefaultISR /* 226*/
.long DefaultISR /* 227*/
.long DefaultISR /* 228*/
.long DefaultISR /* 229*/
.long DefaultISR /* 230*/
.long DefaultISR /* 231*/
.long DefaultISR /* 232*/
.long DefaultISR /* 233*/
.long DefaultISR /* 234*/
.long DefaultISR /* 235*/
.long DefaultISR /* 236*/
.long DefaultISR /* 237*/
.long DefaultISR /* 238*/
.long DefaultISR /* 239*/
.size __isr_vector, . - __isr_vector
/* Flash Configuration */
.section .FlashConfig, "a"
.long 0xFFFFFFFF
.long 0xFFFFFFFF
.long 0xFFFFFFFF
.long 0xFFFFBDFE
.section BootloaderPatchHandler, "a"
.thumb
/* Reset Handler */
.thumb_func
.align 2
.globl Reset_Handler
.weak Reset_Handler
.type Reset_Handler, %function
Reset_Handler:
cpsid i /* Mask interrupts */
ldr r0, = ROM_PatchHandler
blx r0
#ifndef __NO_SYSTEM_INIT
ldr r0, = SystemInit
blx r0
#endif
ldr r0, = init_data_bss
blx r0
cpsie i /* Unmask interrupts */
#ifndef __START
#define __START _start
#endif
#ifndef __ATOLLIC__
ldr r0, = __START
blx r0
#else
ldr r0,= __libc_init_array
blx r0
ldr r0, = main,
bx r0
#endif
.pool
.size Reset_Handler, . - Reset_Handler
.text
.thumb
.align 1
.thumb_func
.weak DefaultISR
.type DefaultISR, %function
DefaultISR:
b DefaultISR
.size DefaultISR, . - DefaultISR
/* Macro to define default handlers. Default handler
* will be weak symbol and just dead loops. They can be
* overwritten by other handlers */
.macro def_irq_handler handler_name
.weak \handler_name
.set \handler_name, DefaultISR
.endm
/* Exception Handlers */
def_irq_handler NMI_Handler
def_irq_handler HardFault_Handler
def_irq_handler MemManage_Handler
def_irq_handler BusFault_Handler
def_irq_handler UsageFault_Handler
def_irq_handler SVC_Handler
def_irq_handler DebugMon_Handler
def_irq_handler PendSV_Handler
def_irq_handler SysTick_Handler
def_irq_handler DMA0_DMA16_IRQHandler
def_irq_handler DMA1_DMA17_IRQHandler
def_irq_handler DMA2_DMA18_IRQHandler
def_irq_handler DMA3_DMA19_IRQHandler
def_irq_handler DMA4_DMA20_IRQHandler
def_irq_handler DMA5_DMA21_IRQHandler
def_irq_handler DMA6_DMA22_IRQHandler
def_irq_handler DMA7_DMA23_IRQHandler
def_irq_handler DMA8_DMA24_IRQHandler
def_irq_handler DMA9_DMA25_IRQHandler
def_irq_handler DMA10_DMA26_IRQHandler
def_irq_handler DMA11_DMA27_IRQHandler
def_irq_handler DMA12_DMA28_IRQHandler
def_irq_handler DMA13_DMA29_IRQHandler
def_irq_handler DMA14_DMA30_IRQHandler
def_irq_handler DMA15_DMA31_IRQHandler
def_irq_handler DMA_Error_IRQHandler
def_irq_handler MCM_IRQHandler
def_irq_handler FTFA_IRQHandler
def_irq_handler Read_Collision_IRQHandler
def_irq_handler LVD_LVW_IRQHandler
def_irq_handler LLWU_IRQHandler
def_irq_handler WDOG_EWM_IRQHandler
def_irq_handler TRNG0_IRQHandler
def_irq_handler I2C0_IRQHandler
def_irq_handler I2C1_IRQHandler
def_irq_handler SPI0_IRQHandler
def_irq_handler SPI1_IRQHandler
def_irq_handler I2S0_Tx_IRQHandler
def_irq_handler I2S0_Rx_IRQHandler
def_irq_handler LPUART0_IRQHandler
def_irq_handler LPUART1_IRQHandler
def_irq_handler LPUART2_IRQHandler
def_irq_handler LPUART3_IRQHandler
def_irq_handler LPUART4_IRQHandler
def_irq_handler Reserved51_IRQHandler
def_irq_handler Reserved52_IRQHandler
def_irq_handler EMVSIM0_IRQHandler
def_irq_handler EMVSIM1_IRQHandler
def_irq_handler ADC0_IRQHandler
def_irq_handler CMP0_IRQHandler
def_irq_handler CMP1_IRQHandler
def_irq_handler FTM0_IRQHandler
def_irq_handler FTM1_IRQHandler
def_irq_handler FTM2_IRQHandler
def_irq_handler CMT_IRQHandler
def_irq_handler RTC_IRQHandler
def_irq_handler RTC_Seconds_IRQHandler
def_irq_handler PIT0CH0_IRQHandler
def_irq_handler PIT0CH1_IRQHandler
def_irq_handler PIT0CH2_IRQHandler
def_irq_handler PIT0CH3_IRQHandler
def_irq_handler PDB0_IRQHandler
def_irq_handler USB0_IRQHandler
def_irq_handler USBDCD_IRQHandler
def_irq_handler Reserved71_IRQHandler
def_irq_handler DAC0_IRQHandler
def_irq_handler MCG_IRQHandler
def_irq_handler LPTMR0_LPTMR1_IRQHandler
def_irq_handler PORTA_IRQHandler
def_irq_handler PORTB_IRQHandler
def_irq_handler PORTC_IRQHandler
def_irq_handler PORTD_IRQHandler
def_irq_handler PORTE_IRQHandler
def_irq_handler SWI_IRQHandler
def_irq_handler SPI2_IRQHandler
def_irq_handler Reserved82_IRQHandler
def_irq_handler Reserved83_IRQHandler
def_irq_handler Reserved84_IRQHandler
def_irq_handler Reserved85_IRQHandler
def_irq_handler FLEXIO0_IRQHandler
def_irq_handler FTM3_IRQHandler
def_irq_handler Reserved88_IRQHandler
def_irq_handler Reserved89_IRQHandler
def_irq_handler I2C2_IRQHandler
def_irq_handler Reserved91_IRQHandler
def_irq_handler Reserved92_IRQHandler
def_irq_handler Reserved93_IRQHandler
def_irq_handler Reserved94_IRQHandler
def_irq_handler Reserved95_IRQHandler
def_irq_handler Reserved96_IRQHandler
def_irq_handler SDHC_IRQHandler
def_irq_handler Reserved98_IRQHandler
def_irq_handler Reserved99_IRQHandler
def_irq_handler Reserved100_IRQHandler
def_irq_handler Reserved101_IRQHandler
def_irq_handler Reserved102_IRQHandler
def_irq_handler TSI0_IRQHandler
def_irq_handler TPM1_IRQHandler
def_irq_handler TPM2_IRQHandler
def_irq_handler Reserved106_IRQHandler
def_irq_handler I2C3_IRQHandler
def_irq_handler Reserved108_IRQHandler
def_irq_handler Reserved109_IRQHandler
def_irq_handler Reserved110_IRQHandler
def_irq_handler Reserved111_IRQHandler
def_irq_handler Reserved112_IRQHandler
def_irq_handler Reserved113_IRQHandler
def_irq_handler Reserved114_IRQHandler
def_irq_handler Reserved115_IRQHandler
def_irq_handler QuadSPI0_IRQHandler
def_irq_handler Reserved117_IRQHandler
def_irq_handler Reserved118_IRQHandler
def_irq_handler Reserved119_IRQHandler
def_irq_handler LTC0_IRQHandler
def_irq_handler Reserved121_IRQHandler
def_irq_handler Reserved122_IRQHandler
.end
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,316 @@
/*
** ###################################################################
** Processors: MK82FN256CAx15
** MK82FN256VDC15
** MK82FN256VLL15
** MK82FN256VLQ15
**
** Compilers: Keil ARM C/C++ Compiler
** Freescale C/C++ for Embedded ARM
** GNU C Compiler
** GNU C Compiler - CodeSourcery Sourcery G++
** IAR ANSI C/C++ Compiler for ARM
**
** Reference manual: K82P121M150SF5RM, Rev. 0, May 2015
** Version: rev. 1.1, 2015-05-28
** Build: b150626
**
** 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 (c) 2015 Freescale Semiconductor, Inc.
** All rights reserved.
**
** Redistribution and use in source and binary forms, with or without modification,
** are permitted provided that the following conditions are met:
**
** o Redistributions of source code must retain the above copyright notice, this list
** of conditions and the following disclaimer.
**
** o 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.
**
** o Neither the name of Freescale Semiconductor, Inc. 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.
**
** http: www.freescale.com
** mail: support@freescale.com
**
** Revisions:
** - rev. 1.0 (2015-04-09)
** Initial version
** - rev. 1.1 (2015-05-28)
** Update according to the reference manual Rev. 0.
**
** ###################################################################
*/
/*!
* @file MK82F25615
* @version 1.1
* @date 2015-05-28
* @brief Device specific configuration file for MK82F25615 (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 "fsl_device_registers.h"
/*!
* @brief Defines the structure to set the Bootloader Configuration Area
*
* This type of variable is used to set the Bootloader Configuration Area
* of the chip.
*/
typedef struct SystemBootloaderConfig
{
uint32_t tag; /*!< Magic number to verify bootloader configuration is valid. Must be set to 'kcfg'. */
uint32_t crcStartAddress; /*!< Start address for application image CRC check. If the bits are all set then Kinetis
bootloader by default will not perform any CRC check. */
uint32_t crcByteCount; /*!< Byte count for application image CRC check. If the bits are all set then Kinetis
bootloader by default will not prform any CRC check. */
uint32_t crcExpectedValue; /*!< Expected CRC value for application CRC check. If the bits are all set then Kinetis
bootloader by default will not perform any CRC check.*/
uint8_t enabledPeripherals; /*!< Bitfield of peripherals to enable.
bit 0 - LPUART, bit 1 - I2C, bit 2 - SPI, bit 4 - USB
Kinetis bootloader will enable the peripheral if corresponding bit is set to 1. */
uint8_t i2cSlaveAddress; /*!< If not 0xFF, used as the 7-bit I2C slave address. If 0xFF, defaults to 0x10 for I2C
slave address */
uint16_t peripheralDetectionTimeoutMs; /*!< Timeout in milliseconds for active peripheral detection. If 0xFFFF,
defaults to 5 seconds. */
uint16_t usbVid; /*!< Sets the USB Vendor ID reported by the device during enumeration. If 0xFFFF, it defaults to
0x15A2. */
uint16_t usbPid; /*!< Sets the USB Product ID reported by the device during enumeration. */
uint32_t usbStringsPointer; /*!< Sets the USB Strings reported by the device during enumeration. */
uint8_t clockFlags; /*!< The flags in the clockFlags configuration field are enabled if the corresponding bit is
cleared (0).
bit 0 - HighSpeed Enable high speed mode (i.e., 48 MHz). */
uint8_t clockDivider; /*!< Inverted value of the divider to use for core and bus clocks when in high speed mode */
uint8_t bootFlags; /*!< If bit 0 is cleared, then Kinetis bootloader will jump to either Quad SPI Flash or internal
flash image depending on FOPT BOOTSRC_SEL bits.
If the bit is set, then Kinetis bootloader will prepare for host communication over serial
peripherals. */
uint8_t RESERVED1;
uint32_t mmcauConfigPointer; /*!< A pointer to the MMCAU configuration structure in memory. */
uint32_t keyBlobPointer; /*!< A pointer to the keyblob data in memory. */
uint8_t RESERVED2[8];
uint32_t qspiConfigBlockPtr; /*!< A pointer to the QSPI config block in internal flash array. */
uint8_t RESERVED3[12];
} system_bootloader_config_t;
#ifdef BOOTLOADER_CONFIG
/* Bootlader configuration area */
#if defined(__IAR_SYSTEMS_ICC__)
/* Pragma to place the Bootloader Configuration Array on correct location defined in linker file. */
#pragma language = extended
#pragma location = "BootloaderConfig"
__root const system_bootloader_config_t BootloaderConfig @"BootloaderConfig" =
#elif defined(__GNUC__)
__attribute__((section(".BootloaderConfig"))) const system_bootloader_config_t BootloaderConfig =
#elif defined(__CC_ARM)
__attribute__((section("BootloaderConfig"))) const system_bootloader_config_t BootloaderConfig __attribute__((used)) =
#else
#error Unsupported compiler!
#endif
{
.tag = 0x6766636BU, /* Magic Number */
.crcStartAddress = 0xFFFFFFFFU, /* Disable CRC check */
.crcByteCount = 0xFFFFFFFFU, /* Disable CRC check */
.crcExpectedValue = 0xFFFFFFFFU, /* Disable CRC check */
.enabledPeripherals = 0x17, /* Enable all peripherals */
.i2cSlaveAddress = 0xFF, /* Use default I2C address */
.peripheralDetectionTimeoutMs = 0x01F4U, /* Timeout :500ms */
.usbVid = 0xFFFFU, /* Use default USB Vendor ID */
.usbPid = 0xFFFFU, /* Use default USB Product ID */
.usbStringsPointer = 0xFFFFFFFFU, /* Use default USB Strings */
.clockFlags = 0x01, /* Enable High speed mode */
.clockDivider = 0xFF, /* Use clock divider 1 */
.bootFlags = 0x01, /* Enable communication with host */
.mmcauConfigPointer = 0xFFFFFFFFU, /* No MMCAU configuration */
.keyBlobPointer = 0x00001000U, /* keyblob data is at 0x1000 */
.qspiConfigBlockPtr = 0xFFFFFFFFU /* No QSPI configuration */
};
#endif
/* ----------------------------------------------------------------------------
-- Core clock
---------------------------------------------------------------------------- */
uint32_t SystemCoreClock = 20971520u;
/* ----------------------------------------------------------------------------
-- SystemInit()
---------------------------------------------------------------------------- */
void SystemInit(void)
{
#if ((__FPU_PRESENT == 1) && (__FPU_USED == 1))
SCB->CPACR |= ((3UL << 10 * 2) | (3UL << 11 * 2)); /* set CP10, CP11 Full Access */
#endif /* ((__FPU_PRESENT == 1) && (__FPU_USED == 1)) */
#if (DISABLE_WDOG)
/* WDOG->UNLOCK: WDOGUNLOCK=0xC520 */
WDOG->UNLOCK = WDOG_UNLOCK_WDOGUNLOCK(0xC520); /* Key 1 */
/* WDOG->UNLOCK: WDOGUNLOCK=0xD928 */
WDOG->UNLOCK = WDOG_UNLOCK_WDOGUNLOCK(0xD928); /* Key 2 */
/* WDOG->STCTRLH:
* ?=0,DISTESTWDOG=0,BYTESEL=0,TESTSEL=0,TESTWDOG=0,?=0,?=1,WAITEN=1,STOPEN=1,DBGEN=0,ALLOWUPDATE=1,WINEN=0,IRQRSTEN=0,CLKSRC=1,WDOGEN=0
*/
WDOG->STCTRLH = WDOG_STCTRLH_BYTESEL(0x00) | WDOG_STCTRLH_WAITEN_MASK | WDOG_STCTRLH_STOPEN_MASK |
WDOG_STCTRLH_ALLOWUPDATE_MASK | WDOG_STCTRLH_CLKSRC_MASK | 0x0100U;
#endif /* (DISABLE_WDOG) */
}
/* ----------------------------------------------------------------------------
-- SystemCoreClockUpdate()
---------------------------------------------------------------------------- */
void SystemCoreClockUpdate(void)
{
uint32_t MCGOUTClock; /* Variable to store output clock frequency of the MCG module */
uint16_t Divider;
if ((MCG->C1 & MCG_C1_CLKS_MASK) == 0x00U)
{
/* Output of FLL or PLL is selected */
if ((MCG->C6 & MCG_C6_PLLS_MASK) == 0x00U)
{
/* FLL is selected */
if ((MCG->C1 & MCG_C1_IREFS_MASK) == 0x00U)
{
/* External reference clock is selected */
switch (MCG->C7 & MCG_C7_OSCSEL_MASK)
{
case 0x00U:
MCGOUTClock = CPU_XTAL_CLK_HZ; /* System oscillator drives MCG clock */
break;
case 0x01U:
MCGOUTClock = CPU_XTAL32k_CLK_HZ; /* RTC 32 kHz oscillator drives MCG clock */
break;
case 0x02U:
default:
MCGOUTClock = CPU_INT_IRC_CLK_HZ; /* IRC 48MHz oscillator drives MCG clock */
break;
}
if (((MCG->C2 & MCG_C2_RANGE_MASK) != 0x00U) && ((MCG->C7 & MCG_C7_OSCSEL_MASK) != 0x01U))
{
switch (MCG->C1 & MCG_C1_FRDIV_MASK)
{
case 0x38U:
Divider = 1536U;
break;
case 0x30U:
Divider = 1280U;
break;
default:
Divider = (uint16_t)(32LU << ((MCG->C1 & MCG_C1_FRDIV_MASK) >> MCG_C1_FRDIV_SHIFT));
break;
}
}
else
{ /* ((MCG->C2 & MCG_C2_RANGE_MASK) != 0x00U) */
Divider = (uint16_t)(1LU << ((MCG->C1 & MCG_C1_FRDIV_MASK) >> MCG_C1_FRDIV_SHIFT));
}
MCGOUTClock = (MCGOUTClock / Divider); /* Calculate the divided FLL reference clock */
}
else
{ /* (!((MCG->C1 & MCG_C1_IREFS_MASK) == 0x00U)) */
MCGOUTClock = CPU_INT_SLOW_CLK_HZ; /* The slow internal reference clock is selected */
} /* (!((MCG->C1 & MCG_C1_IREFS_MASK) == 0x00U)) */
/* Select correct multiplier to calculate the MCG output clock */
switch (MCG->C4 & (MCG_C4_DMX32_MASK | MCG_C4_DRST_DRS_MASK))
{
case 0x00U:
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) == 0x00U)) */
/* PLL is selected */
Divider = (((uint16_t)MCG->C5 & MCG_C5_PRDIV_MASK) + 0x01U);
MCGOUTClock = (uint32_t)(CPU_XTAL_CLK_HZ / Divider); /* Calculate the PLL reference clock */
Divider = (((uint16_t)MCG->C6 & MCG_C6_VDIV_MASK) + 16U);
MCGOUTClock *= Divider; /* Calculate the VCO output clock */
MCGOUTClock /= 2; /* Calculate the MCG output clock */
} /* (!((MCG->C6 & MCG_C6_PLLS_MASK) == 0x00U)) */
}
else if ((MCG->C1 & MCG_C1_CLKS_MASK) == 0x40U)
{
/* Internal reference clock is selected */
if ((MCG->C2 & MCG_C2_IRCS_MASK) == 0x00U)
{
MCGOUTClock = CPU_INT_SLOW_CLK_HZ; /* Slow internal reference clock selected */
}
else
{ /* (!((MCG->C2 & MCG_C2_IRCS_MASK) == 0x00U)) */
Divider = (uint16_t)(0x01LU << ((MCG->SC & MCG_SC_FCRDIV_MASK) >> MCG_SC_FCRDIV_SHIFT));
MCGOUTClock = (uint32_t)(CPU_INT_FAST_CLK_HZ / Divider); /* Fast internal reference clock selected */
} /* (!((MCG->C2 & MCG_C2_IRCS_MASK) == 0x00U)) */
}
else if ((MCG->C1 & MCG_C1_CLKS_MASK) == 0x80U)
{
/* External reference clock is selected */
switch (MCG->C7 & MCG_C7_OSCSEL_MASK)
{
case 0x00U:
MCGOUTClock = CPU_XTAL_CLK_HZ; /* System oscillator drives MCG clock */
break;
case 0x01U:
MCGOUTClock = CPU_XTAL32k_CLK_HZ; /* RTC 32 kHz oscillator drives MCG clock */
break;
case 0x02U:
default:
MCGOUTClock = CPU_INT_IRC_CLK_HZ; /* IRC 48MHz oscillator drives MCG clock */
break;
}
}
else
{ /* (!((MCG->C1 & MCG_C1_CLKS_MASK) == 0x80U)) */
/* Reserved value */
return;
} /* (!((MCG->C1 & MCG_C1_CLKS_MASK) == 0x80U)) */
SystemCoreClock =
(MCGOUTClock / (0x01U + ((SIM->CLKDIV1 & SIM_CLKDIV1_OUTDIV1_MASK) >> SIM_CLKDIV1_OUTDIV1_SHIFT)));
}
@@ -0,0 +1,383 @@
/*
** ###################################################################
** Processors: MK82FN256CAx15
** MK82FN256VDC15
** MK82FN256VLL15
** MK82FN256VLQ15
**
** Compilers: Keil ARM C/C++ Compiler
** Freescale C/C++ for Embedded ARM
** GNU C Compiler
** GNU C Compiler - CodeSourcery Sourcery G++
** IAR ANSI C/C++ Compiler for ARM
**
** Reference manual: K82P121M150SF5RM, Rev. 0, May 2015
** Version: rev. 1.1, 2015-05-28
** Build: b150626
**
** 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 (c) 2015 Freescale Semiconductor, Inc.
** All rights reserved.
**
** Redistribution and use in source and binary forms, with or without modification,
** are permitted provided that the following conditions are met:
**
** o Redistributions of source code must retain the above copyright notice, this list
** of conditions and the following disclaimer.
**
** o 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.
**
** o Neither the name of Freescale Semiconductor, Inc. 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.
**
** http: www.freescale.com
** mail: support@freescale.com
**
** Revisions:
** - rev. 1.0 (2015-04-09)
** Initial version
** - rev. 1.1 (2015-05-28)
** Update according to the reference manual Rev. 0.
**
** ###################################################################
*/
/*!
* @file MK82F25615
* @version 1.1
* @date 2015-05-28
* @brief Device specific configuration file for MK82F25615 (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_MK82F25615_H_
#define SYSTEM_MK82F25615_H_ /**< Symbol preventing repeated inclusion */
#ifdef __cplusplus
extern "C" {
#endif
#include <stdint.h>
#ifndef DISABLE_WDOG
#define DISABLE_WDOG 1
#endif
/* MCG mode constants */
#define MCG_MODE_FEI 0U
#define MCG_MODE_FBI 1U
#define MCG_MODE_BLPI 2U
#define MCG_MODE_FEE 3U
#define MCG_MODE_FBE 4U
#define MCG_MODE_BLPE 5U
#define MCG_MODE_PBE 6U
#define MCG_MODE_PEE 7U
/* Predefined clock setups
0 ... Default part configuration
Multipurpose Clock Generator (MCG) in FEI mode.
Reference clock source for MCG module: Slow internal reference clock
Core clock = 20.97152MHz
Bus clock = 20.97152MHz
1 ... Maximal speed configuration
Multipurpose Clock Generator (MCG) in PEE mode.
Reference clock source for MCG module: System oscillator 0 reference clock
Core clock = 150MHz
Bus clock = 75MHz
2 ... Chip internally clocked, ready for Very Low Power Run mode.
Multipurpose Clock Generator (MCG) in BLPI mode.
Reference clock source for MCG module: Fast internal reference clock
Core clock = 4MHz
Bus clock = 4MHz
3 ... Chip externally clocked, ready for Very Low Power Run mode.
Multipurpose Clock Generator (MCG) in BLPE mode.
Reference clock source for MCG module: System oscillator 0 reference clock
Core clock = 4MHz
Bus clock = 4MHz
4 ... USB clock setup.
Multipurpose Clock Generator (MCG) in PEE mode.
Reference clock source for MCG module: System oscillator 0 reference clock
Core clock = 144MHz
Bus clock = 72MHz
5 ... Maximum achievable clock frequency configuration in RUN mode.
Multipurpose Clock Generator (MCG) in PEE mode.
Reference clock source for MCG module: System oscillator 0 reference clock
Core clock = 120MHz
Bus clock = 60MHz
*/
/* Define clock source values */
#define CPU_XTAL_CLK_HZ \
12000000U /* Value of the external crystal or oscillator clock frequency of the system oscillator (OSC) in Hz */
#define CPU_XTAL32k_CLK_HZ \
32768U /* Value of the external 32k crystal or oscillator clock frequency of the RTC 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 CPU_INT_IRC_CLK_HZ 48000000U /* Value of the 48M internal oscillator clock frequency in Hz */
/* RTC oscillator setting */
/* RTC_CR: SC2P=0,SC4P=0,SC8P=0,SC16P=0,CLKO=1,OSCE=1,WPS=0,UM=0,SUP=0,WPE=0,SWR=0 */
#define SYSTEM_RTC_CR_VALUE 0x0300U /* RTC_CR */
/* Low power mode enable */
/* SMC_PMPROT: AHSRUN=1,AVLP=1,ALLS=1,AVLLS=1 */
#define SYSTEM_SMC_PMPROT_VALUE 0xAAU /* SMC_PMPROT */
/* Internal reference clock trim */
/* #undef SLOW_TRIM_ADDRESS */ /* Slow oscillator not trimmed. Commented out for MISRA compliance. */
/* #undef SLOW_FINE_TRIM_ADDRESS */ /* Slow oscillator not trimmed. Commented out for MISRA compliance. */
/* #undef FAST_TRIM_ADDRESS */ /* Fast oscillator not trimmed. Commented out for MISRA compliance. */
/* #undef FAST_FINE_TRIM_ADDRESS */ /* Fast oscillator not trimmed. Commented out for MISRA compliance. */
#ifdef CLOCK_SETUP
#if (CLOCK_SETUP == 0)
#define DEFAULT_SYSTEM_CLOCK 20971520U /* Default System clock value */
#define MCG_MODE MCG_MODE_FEI /* Clock generator mode */
/* MCG_C1: CLKS=0,FRDIV=0,IREFS=1,IRCLKEN=1,IREFSTEN=0 */
#define SYSTEM_MCG_C1_VALUE 0x06U /* MCG_C1 */
/* MCG_C2: LOCRE0=0,FCFTRIM=0,RANGE=2,HGO=0,EREFS=1,LP=0,IRCS=0 */
#define SYSTEM_MCG_C2_VALUE 0x24U /* MCG_C2 */
/* MCG_C4: DMX32=0,DRST_DRS=0,FCTRIM=0,SCFTRIM=0 */
#define SYSTEM_MCG_C4_VALUE 0x00U /* MCG_C4 */
/* MCG_SC: ATME=0,ATMS=0,ATMF=0,FLTPRSRV=0,FCRDIV=0,LOCS0=0 */
#define SYSTEM_MCG_SC_VALUE 0x00U /* MCG_SC */
/* MCG_C5: PLLCLKEN=0,PLLSTEN=0,PRDIV=0 */
#define SYSTEM_MCG_C5_VALUE 0x00U /* MCG_C5 */
/* MCG_C6: LOLIE0=0,PLLS=0,CME0=0,VDIV=0 */
#define SYSTEM_MCG_C6_VALUE 0x00U /* MCG_C6 */
/* MCG_C7: OSCSEL=0 */
#define SYSTEM_MCG_C7_VALUE 0x00U /* MCG_C7 */
/* OSC_CR: ERCLKEN=1,EREFSTEN=0,SC2P=0,SC4P=0,SC8P=0,SC16P=0 */
#define SYSTEM_OSC_CR_VALUE 0x80U /* OSC_CR */
/* SMC_PMCTRL: RUNM=0,STOPA=0,STOPM=0 */
#define SYSTEM_SMC_PMCTRL_VALUE 0x00U /* SMC_PMCTRL */
/* SIM_CLKDIV1: OUTDIV1=0,OUTDIV2=0,OUTDIV3=1,OUTDIV4=1 */
#define SYSTEM_SIM_CLKDIV1_VALUE 0x00110000U /* SIM_CLKDIV1 */
/* SIM_CLKDIV3: PLLFLLDIV=0,PLLFLLFRAC=0 */
#define SYSTEM_SIM_CLKDIV3_VALUE 0x00U /* SIM_CLKDIV3 */
/* SIM_SOPT1: USBREGEN=0,USBSSTBY=0,USBVSTBY=0,OSC32KSEL=2,RAMSIZE=0 */
#define SYSTEM_SIM_SOPT1_VALUE 0x00080000U /* SIM_SOPT1 */
/* SIM_SOPT2:
* EMVSIMSRC=0,SDHCSRC=0,LPUARTSRC=0,TPMSRC=1,FLEXIOSRC=0,USBSRC=0,PLLFLLSEL=0,TRACECLKSEL=0,FBSL=0,CLKOUTSEL=0,RTCCLKOUTSEL=0
*/
#define SYSTEM_SIM_SOPT2_VALUE 0x01000000U /* SIM_SOPT2 */
#elif(CLOCK_SETUP == 1)
#define DEFAULT_SYSTEM_CLOCK 150000000U /* Default System clock value */
#define MCG_MODE MCG_MODE_PEE /* Clock generator mode */
/* MCG_C1: CLKS=0,FRDIV=4,IREFS=0,IRCLKEN=1,IREFSTEN=0 */
#define SYSTEM_MCG_C1_VALUE 0x22U /* MCG_C1 */
/* MCG_C2: LOCRE0=0,FCFTRIM=0,RANGE=2,HGO=0,EREFS=1,LP=0,IRCS=0 */
#define SYSTEM_MCG_C2_VALUE 0x24U /* MCG_C2 */
/* MCG_C4: DMX32=0,DRST_DRS=0,FCTRIM=0,SCFTRIM=0 */
#define SYSTEM_MCG_C4_VALUE 0x00U /* MCG_C4 */
/* MCG_SC: ATME=0,ATMS=0,ATMF=0,FLTPRSRV=0,FCRDIV=0,LOCS0=0 */
#define SYSTEM_MCG_SC_VALUE 0x00U /* MCG_SC */
/* MCG_C5: PLLCLKEN=0,PLLSTEN=0,PRDIV=0 */
#define SYSTEM_MCG_C5_VALUE 0x00U /* MCG_C5 */
/* MCG_C6: LOLIE0=0,PLLS=1,CME0=0,VDIV=9 */
#define SYSTEM_MCG_C6_VALUE 0x49U /* MCG_C6 */
/* MCG_C7: OSCSEL=0 */
#define SYSTEM_MCG_C7_VALUE 0x00U /* MCG_C7 */
/* OSC_CR: ERCLKEN=1,EREFSTEN=0,SC2P=0,SC4P=0,SC8P=0,SC16P=0 */
#define SYSTEM_OSC_CR_VALUE 0x80U /* OSC_CR */
/* SMC_PMCTRL: RUNM=3,STOPA=0,STOPM=0 */
#define SYSTEM_SMC_PMCTRL_VALUE 0x60U /* SMC_PMCTRL */
/* SIM_CLKDIV1: OUTDIV1=0,OUTDIV2=1,OUTDIV3=1,OUTDIV4=5 */
#define SYSTEM_SIM_CLKDIV1_VALUE 0x01150000U /* SIM_CLKDIV1 */
/* SIM_CLKDIV3: PLLFLLDIV=0,PLLFLLFRAC=0 */
#define SYSTEM_SIM_CLKDIV3_VALUE 0x00U /* SIM_CLKDIV3 */
/* SIM_SOPT1: USBREGEN=0,USBSSTBY=0,USBVSTBY=0,OSC32KSEL=2,RAMSIZE=0 */
#define SYSTEM_SIM_SOPT1_VALUE 0x00080000U /* SIM_SOPT1 */
/* SIM_SOPT2:
* EMVSIMSRC=0,SDHCSRC=0,LPUARTSRC=0,TPMSRC=1,FLEXIOSRC=0,USBSRC=0,PLLFLLSEL=1,TRACECLKSEL=0,FBSL=0,CLKOUTSEL=0,RTCCLKOUTSEL=0
*/
#define SYSTEM_SIM_SOPT2_VALUE 0x01010000U /* SIM_SOPT2 */
#elif(CLOCK_SETUP == 2)
#define DEFAULT_SYSTEM_CLOCK 4000000U /* Default System clock value */
#define MCG_MODE MCG_MODE_BLPI /* Clock generator mode */
/* MCG_C1: CLKS=1,FRDIV=0,IREFS=1,IRCLKEN=1,IREFSTEN=0 */
#define SYSTEM_MCG_C1_VALUE 0x46U /* MCG_C1 */
/* MCG_C2: LOCRE0=0,FCFTRIM=0,RANGE=2,HGO=0,EREFS=1,LP=1,IRCS=1 */
#define SYSTEM_MCG_C2_VALUE 0x27U /* MCG_C2 */
/* MCG_C4: DMX32=0,DRST_DRS=0,FCTRIM=0,SCFTRIM=0 */
#define SYSTEM_MCG_C4_VALUE 0x00U /* MCG_C4 */
/* MCG_SC: ATME=0,ATMS=0,ATMF=0,FLTPRSRV=0,FCRDIV=0,LOCS0=0 */
#define SYSTEM_MCG_SC_VALUE 0x00U /* MCG_SC */
/* MCG_C5: PLLCLKEN=0,PLLSTEN=0,PRDIV=0 */
#define SYSTEM_MCG_C5_VALUE 0x00U /* MCG_C5 */
/* MCG_C6: LOLIE0=0,PLLS=0,CME0=0,VDIV=0 */
#define SYSTEM_MCG_C6_VALUE 0x00U /* MCG_C6 */
/* MCG_C7: OSCSEL=0 */
#define SYSTEM_MCG_C7_VALUE 0x00U /* MCG_C7 */
/* OSC_CR: ERCLKEN=1,EREFSTEN=0,SC2P=0,SC4P=0,SC8P=0,SC16P=0 */
#define SYSTEM_OSC_CR_VALUE 0x80U /* OSC_CR */
/* SMC_PMCTRL: RUNM=0,STOPA=0,STOPM=0 */
#define SYSTEM_SMC_PMCTRL_VALUE 0x00U /* SMC_PMCTRL */
/* SIM_CLKDIV1: OUTDIV1=0,OUTDIV2=0,OUTDIV3=0,OUTDIV4=4 */
#define SYSTEM_SIM_CLKDIV1_VALUE 0x00040000U /* SIM_CLKDIV1 */
/* SIM_CLKDIV3: PLLFLLDIV=0,PLLFLLFRAC=0 */
#define SYSTEM_SIM_CLKDIV3_VALUE 0x00U /* SIM_CLKDIV3 */
/* SIM_SOPT1: USBREGEN=0,USBSSTBY=0,USBVSTBY=0,OSC32KSEL=2,RAMSIZE=0 */
#define SYSTEM_SIM_SOPT1_VALUE 0x00080000U /* SIM_SOPT1 */
/* SIM_SOPT2:
* EMVSIMSRC=0,SDHCSRC=0,LPUARTSRC=0,TPMSRC=1,FLEXIOSRC=0,USBSRC=0,PLLFLLSEL=3,TRACECLKSEL=0,FBSL=0,CLKOUTSEL=0,RTCCLKOUTSEL=0
*/
#define SYSTEM_SIM_SOPT2_VALUE 0x01030000U /* SIM_SOPT2 */
#elif(CLOCK_SETUP == 3)
#define DEFAULT_SYSTEM_CLOCK 4000000U /* Default System clock value */
#define MCG_MODE MCG_MODE_BLPE /* Clock generator mode */
/* MCG_C1: CLKS=2,FRDIV=4,IREFS=0,IRCLKEN=1,IREFSTEN=0 */
#define SYSTEM_MCG_C1_VALUE 0xA2U /* MCG_C1 */
/* MCG_C2: LOCRE0=0,FCFTRIM=0,RANGE=2,HGO=0,EREFS=1,LP=1,IRCS=1 */
#define SYSTEM_MCG_C2_VALUE 0x27U /* MCG_C2 */
/* MCG_C4: DMX32=0,DRST_DRS=0,FCTRIM=0,SCFTRIM=0 */
#define SYSTEM_MCG_C4_VALUE 0x00U /* MCG_C4 */
/* MCG_SC: ATME=0,ATMS=0,ATMF=0,FLTPRSRV=0,FCRDIV=0,LOCS0=0 */
#define SYSTEM_MCG_SC_VALUE 0x00U /* MCG_SC */
/* MCG_C5: PLLCLKEN=0,PLLSTEN=0,PRDIV=0 */
#define SYSTEM_MCG_C5_VALUE 0x00U /* MCG_C5 */
/* MCG_C6: LOLIE0=0,PLLS=0,CME0=0,VDIV=0 */
#define SYSTEM_MCG_C6_VALUE 0x00U /* MCG_C6 */
/* MCG_C7: OSCSEL=0 */
#define SYSTEM_MCG_C7_VALUE 0x00U /* MCG_C7 */
/* OSC_CR: ERCLKEN=1,EREFSTEN=0,SC2P=0,SC4P=0,SC8P=0,SC16P=0 */
#define SYSTEM_OSC_CR_VALUE 0x80U /* OSC_CR */
/* SMC_PMCTRL: RUNM=0,STOPA=0,STOPM=0 */
#define SYSTEM_SMC_PMCTRL_VALUE 0x00U /* SMC_PMCTRL */
/* SIM_CLKDIV1: OUTDIV1=2,OUTDIV2=2,OUTDIV3=2,OUTDIV4=0x0B */
#define SYSTEM_SIM_CLKDIV1_VALUE 0x222B0000U /* SIM_CLKDIV1 */
/* SIM_CLKDIV3: PLLFLLDIV=0,PLLFLLFRAC=0 */
#define SYSTEM_SIM_CLKDIV3_VALUE 0x00U /* SIM_CLKDIV3 */
/* SIM_SOPT1: USBREGEN=0,USBSSTBY=0,USBVSTBY=0,OSC32KSEL=2,RAMSIZE=0 */
#define SYSTEM_SIM_SOPT1_VALUE 0x00080000U /* SIM_SOPT1 */
/* SIM_SOPT2:
* EMVSIMSRC=0,SDHCSRC=0,LPUARTSRC=0,TPMSRC=1,FLEXIOSRC=0,USBSRC=0,PLLFLLSEL=3,TRACECLKSEL=0,FBSL=0,CLKOUTSEL=0,RTCCLKOUTSEL=0
*/
#define SYSTEM_SIM_SOPT2_VALUE 0x01030000U /* SIM_SOPT2 */
#elif(CLOCK_SETUP == 4)
#define DEFAULT_SYSTEM_CLOCK 144000000U /* Default System clock value */
#define MCG_MODE MCG_MODE_PEE /* Clock generator mode */
/* MCG_C1: CLKS=0,FRDIV=4,IREFS=0,IRCLKEN=1,IREFSTEN=0 */
#define SYSTEM_MCG_C1_VALUE 0x22U /* MCG_C1 */
/* MCG_C2: LOCRE0=0,FCFTRIM=0,RANGE=2,HGO=0,EREFS=1,LP=0,IRCS=0 */
#define SYSTEM_MCG_C2_VALUE 0x24U /* MCG_C2 */
/* MCG_C4: DMX32=0,DRST_DRS=0,FCTRIM=0,SCFTRIM=0 */
#define SYSTEM_MCG_C4_VALUE 0x00U /* MCG_C4 */
/* MCG_SC: ATME=0,ATMS=0,ATMF=0,FLTPRSRV=0,FCRDIV=0,LOCS0=0 */
#define SYSTEM_MCG_SC_VALUE 0x00U /* MCG_SC */
/* MCG_C5: PLLCLKEN=0,PLLSTEN=0,PRDIV=0 */
#define SYSTEM_MCG_C5_VALUE 0x00U /* MCG_C5 */
/* MCG_C6: LOLIE0=0,PLLS=1,CME0=0,VDIV=8 */
#define SYSTEM_MCG_C6_VALUE 0x48U /* MCG_C6 */
/* MCG_C7: OSCSEL=0 */
#define SYSTEM_MCG_C7_VALUE 0x00U /* MCG_C7 */
/* OSC_CR: ERCLKEN=1,EREFSTEN=0,SC2P=0,SC4P=0,SC8P=0,SC16P=0 */
#define SYSTEM_OSC_CR_VALUE 0x80U /* OSC_CR */
/* SMC_PMCTRL: RUNM=3,STOPA=0,STOPM=0 */
#define SYSTEM_SMC_PMCTRL_VALUE 0x60U /* SMC_PMCTRL */
/* SIM_CLKDIV1: OUTDIV1=0,OUTDIV2=1,OUTDIV3=1,OUTDIV4=5 */
#define SYSTEM_SIM_CLKDIV1_VALUE 0x01150000U /* SIM_CLKDIV1 */
/* SIM_CLKDIV2: USBDIV=2,USBFRAC=0 */
#define SYSTEM_SIM_CLKDIV2_VALUE 0x04U /* SIM_CLKDIV2 */
/* SIM_CLKDIV3: PLLFLLDIV=0,PLLFLLFRAC=0 */
#define SYSTEM_SIM_CLKDIV3_VALUE 0x00U /* SIM_CLKDIV3 */
/* SIM_SOPT1: USBREGEN=0,USBSSTBY=0,USBVSTBY=0,OSC32KSEL=2,RAMSIZE=0 */
#define SYSTEM_SIM_SOPT1_VALUE 0x00080000U /* SIM_SOPT1 */
/* SIM_SOPT2:
* EMVSIMSRC=0,SDHCSRC=0,LPUARTSRC=0,TPMSRC=1,FLEXIOSRC=0,USBSRC=0,PLLFLLSEL=1,TRACECLKSEL=0,FBSL=0,CLKOUTSEL=0,RTCCLKOUTSEL=0
*/
#define SYSTEM_SIM_SOPT2_VALUE 0x01010000U /* SIM_SOPT2 */
#elif(CLOCK_SETUP == 5)
#define DEFAULT_SYSTEM_CLOCK 120000000U /* Default System clock value */
#define MCG_MODE MCG_MODE_PEE /* Clock generator mode */
/* MCG_C1: CLKS=0,FRDIV=4,IREFS=0,IRCLKEN=1,IREFSTEN=0 */
#define SYSTEM_MCG_C1_VALUE 0x22U /* MCG_C1 */
/* MCG_C2: LOCRE0=0,FCFTRIM=0,RANGE=2,HGO=0,EREFS=1,LP=0,IRCS=0 */
#define SYSTEM_MCG_C2_VALUE 0x24U /* MCG_C2 */
/* MCG_C4: DMX32=0,DRST_DRS=0,FCTRIM=0,SCFTRIM=0 */
#define SYSTEM_MCG_C4_VALUE 0x00U /* MCG_C4 */
/* MCG_SC: ATME=0,ATMS=0,ATMF=0,FLTPRSRV=0,FCRDIV=0,LOCS0=0 */
#define SYSTEM_MCG_SC_VALUE 0x00U /* MCG_SC */
/* MCG_C5: PLLCLKEN=0,PLLSTEN=0,PRDIV=0 */
#define SYSTEM_MCG_C5_VALUE 0x00U /* MCG_C5 */
/* MCG_C6: LOLIE0=0,PLLS=1,CME0=0,VDIV=4 */
#define SYSTEM_MCG_C6_VALUE 0x44U /* MCG_C6 */
/* MCG_C7: OSCSEL=0 */
#define SYSTEM_MCG_C7_VALUE 0x00U /* MCG_C7 */
/* OSC_CR: ERCLKEN=1,EREFSTEN=0,SC2P=0,SC4P=0,SC8P=0,SC16P=0 */
#define SYSTEM_OSC_CR_VALUE 0x80U /* OSC_CR */
/* SMC_PMCTRL: RUNM=0,STOPA=0,STOPM=0 */
#define SYSTEM_SMC_PMCTRL_VALUE 0x00U /* SMC_PMCTRL */
/* SIM_CLKDIV1: OUTDIV1=0,OUTDIV2=1,OUTDIV3=1,OUTDIV4=4 */
#define SYSTEM_SIM_CLKDIV1_VALUE 0x01140000U /* SIM_CLKDIV1 */
/* SIM_CLKDIV3: PLLFLLDIV=0,PLLFLLFRAC=0 */
#define SYSTEM_SIM_CLKDIV3_VALUE 0x00U /* SIM_CLKDIV3 */
/* SIM_SOPT1: USBREGEN=0,USBSSTBY=0,USBVSTBY=0,OSC32KSEL=2,RAMSIZE=0 */
#define SYSTEM_SIM_SOPT1_VALUE 0x00080000U /* SIM_SOPT1 */
/* SIM_SOPT2:
* EMVSIMSRC=0,SDHCSRC=0,LPUARTSRC=0,TPMSRC=1,FLEXIOSRC=0,USBSRC=0,PLLFLLSEL=1,TRACECLKSEL=0,FBSL=0,CLKOUTSEL=0,RTCCLKOUTSEL=0
*/
#define SYSTEM_SIM_SOPT2_VALUE 0x01010000U /* SIM_SOPT2 */
#endif
#else
#define DEFAULT_SYSTEM_CLOCK 20971520u
#endif
/**
* @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_MK82F25615_H_) */
@@ -0,0 +1,304 @@
/*
** ###################################################################
** Processors: MK82FN256CAx15
** MK82FN256VDC15
** MK82FN256VLL15
** MK82FN256VLQ15
**
** Compilers: Keil ARM C/C++ Compiler
** Freescale C/C++ for Embedded ARM
** GNU C Compiler
** GNU C Compiler - CodeSourcery Sourcery G++
** IAR ANSI C/C++ Compiler for ARM
**
** Reference manual: K82P121M150SF5RM, Rev. 0, May 2015
** Version: rev. 1.1, 2015-05-28
** Build: b150626
**
** 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 (c) 2015 Freescale Semiconductor, Inc.
** All rights reserved.
**
** Redistribution and use in source and binary forms, with or without modification,
** are permitted provided that the following conditions are met:
**
** o Redistributions of source code must retain the above copyright notice, this list
** of conditions and the following disclaimer.
**
** o 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.
**
** o Neither the name of Freescale Semiconductor, Inc. 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.
**
** http: www.freescale.com
** mail: support@freescale.com
**
** Revisions:
** - rev. 1.0 (2015-04-09)
** Initial version
** - rev. 1.1 (2015-05-28)
** Update according to the reference manual Rev. 0.
**
** ###################################################################
*/
/*!
* @file MK82F25615
* @version 1.1
* @date 2015-05-28
* @brief Device specific configuration file for MK82F25615 (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 "fsl_device_registers.h"
/*!
* @brief Defines the structure to set the Bootloader Configuration Area
*
* This type of variable is used to set the Bootloader Configuration Area
* of the chip.
*/
typedef struct SystemBootloaderConfig
{
uint32_t tag; /*!< Magic number to verify bootloader configuration is valid. Must be set to 'kcfg'. */
uint32_t crcStartAddress; /*!< Start address for application image CRC check. If the bits are all set then Kinetis
bootloader by default will not perform any CRC check. */
uint32_t crcByteCount; /*!< Byte count for application image CRC check. If the bits are all set then Kinetis
bootloader by default will not prform any CRC check. */
uint32_t crcExpectedValue; /*!< Expected CRC value for application CRC check. If the bits are all set then Kinetis
bootloader by default will not perform any CRC check.*/
uint8_t enabledPeripherals; /*!< Bitfield of peripherals to enable.
bit 0 - LPUART, bit 1 - I2C, bit 2 - SPI, bit 4 - USB
Kinetis bootloader will enable the peripheral if corresponding bit is set to 1. */
uint8_t i2cSlaveAddress; /*!< If not 0xFF, used as the 7-bit I2C slave address. If 0xFF, defaults to 0x10 for I2C
slave address */
uint16_t peripheralDetectionTimeoutMs; /*!< Timeout in milliseconds for active peripheral detection. If 0xFFFF,
defaults to 5 seconds. */
uint16_t usbVid; /*!< Sets the USB Vendor ID reported by the device during enumeration. If 0xFFFF, it defaults to
0x15A2. */
uint16_t usbPid; /*!< Sets the USB Product ID reported by the device during enumeration. */
uint32_t usbStringsPointer; /*!< Sets the USB Strings reported by the device during enumeration. */
uint8_t clockFlags; /*!< The flags in the clockFlags configuration field are enabled if the corresponding bit is
cleared (0).
bit 0 - HighSpeed Enable high speed mode (i.e., 48 MHz). */
uint8_t clockDivider; /*!< Inverted value of the divider to use for core and bus clocks when in high speed mode */
uint8_t bootFlags; /*!< If bit 0 is cleared, then Kinetis bootloader will jump to either Quad SPI Flash or internal
flash image depending on FOPT BOOTSRC_SEL bits.
If the bit is set, then Kinetis bootloader will prepare for host communication over serial
peripherals. */
uint8_t RESERVED1;
uint32_t mmcauConfigPointer; /*!< A pointer to the MMCAU configuration structure in memory. */
uint32_t keyBlobPointer; /*!< A pointer to the keyblob data in memory. */
uint8_t RESERVED2[8];
uint32_t qspiConfigBlockPtr; /*!< A pointer to the QSPI config block in internal flash array. */
uint8_t RESERVED3[12];
} system_bootloader_config_t;
#ifdef BOOTLOADER_CONFIG
/* Bootlader configuration area */
#if defined(__IAR_SYSTEMS_ICC__)
/* Pragma to place the Bootloader Configuration Array on correct location defined in linker file. */
#pragma language = extended
#pragma location = "BootloaderConfig"
__root const system_bootloader_config_t BootloaderConfig @"BootloaderConfig" =
#elif defined(__GNUC__)
__attribute__((section(".BootloaderConfig"))) const system_bootloader_config_t BootloaderConfig =
#elif defined(__CC_ARM)
__attribute__((section("BootloaderConfig"))) const system_bootloader_config_t BootloaderConfig __attribute__((used)) =
#else
#error Unsupported compiler!
#endif
{
.tag = 0x6766636BU, /* Magic Number */
.crcStartAddress = 0xFFFFFFFFU, /* Disable CRC check */
.crcByteCount = 0xFFFFFFFFU, /* Disable CRC check */
.crcExpectedValue = 0xFFFFFFFFU, /* Disable CRC check */
.enabledPeripherals = 0x17, /* Enable all peripherals */
.i2cSlaveAddress = 0xFF, /* Use default I2C address */
.peripheralDetectionTimeoutMs = 0x01F4U, /* timeout: 500ms */
.usbVid = 0xFFFFU, /* Use default USB Vendor ID */
.usbPid = 0xFFFFU, /* Use default USB Product ID */
.usbStringsPointer = 0xFFFFFFFFU, /* Use default USB Strings */
.clockFlags = 0x01, /* Enable High speed mode */
.clockDivider = 0xFF, /* Use clock divider 1 */
.bootFlags = 0x01, /* Enable communication with host */
.mmcauConfigPointer = 0xFFFFFFFFU, /* No MMCAU configuration */
.keyBlobPointer = 0x000001000, /* keyblob data is at 0x1000 */
.qspiConfigBlockPtr = 0xFFFFFFFFU /* No QSPI configuration */
};
#endif
/* ----------------------------------------------------------------------------
-- Core clock
---------------------------------------------------------------------------- */
uint32_t SystemCoreClock = 96000000ul;
/* ----------------------------------------------------------------------------
-- SystemInit()
---------------------------------------------------------------------------- */
void SystemInit(void)
{
#if ((__FPU_PRESENT == 1) && (__FPU_USED == 1))
SCB->CPACR |= ((3UL << 10 * 2) | (3UL << 11 * 2)); /* set CP10, CP11 Full Access */
#endif /* ((__FPU_PRESENT == 1) && (__FPU_USED == 1)) */
}
/* ----------------------------------------------------------------------------
-- SystemCoreClockUpdate()
---------------------------------------------------------------------------- */
void SystemCoreClockUpdate(void)
{
uint32_t MCGOUTClock; /* Variable to store output clock frequency of the MCG module */
uint16_t Divider;
if ((MCG->C1 & MCG_C1_CLKS_MASK) == 0x00U)
{
/* Output of FLL or PLL is selected */
if ((MCG->C6 & MCG_C6_PLLS_MASK) == 0x00U)
{
/* FLL is selected */
if ((MCG->C1 & MCG_C1_IREFS_MASK) == 0x00U)
{
/* External reference clock is selected */
switch (MCG->C7 & MCG_C7_OSCSEL_MASK)
{
case 0x00U:
MCGOUTClock = CPU_XTAL_CLK_HZ; /* System oscillator drives MCG clock */
break;
case 0x01U:
MCGOUTClock = CPU_XTAL32k_CLK_HZ; /* RTC 32 kHz oscillator drives MCG clock */
break;
case 0x02U:
default:
MCGOUTClock = CPU_INT_IRC_CLK_HZ; /* IRC 48MHz oscillator drives MCG clock */
break;
}
if (((MCG->C2 & MCG_C2_RANGE_MASK) != 0x00U) && ((MCG->C7 & MCG_C7_OSCSEL_MASK) != 0x01U))
{
switch (MCG->C1 & MCG_C1_FRDIV_MASK)
{
case 0x38U:
Divider = 1536U;
break;
case 0x30U:
Divider = 1280U;
break;
default:
Divider = (uint16_t)(32LU << ((MCG->C1 & MCG_C1_FRDIV_MASK) >> MCG_C1_FRDIV_SHIFT));
break;
}
}
else
{ /* ((MCG->C2 & MCG_C2_RANGE_MASK) != 0x00U) */
Divider = (uint16_t)(1LU << ((MCG->C1 & MCG_C1_FRDIV_MASK) >> MCG_C1_FRDIV_SHIFT));
}
MCGOUTClock = (MCGOUTClock / Divider); /* Calculate the divided FLL reference clock */
}
else
{ /* (!((MCG->C1 & MCG_C1_IREFS_MASK) == 0x00U)) */
MCGOUTClock = CPU_INT_SLOW_CLK_HZ; /* The slow internal reference clock is selected */
} /* (!((MCG->C1 & MCG_C1_IREFS_MASK) == 0x00U)) */
/* Select correct multiplier to calculate the MCG output clock */
switch (MCG->C4 & (MCG_C4_DMX32_MASK | MCG_C4_DRST_DRS_MASK))
{
case 0x00U:
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) == 0x00U)) */
/* PLL is selected */
Divider = (((uint16_t)MCG->C5 & MCG_C5_PRDIV_MASK) + 0x01U);
MCGOUTClock = (uint32_t)(CPU_XTAL_CLK_HZ / Divider); /* Calculate the PLL reference clock */
Divider = (((uint16_t)MCG->C6 & MCG_C6_VDIV_MASK) + 16U);
MCGOUTClock *= Divider; /* Calculate the VCO output clock */
MCGOUTClock /= 2; /* Calculate the MCG output clock */
} /* (!((MCG->C6 & MCG_C6_PLLS_MASK) == 0x00U)) */
}
else if ((MCG->C1 & MCG_C1_CLKS_MASK) == 0x40U)
{
/* Internal reference clock is selected */
if ((MCG->C2 & MCG_C2_IRCS_MASK) == 0x00U)
{
MCGOUTClock = CPU_INT_SLOW_CLK_HZ; /* Slow internal reference clock selected */
}
else
{ /* (!((MCG->C2 & MCG_C2_IRCS_MASK) == 0x00U)) */
Divider = (uint16_t)(0x01LU << ((MCG->SC & MCG_SC_FCRDIV_MASK) >> MCG_SC_FCRDIV_SHIFT));
MCGOUTClock = (uint32_t)(CPU_INT_FAST_CLK_HZ / Divider); /* Fast internal reference clock selected */
} /* (!((MCG->C2 & MCG_C2_IRCS_MASK) == 0x00U)) */
}
else if ((MCG->C1 & MCG_C1_CLKS_MASK) == 0x80U)
{
/* External reference clock is selected */
switch (MCG->C7 & MCG_C7_OSCSEL_MASK)
{
case 0x00U:
MCGOUTClock = CPU_XTAL_CLK_HZ; /* System oscillator drives MCG clock */
break;
case 0x01U:
MCGOUTClock = CPU_XTAL32k_CLK_HZ; /* RTC 32 kHz oscillator drives MCG clock */
break;
case 0x02U:
default:
MCGOUTClock = CPU_INT_IRC_CLK_HZ; /* IRC 48MHz oscillator drives MCG clock */
break;
}
}
else
{ /* (!((MCG->C1 & MCG_C1_CLKS_MASK) == 0x80U)) */
/* Reserved value */
return;
} /* (!((MCG->C1 & MCG_C1_CLKS_MASK) == 0x80U)) */
SystemCoreClock =
(MCGOUTClock / (0x01U + ((SIM->CLKDIV1 & SIM_CLKDIV1_OUTDIV1_MASK) >> SIM_CLKDIV1_OUTDIV1_SHIFT)));
}
@@ -0,0 +1,235 @@
/*
** ###################################################################
** Processors: MK82FN256CAx15
** MK82FN256VDC15
** MK82FN256VLL15
** MK82FN256VLQ15
**
** Compilers: Keil ARM C/C++ Compiler
** Freescale C/C++ for Embedded ARM
** GNU C Compiler
** GNU C Compiler - CodeSourcery Sourcery G++
** IAR ANSI C/C++ Compiler for ARM
**
** Reference manual: K82P121M150SF5RM, Rev. 0, May 2015
** Version: rev. 1.1, 2015-05-28
** Build: b150626
**
** 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 (c) 2015 Freescale Semiconductor, Inc.
** All rights reserved.
**
** Redistribution and use in source and binary forms, with or without modification,
** are permitted provided that the following conditions are met:
**
** o Redistributions of source code must retain the above copyright notice, this list
** of conditions and the following disclaimer.
**
** o 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.
**
** o Neither the name of Freescale Semiconductor, Inc. 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.
**
** http: www.freescale.com
** mail: support@freescale.com
**
** Revisions:
** - rev. 1.0 (2015-04-09)
** Initial version
** - rev. 1.1 (2015-05-28)
** Update according to the reference manual Rev. 0.
**
** ###################################################################
*/
/*!
* @file MK82F25615
* @version 1.1
* @date 2015-05-28
* @brief Device specific configuration file for MK82F25615 (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 "fsl_device_registers.h"
/*!
* @brief Defines the structure to set the Bootloader Configuration Area
*
* This type of variable is used to set the Bootloader Configuration Area
* of the chip.
*/
typedef struct SystemBootloaderConfig
{
uint32_t tag; /*!< Magic number to verify bootloader configuration is valid. Must be set to 'kcfg'. */
uint32_t crcStartAddress; /*!< Start address for application image CRC check. If the bits are all set then Kinetis
bootloader by default will not perform any CRC check. */
uint32_t crcByteCount; /*!< Byte count for application image CRC check. If the bits are all set then Kinetis
bootloader by default will not prform any CRC check. */
uint32_t crcExpectedValue; /*!< Expected CRC value for application CRC check. If the bits are all set then Kinetis
bootloader by default will not perform any CRC check.*/
uint8_t enabledPeripherals; /*!< Bitfield of peripherals to enable.
bit 0 - LPUART, bit 1 - I2C, bit 2 - SPI, bit 4 - USB
Kinetis bootloader will enable the peripheral if corresponding bit is set to 1. */
uint8_t i2cSlaveAddress; /*!< If not 0xFF, used as the 7-bit I2C slave address. If 0xFF, defaults to 0x10 for I2C
slave address */
uint16_t peripheralDetectionTimeoutMs; /*!< Timeout in milliseconds for active peripheral detection. If 0xFFFF,
defaults to 5 seconds. */
uint16_t usbVid; /*!< Sets the USB Vendor ID reported by the device during enumeration. If 0xFFFF, it defaults to
0x15A2. */
uint16_t usbPid; /*!< Sets the USB Product ID reported by the device during enumeration. */
uint32_t usbStringsPointer; /*!< Sets the USB Strings reported by the device during enumeration. */
uint8_t clockFlags; /*!< The flags in the clockFlags configuration field are enabled if the corresponding bit is
cleared (0).
bit 0 - HighSpeed Enable high speed mode (i.e., 48 MHz). */
uint8_t clockDivider; /*!< Inverted value of the divider to use for core and bus clocks when in high speed mode */
uint8_t bootFlags; /*!< If bit 0 is cleared, then Kinetis bootloader will jump to either Quad SPI Flash or internal
flash image depending on FOPT BOOTSRC_SEL bits.
If the bit is set, then Kinetis bootloader will prepare for host communication over serial
peripherals. */
uint8_t RESERVED1;
uint32_t mmcauConfigPointer; /*!< A pointer to the MMCAU configuration structure in memory. */
uint32_t keyBlobPointer; /*!< A pointer to the keyblob data in memory. */
uint8_t RESERVED2[8];
uint32_t qspiConfigBlockPtr; /*!< A pointer to the QSPI config block in internal flash array. */
uint8_t RESERVED3[12];
} system_bootloader_config_t;
/* Bootlader configuration area */
#if defined(__IAR_SYSTEMS_ICC__)
/* Pragma to place the Bootloader Configuration Array on correct location defined in linker file. */
#pragma language = extended
#pragma location = "BootloaderConfig"
__root const system_bootloader_config_t BootloaderConfig @"BootloaderConfig" =
#elif defined(__GNUC__)
__attribute__((section(".BootloaderConfig"))) const system_bootloader_config_t BootloaderConfig =
#elif defined(__CC_ARM)
__attribute__((section("BootloaderConfig"))) const system_bootloader_config_t BootloaderConfig __attribute__((used)) =
#else
#error Unsupported compiler!
#endif
{
.tag = 0x6766636BU, /* Magic Number */
.crcStartAddress = 0xFFFFFFFFU, /* Disable CRC check */
.crcByteCount = 0xFFFFFFFFU, /* Disable CRC check */
.crcExpectedValue = 0xFFFFFFFFU, /* Disable CRC check */
.enabledPeripherals = 0x17, /* Enable all peripherals */
.i2cSlaveAddress = 0xFF, /* Use default I2C address */
.peripheralDetectionTimeoutMs = 3000, /* timeout: 3000ms */
.usbVid = 0xFFFFU, /* Use default USB Vendor ID */
.usbPid = 0xFFFFU, /* Use default USB Product ID */
.usbStringsPointer = 0xFFFFFFFFU, /* Use default USB Strings */
.clockFlags = 0x01, /* Enable High speed mode */
.clockDivider = 0xFF, /* Use clock divider 1 */
.bootFlags = 0x01, /* Enable communication with host */
.mmcauConfigPointer = 0xFFFFFFFFU, /* No MMCAU configuration */
.keyBlobPointer = 0x000001000, /* keyblob data is at 0x1000 */
.qspiConfigBlockPtr = 0x2000, /* QCB is placed at 0x2000 */
};
/* ----------------------------------------------------------------------------
-- Core clock
---------------------------------------------------------------------------- */
uint32_t SystemCoreClock = 96000000ul;
/**
* A section located at 0x410 used for storing ROM patch code
*
* pseudo-code:
* int rom_patch(qspi_config_t *base)
* {
* volatile uint32_t *qspi_flshcr_reg = (volatile uint32_t*)QuadSPI0_FLSHCR_BASE;
*
* // Set QuadSPI_FLSHCR[TDH] to given parameters.
* *qspi_flshcr_reg &= (uint32_t)~QuadSPI_FLSHCR_TDH_MASK;
* *qspi_flshcr_reg |= (base->data_hold_time)<<QuadSPI0_FLSHCR_TDH_SHIFT;
*
* return kStatus_Success;
}
*/
#if defined(__IAR_SYSTEMS_ICC__)
/* Pragma to place the rom patch code on correct location defined in linker file. */
#pragma language = extended
#pragma section = "rom_patch_code"
const uint8_t s_rom_patch[124] @"rom_patch_code" =
#elif defined(__GNUC__)
__attribute__((section("rom_patch_code"))) const uint8_t s_rom_patch[124] __attribute__((used)) =
#elif defined(__CC_ARM)
__attribute__((section("rom_patch_code"))) const uint8_t s_rom_patch[124] __attribute__((used)) =
#else
#error Unsupported compiler!
#endif
{ 0x10, 0xB5, 0x01, 0x00, 0x17, 0x4A, 0x10, 0x00, 0x18, 0x30, 0x17, 0x4B, 0x1B, 0x68, 0xDB, 0x00, 0x02, 0xD5,
0x16, 0x4A, 0x10, 0x00, 0x18, 0x30, 0x13, 0x68, 0x15, 0x4C, 0x1C, 0x40, 0x14, 0x60, 0x13, 0x68, 0x0C, 0x69,
0x24, 0x04, 0x1C, 0x43, 0x14, 0x60, 0x02, 0x68, 0x11, 0x4B, 0x13, 0x40, 0x03, 0x60, 0xDA, 0x22, 0x52, 0x00,
0x89, 0x18, 0x02, 0x68, 0x0B, 0x68, 0x1B, 0x04, 0xFC, 0x24, 0xA4, 0x03, 0x1C, 0x40, 0x14, 0x43, 0x04, 0x60,
0x02, 0x68, 0x0B, 0x4B, 0x13, 0x40, 0x03, 0x60, 0x02, 0x68, 0x49, 0x68, 0x09, 0x06, 0xFC, 0x23, 0x9B, 0x05,
0x0B, 0x40, 0x13, 0x43, 0x03, 0x60, 0x00, 0x20, 0x10, 0xBD, 0x0C, 0xA0, 0x0D, 0x40, 0x24, 0x80, 0x04, 0x40,
0x0C, 0xA0, 0x05, 0x40, 0xFF, 0xFF, 0xFC, 0xFF, 0xFF, 0xFF, 0xC0, 0xFF, 0xFF, 0xFF, 0xFF, 0xC0 };
/*
* ROM patch handler for ROM patch code execution.
*/
#if defined(__IAR_SYSTEMS_ICC__)
/* Pragma to place the ROM_PatchHandler on correct location defined in linker file. */
#pragma language = extended
#pragma section = "BootloaderPatchHandler"
void ROM_PatchHandler(void) @"BootloaderPatchHandler"
#elif defined(__GNUC__)
__attribute__((section("BootloaderPatchHandler"))) void ROM_PatchHandler(void)
#elif defined(__CC_ARM)
__attribute__((section("BootloaderPatchHandler"))) void ROM_PatchHandler(void)
#else
#error Unsupported compiler!
#endif
{
typedef int (*patch_handler_t)(uint32_t);
#if defined(__IAR_SYSTEMS_ICC__)
uint32_t s_rom_patch_start = (uint32_t)__section_begin("rom_patch_code");
#elif defined(__CC_ARM)
extern uint32_t Load$$EXEC_m_rom_patch_code$$Base[];
uint32_t s_rom_patch_start = (uint32_t)&Load$$EXEC_m_rom_patch_code$$Base;
#elif defined(__GNUC__)
extern uint32_t rom_patch_code_start[];
uint32_t s_rom_patch_start = (uint32_t)&rom_patch_code_start;
#endif
uint32_t patch_start = s_rom_patch_start + 1;
patch_handler_t patch_run = (patch_handler_t)patch_start;
patch_run(BootloaderConfig.qspiConfigBlockPtr);
}
/* ----------------------------------------------------------------------------
-- SystemInit()
---------------------------------------------------------------------------- */
void SystemInit(void)
{
#if ((__FPU_PRESENT == 1) && (__FPU_USED == 1))
SCB->CPACR |= ((3UL << 10 * 2) | (3UL << 11 * 2)); /* set CP10, CP11 Full Access */
#endif /* ((__FPU_PRESENT == 1) && (__FPU_USED == 1)) */
}
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,462 @@
/* ---------------------------------------------------------------------------------------*/
/* @file: startup_MK82F25615.s */
/* @purpose: CMSIS Cortex-M4 Core Device Startup File */
/* MK82F25615 */
/* @version: 1.1 */
/* @date: 2015-5-28 */
/* @build: b150626 */
/* ---------------------------------------------------------------------------------------*/
/* */
/* Copyright (c) 1997 - 2015 , Freescale Semiconductor, Inc. */
/* All rights reserved. */
/* */
/* Redistribution and use in source and binary forms, with or without modification, */
/* are permitted provided that the following conditions are met: */
/* */
/* o Redistributions of source code must retain the above copyright notice, this list */
/* of conditions and the following disclaimer. */
/* */
/* o 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. */
/* */
/* o Neither the name of Freescale Semiconductor, Inc. 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. */
/*****************************************************************************/
/* Version: GCC for ARM Embedded Processors */
/*****************************************************************************/
.syntax unified
.arch armv7-m
.section .isr_vector, "a"
.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_DMA16_IRQHandler /* DMA channel 0,16 transfer complete*/
.long DMA1_DMA17_IRQHandler /* DMA channel 1,17 transfer complete*/
.long DMA2_DMA18_IRQHandler /* DMA channel 2,18 transfer complete*/
.long DMA3_DMA19_IRQHandler /* DMA channel 3,19 transfer complete*/
.long DMA4_DMA20_IRQHandler /* DMA channel 4,20 transfer complete*/
.long DMA5_DMA21_IRQHandler /* DMA channel 5,21 transfer complete*/
.long DMA6_DMA22_IRQHandler /* DMA channel 6,22 transfer complete*/
.long DMA7_DMA23_IRQHandler /* DMA channel 7,23 transfer complete*/
.long DMA8_DMA24_IRQHandler /* DMA channel 8,24 transfer complete*/
.long DMA9_DMA25_IRQHandler /* DMA channel 9,25 transfer complete*/
.long DMA10_DMA26_IRQHandler /* DMA channel 10,26 transfer complete*/
.long DMA11_DMA27_IRQHandler /* DMA channel 11,27 transfer complete*/
.long DMA12_DMA28_IRQHandler /* DMA channel 12,28 transfer complete*/
.long DMA13_DMA29_IRQHandler /* DMA channel 13,29 transfer complete*/
.long DMA14_DMA30_IRQHandler /* DMA channel 14,30 transfer complete*/
.long DMA15_DMA31_IRQHandler /* DMA channel 15,31 transfer complete*/
.long DMA_Error_IRQHandler /* DMA channel 0 - 31 error*/
.long MCM_IRQHandler /* MCM normal interrupt*/
.long FTFA_IRQHandler /* FTFA command complete*/
.long Read_Collision_IRQHandler /* FTFA read collision*/
.long LVD_LVW_IRQHandler /* PMC controller low-voltage detect, low-voltage warning*/
.long LLWU_IRQHandler /* Low leakage wakeup unit*/
.long WDOG_EWM_IRQHandler /* Single interrupt vector for WDOG and EWM*/
.long TRNG0_IRQHandler /* True randon number generator*/
.long I2C0_IRQHandler /* Inter-integrated circuit 0*/
.long I2C1_IRQHandler /* Inter-integrated circuit 1*/
.long SPI0_IRQHandler /* Serial peripheral Interface 0*/
.long SPI1_IRQHandler /* Serial peripheral Interface 1*/
.long I2S0_Tx_IRQHandler /* Integrated interchip sound 0 transmit interrupt*/
.long I2S0_Rx_IRQHandler /* Integrated interchip sound 0 receive interrupt*/
.long LPUART0_IRQHandler /* LPUART0 receive/transmit/error interrupt*/
.long LPUART1_IRQHandler /* LPUART1 receive/transmit/error interrupt*/
.long LPUART2_IRQHandler /* LPUART2 receive/transmit/error interrupt*/
.long LPUART3_IRQHandler /* LPUART3 receive/transmit/error interrupt*/
.long LPUART4_IRQHandler /* LPUART4 receive/transmit/error interrupt*/
.long Reserved51_IRQHandler /* Reserved interrupt*/
.long Reserved52_IRQHandler /* Reserved interrupt*/
.long EMVSIM0_IRQHandler /* EMVSIM0 common interrupt*/
.long EMVSIM1_IRQHandler /* EMVSIM1 common interrupt*/
.long ADC0_IRQHandler /* Analog-to-digital converter 0*/
.long CMP0_IRQHandler /* Comparator 0*/
.long CMP1_IRQHandler /* Comparator 1*/
.long FTM0_IRQHandler /* FlexTimer module 0 fault, overflow and channels interrupt*/
.long FTM1_IRQHandler /* FlexTimer module 1 fault, overflow and channels interrupt*/
.long FTM2_IRQHandler /* FlexTimer module 2 fault, overflow and channels interrupt*/
.long CMT_IRQHandler /* Carrier modulator transmitter*/
.long RTC_IRQHandler /* Real time clock*/
.long RTC_Seconds_IRQHandler /* Real time clock seconds*/
.long PIT0CH0_IRQHandler /* Periodic interrupt timer 0 channel 0*/
.long PIT0CH1_IRQHandler /* Periodic interrupt timer 0 channel 1*/
.long PIT0CH2_IRQHandler /* Periodic interrupt timer 0 channel 2*/
.long PIT0CH3_IRQHandler /* Periodic interrupt timer 0 channel 3*/
.long PDB0_IRQHandler /* Programmable delay block*/
.long USB0_IRQHandler /* USB OTG interrupt*/
.long USBDCD_IRQHandler /* USB charger detect*/
.long Reserved71_IRQHandler /* Reserved interrupt*/
.long DAC0_IRQHandler /* Digital-to-analog converter 0*/
.long MCG_IRQHandler /* Multipurpose clock generator*/
.long LPTMR0_LPTMR1_IRQHandler /* Single interrupt vector for Low Power Timer 0 and 1*/
.long PORTA_IRQHandler /* Port A pin detect interrupt*/
.long PORTB_IRQHandler /* Port B pin detect interrupt*/
.long PORTC_IRQHandler /* Port C pin detect interrupt*/
.long PORTD_IRQHandler /* Port D pin detect interrupt*/
.long PORTE_IRQHandler /* Port E pin detect interrupt*/
.long SWI_IRQHandler /* Software interrupt*/
.long SPI2_IRQHandler /* Serial peripheral Interface 2*/
.long Reserved82_IRQHandler /* Reserved interrupt*/
.long Reserved83_IRQHandler /* Reserved interrupt*/
.long Reserved84_IRQHandler /* Reserved interrupt*/
.long Reserved85_IRQHandler /* Reserved interrupt*/
.long FLEXIO0_IRQHandler /* FLEXIO0*/
.long FTM3_IRQHandler /* FlexTimer module 3 fault, overflow and channels interrupt*/
.long Reserved88_IRQHandler /* Reserved interrupt*/
.long Reserved89_IRQHandler /* Reserved interrupt*/
.long I2C2_IRQHandler /* Inter-integrated circuit 2*/
.long Reserved91_IRQHandler /* Reserved interrupt*/
.long Reserved92_IRQHandler /* Reserved interrupt*/
.long Reserved93_IRQHandler /* Reserved interrupt*/
.long Reserved94_IRQHandler /* Reserved interrupt*/
.long Reserved95_IRQHandler /* Reserved interrupt*/
.long Reserved96_IRQHandler /* Reserved interrupt*/
.long SDHC_IRQHandler /* Secured digital host controller*/
.long Reserved98_IRQHandler /* Reserved interrupt*/
.long Reserved99_IRQHandler /* Reserved interrupt*/
.long Reserved100_IRQHandler /* Reserved interrupt*/
.long Reserved101_IRQHandler /* Reserved interrupt*/
.long Reserved102_IRQHandler /* Reserved interrupt*/
.long TSI0_IRQHandler /* Touch Sensing Input*/
.long TPM1_IRQHandler /* TPM1 single interrupt vector for all sources*/
.long TPM2_IRQHandler /* TPM2 single interrupt vector for all sources*/
.long Reserved106_IRQHandler /* Reserved interrupt*/
.long I2C3_IRQHandler /* Inter-integrated circuit 3*/
.long Reserved108_IRQHandler /* Reserved interrupt*/
.long Reserved109_IRQHandler /* Reserved interrupt*/
.long Reserved110_IRQHandler /* Reserved interrupt*/
.long Reserved111_IRQHandler /* Reserved interrupt*/
.long Reserved112_IRQHandler /* Reserved interrupt*/
.long Reserved113_IRQHandler /* Reserved interrupt*/
.long Reserved114_IRQHandler /* Reserved interrupt*/
.long Reserved115_IRQHandler /* Reserved interrupt*/
.long QuadSPI0_IRQHandler /* qspi*/
.long Reserved117_IRQHandler /* Reserved interrupt*/
.long Reserved118_IRQHandler /* Reserved interrupt*/
.long Reserved119_IRQHandler /* Reserved interrupt*/
.long LTC0_IRQHandler /* LP Trusted Cryptography*/
.long Reserved121_IRQHandler /* Reserved interrupt*/
.long Reserved122_IRQHandler /* Reserved interrupt*/
.long DefaultISR /* 123*/
.long DefaultISR /* 124*/
.long DefaultISR /* 125*/
.long DefaultISR /* 126*/
.long DefaultISR /* 127*/
.long DefaultISR /* 128*/
.long DefaultISR /* 129*/
.long DefaultISR /* 130*/
.long DefaultISR /* 131*/
.long DefaultISR /* 132*/
.long DefaultISR /* 133*/
.long DefaultISR /* 134*/
.long DefaultISR /* 135*/
.long DefaultISR /* 136*/
.long DefaultISR /* 137*/
.long DefaultISR /* 138*/
.long DefaultISR /* 139*/
.long DefaultISR /* 140*/
.long DefaultISR /* 141*/
.long DefaultISR /* 142*/
.long DefaultISR /* 143*/
.long DefaultISR /* 144*/
.long DefaultISR /* 145*/
.long DefaultISR /* 146*/
.long DefaultISR /* 147*/
.long DefaultISR /* 148*/
.long DefaultISR /* 149*/
.long DefaultISR /* 150*/
.long DefaultISR /* 151*/
.long DefaultISR /* 152*/
.long DefaultISR /* 153*/
.long DefaultISR /* 154*/
.long DefaultISR /* 155*/
.long DefaultISR /* 156*/
.long DefaultISR /* 157*/
.long DefaultISR /* 158*/
.long DefaultISR /* 159*/
.long DefaultISR /* 160*/
.long DefaultISR /* 161*/
.long DefaultISR /* 162*/
.long DefaultISR /* 163*/
.long DefaultISR /* 164*/
.long DefaultISR /* 165*/
.long DefaultISR /* 166*/
.long DefaultISR /* 167*/
.long DefaultISR /* 168*/
.long DefaultISR /* 169*/
.long DefaultISR /* 170*/
.long DefaultISR /* 171*/
.long DefaultISR /* 172*/
.long DefaultISR /* 173*/
.long DefaultISR /* 174*/
.long DefaultISR /* 175*/
.long DefaultISR /* 176*/
.long DefaultISR /* 177*/
.long DefaultISR /* 178*/
.long DefaultISR /* 179*/
.long DefaultISR /* 180*/
.long DefaultISR /* 181*/
.long DefaultISR /* 182*/
.long DefaultISR /* 183*/
.long DefaultISR /* 184*/
.long DefaultISR /* 185*/
.long DefaultISR /* 186*/
.long DefaultISR /* 187*/
.long DefaultISR /* 188*/
.long DefaultISR /* 189*/
.long DefaultISR /* 190*/
.long DefaultISR /* 191*/
.long DefaultISR /* 192*/
.long DefaultISR /* 193*/
.long DefaultISR /* 194*/
.long DefaultISR /* 195*/
.long DefaultISR /* 196*/
.long DefaultISR /* 197*/
.long DefaultISR /* 198*/
.long DefaultISR /* 199*/
.long DefaultISR /* 200*/
.long DefaultISR /* 201*/
.long DefaultISR /* 202*/
.long DefaultISR /* 203*/
.long DefaultISR /* 204*/
.long DefaultISR /* 205*/
.long DefaultISR /* 206*/
.long DefaultISR /* 207*/
.long DefaultISR /* 208*/
.long DefaultISR /* 209*/
.long DefaultISR /* 210*/
.long DefaultISR /* 211*/
.long DefaultISR /* 212*/
.long DefaultISR /* 213*/
.long DefaultISR /* 214*/
.long DefaultISR /* 215*/
.long DefaultISR /* 216*/
.long DefaultISR /* 217*/
.long DefaultISR /* 218*/
.long DefaultISR /* 219*/
.long DefaultISR /* 220*/
.long DefaultISR /* 221*/
.long DefaultISR /* 222*/
.long DefaultISR /* 223*/
.long DefaultISR /* 224*/
.long DefaultISR /* 225*/
.long DefaultISR /* 226*/
.long DefaultISR /* 227*/
.long DefaultISR /* 228*/
.long DefaultISR /* 229*/
.long DefaultISR /* 230*/
.long DefaultISR /* 231*/
.long DefaultISR /* 232*/
.long DefaultISR /* 233*/
.long DefaultISR /* 234*/
.long DefaultISR /* 235*/
.long DefaultISR /* 236*/
.long DefaultISR /* 237*/
.long DefaultISR /* 238*/
.long DefaultISR /* 239*/
.size __isr_vector, . - __isr_vector
/* Flash Configuration */
.section .FlashConfig, "a"
.long 0xFFFFFFFF
.long 0xFFFFFFFF
.long 0xFFFFFFFF
.long 0xFFFF3DFE
.text
.thumb
/* Reset Handler */
.thumb_func
.align 2
.globl Reset_Handler
.weak Reset_Handler
.type Reset_Handler, %function
Reset_Handler:
cpsid i /* Mask interrupts */
#ifndef __NO_SYSTEM_INIT
bl SystemInit
#endif
bl init_data_bss
cpsie i /* Unmask interrupts */
#ifndef __START
#define __START _start
#endif
#ifndef __ATOLLIC__
bl __START
#else
bl __libc_init_array
bl main
#endif
.pool
.size Reset_Handler, . - Reset_Handler
.align 1
.thumb_func
.weak DefaultISR
.type DefaultISR, %function
DefaultISR:
b DefaultISR
.size DefaultISR, . - DefaultISR
/* Macro to define default handlers. Default handler
* will be weak symbol and just dead loops. They can be
* overwritten by other handlers */
.macro def_irq_handler handler_name
.weak \handler_name
.set \handler_name, DefaultISR
.endm
/* Exception Handlers */
def_irq_handler NMI_Handler
def_irq_handler HardFault_Handler
def_irq_handler MemManage_Handler
def_irq_handler BusFault_Handler
def_irq_handler UsageFault_Handler
def_irq_handler SVC_Handler
def_irq_handler DebugMon_Handler
def_irq_handler PendSV_Handler
def_irq_handler SysTick_Handler
def_irq_handler DMA0_DMA16_IRQHandler
def_irq_handler DMA1_DMA17_IRQHandler
def_irq_handler DMA2_DMA18_IRQHandler
def_irq_handler DMA3_DMA19_IRQHandler
def_irq_handler DMA4_DMA20_IRQHandler
def_irq_handler DMA5_DMA21_IRQHandler
def_irq_handler DMA6_DMA22_IRQHandler
def_irq_handler DMA7_DMA23_IRQHandler
def_irq_handler DMA8_DMA24_IRQHandler
def_irq_handler DMA9_DMA25_IRQHandler
def_irq_handler DMA10_DMA26_IRQHandler
def_irq_handler DMA11_DMA27_IRQHandler
def_irq_handler DMA12_DMA28_IRQHandler
def_irq_handler DMA13_DMA29_IRQHandler
def_irq_handler DMA14_DMA30_IRQHandler
def_irq_handler DMA15_DMA31_IRQHandler
def_irq_handler DMA_Error_IRQHandler
def_irq_handler MCM_IRQHandler
def_irq_handler FTFA_IRQHandler
def_irq_handler Read_Collision_IRQHandler
def_irq_handler LVD_LVW_IRQHandler
def_irq_handler LLWU_IRQHandler
def_irq_handler WDOG_EWM_IRQHandler
def_irq_handler TRNG0_IRQHandler
def_irq_handler I2C0_IRQHandler
def_irq_handler I2C1_IRQHandler
def_irq_handler SPI0_IRQHandler
def_irq_handler SPI1_IRQHandler
def_irq_handler I2S0_Tx_IRQHandler
def_irq_handler I2S0_Rx_IRQHandler
def_irq_handler LPUART0_IRQHandler
def_irq_handler LPUART1_IRQHandler
def_irq_handler LPUART2_IRQHandler
def_irq_handler LPUART3_IRQHandler
def_irq_handler LPUART4_IRQHandler
def_irq_handler Reserved51_IRQHandler
def_irq_handler Reserved52_IRQHandler
def_irq_handler EMVSIM0_IRQHandler
def_irq_handler EMVSIM1_IRQHandler
def_irq_handler ADC0_IRQHandler
def_irq_handler CMP0_IRQHandler
def_irq_handler CMP1_IRQHandler
def_irq_handler FTM0_IRQHandler
def_irq_handler FTM1_IRQHandler
def_irq_handler FTM2_IRQHandler
def_irq_handler CMT_IRQHandler
def_irq_handler RTC_IRQHandler
def_irq_handler RTC_Seconds_IRQHandler
def_irq_handler PIT0CH0_IRQHandler
def_irq_handler PIT0CH1_IRQHandler
def_irq_handler PIT0CH2_IRQHandler
def_irq_handler PIT0CH3_IRQHandler
def_irq_handler PDB0_IRQHandler
def_irq_handler USB0_IRQHandler
def_irq_handler USBDCD_IRQHandler
def_irq_handler Reserved71_IRQHandler
def_irq_handler DAC0_IRQHandler
def_irq_handler MCG_IRQHandler
def_irq_handler LPTMR0_LPTMR1_IRQHandler
def_irq_handler PORTA_IRQHandler
def_irq_handler PORTB_IRQHandler
def_irq_handler PORTC_IRQHandler
def_irq_handler PORTD_IRQHandler
def_irq_handler PORTE_IRQHandler
def_irq_handler SWI_IRQHandler
def_irq_handler SPI2_IRQHandler
def_irq_handler Reserved82_IRQHandler
def_irq_handler Reserved83_IRQHandler
def_irq_handler Reserved84_IRQHandler
def_irq_handler Reserved85_IRQHandler
def_irq_handler FLEXIO0_IRQHandler
def_irq_handler FTM3_IRQHandler
def_irq_handler Reserved88_IRQHandler
def_irq_handler Reserved89_IRQHandler
def_irq_handler I2C2_IRQHandler
def_irq_handler Reserved91_IRQHandler
def_irq_handler Reserved92_IRQHandler
def_irq_handler Reserved93_IRQHandler
def_irq_handler Reserved94_IRQHandler
def_irq_handler Reserved95_IRQHandler
def_irq_handler Reserved96_IRQHandler
def_irq_handler SDHC_IRQHandler
def_irq_handler Reserved98_IRQHandler
def_irq_handler Reserved99_IRQHandler
def_irq_handler Reserved100_IRQHandler
def_irq_handler Reserved101_IRQHandler
def_irq_handler Reserved102_IRQHandler
def_irq_handler TSI0_IRQHandler
def_irq_handler TPM1_IRQHandler
def_irq_handler TPM2_IRQHandler
def_irq_handler Reserved106_IRQHandler
def_irq_handler I2C3_IRQHandler
def_irq_handler Reserved108_IRQHandler
def_irq_handler Reserved109_IRQHandler
def_irq_handler Reserved110_IRQHandler
def_irq_handler Reserved111_IRQHandler
def_irq_handler Reserved112_IRQHandler
def_irq_handler Reserved113_IRQHandler
def_irq_handler Reserved114_IRQHandler
def_irq_handler Reserved115_IRQHandler
def_irq_handler QuadSPI0_IRQHandler
def_irq_handler Reserved117_IRQHandler
def_irq_handler Reserved118_IRQHandler
def_irq_handler Reserved119_IRQHandler
def_irq_handler LTC0_IRQHandler
def_irq_handler Reserved121_IRQHandler
def_irq_handler Reserved122_IRQHandler
.end
@@ -0,0 +1,462 @@
/* ---------------------------------------------------------------------------------------*/
/* @file: startup_MK82F25615.s */
/* @purpose: CMSIS Cortex-M4 Core Device Startup File */
/* MK82F25615 */
/* @version: 1.1 */
/* @date: 2015-5-28 */
/* @build: b150626 */
/* ---------------------------------------------------------------------------------------*/
/* */
/* Copyright (c) 1997 - 2015 , Freescale Semiconductor, Inc. */
/* All rights reserved. */
/* */
/* Redistribution and use in source and binary forms, with or without modification, */
/* are permitted provided that the following conditions are met: */
/* */
/* o Redistributions of source code must retain the above copyright notice, this list */
/* of conditions and the following disclaimer. */
/* */
/* o 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. */
/* */
/* o Neither the name of Freescale Semiconductor, Inc. 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. */
/*****************************************************************************/
/* Version: GCC for ARM Embedded Processors */
/*****************************************************************************/
.syntax unified
.arch armv7-m
.section .isr_vector, "a"
.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_DMA16_IRQHandler /* DMA channel 0,16 transfer complete*/
.long DMA1_DMA17_IRQHandler /* DMA channel 1,17 transfer complete*/
.long DMA2_DMA18_IRQHandler /* DMA channel 2,18 transfer complete*/
.long DMA3_DMA19_IRQHandler /* DMA channel 3,19 transfer complete*/
.long DMA4_DMA20_IRQHandler /* DMA channel 4,20 transfer complete*/
.long DMA5_DMA21_IRQHandler /* DMA channel 5,21 transfer complete*/
.long DMA6_DMA22_IRQHandler /* DMA channel 6,22 transfer complete*/
.long DMA7_DMA23_IRQHandler /* DMA channel 7,23 transfer complete*/
.long DMA8_DMA24_IRQHandler /* DMA channel 8,24 transfer complete*/
.long DMA9_DMA25_IRQHandler /* DMA channel 9,25 transfer complete*/
.long DMA10_DMA26_IRQHandler /* DMA channel 10,26 transfer complete*/
.long DMA11_DMA27_IRQHandler /* DMA channel 11,27 transfer complete*/
.long DMA12_DMA28_IRQHandler /* DMA channel 12,28 transfer complete*/
.long DMA13_DMA29_IRQHandler /* DMA channel 13,29 transfer complete*/
.long DMA14_DMA30_IRQHandler /* DMA channel 14,30 transfer complete*/
.long DMA15_DMA31_IRQHandler /* DMA channel 15,31 transfer complete*/
.long DMA_Error_IRQHandler /* DMA channel 0 - 31 error*/
.long MCM_IRQHandler /* MCM normal interrupt*/
.long FTFA_IRQHandler /* FTFA command complete*/
.long Read_Collision_IRQHandler /* FTFA read collision*/
.long LVD_LVW_IRQHandler /* PMC controller low-voltage detect, low-voltage warning*/
.long LLWU_IRQHandler /* Low leakage wakeup unit*/
.long WDOG_EWM_IRQHandler /* Single interrupt vector for WDOG and EWM*/
.long TRNG0_IRQHandler /* True randon number generator*/
.long I2C0_IRQHandler /* Inter-integrated circuit 0*/
.long I2C1_IRQHandler /* Inter-integrated circuit 1*/
.long SPI0_IRQHandler /* Serial peripheral Interface 0*/
.long SPI1_IRQHandler /* Serial peripheral Interface 1*/
.long I2S0_Tx_IRQHandler /* Integrated interchip sound 0 transmit interrupt*/
.long I2S0_Rx_IRQHandler /* Integrated interchip sound 0 receive interrupt*/
.long LPUART0_IRQHandler /* LPUART0 receive/transmit/error interrupt*/
.long LPUART1_IRQHandler /* LPUART1 receive/transmit/error interrupt*/
.long LPUART2_IRQHandler /* LPUART2 receive/transmit/error interrupt*/
.long LPUART3_IRQHandler /* LPUART3 receive/transmit/error interrupt*/
.long LPUART4_IRQHandler /* LPUART4 receive/transmit/error interrupt*/
.long Reserved51_IRQHandler /* Reserved interrupt*/
.long Reserved52_IRQHandler /* Reserved interrupt*/
.long EMVSIM0_IRQHandler /* EMVSIM0 common interrupt*/
.long EMVSIM1_IRQHandler /* EMVSIM1 common interrupt*/
.long ADC0_IRQHandler /* Analog-to-digital converter 0*/
.long CMP0_IRQHandler /* Comparator 0*/
.long CMP1_IRQHandler /* Comparator 1*/
.long FTM0_IRQHandler /* FlexTimer module 0 fault, overflow and channels interrupt*/
.long FTM1_IRQHandler /* FlexTimer module 1 fault, overflow and channels interrupt*/
.long FTM2_IRQHandler /* FlexTimer module 2 fault, overflow and channels interrupt*/
.long CMT_IRQHandler /* Carrier modulator transmitter*/
.long RTC_IRQHandler /* Real time clock*/
.long RTC_Seconds_IRQHandler /* Real time clock seconds*/
.long PIT0CH0_IRQHandler /* Periodic interrupt timer 0 channel 0*/
.long PIT0CH1_IRQHandler /* Periodic interrupt timer 0 channel 1*/
.long PIT0CH2_IRQHandler /* Periodic interrupt timer 0 channel 2*/
.long PIT0CH3_IRQHandler /* Periodic interrupt timer 0 channel 3*/
.long PDB0_IRQHandler /* Programmable delay block*/
.long USB0_IRQHandler /* USB OTG interrupt*/
.long USBDCD_IRQHandler /* USB charger detect*/
.long Reserved71_IRQHandler /* Reserved interrupt*/
.long DAC0_IRQHandler /* Digital-to-analog converter 0*/
.long MCG_IRQHandler /* Multipurpose clock generator*/
.long LPTMR0_LPTMR1_IRQHandler /* Single interrupt vector for Low Power Timer 0 and 1*/
.long PORTA_IRQHandler /* Port A pin detect interrupt*/
.long PORTB_IRQHandler /* Port B pin detect interrupt*/
.long PORTC_IRQHandler /* Port C pin detect interrupt*/
.long PORTD_IRQHandler /* Port D pin detect interrupt*/
.long PORTE_IRQHandler /* Port E pin detect interrupt*/
.long SWI_IRQHandler /* Software interrupt*/
.long SPI2_IRQHandler /* Serial peripheral Interface 2*/
.long Reserved82_IRQHandler /* Reserved interrupt*/
.long Reserved83_IRQHandler /* Reserved interrupt*/
.long Reserved84_IRQHandler /* Reserved interrupt*/
.long Reserved85_IRQHandler /* Reserved interrupt*/
.long FLEXIO0_IRQHandler /* FLEXIO0*/
.long FTM3_IRQHandler /* FlexTimer module 3 fault, overflow and channels interrupt*/
.long Reserved88_IRQHandler /* Reserved interrupt*/
.long Reserved89_IRQHandler /* Reserved interrupt*/
.long I2C2_IRQHandler /* Inter-integrated circuit 2*/
.long Reserved91_IRQHandler /* Reserved interrupt*/
.long Reserved92_IRQHandler /* Reserved interrupt*/
.long Reserved93_IRQHandler /* Reserved interrupt*/
.long Reserved94_IRQHandler /* Reserved interrupt*/
.long Reserved95_IRQHandler /* Reserved interrupt*/
.long Reserved96_IRQHandler /* Reserved interrupt*/
.long SDHC_IRQHandler /* Secured digital host controller*/
.long Reserved98_IRQHandler /* Reserved interrupt*/
.long Reserved99_IRQHandler /* Reserved interrupt*/
.long Reserved100_IRQHandler /* Reserved interrupt*/
.long Reserved101_IRQHandler /* Reserved interrupt*/
.long Reserved102_IRQHandler /* Reserved interrupt*/
.long TSI0_IRQHandler /* Touch Sensing Input*/
.long TPM1_IRQHandler /* TPM1 single interrupt vector for all sources*/
.long TPM2_IRQHandler /* TPM2 single interrupt vector for all sources*/
.long Reserved106_IRQHandler /* Reserved interrupt*/
.long I2C3_IRQHandler /* Inter-integrated circuit 3*/
.long Reserved108_IRQHandler /* Reserved interrupt*/
.long Reserved109_IRQHandler /* Reserved interrupt*/
.long Reserved110_IRQHandler /* Reserved interrupt*/
.long Reserved111_IRQHandler /* Reserved interrupt*/
.long Reserved112_IRQHandler /* Reserved interrupt*/
.long Reserved113_IRQHandler /* Reserved interrupt*/
.long Reserved114_IRQHandler /* Reserved interrupt*/
.long Reserved115_IRQHandler /* Reserved interrupt*/
.long QuadSPI0_IRQHandler /* qspi*/
.long Reserved117_IRQHandler /* Reserved interrupt*/
.long Reserved118_IRQHandler /* Reserved interrupt*/
.long Reserved119_IRQHandler /* Reserved interrupt*/
.long LTC0_IRQHandler /* LP Trusted Cryptography*/
.long Reserved121_IRQHandler /* Reserved interrupt*/
.long Reserved122_IRQHandler /* Reserved interrupt*/
.long DefaultISR /* 123*/
.long DefaultISR /* 124*/
.long DefaultISR /* 125*/
.long DefaultISR /* 126*/
.long DefaultISR /* 127*/
.long DefaultISR /* 128*/
.long DefaultISR /* 129*/
.long DefaultISR /* 130*/
.long DefaultISR /* 131*/
.long DefaultISR /* 132*/
.long DefaultISR /* 133*/
.long DefaultISR /* 134*/
.long DefaultISR /* 135*/
.long DefaultISR /* 136*/
.long DefaultISR /* 137*/
.long DefaultISR /* 138*/
.long DefaultISR /* 139*/
.long DefaultISR /* 140*/
.long DefaultISR /* 141*/
.long DefaultISR /* 142*/
.long DefaultISR /* 143*/
.long DefaultISR /* 144*/
.long DefaultISR /* 145*/
.long DefaultISR /* 146*/
.long DefaultISR /* 147*/
.long DefaultISR /* 148*/
.long DefaultISR /* 149*/
.long DefaultISR /* 150*/
.long DefaultISR /* 151*/
.long DefaultISR /* 152*/
.long DefaultISR /* 153*/
.long DefaultISR /* 154*/
.long DefaultISR /* 155*/
.long DefaultISR /* 156*/
.long DefaultISR /* 157*/
.long DefaultISR /* 158*/
.long DefaultISR /* 159*/
.long DefaultISR /* 160*/
.long DefaultISR /* 161*/
.long DefaultISR /* 162*/
.long DefaultISR /* 163*/
.long DefaultISR /* 164*/
.long DefaultISR /* 165*/
.long DefaultISR /* 166*/
.long DefaultISR /* 167*/
.long DefaultISR /* 168*/
.long DefaultISR /* 169*/
.long DefaultISR /* 170*/
.long DefaultISR /* 171*/
.long DefaultISR /* 172*/
.long DefaultISR /* 173*/
.long DefaultISR /* 174*/
.long DefaultISR /* 175*/
.long DefaultISR /* 176*/
.long DefaultISR /* 177*/
.long DefaultISR /* 178*/
.long DefaultISR /* 179*/
.long DefaultISR /* 180*/
.long DefaultISR /* 181*/
.long DefaultISR /* 182*/
.long DefaultISR /* 183*/
.long DefaultISR /* 184*/
.long DefaultISR /* 185*/
.long DefaultISR /* 186*/
.long DefaultISR /* 187*/
.long DefaultISR /* 188*/
.long DefaultISR /* 189*/
.long DefaultISR /* 190*/
.long DefaultISR /* 191*/
.long DefaultISR /* 192*/
.long DefaultISR /* 193*/
.long DefaultISR /* 194*/
.long DefaultISR /* 195*/
.long DefaultISR /* 196*/
.long DefaultISR /* 197*/
.long DefaultISR /* 198*/
.long DefaultISR /* 199*/
.long DefaultISR /* 200*/
.long DefaultISR /* 201*/
.long DefaultISR /* 202*/
.long DefaultISR /* 203*/
.long DefaultISR /* 204*/
.long DefaultISR /* 205*/
.long DefaultISR /* 206*/
.long DefaultISR /* 207*/
.long DefaultISR /* 208*/
.long DefaultISR /* 209*/
.long DefaultISR /* 210*/
.long DefaultISR /* 211*/
.long DefaultISR /* 212*/
.long DefaultISR /* 213*/
.long DefaultISR /* 214*/
.long DefaultISR /* 215*/
.long DefaultISR /* 216*/
.long DefaultISR /* 217*/
.long DefaultISR /* 218*/
.long DefaultISR /* 219*/
.long DefaultISR /* 220*/
.long DefaultISR /* 221*/
.long DefaultISR /* 222*/
.long DefaultISR /* 223*/
.long DefaultISR /* 224*/
.long DefaultISR /* 225*/
.long DefaultISR /* 226*/
.long DefaultISR /* 227*/
.long DefaultISR /* 228*/
.long DefaultISR /* 229*/
.long DefaultISR /* 230*/
.long DefaultISR /* 231*/
.long DefaultISR /* 232*/
.long DefaultISR /* 233*/
.long DefaultISR /* 234*/
.long DefaultISR /* 235*/
.long DefaultISR /* 236*/
.long DefaultISR /* 237*/
.long DefaultISR /* 238*/
.long DefaultISR /* 239*/
.size __isr_vector, . - __isr_vector
/* Flash Configuration */
.section .FlashConfig, "a"
.long 0xFFFFFFFF
.long 0xFFFFFFFF
.long 0xFFFFFFFF
.long 0xFFFFBDFE
.text
.thumb
/* Reset Handler */
.thumb_func
.align 2
.globl Reset_Handler
.weak Reset_Handler
.type Reset_Handler, %function
Reset_Handler:
cpsid i /* Mask interrupts */
#ifndef __NO_SYSTEM_INIT
bl SystemInit
#endif
bl init_data_bss
cpsie i /* Unmask interrupts */
#ifndef __START
#define __START _start
#endif
#ifndef __ATOLLIC__
bl __START
#else
bl __libc_init_array
bl main
#endif
.pool
.size Reset_Handler, . - Reset_Handler
.align 1
.thumb_func
.weak DefaultISR
.type DefaultISR, %function
DefaultISR:
b DefaultISR
.size DefaultISR, . - DefaultISR
/* Macro to define default handlers. Default handler
* will be weak symbol and just dead loops. They can be
* overwritten by other handlers */
.macro def_irq_handler handler_name
.weak \handler_name
.set \handler_name, DefaultISR
.endm
/* Exception Handlers */
def_irq_handler NMI_Handler
def_irq_handler HardFault_Handler
def_irq_handler MemManage_Handler
def_irq_handler BusFault_Handler
def_irq_handler UsageFault_Handler
def_irq_handler SVC_Handler
def_irq_handler DebugMon_Handler
def_irq_handler PendSV_Handler
def_irq_handler SysTick_Handler
def_irq_handler DMA0_DMA16_IRQHandler
def_irq_handler DMA1_DMA17_IRQHandler
def_irq_handler DMA2_DMA18_IRQHandler
def_irq_handler DMA3_DMA19_IRQHandler
def_irq_handler DMA4_DMA20_IRQHandler
def_irq_handler DMA5_DMA21_IRQHandler
def_irq_handler DMA6_DMA22_IRQHandler
def_irq_handler DMA7_DMA23_IRQHandler
def_irq_handler DMA8_DMA24_IRQHandler
def_irq_handler DMA9_DMA25_IRQHandler
def_irq_handler DMA10_DMA26_IRQHandler
def_irq_handler DMA11_DMA27_IRQHandler
def_irq_handler DMA12_DMA28_IRQHandler
def_irq_handler DMA13_DMA29_IRQHandler
def_irq_handler DMA14_DMA30_IRQHandler
def_irq_handler DMA15_DMA31_IRQHandler
def_irq_handler DMA_Error_IRQHandler
def_irq_handler MCM_IRQHandler
def_irq_handler FTFA_IRQHandler
def_irq_handler Read_Collision_IRQHandler
def_irq_handler LVD_LVW_IRQHandler
def_irq_handler LLWU_IRQHandler
def_irq_handler WDOG_EWM_IRQHandler
def_irq_handler TRNG0_IRQHandler
def_irq_handler I2C0_IRQHandler
def_irq_handler I2C1_IRQHandler
def_irq_handler SPI0_IRQHandler
def_irq_handler SPI1_IRQHandler
def_irq_handler I2S0_Tx_IRQHandler
def_irq_handler I2S0_Rx_IRQHandler
def_irq_handler LPUART0_IRQHandler
def_irq_handler LPUART1_IRQHandler
def_irq_handler LPUART2_IRQHandler
def_irq_handler LPUART3_IRQHandler
def_irq_handler LPUART4_IRQHandler
def_irq_handler Reserved51_IRQHandler
def_irq_handler Reserved52_IRQHandler
def_irq_handler EMVSIM0_IRQHandler
def_irq_handler EMVSIM1_IRQHandler
def_irq_handler ADC0_IRQHandler
def_irq_handler CMP0_IRQHandler
def_irq_handler CMP1_IRQHandler
def_irq_handler FTM0_IRQHandler
def_irq_handler FTM1_IRQHandler
def_irq_handler FTM2_IRQHandler
def_irq_handler CMT_IRQHandler
def_irq_handler RTC_IRQHandler
def_irq_handler RTC_Seconds_IRQHandler
def_irq_handler PIT0CH0_IRQHandler
def_irq_handler PIT0CH1_IRQHandler
def_irq_handler PIT0CH2_IRQHandler
def_irq_handler PIT0CH3_IRQHandler
def_irq_handler PDB0_IRQHandler
def_irq_handler USB0_IRQHandler
def_irq_handler USBDCD_IRQHandler
def_irq_handler Reserved71_IRQHandler
def_irq_handler DAC0_IRQHandler
def_irq_handler MCG_IRQHandler
def_irq_handler LPTMR0_LPTMR1_IRQHandler
def_irq_handler PORTA_IRQHandler
def_irq_handler PORTB_IRQHandler
def_irq_handler PORTC_IRQHandler
def_irq_handler PORTD_IRQHandler
def_irq_handler PORTE_IRQHandler
def_irq_handler SWI_IRQHandler
def_irq_handler SPI2_IRQHandler
def_irq_handler Reserved82_IRQHandler
def_irq_handler Reserved83_IRQHandler
def_irq_handler Reserved84_IRQHandler
def_irq_handler Reserved85_IRQHandler
def_irq_handler FLEXIO0_IRQHandler
def_irq_handler FTM3_IRQHandler
def_irq_handler Reserved88_IRQHandler
def_irq_handler Reserved89_IRQHandler
def_irq_handler I2C2_IRQHandler
def_irq_handler Reserved91_IRQHandler
def_irq_handler Reserved92_IRQHandler
def_irq_handler Reserved93_IRQHandler
def_irq_handler Reserved94_IRQHandler
def_irq_handler Reserved95_IRQHandler
def_irq_handler Reserved96_IRQHandler
def_irq_handler SDHC_IRQHandler
def_irq_handler Reserved98_IRQHandler
def_irq_handler Reserved99_IRQHandler
def_irq_handler Reserved100_IRQHandler
def_irq_handler Reserved101_IRQHandler
def_irq_handler Reserved102_IRQHandler
def_irq_handler TSI0_IRQHandler
def_irq_handler TPM1_IRQHandler
def_irq_handler TPM2_IRQHandler
def_irq_handler Reserved106_IRQHandler
def_irq_handler I2C3_IRQHandler
def_irq_handler Reserved108_IRQHandler
def_irq_handler Reserved109_IRQHandler
def_irq_handler Reserved110_IRQHandler
def_irq_handler Reserved111_IRQHandler
def_irq_handler Reserved112_IRQHandler
def_irq_handler Reserved113_IRQHandler
def_irq_handler Reserved114_IRQHandler
def_irq_handler Reserved115_IRQHandler
def_irq_handler QuadSPI0_IRQHandler
def_irq_handler Reserved117_IRQHandler
def_irq_handler Reserved118_IRQHandler
def_irq_handler Reserved119_IRQHandler
def_irq_handler LTC0_IRQHandler
def_irq_handler Reserved121_IRQHandler
def_irq_handler Reserved122_IRQHandler
.end
@@ -0,0 +1,470 @@
/* ---------------------------------------------------------------------------------------*/
/* @file: startup_MK82F25615.s */
/* @purpose: CMSIS Cortex-M4 Core Device Startup File */
/* MK82F25615 */
/* @version: 1.1 */
/* @date: 2015-5-28 */
/* @build: b150626 */
/* ---------------------------------------------------------------------------------------*/
/* */
/* Copyright (c) 1997 - 2015 , Freescale Semiconductor, Inc. */
/* All rights reserved. */
/* */
/* Redistribution and use in source and binary forms, with or without modification, */
/* are permitted provided that the following conditions are met: */
/* */
/* o Redistributions of source code must retain the above copyright notice, this list */
/* of conditions and the following disclaimer. */
/* */
/* o 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. */
/* */
/* o Neither the name of Freescale Semiconductor, Inc. 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. */
/*****************************************************************************/
/* Version: GCC for ARM Embedded Processors */
/*****************************************************************************/
.syntax unified
.arch armv7-m
.section .isr_vector, "a"
.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_DMA16_IRQHandler /* DMA channel 0,16 transfer complete*/
.long DMA1_DMA17_IRQHandler /* DMA channel 1,17 transfer complete*/
.long DMA2_DMA18_IRQHandler /* DMA channel 2,18 transfer complete*/
.long DMA3_DMA19_IRQHandler /* DMA channel 3,19 transfer complete*/
.long DMA4_DMA20_IRQHandler /* DMA channel 4,20 transfer complete*/
.long DMA5_DMA21_IRQHandler /* DMA channel 5,21 transfer complete*/
.long DMA6_DMA22_IRQHandler /* DMA channel 6,22 transfer complete*/
.long DMA7_DMA23_IRQHandler /* DMA channel 7,23 transfer complete*/
.long DMA8_DMA24_IRQHandler /* DMA channel 8,24 transfer complete*/
.long DMA9_DMA25_IRQHandler /* DMA channel 9,25 transfer complete*/
.long DMA10_DMA26_IRQHandler /* DMA channel 10,26 transfer complete*/
.long DMA11_DMA27_IRQHandler /* DMA channel 11,27 transfer complete*/
.long DMA12_DMA28_IRQHandler /* DMA channel 12,28 transfer complete*/
.long DMA13_DMA29_IRQHandler /* DMA channel 13,29 transfer complete*/
.long DMA14_DMA30_IRQHandler /* DMA channel 14,30 transfer complete*/
.long DMA15_DMA31_IRQHandler /* DMA channel 15,31 transfer complete*/
.long DMA_Error_IRQHandler /* DMA channel 0 - 31 error*/
.long MCM_IRQHandler /* MCM normal interrupt*/
.long FTFA_IRQHandler /* FTFA command complete*/
.long Read_Collision_IRQHandler /* FTFA read collision*/
.long LVD_LVW_IRQHandler /* PMC controller low-voltage detect, low-voltage warning*/
.long LLWU_IRQHandler /* Low leakage wakeup unit*/
.long WDOG_EWM_IRQHandler /* Single interrupt vector for WDOG and EWM*/
.long TRNG0_IRQHandler /* True randon number generator*/
.long I2C0_IRQHandler /* Inter-integrated circuit 0*/
.long I2C1_IRQHandler /* Inter-integrated circuit 1*/
.long SPI0_IRQHandler /* Serial peripheral Interface 0*/
.long SPI1_IRQHandler /* Serial peripheral Interface 1*/
.long I2S0_Tx_IRQHandler /* Integrated interchip sound 0 transmit interrupt*/
.long I2S0_Rx_IRQHandler /* Integrated interchip sound 0 receive interrupt*/
.long LPUART0_IRQHandler /* LPUART0 receive/transmit/error interrupt*/
.long LPUART1_IRQHandler /* LPUART1 receive/transmit/error interrupt*/
.long LPUART2_IRQHandler /* LPUART2 receive/transmit/error interrupt*/
.long LPUART3_IRQHandler /* LPUART3 receive/transmit/error interrupt*/
.long LPUART4_IRQHandler /* LPUART4 receive/transmit/error interrupt*/
.long Reserved51_IRQHandler /* Reserved interrupt*/
.long Reserved52_IRQHandler /* Reserved interrupt*/
.long EMVSIM0_IRQHandler /* EMVSIM0 common interrupt*/
.long EMVSIM1_IRQHandler /* EMVSIM1 common interrupt*/
.long ADC0_IRQHandler /* Analog-to-digital converter 0*/
.long CMP0_IRQHandler /* Comparator 0*/
.long CMP1_IRQHandler /* Comparator 1*/
.long FTM0_IRQHandler /* FlexTimer module 0 fault, overflow and channels interrupt*/
.long FTM1_IRQHandler /* FlexTimer module 1 fault, overflow and channels interrupt*/
.long FTM2_IRQHandler /* FlexTimer module 2 fault, overflow and channels interrupt*/
.long CMT_IRQHandler /* Carrier modulator transmitter*/
.long RTC_IRQHandler /* Real time clock*/
.long RTC_Seconds_IRQHandler /* Real time clock seconds*/
.long PIT0CH0_IRQHandler /* Periodic interrupt timer 0 channel 0*/
.long PIT0CH1_IRQHandler /* Periodic interrupt timer 0 channel 1*/
.long PIT0CH2_IRQHandler /* Periodic interrupt timer 0 channel 2*/
.long PIT0CH3_IRQHandler /* Periodic interrupt timer 0 channel 3*/
.long PDB0_IRQHandler /* Programmable delay block*/
.long USB0_IRQHandler /* USB OTG interrupt*/
.long USBDCD_IRQHandler /* USB charger detect*/
.long Reserved71_IRQHandler /* Reserved interrupt*/
.long DAC0_IRQHandler /* Digital-to-analog converter 0*/
.long MCG_IRQHandler /* Multipurpose clock generator*/
.long LPTMR0_LPTMR1_IRQHandler /* Single interrupt vector for Low Power Timer 0 and 1*/
.long PORTA_IRQHandler /* Port A pin detect interrupt*/
.long PORTB_IRQHandler /* Port B pin detect interrupt*/
.long PORTC_IRQHandler /* Port C pin detect interrupt*/
.long PORTD_IRQHandler /* Port D pin detect interrupt*/
.long PORTE_IRQHandler /* Port E pin detect interrupt*/
.long SWI_IRQHandler /* Software interrupt*/
.long SPI2_IRQHandler /* Serial peripheral Interface 2*/
.long Reserved82_IRQHandler /* Reserved interrupt*/
.long Reserved83_IRQHandler /* Reserved interrupt*/
.long Reserved84_IRQHandler /* Reserved interrupt*/
.long Reserved85_IRQHandler /* Reserved interrupt*/
.long FLEXIO0_IRQHandler /* FLEXIO0*/
.long FTM3_IRQHandler /* FlexTimer module 3 fault, overflow and channels interrupt*/
.long Reserved88_IRQHandler /* Reserved interrupt*/
.long Reserved89_IRQHandler /* Reserved interrupt*/
.long I2C2_IRQHandler /* Inter-integrated circuit 2*/
.long Reserved91_IRQHandler /* Reserved interrupt*/
.long Reserved92_IRQHandler /* Reserved interrupt*/
.long Reserved93_IRQHandler /* Reserved interrupt*/
.long Reserved94_IRQHandler /* Reserved interrupt*/
.long Reserved95_IRQHandler /* Reserved interrupt*/
.long Reserved96_IRQHandler /* Reserved interrupt*/
.long SDHC_IRQHandler /* Secured digital host controller*/
.long Reserved98_IRQHandler /* Reserved interrupt*/
.long Reserved99_IRQHandler /* Reserved interrupt*/
.long Reserved100_IRQHandler /* Reserved interrupt*/
.long Reserved101_IRQHandler /* Reserved interrupt*/
.long Reserved102_IRQHandler /* Reserved interrupt*/
.long TSI0_IRQHandler /* Touch Sensing Input*/
.long TPM1_IRQHandler /* TPM1 single interrupt vector for all sources*/
.long TPM2_IRQHandler /* TPM2 single interrupt vector for all sources*/
.long Reserved106_IRQHandler /* Reserved interrupt*/
.long I2C3_IRQHandler /* Inter-integrated circuit 3*/
.long Reserved108_IRQHandler /* Reserved interrupt*/
.long Reserved109_IRQHandler /* Reserved interrupt*/
.long Reserved110_IRQHandler /* Reserved interrupt*/
.long Reserved111_IRQHandler /* Reserved interrupt*/
.long Reserved112_IRQHandler /* Reserved interrupt*/
.long Reserved113_IRQHandler /* Reserved interrupt*/
.long Reserved114_IRQHandler /* Reserved interrupt*/
.long Reserved115_IRQHandler /* Reserved interrupt*/
.long QuadSPI0_IRQHandler /* qspi*/
.long Reserved117_IRQHandler /* Reserved interrupt*/
.long Reserved118_IRQHandler /* Reserved interrupt*/
.long Reserved119_IRQHandler /* Reserved interrupt*/
.long LTC0_IRQHandler /* LP Trusted Cryptography*/
.long Reserved121_IRQHandler /* Reserved interrupt*/
.long Reserved122_IRQHandler /* Reserved interrupt*/
.long DefaultISR /* 123*/
.long DefaultISR /* 124*/
.long DefaultISR /* 125*/
.long DefaultISR /* 126*/
.long DefaultISR /* 127*/
.long DefaultISR /* 128*/
.long DefaultISR /* 129*/
.long DefaultISR /* 130*/
.long DefaultISR /* 131*/
.long DefaultISR /* 132*/
.long DefaultISR /* 133*/
.long DefaultISR /* 134*/
.long DefaultISR /* 135*/
.long DefaultISR /* 136*/
.long DefaultISR /* 137*/
.long DefaultISR /* 138*/
.long DefaultISR /* 139*/
.long DefaultISR /* 140*/
.long DefaultISR /* 141*/
.long DefaultISR /* 142*/
.long DefaultISR /* 143*/
.long DefaultISR /* 144*/
.long DefaultISR /* 145*/
.long DefaultISR /* 146*/
.long DefaultISR /* 147*/
.long DefaultISR /* 148*/
.long DefaultISR /* 149*/
.long DefaultISR /* 150*/
.long DefaultISR /* 151*/
.long DefaultISR /* 152*/
.long DefaultISR /* 153*/
.long DefaultISR /* 154*/
.long DefaultISR /* 155*/
.long DefaultISR /* 156*/
.long DefaultISR /* 157*/
.long DefaultISR /* 158*/
.long DefaultISR /* 159*/
.long DefaultISR /* 160*/
.long DefaultISR /* 161*/
.long DefaultISR /* 162*/
.long DefaultISR /* 163*/
.long DefaultISR /* 164*/
.long DefaultISR /* 165*/
.long DefaultISR /* 166*/
.long DefaultISR /* 167*/
.long DefaultISR /* 168*/
.long DefaultISR /* 169*/
.long DefaultISR /* 170*/
.long DefaultISR /* 171*/
.long DefaultISR /* 172*/
.long DefaultISR /* 173*/
.long DefaultISR /* 174*/
.long DefaultISR /* 175*/
.long DefaultISR /* 176*/
.long DefaultISR /* 177*/
.long DefaultISR /* 178*/
.long DefaultISR /* 179*/
.long DefaultISR /* 180*/
.long DefaultISR /* 181*/
.long DefaultISR /* 182*/
.long DefaultISR /* 183*/
.long DefaultISR /* 184*/
.long DefaultISR /* 185*/
.long DefaultISR /* 186*/
.long DefaultISR /* 187*/
.long DefaultISR /* 188*/
.long DefaultISR /* 189*/
.long DefaultISR /* 190*/
.long DefaultISR /* 191*/
.long DefaultISR /* 192*/
.long DefaultISR /* 193*/
.long DefaultISR /* 194*/
.long DefaultISR /* 195*/
.long DefaultISR /* 196*/
.long DefaultISR /* 197*/
.long DefaultISR /* 198*/
.long DefaultISR /* 199*/
.long DefaultISR /* 200*/
.long DefaultISR /* 201*/
.long DefaultISR /* 202*/
.long DefaultISR /* 203*/
.long DefaultISR /* 204*/
.long DefaultISR /* 205*/
.long DefaultISR /* 206*/
.long DefaultISR /* 207*/
.long DefaultISR /* 208*/
.long DefaultISR /* 209*/
.long DefaultISR /* 210*/
.long DefaultISR /* 211*/
.long DefaultISR /* 212*/
.long DefaultISR /* 213*/
.long DefaultISR /* 214*/
.long DefaultISR /* 215*/
.long DefaultISR /* 216*/
.long DefaultISR /* 217*/
.long DefaultISR /* 218*/
.long DefaultISR /* 219*/
.long DefaultISR /* 220*/
.long DefaultISR /* 221*/
.long DefaultISR /* 222*/
.long DefaultISR /* 223*/
.long DefaultISR /* 224*/
.long DefaultISR /* 225*/
.long DefaultISR /* 226*/
.long DefaultISR /* 227*/
.long DefaultISR /* 228*/
.long DefaultISR /* 229*/
.long DefaultISR /* 230*/
.long DefaultISR /* 231*/
.long DefaultISR /* 232*/
.long DefaultISR /* 233*/
.long DefaultISR /* 234*/
.long DefaultISR /* 235*/
.long DefaultISR /* 236*/
.long DefaultISR /* 237*/
.long DefaultISR /* 238*/
.long DefaultISR /* 239*/
.size __isr_vector, . - __isr_vector
/* Flash Configuration */
.section .FlashConfig, "a"
.long 0xFFFFFFFF
.long 0xFFFFFFFF
.long 0xFFFFFFFF
.long 0xFFFFBDFE
.section BootloaderPatchHandler, "a"
.thumb
/* Reset Handler */
.thumb_func
.align 2
.globl Reset_Handler
.weak Reset_Handler
.type Reset_Handler, %function
Reset_Handler:
cpsid i /* Mask interrupts */
ldr r0, = ROM_PatchHandler
blx r0
#ifndef __NO_SYSTEM_INIT
ldr r0, = SystemInit
blx r0
#endif
ldr r0, = init_data_bss
blx r0
cpsie i /* Unmask interrupts */
#ifndef __START
#define __START _start
#endif
#ifndef __ATOLLIC__
ldr r0, = __START
blx r0
#else
ldr r0,= __libc_init_array
blx r0
ldr r0, = main,
bx r0
#endif
.pool
.size Reset_Handler, . - Reset_Handler
.text
.thumb
.align 1
.thumb_func
.weak DefaultISR
.type DefaultISR, %function
DefaultISR:
b DefaultISR
.size DefaultISR, . - DefaultISR
/* Macro to define default handlers. Default handler
* will be weak symbol and just dead loops. They can be
* overwritten by other handlers */
.macro def_irq_handler handler_name
.weak \handler_name
.set \handler_name, DefaultISR
.endm
/* Exception Handlers */
def_irq_handler NMI_Handler
def_irq_handler HardFault_Handler
def_irq_handler MemManage_Handler
def_irq_handler BusFault_Handler
def_irq_handler UsageFault_Handler
def_irq_handler SVC_Handler
def_irq_handler DebugMon_Handler
def_irq_handler PendSV_Handler
def_irq_handler SysTick_Handler
def_irq_handler DMA0_DMA16_IRQHandler
def_irq_handler DMA1_DMA17_IRQHandler
def_irq_handler DMA2_DMA18_IRQHandler
def_irq_handler DMA3_DMA19_IRQHandler
def_irq_handler DMA4_DMA20_IRQHandler
def_irq_handler DMA5_DMA21_IRQHandler
def_irq_handler DMA6_DMA22_IRQHandler
def_irq_handler DMA7_DMA23_IRQHandler
def_irq_handler DMA8_DMA24_IRQHandler
def_irq_handler DMA9_DMA25_IRQHandler
def_irq_handler DMA10_DMA26_IRQHandler
def_irq_handler DMA11_DMA27_IRQHandler
def_irq_handler DMA12_DMA28_IRQHandler
def_irq_handler DMA13_DMA29_IRQHandler
def_irq_handler DMA14_DMA30_IRQHandler
def_irq_handler DMA15_DMA31_IRQHandler
def_irq_handler DMA_Error_IRQHandler
def_irq_handler MCM_IRQHandler
def_irq_handler FTFA_IRQHandler
def_irq_handler Read_Collision_IRQHandler
def_irq_handler LVD_LVW_IRQHandler
def_irq_handler LLWU_IRQHandler
def_irq_handler WDOG_EWM_IRQHandler
def_irq_handler TRNG0_IRQHandler
def_irq_handler I2C0_IRQHandler
def_irq_handler I2C1_IRQHandler
def_irq_handler SPI0_IRQHandler
def_irq_handler SPI1_IRQHandler
def_irq_handler I2S0_Tx_IRQHandler
def_irq_handler I2S0_Rx_IRQHandler
def_irq_handler LPUART0_IRQHandler
def_irq_handler LPUART1_IRQHandler
def_irq_handler LPUART2_IRQHandler
def_irq_handler LPUART3_IRQHandler
def_irq_handler LPUART4_IRQHandler
def_irq_handler Reserved51_IRQHandler
def_irq_handler Reserved52_IRQHandler
def_irq_handler EMVSIM0_IRQHandler
def_irq_handler EMVSIM1_IRQHandler
def_irq_handler ADC0_IRQHandler
def_irq_handler CMP0_IRQHandler
def_irq_handler CMP1_IRQHandler
def_irq_handler FTM0_IRQHandler
def_irq_handler FTM1_IRQHandler
def_irq_handler FTM2_IRQHandler
def_irq_handler CMT_IRQHandler
def_irq_handler RTC_IRQHandler
def_irq_handler RTC_Seconds_IRQHandler
def_irq_handler PIT0CH0_IRQHandler
def_irq_handler PIT0CH1_IRQHandler
def_irq_handler PIT0CH2_IRQHandler
def_irq_handler PIT0CH3_IRQHandler
def_irq_handler PDB0_IRQHandler
def_irq_handler USB0_IRQHandler
def_irq_handler USBDCD_IRQHandler
def_irq_handler Reserved71_IRQHandler
def_irq_handler DAC0_IRQHandler
def_irq_handler MCG_IRQHandler
def_irq_handler LPTMR0_LPTMR1_IRQHandler
def_irq_handler PORTA_IRQHandler
def_irq_handler PORTB_IRQHandler
def_irq_handler PORTC_IRQHandler
def_irq_handler PORTD_IRQHandler
def_irq_handler PORTE_IRQHandler
def_irq_handler SWI_IRQHandler
def_irq_handler SPI2_IRQHandler
def_irq_handler Reserved82_IRQHandler
def_irq_handler Reserved83_IRQHandler
def_irq_handler Reserved84_IRQHandler
def_irq_handler Reserved85_IRQHandler
def_irq_handler FLEXIO0_IRQHandler
def_irq_handler FTM3_IRQHandler
def_irq_handler Reserved88_IRQHandler
def_irq_handler Reserved89_IRQHandler
def_irq_handler I2C2_IRQHandler
def_irq_handler Reserved91_IRQHandler
def_irq_handler Reserved92_IRQHandler
def_irq_handler Reserved93_IRQHandler
def_irq_handler Reserved94_IRQHandler
def_irq_handler Reserved95_IRQHandler
def_irq_handler Reserved96_IRQHandler
def_irq_handler SDHC_IRQHandler
def_irq_handler Reserved98_IRQHandler
def_irq_handler Reserved99_IRQHandler
def_irq_handler Reserved100_IRQHandler
def_irq_handler Reserved101_IRQHandler
def_irq_handler Reserved102_IRQHandler
def_irq_handler TSI0_IRQHandler
def_irq_handler TPM1_IRQHandler
def_irq_handler TPM2_IRQHandler
def_irq_handler Reserved106_IRQHandler
def_irq_handler I2C3_IRQHandler
def_irq_handler Reserved108_IRQHandler
def_irq_handler Reserved109_IRQHandler
def_irq_handler Reserved110_IRQHandler
def_irq_handler Reserved111_IRQHandler
def_irq_handler Reserved112_IRQHandler
def_irq_handler Reserved113_IRQHandler
def_irq_handler Reserved114_IRQHandler
def_irq_handler Reserved115_IRQHandler
def_irq_handler QuadSPI0_IRQHandler
def_irq_handler Reserved117_IRQHandler
def_irq_handler Reserved118_IRQHandler
def_irq_handler Reserved119_IRQHandler
def_irq_handler LTC0_IRQHandler
def_irq_handler Reserved121_IRQHandler
def_irq_handler Reserved122_IRQHandler
.end
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,316 @@
/*
** ###################################################################
** Processors: MK82FN256CAx15
** MK82FN256VDC15
** MK82FN256VLL15
** MK82FN256VLQ15
**
** Compilers: Keil ARM C/C++ Compiler
** Freescale C/C++ for Embedded ARM
** GNU C Compiler
** GNU C Compiler - CodeSourcery Sourcery G++
** IAR ANSI C/C++ Compiler for ARM
**
** Reference manual: K82P121M150SF5RM, Rev. 0, May 2015
** Version: rev. 1.1, 2015-05-28
** Build: b150626
**
** 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 (c) 2015 Freescale Semiconductor, Inc.
** All rights reserved.
**
** Redistribution and use in source and binary forms, with or without modification,
** are permitted provided that the following conditions are met:
**
** o Redistributions of source code must retain the above copyright notice, this list
** of conditions and the following disclaimer.
**
** o 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.
**
** o Neither the name of Freescale Semiconductor, Inc. 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.
**
** http: www.freescale.com
** mail: support@freescale.com
**
** Revisions:
** - rev. 1.0 (2015-04-09)
** Initial version
** - rev. 1.1 (2015-05-28)
** Update according to the reference manual Rev. 0.
**
** ###################################################################
*/
/*!
* @file MK82F25615
* @version 1.1
* @date 2015-05-28
* @brief Device specific configuration file for MK82F25615 (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 "fsl_device_registers.h"
/*!
* @brief Defines the structure to set the Bootloader Configuration Area
*
* This type of variable is used to set the Bootloader Configuration Area
* of the chip.
*/
typedef struct SystemBootloaderConfig
{
uint32_t tag; /*!< Magic number to verify bootloader configuration is valid. Must be set to 'kcfg'. */
uint32_t crcStartAddress; /*!< Start address for application image CRC check. If the bits are all set then Kinetis
bootloader by default will not perform any CRC check. */
uint32_t crcByteCount; /*!< Byte count for application image CRC check. If the bits are all set then Kinetis
bootloader by default will not prform any CRC check. */
uint32_t crcExpectedValue; /*!< Expected CRC value for application CRC check. If the bits are all set then Kinetis
bootloader by default will not perform any CRC check.*/
uint8_t enabledPeripherals; /*!< Bitfield of peripherals to enable.
bit 0 - LPUART, bit 1 - I2C, bit 2 - SPI, bit 4 - USB
Kinetis bootloader will enable the peripheral if corresponding bit is set to 1. */
uint8_t i2cSlaveAddress; /*!< If not 0xFF, used as the 7-bit I2C slave address. If 0xFF, defaults to 0x10 for I2C
slave address */
uint16_t peripheralDetectionTimeoutMs; /*!< Timeout in milliseconds for active peripheral detection. If 0xFFFF,
defaults to 5 seconds. */
uint16_t usbVid; /*!< Sets the USB Vendor ID reported by the device during enumeration. If 0xFFFF, it defaults to
0x15A2. */
uint16_t usbPid; /*!< Sets the USB Product ID reported by the device during enumeration. */
uint32_t usbStringsPointer; /*!< Sets the USB Strings reported by the device during enumeration. */
uint8_t clockFlags; /*!< The flags in the clockFlags configuration field are enabled if the corresponding bit is
cleared (0).
bit 0 - HighSpeed Enable high speed mode (i.e., 48 MHz). */
uint8_t clockDivider; /*!< Inverted value of the divider to use for core and bus clocks when in high speed mode */
uint8_t bootFlags; /*!< If bit 0 is cleared, then Kinetis bootloader will jump to either Quad SPI Flash or internal
flash image depending on FOPT BOOTSRC_SEL bits.
If the bit is set, then Kinetis bootloader will prepare for host communication over serial
peripherals. */
uint8_t RESERVED1;
uint32_t mmcauConfigPointer; /*!< A pointer to the MMCAU configuration structure in memory. */
uint32_t keyBlobPointer; /*!< A pointer to the keyblob data in memory. */
uint8_t RESERVED2[8];
uint32_t qspiConfigBlockPtr; /*!< A pointer to the QSPI config block in internal flash array. */
uint8_t RESERVED3[12];
} system_bootloader_config_t;
#ifdef BOOTLOADER_CONFIG
/* Bootlader configuration area */
#if defined(__IAR_SYSTEMS_ICC__)
/* Pragma to place the Bootloader Configuration Array on correct location defined in linker file. */
#pragma language = extended
#pragma location = "BootloaderConfig"
__root const system_bootloader_config_t BootloaderConfig @"BootloaderConfig" =
#elif defined(__GNUC__)
__attribute__((section(".BootloaderConfig"))) const system_bootloader_config_t BootloaderConfig =
#elif defined(__CC_ARM)
__attribute__((section("BootloaderConfig"))) const system_bootloader_config_t BootloaderConfig __attribute__((used)) =
#else
#error Unsupported compiler!
#endif
{
.tag = 0x6766636BU, /* Magic Number */
.crcStartAddress = 0xFFFFFFFFU, /* Disable CRC check */
.crcByteCount = 0xFFFFFFFFU, /* Disable CRC check */
.crcExpectedValue = 0xFFFFFFFFU, /* Disable CRC check */
.enabledPeripherals = 0x17, /* Enable all peripherals */
.i2cSlaveAddress = 0xFF, /* Use default I2C address */
.peripheralDetectionTimeoutMs = 0x01F4U, /* Timeout :500ms */
.usbVid = 0xFFFFU, /* Use default USB Vendor ID */
.usbPid = 0xFFFFU, /* Use default USB Product ID */
.usbStringsPointer = 0xFFFFFFFFU, /* Use default USB Strings */
.clockFlags = 0x01, /* Enable High speed mode */
.clockDivider = 0xFF, /* Use clock divider 1 */
.bootFlags = 0x01, /* Enable communication with host */
.mmcauConfigPointer = 0xFFFFFFFFU, /* No MMCAU configuration */
.keyBlobPointer = 0x00001000U, /* keyblob data is at 0x1000 */
.qspiConfigBlockPtr = 0xFFFFFFFFU /* No QSPI configuration */
};
#endif
/* ----------------------------------------------------------------------------
-- Core clock
---------------------------------------------------------------------------- */
uint32_t SystemCoreClock = 20971520u;
/* ----------------------------------------------------------------------------
-- SystemInit()
---------------------------------------------------------------------------- */
void SystemInit(void)
{
#if ((__FPU_PRESENT == 1) && (__FPU_USED == 1))
SCB->CPACR |= ((3UL << 10 * 2) | (3UL << 11 * 2)); /* set CP10, CP11 Full Access */
#endif /* ((__FPU_PRESENT == 1) && (__FPU_USED == 1)) */
#if (DISABLE_WDOG)
/* WDOG->UNLOCK: WDOGUNLOCK=0xC520 */
WDOG->UNLOCK = WDOG_UNLOCK_WDOGUNLOCK(0xC520); /* Key 1 */
/* WDOG->UNLOCK: WDOGUNLOCK=0xD928 */
WDOG->UNLOCK = WDOG_UNLOCK_WDOGUNLOCK(0xD928); /* Key 2 */
/* WDOG->STCTRLH:
* ?=0,DISTESTWDOG=0,BYTESEL=0,TESTSEL=0,TESTWDOG=0,?=0,?=1,WAITEN=1,STOPEN=1,DBGEN=0,ALLOWUPDATE=1,WINEN=0,IRQRSTEN=0,CLKSRC=1,WDOGEN=0
*/
WDOG->STCTRLH = WDOG_STCTRLH_BYTESEL(0x00) | WDOG_STCTRLH_WAITEN_MASK | WDOG_STCTRLH_STOPEN_MASK |
WDOG_STCTRLH_ALLOWUPDATE_MASK | WDOG_STCTRLH_CLKSRC_MASK | 0x0100U;
#endif /* (DISABLE_WDOG) */
}
/* ----------------------------------------------------------------------------
-- SystemCoreClockUpdate()
---------------------------------------------------------------------------- */
void SystemCoreClockUpdate(void)
{
uint32_t MCGOUTClock; /* Variable to store output clock frequency of the MCG module */
uint16_t Divider;
if ((MCG->C1 & MCG_C1_CLKS_MASK) == 0x00U)
{
/* Output of FLL or PLL is selected */
if ((MCG->C6 & MCG_C6_PLLS_MASK) == 0x00U)
{
/* FLL is selected */
if ((MCG->C1 & MCG_C1_IREFS_MASK) == 0x00U)
{
/* External reference clock is selected */
switch (MCG->C7 & MCG_C7_OSCSEL_MASK)
{
case 0x00U:
MCGOUTClock = CPU_XTAL_CLK_HZ; /* System oscillator drives MCG clock */
break;
case 0x01U:
MCGOUTClock = CPU_XTAL32k_CLK_HZ; /* RTC 32 kHz oscillator drives MCG clock */
break;
case 0x02U:
default:
MCGOUTClock = CPU_INT_IRC_CLK_HZ; /* IRC 48MHz oscillator drives MCG clock */
break;
}
if (((MCG->C2 & MCG_C2_RANGE_MASK) != 0x00U) && ((MCG->C7 & MCG_C7_OSCSEL_MASK) != 0x01U))
{
switch (MCG->C1 & MCG_C1_FRDIV_MASK)
{
case 0x38U:
Divider = 1536U;
break;
case 0x30U:
Divider = 1280U;
break;
default:
Divider = (uint16_t)(32LU << ((MCG->C1 & MCG_C1_FRDIV_MASK) >> MCG_C1_FRDIV_SHIFT));
break;
}
}
else
{ /* ((MCG->C2 & MCG_C2_RANGE_MASK) != 0x00U) */
Divider = (uint16_t)(1LU << ((MCG->C1 & MCG_C1_FRDIV_MASK) >> MCG_C1_FRDIV_SHIFT));
}
MCGOUTClock = (MCGOUTClock / Divider); /* Calculate the divided FLL reference clock */
}
else
{ /* (!((MCG->C1 & MCG_C1_IREFS_MASK) == 0x00U)) */
MCGOUTClock = CPU_INT_SLOW_CLK_HZ; /* The slow internal reference clock is selected */
} /* (!((MCG->C1 & MCG_C1_IREFS_MASK) == 0x00U)) */
/* Select correct multiplier to calculate the MCG output clock */
switch (MCG->C4 & (MCG_C4_DMX32_MASK | MCG_C4_DRST_DRS_MASK))
{
case 0x00U:
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) == 0x00U)) */
/* PLL is selected */
Divider = (((uint16_t)MCG->C5 & MCG_C5_PRDIV_MASK) + 0x01U);
MCGOUTClock = (uint32_t)(CPU_XTAL_CLK_HZ / Divider); /* Calculate the PLL reference clock */
Divider = (((uint16_t)MCG->C6 & MCG_C6_VDIV_MASK) + 16U);
MCGOUTClock *= Divider; /* Calculate the VCO output clock */
MCGOUTClock /= 2; /* Calculate the MCG output clock */
} /* (!((MCG->C6 & MCG_C6_PLLS_MASK) == 0x00U)) */
}
else if ((MCG->C1 & MCG_C1_CLKS_MASK) == 0x40U)
{
/* Internal reference clock is selected */
if ((MCG->C2 & MCG_C2_IRCS_MASK) == 0x00U)
{
MCGOUTClock = CPU_INT_SLOW_CLK_HZ; /* Slow internal reference clock selected */
}
else
{ /* (!((MCG->C2 & MCG_C2_IRCS_MASK) == 0x00U)) */
Divider = (uint16_t)(0x01LU << ((MCG->SC & MCG_SC_FCRDIV_MASK) >> MCG_SC_FCRDIV_SHIFT));
MCGOUTClock = (uint32_t)(CPU_INT_FAST_CLK_HZ / Divider); /* Fast internal reference clock selected */
} /* (!((MCG->C2 & MCG_C2_IRCS_MASK) == 0x00U)) */
}
else if ((MCG->C1 & MCG_C1_CLKS_MASK) == 0x80U)
{
/* External reference clock is selected */
switch (MCG->C7 & MCG_C7_OSCSEL_MASK)
{
case 0x00U:
MCGOUTClock = CPU_XTAL_CLK_HZ; /* System oscillator drives MCG clock */
break;
case 0x01U:
MCGOUTClock = CPU_XTAL32k_CLK_HZ; /* RTC 32 kHz oscillator drives MCG clock */
break;
case 0x02U:
default:
MCGOUTClock = CPU_INT_IRC_CLK_HZ; /* IRC 48MHz oscillator drives MCG clock */
break;
}
}
else
{ /* (!((MCG->C1 & MCG_C1_CLKS_MASK) == 0x80U)) */
/* Reserved value */
return;
} /* (!((MCG->C1 & MCG_C1_CLKS_MASK) == 0x80U)) */
SystemCoreClock =
(MCGOUTClock / (0x01U + ((SIM->CLKDIV1 & SIM_CLKDIV1_OUTDIV1_MASK) >> SIM_CLKDIV1_OUTDIV1_SHIFT)));
}
@@ -0,0 +1,383 @@
/*
** ###################################################################
** Processors: MK82FN256CAx15
** MK82FN256VDC15
** MK82FN256VLL15
** MK82FN256VLQ15
**
** Compilers: Keil ARM C/C++ Compiler
** Freescale C/C++ for Embedded ARM
** GNU C Compiler
** GNU C Compiler - CodeSourcery Sourcery G++
** IAR ANSI C/C++ Compiler for ARM
**
** Reference manual: K82P121M150SF5RM, Rev. 0, May 2015
** Version: rev. 1.1, 2015-05-28
** Build: b150626
**
** 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 (c) 2015 Freescale Semiconductor, Inc.
** All rights reserved.
**
** Redistribution and use in source and binary forms, with or without modification,
** are permitted provided that the following conditions are met:
**
** o Redistributions of source code must retain the above copyright notice, this list
** of conditions and the following disclaimer.
**
** o 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.
**
** o Neither the name of Freescale Semiconductor, Inc. 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.
**
** http: www.freescale.com
** mail: support@freescale.com
**
** Revisions:
** - rev. 1.0 (2015-04-09)
** Initial version
** - rev. 1.1 (2015-05-28)
** Update according to the reference manual Rev. 0.
**
** ###################################################################
*/
/*!
* @file MK82F25615
* @version 1.1
* @date 2015-05-28
* @brief Device specific configuration file for MK82F25615 (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_MK82F25615_H_
#define SYSTEM_MK82F25615_H_ /**< Symbol preventing repeated inclusion */
#ifdef __cplusplus
extern "C" {
#endif
#include <stdint.h>
#ifndef DISABLE_WDOG
#define DISABLE_WDOG 1
#endif
/* MCG mode constants */
#define MCG_MODE_FEI 0U
#define MCG_MODE_FBI 1U
#define MCG_MODE_BLPI 2U
#define MCG_MODE_FEE 3U
#define MCG_MODE_FBE 4U
#define MCG_MODE_BLPE 5U
#define MCG_MODE_PBE 6U
#define MCG_MODE_PEE 7U
/* Predefined clock setups
0 ... Default part configuration
Multipurpose Clock Generator (MCG) in FEI mode.
Reference clock source for MCG module: Slow internal reference clock
Core clock = 20.97152MHz
Bus clock = 20.97152MHz
1 ... Maximal speed configuration
Multipurpose Clock Generator (MCG) in PEE mode.
Reference clock source for MCG module: System oscillator 0 reference clock
Core clock = 150MHz
Bus clock = 75MHz
2 ... Chip internally clocked, ready for Very Low Power Run mode.
Multipurpose Clock Generator (MCG) in BLPI mode.
Reference clock source for MCG module: Fast internal reference clock
Core clock = 4MHz
Bus clock = 4MHz
3 ... Chip externally clocked, ready for Very Low Power Run mode.
Multipurpose Clock Generator (MCG) in BLPE mode.
Reference clock source for MCG module: System oscillator 0 reference clock
Core clock = 4MHz
Bus clock = 4MHz
4 ... USB clock setup.
Multipurpose Clock Generator (MCG) in PEE mode.
Reference clock source for MCG module: System oscillator 0 reference clock
Core clock = 144MHz
Bus clock = 72MHz
5 ... Maximum achievable clock frequency configuration in RUN mode.
Multipurpose Clock Generator (MCG) in PEE mode.
Reference clock source for MCG module: System oscillator 0 reference clock
Core clock = 120MHz
Bus clock = 60MHz
*/
/* Define clock source values */
#define CPU_XTAL_CLK_HZ \
12000000U /* Value of the external crystal or oscillator clock frequency of the system oscillator (OSC) in Hz */
#define CPU_XTAL32k_CLK_HZ \
32768U /* Value of the external 32k crystal or oscillator clock frequency of the RTC 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 CPU_INT_IRC_CLK_HZ 48000000U /* Value of the 48M internal oscillator clock frequency in Hz */
/* RTC oscillator setting */
/* RTC_CR: SC2P=0,SC4P=0,SC8P=0,SC16P=0,CLKO=1,OSCE=1,WPS=0,UM=0,SUP=0,WPE=0,SWR=0 */
#define SYSTEM_RTC_CR_VALUE 0x0300U /* RTC_CR */
/* Low power mode enable */
/* SMC_PMPROT: AHSRUN=1,AVLP=1,ALLS=1,AVLLS=1 */
#define SYSTEM_SMC_PMPROT_VALUE 0xAAU /* SMC_PMPROT */
/* Internal reference clock trim */
/* #undef SLOW_TRIM_ADDRESS */ /* Slow oscillator not trimmed. Commented out for MISRA compliance. */
/* #undef SLOW_FINE_TRIM_ADDRESS */ /* Slow oscillator not trimmed. Commented out for MISRA compliance. */
/* #undef FAST_TRIM_ADDRESS */ /* Fast oscillator not trimmed. Commented out for MISRA compliance. */
/* #undef FAST_FINE_TRIM_ADDRESS */ /* Fast oscillator not trimmed. Commented out for MISRA compliance. */
#ifdef CLOCK_SETUP
#if (CLOCK_SETUP == 0)
#define DEFAULT_SYSTEM_CLOCK 20971520U /* Default System clock value */
#define MCG_MODE MCG_MODE_FEI /* Clock generator mode */
/* MCG_C1: CLKS=0,FRDIV=0,IREFS=1,IRCLKEN=1,IREFSTEN=0 */
#define SYSTEM_MCG_C1_VALUE 0x06U /* MCG_C1 */
/* MCG_C2: LOCRE0=0,FCFTRIM=0,RANGE=2,HGO=0,EREFS=1,LP=0,IRCS=0 */
#define SYSTEM_MCG_C2_VALUE 0x24U /* MCG_C2 */
/* MCG_C4: DMX32=0,DRST_DRS=0,FCTRIM=0,SCFTRIM=0 */
#define SYSTEM_MCG_C4_VALUE 0x00U /* MCG_C4 */
/* MCG_SC: ATME=0,ATMS=0,ATMF=0,FLTPRSRV=0,FCRDIV=0,LOCS0=0 */
#define SYSTEM_MCG_SC_VALUE 0x00U /* MCG_SC */
/* MCG_C5: PLLCLKEN=0,PLLSTEN=0,PRDIV=0 */
#define SYSTEM_MCG_C5_VALUE 0x00U /* MCG_C5 */
/* MCG_C6: LOLIE0=0,PLLS=0,CME0=0,VDIV=0 */
#define SYSTEM_MCG_C6_VALUE 0x00U /* MCG_C6 */
/* MCG_C7: OSCSEL=0 */
#define SYSTEM_MCG_C7_VALUE 0x00U /* MCG_C7 */
/* OSC_CR: ERCLKEN=1,EREFSTEN=0,SC2P=0,SC4P=0,SC8P=0,SC16P=0 */
#define SYSTEM_OSC_CR_VALUE 0x80U /* OSC_CR */
/* SMC_PMCTRL: RUNM=0,STOPA=0,STOPM=0 */
#define SYSTEM_SMC_PMCTRL_VALUE 0x00U /* SMC_PMCTRL */
/* SIM_CLKDIV1: OUTDIV1=0,OUTDIV2=0,OUTDIV3=1,OUTDIV4=1 */
#define SYSTEM_SIM_CLKDIV1_VALUE 0x00110000U /* SIM_CLKDIV1 */
/* SIM_CLKDIV3: PLLFLLDIV=0,PLLFLLFRAC=0 */
#define SYSTEM_SIM_CLKDIV3_VALUE 0x00U /* SIM_CLKDIV3 */
/* SIM_SOPT1: USBREGEN=0,USBSSTBY=0,USBVSTBY=0,OSC32KSEL=2,RAMSIZE=0 */
#define SYSTEM_SIM_SOPT1_VALUE 0x00080000U /* SIM_SOPT1 */
/* SIM_SOPT2:
* EMVSIMSRC=0,SDHCSRC=0,LPUARTSRC=0,TPMSRC=1,FLEXIOSRC=0,USBSRC=0,PLLFLLSEL=0,TRACECLKSEL=0,FBSL=0,CLKOUTSEL=0,RTCCLKOUTSEL=0
*/
#define SYSTEM_SIM_SOPT2_VALUE 0x01000000U /* SIM_SOPT2 */
#elif(CLOCK_SETUP == 1)
#define DEFAULT_SYSTEM_CLOCK 150000000U /* Default System clock value */
#define MCG_MODE MCG_MODE_PEE /* Clock generator mode */
/* MCG_C1: CLKS=0,FRDIV=4,IREFS=0,IRCLKEN=1,IREFSTEN=0 */
#define SYSTEM_MCG_C1_VALUE 0x22U /* MCG_C1 */
/* MCG_C2: LOCRE0=0,FCFTRIM=0,RANGE=2,HGO=0,EREFS=1,LP=0,IRCS=0 */
#define SYSTEM_MCG_C2_VALUE 0x24U /* MCG_C2 */
/* MCG_C4: DMX32=0,DRST_DRS=0,FCTRIM=0,SCFTRIM=0 */
#define SYSTEM_MCG_C4_VALUE 0x00U /* MCG_C4 */
/* MCG_SC: ATME=0,ATMS=0,ATMF=0,FLTPRSRV=0,FCRDIV=0,LOCS0=0 */
#define SYSTEM_MCG_SC_VALUE 0x00U /* MCG_SC */
/* MCG_C5: PLLCLKEN=0,PLLSTEN=0,PRDIV=0 */
#define SYSTEM_MCG_C5_VALUE 0x00U /* MCG_C5 */
/* MCG_C6: LOLIE0=0,PLLS=1,CME0=0,VDIV=9 */
#define SYSTEM_MCG_C6_VALUE 0x49U /* MCG_C6 */
/* MCG_C7: OSCSEL=0 */
#define SYSTEM_MCG_C7_VALUE 0x00U /* MCG_C7 */
/* OSC_CR: ERCLKEN=1,EREFSTEN=0,SC2P=0,SC4P=0,SC8P=0,SC16P=0 */
#define SYSTEM_OSC_CR_VALUE 0x80U /* OSC_CR */
/* SMC_PMCTRL: RUNM=3,STOPA=0,STOPM=0 */
#define SYSTEM_SMC_PMCTRL_VALUE 0x60U /* SMC_PMCTRL */
/* SIM_CLKDIV1: OUTDIV1=0,OUTDIV2=1,OUTDIV3=1,OUTDIV4=5 */
#define SYSTEM_SIM_CLKDIV1_VALUE 0x01150000U /* SIM_CLKDIV1 */
/* SIM_CLKDIV3: PLLFLLDIV=0,PLLFLLFRAC=0 */
#define SYSTEM_SIM_CLKDIV3_VALUE 0x00U /* SIM_CLKDIV3 */
/* SIM_SOPT1: USBREGEN=0,USBSSTBY=0,USBVSTBY=0,OSC32KSEL=2,RAMSIZE=0 */
#define SYSTEM_SIM_SOPT1_VALUE 0x00080000U /* SIM_SOPT1 */
/* SIM_SOPT2:
* EMVSIMSRC=0,SDHCSRC=0,LPUARTSRC=0,TPMSRC=1,FLEXIOSRC=0,USBSRC=0,PLLFLLSEL=1,TRACECLKSEL=0,FBSL=0,CLKOUTSEL=0,RTCCLKOUTSEL=0
*/
#define SYSTEM_SIM_SOPT2_VALUE 0x01010000U /* SIM_SOPT2 */
#elif(CLOCK_SETUP == 2)
#define DEFAULT_SYSTEM_CLOCK 4000000U /* Default System clock value */
#define MCG_MODE MCG_MODE_BLPI /* Clock generator mode */
/* MCG_C1: CLKS=1,FRDIV=0,IREFS=1,IRCLKEN=1,IREFSTEN=0 */
#define SYSTEM_MCG_C1_VALUE 0x46U /* MCG_C1 */
/* MCG_C2: LOCRE0=0,FCFTRIM=0,RANGE=2,HGO=0,EREFS=1,LP=1,IRCS=1 */
#define SYSTEM_MCG_C2_VALUE 0x27U /* MCG_C2 */
/* MCG_C4: DMX32=0,DRST_DRS=0,FCTRIM=0,SCFTRIM=0 */
#define SYSTEM_MCG_C4_VALUE 0x00U /* MCG_C4 */
/* MCG_SC: ATME=0,ATMS=0,ATMF=0,FLTPRSRV=0,FCRDIV=0,LOCS0=0 */
#define SYSTEM_MCG_SC_VALUE 0x00U /* MCG_SC */
/* MCG_C5: PLLCLKEN=0,PLLSTEN=0,PRDIV=0 */
#define SYSTEM_MCG_C5_VALUE 0x00U /* MCG_C5 */
/* MCG_C6: LOLIE0=0,PLLS=0,CME0=0,VDIV=0 */
#define SYSTEM_MCG_C6_VALUE 0x00U /* MCG_C6 */
/* MCG_C7: OSCSEL=0 */
#define SYSTEM_MCG_C7_VALUE 0x00U /* MCG_C7 */
/* OSC_CR: ERCLKEN=1,EREFSTEN=0,SC2P=0,SC4P=0,SC8P=0,SC16P=0 */
#define SYSTEM_OSC_CR_VALUE 0x80U /* OSC_CR */
/* SMC_PMCTRL: RUNM=0,STOPA=0,STOPM=0 */
#define SYSTEM_SMC_PMCTRL_VALUE 0x00U /* SMC_PMCTRL */
/* SIM_CLKDIV1: OUTDIV1=0,OUTDIV2=0,OUTDIV3=0,OUTDIV4=4 */
#define SYSTEM_SIM_CLKDIV1_VALUE 0x00040000U /* SIM_CLKDIV1 */
/* SIM_CLKDIV3: PLLFLLDIV=0,PLLFLLFRAC=0 */
#define SYSTEM_SIM_CLKDIV3_VALUE 0x00U /* SIM_CLKDIV3 */
/* SIM_SOPT1: USBREGEN=0,USBSSTBY=0,USBVSTBY=0,OSC32KSEL=2,RAMSIZE=0 */
#define SYSTEM_SIM_SOPT1_VALUE 0x00080000U /* SIM_SOPT1 */
/* SIM_SOPT2:
* EMVSIMSRC=0,SDHCSRC=0,LPUARTSRC=0,TPMSRC=1,FLEXIOSRC=0,USBSRC=0,PLLFLLSEL=3,TRACECLKSEL=0,FBSL=0,CLKOUTSEL=0,RTCCLKOUTSEL=0
*/
#define SYSTEM_SIM_SOPT2_VALUE 0x01030000U /* SIM_SOPT2 */
#elif(CLOCK_SETUP == 3)
#define DEFAULT_SYSTEM_CLOCK 4000000U /* Default System clock value */
#define MCG_MODE MCG_MODE_BLPE /* Clock generator mode */
/* MCG_C1: CLKS=2,FRDIV=4,IREFS=0,IRCLKEN=1,IREFSTEN=0 */
#define SYSTEM_MCG_C1_VALUE 0xA2U /* MCG_C1 */
/* MCG_C2: LOCRE0=0,FCFTRIM=0,RANGE=2,HGO=0,EREFS=1,LP=1,IRCS=1 */
#define SYSTEM_MCG_C2_VALUE 0x27U /* MCG_C2 */
/* MCG_C4: DMX32=0,DRST_DRS=0,FCTRIM=0,SCFTRIM=0 */
#define SYSTEM_MCG_C4_VALUE 0x00U /* MCG_C4 */
/* MCG_SC: ATME=0,ATMS=0,ATMF=0,FLTPRSRV=0,FCRDIV=0,LOCS0=0 */
#define SYSTEM_MCG_SC_VALUE 0x00U /* MCG_SC */
/* MCG_C5: PLLCLKEN=0,PLLSTEN=0,PRDIV=0 */
#define SYSTEM_MCG_C5_VALUE 0x00U /* MCG_C5 */
/* MCG_C6: LOLIE0=0,PLLS=0,CME0=0,VDIV=0 */
#define SYSTEM_MCG_C6_VALUE 0x00U /* MCG_C6 */
/* MCG_C7: OSCSEL=0 */
#define SYSTEM_MCG_C7_VALUE 0x00U /* MCG_C7 */
/* OSC_CR: ERCLKEN=1,EREFSTEN=0,SC2P=0,SC4P=0,SC8P=0,SC16P=0 */
#define SYSTEM_OSC_CR_VALUE 0x80U /* OSC_CR */
/* SMC_PMCTRL: RUNM=0,STOPA=0,STOPM=0 */
#define SYSTEM_SMC_PMCTRL_VALUE 0x00U /* SMC_PMCTRL */
/* SIM_CLKDIV1: OUTDIV1=2,OUTDIV2=2,OUTDIV3=2,OUTDIV4=0x0B */
#define SYSTEM_SIM_CLKDIV1_VALUE 0x222B0000U /* SIM_CLKDIV1 */
/* SIM_CLKDIV3: PLLFLLDIV=0,PLLFLLFRAC=0 */
#define SYSTEM_SIM_CLKDIV3_VALUE 0x00U /* SIM_CLKDIV3 */
/* SIM_SOPT1: USBREGEN=0,USBSSTBY=0,USBVSTBY=0,OSC32KSEL=2,RAMSIZE=0 */
#define SYSTEM_SIM_SOPT1_VALUE 0x00080000U /* SIM_SOPT1 */
/* SIM_SOPT2:
* EMVSIMSRC=0,SDHCSRC=0,LPUARTSRC=0,TPMSRC=1,FLEXIOSRC=0,USBSRC=0,PLLFLLSEL=3,TRACECLKSEL=0,FBSL=0,CLKOUTSEL=0,RTCCLKOUTSEL=0
*/
#define SYSTEM_SIM_SOPT2_VALUE 0x01030000U /* SIM_SOPT2 */
#elif(CLOCK_SETUP == 4)
#define DEFAULT_SYSTEM_CLOCK 144000000U /* Default System clock value */
#define MCG_MODE MCG_MODE_PEE /* Clock generator mode */
/* MCG_C1: CLKS=0,FRDIV=4,IREFS=0,IRCLKEN=1,IREFSTEN=0 */
#define SYSTEM_MCG_C1_VALUE 0x22U /* MCG_C1 */
/* MCG_C2: LOCRE0=0,FCFTRIM=0,RANGE=2,HGO=0,EREFS=1,LP=0,IRCS=0 */
#define SYSTEM_MCG_C2_VALUE 0x24U /* MCG_C2 */
/* MCG_C4: DMX32=0,DRST_DRS=0,FCTRIM=0,SCFTRIM=0 */
#define SYSTEM_MCG_C4_VALUE 0x00U /* MCG_C4 */
/* MCG_SC: ATME=0,ATMS=0,ATMF=0,FLTPRSRV=0,FCRDIV=0,LOCS0=0 */
#define SYSTEM_MCG_SC_VALUE 0x00U /* MCG_SC */
/* MCG_C5: PLLCLKEN=0,PLLSTEN=0,PRDIV=0 */
#define SYSTEM_MCG_C5_VALUE 0x00U /* MCG_C5 */
/* MCG_C6: LOLIE0=0,PLLS=1,CME0=0,VDIV=8 */
#define SYSTEM_MCG_C6_VALUE 0x48U /* MCG_C6 */
/* MCG_C7: OSCSEL=0 */
#define SYSTEM_MCG_C7_VALUE 0x00U /* MCG_C7 */
/* OSC_CR: ERCLKEN=1,EREFSTEN=0,SC2P=0,SC4P=0,SC8P=0,SC16P=0 */
#define SYSTEM_OSC_CR_VALUE 0x80U /* OSC_CR */
/* SMC_PMCTRL: RUNM=3,STOPA=0,STOPM=0 */
#define SYSTEM_SMC_PMCTRL_VALUE 0x60U /* SMC_PMCTRL */
/* SIM_CLKDIV1: OUTDIV1=0,OUTDIV2=1,OUTDIV3=1,OUTDIV4=5 */
#define SYSTEM_SIM_CLKDIV1_VALUE 0x01150000U /* SIM_CLKDIV1 */
/* SIM_CLKDIV2: USBDIV=2,USBFRAC=0 */
#define SYSTEM_SIM_CLKDIV2_VALUE 0x04U /* SIM_CLKDIV2 */
/* SIM_CLKDIV3: PLLFLLDIV=0,PLLFLLFRAC=0 */
#define SYSTEM_SIM_CLKDIV3_VALUE 0x00U /* SIM_CLKDIV3 */
/* SIM_SOPT1: USBREGEN=0,USBSSTBY=0,USBVSTBY=0,OSC32KSEL=2,RAMSIZE=0 */
#define SYSTEM_SIM_SOPT1_VALUE 0x00080000U /* SIM_SOPT1 */
/* SIM_SOPT2:
* EMVSIMSRC=0,SDHCSRC=0,LPUARTSRC=0,TPMSRC=1,FLEXIOSRC=0,USBSRC=0,PLLFLLSEL=1,TRACECLKSEL=0,FBSL=0,CLKOUTSEL=0,RTCCLKOUTSEL=0
*/
#define SYSTEM_SIM_SOPT2_VALUE 0x01010000U /* SIM_SOPT2 */
#elif(CLOCK_SETUP == 5)
#define DEFAULT_SYSTEM_CLOCK 120000000U /* Default System clock value */
#define MCG_MODE MCG_MODE_PEE /* Clock generator mode */
/* MCG_C1: CLKS=0,FRDIV=4,IREFS=0,IRCLKEN=1,IREFSTEN=0 */
#define SYSTEM_MCG_C1_VALUE 0x22U /* MCG_C1 */
/* MCG_C2: LOCRE0=0,FCFTRIM=0,RANGE=2,HGO=0,EREFS=1,LP=0,IRCS=0 */
#define SYSTEM_MCG_C2_VALUE 0x24U /* MCG_C2 */
/* MCG_C4: DMX32=0,DRST_DRS=0,FCTRIM=0,SCFTRIM=0 */
#define SYSTEM_MCG_C4_VALUE 0x00U /* MCG_C4 */
/* MCG_SC: ATME=0,ATMS=0,ATMF=0,FLTPRSRV=0,FCRDIV=0,LOCS0=0 */
#define SYSTEM_MCG_SC_VALUE 0x00U /* MCG_SC */
/* MCG_C5: PLLCLKEN=0,PLLSTEN=0,PRDIV=0 */
#define SYSTEM_MCG_C5_VALUE 0x00U /* MCG_C5 */
/* MCG_C6: LOLIE0=0,PLLS=1,CME0=0,VDIV=4 */
#define SYSTEM_MCG_C6_VALUE 0x44U /* MCG_C6 */
/* MCG_C7: OSCSEL=0 */
#define SYSTEM_MCG_C7_VALUE 0x00U /* MCG_C7 */
/* OSC_CR: ERCLKEN=1,EREFSTEN=0,SC2P=0,SC4P=0,SC8P=0,SC16P=0 */
#define SYSTEM_OSC_CR_VALUE 0x80U /* OSC_CR */
/* SMC_PMCTRL: RUNM=0,STOPA=0,STOPM=0 */
#define SYSTEM_SMC_PMCTRL_VALUE 0x00U /* SMC_PMCTRL */
/* SIM_CLKDIV1: OUTDIV1=0,OUTDIV2=1,OUTDIV3=1,OUTDIV4=4 */
#define SYSTEM_SIM_CLKDIV1_VALUE 0x01140000U /* SIM_CLKDIV1 */
/* SIM_CLKDIV3: PLLFLLDIV=0,PLLFLLFRAC=0 */
#define SYSTEM_SIM_CLKDIV3_VALUE 0x00U /* SIM_CLKDIV3 */
/* SIM_SOPT1: USBREGEN=0,USBSSTBY=0,USBVSTBY=0,OSC32KSEL=2,RAMSIZE=0 */
#define SYSTEM_SIM_SOPT1_VALUE 0x00080000U /* SIM_SOPT1 */
/* SIM_SOPT2:
* EMVSIMSRC=0,SDHCSRC=0,LPUARTSRC=0,TPMSRC=1,FLEXIOSRC=0,USBSRC=0,PLLFLLSEL=1,TRACECLKSEL=0,FBSL=0,CLKOUTSEL=0,RTCCLKOUTSEL=0
*/
#define SYSTEM_SIM_SOPT2_VALUE 0x01010000U /* SIM_SOPT2 */
#endif
#else
#define DEFAULT_SYSTEM_CLOCK 20971520u
#endif
/**
* @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_MK82F25615_H_) */
@@ -0,0 +1,308 @@
/*
** ###################################################################
** Processors: MK82FN256CAx15
** MK82FN256VDC15
** MK82FN256VLL15
** MK82FN256VLQ15
**
** Compilers: Keil ARM C/C++ Compiler
** Freescale C/C++ for Embedded ARM
** GNU C Compiler
** GNU C Compiler - CodeSourcery Sourcery G++
** IAR ANSI C/C++ Compiler for ARM
**
** Reference manual: K82P121M150SF5RM, Rev. 0, May 2015
** Version: rev. 1.1, 2015-05-28
** Build: b150626
**
** 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 (c) 2015 Freescale Semiconductor, Inc.
** All rights reserved.
**
** Redistribution and use in source and binary forms, with or without modification,
** are permitted provided that the following conditions are met:
**
** o Redistributions of source code must retain the above copyright notice, this list
** of conditions and the following disclaimer.
**
** o 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.
**
** o Neither the name of Freescale Semiconductor, Inc. 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.
**
** http: www.freescale.com
** mail: support@freescale.com
**
** Revisions:
** - rev. 1.0 (2015-04-09)
** Initial version
** - rev. 1.1 (2015-05-28)
** Update according to the reference manual Rev. 0.
**
** ###################################################################
*/
/*!
* @file MK82F25615
* @version 1.1
* @date 2015-05-28
* @brief Device specific configuration file for MK82F25615 (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 "fsl_device_registers.h"
/*!
* @brief Defines the structure to set the Bootloader Configuration Area
*
* This type of variable is used to set the Bootloader Configuration Area
* of the chip.
*/
typedef struct SystemBootloaderConfig
{
uint32_t tag; /*!< Magic number to verify bootloader configuration is valid. Must be set to 'kcfg'. */
uint32_t crcStartAddress; /*!< Start address for application image CRC check. If the bits are all set then Kinetis
bootloader by default will not perform any CRC check. */
uint32_t crcByteCount; /*!< Byte count for application image CRC check. If the bits are all set then Kinetis
bootloader by default will not prform any CRC check. */
uint32_t crcExpectedValue; /*!< Expected CRC value for application CRC check. If the bits are all set then Kinetis
bootloader by default will not perform any CRC check.*/
uint8_t enabledPeripherals; /*!< Bitfield of peripherals to enable.
bit 0 - LPUART, bit 1 - I2C, bit 2 - SPI, bit 4 - USB
Kinetis bootloader will enable the peripheral if corresponding bit is set to 1. */
uint8_t i2cSlaveAddress; /*!< If not 0xFF, used as the 7-bit I2C slave address. If 0xFF, defaults to 0x10 for I2C
slave address */
uint16_t peripheralDetectionTimeoutMs; /*!< Timeout in milliseconds for active peripheral detection. If 0xFFFF,
defaults to 5 seconds. */
uint16_t usbVid; /*!< Sets the USB Vendor ID reported by the device during enumeration. If 0xFFFF, it defaults to
0x15A2. */
uint16_t usbPid; /*!< Sets the USB Product ID reported by the device during enumeration. */
uint32_t usbStringsPointer; /*!< Sets the USB Strings reported by the device during enumeration. */
uint8_t clockFlags; /*!< The flags in the clockFlags configuration field are enabled if the corresponding bit is
cleared (0).
bit 0 - HighSpeed Enable high speed mode (i.e., 48 MHz). */
uint8_t clockDivider; /*!< Inverted value of the divider to use for core and bus clocks when in high speed mode */
uint8_t bootFlags; /*!< If bit 0 is cleared, then Kinetis bootloader will jump to either Quad SPI Flash or internal
flash image depending on FOPT BOOTSRC_SEL bits.
If the bit is set, then Kinetis bootloader will prepare for host communication over serial
peripherals. */
uint8_t RESERVED1;
uint32_t mmcauConfigPointer; /*!< A pointer to the MMCAU configuration structure in memory. */
uint32_t keyBlobPointer; /*!< A pointer to the keyblob data in memory. */
uint8_t RESERVED2[8];
uint32_t qspiConfigBlockPtr; /*!< A pointer to the QSPI config block in internal flash array. */
uint8_t RESERVED3[12];
} system_bootloader_config_t;
#ifdef BOOTLOADER_CONFIG
/* Bootlader configuration area */
#if defined(__IAR_SYSTEMS_ICC__)
/* Pragma to place the Bootloader Configuration Array on correct location defined in linker file. */
#pragma language = extended
#pragma location = "BootloaderConfig"
__root const system_bootloader_config_t BootloaderConfig @"BootloaderConfig" =
#elif defined(__GNUC__)
__attribute__((section(".BootloaderConfig"))) const system_bootloader_config_t BootloaderConfig =
#elif defined(__CC_ARM)
__attribute__((section("BootloaderConfig"))) const system_bootloader_config_t BootloaderConfig __attribute__((used)) =
#else
#error Unsupported compiler!
#endif
{
.tag = 0x6766636BU, /* Magic Number */
.crcStartAddress = 0xFFFFFFFFU, /* Disable CRC check */
.crcByteCount = 0xFFFFFFFFU, /* Disable CRC check */
.crcExpectedValue = 0xFFFFFFFFU, /* Disable CRC check */
.enabledPeripherals = 0x17, /* Enable all peripherals */
.i2cSlaveAddress = 0xFF, /* Use default I2C address */
.peripheralDetectionTimeoutMs = 0x01F4U, /* timeout: 500ms */
.usbVid = 0xFFFFU, /* Use default USB Vendor ID */
.usbPid = 0xFFFFU, /* Use default USB Product ID */
.usbStringsPointer = 0xFFFFFFFFU, /* Use default USB Strings */
.clockFlags = 0x01, /* Enable High speed mode */
.clockDivider = 0xFF, /* Use clock divider 1 */
.bootFlags = 0x01, /* Enable communication with host */
.mmcauConfigPointer = 0xFFFFFFFFU, /* No MMCAU configuration */
#ifdef BL_TARGET_FLASH
.keyBlobPointer = 0x0000c000, /* keyblob data is ata 0xc000 */
#else
.keyBlobPointer = 0x000001000, /* keyblob data is at 0x1000 */
#endif // BL_TARGET_FLASH
.qspiConfigBlockPtr = 0xFFFFFFFFU /* No QSPI configuration */
};
#endif
/* ----------------------------------------------------------------------------
-- Core clock
---------------------------------------------------------------------------- */
uint32_t SystemCoreClock = 96000000ul;
/* ----------------------------------------------------------------------------
-- SystemInit()
---------------------------------------------------------------------------- */
void SystemInit(void)
{
#if ((__FPU_PRESENT == 1) && (__FPU_USED == 1))
SCB->CPACR |= ((3UL << 10 * 2) | (3UL << 11 * 2)); /* set CP10, CP11 Full Access */
#endif /* ((__FPU_PRESENT == 1) && (__FPU_USED == 1)) */
}
/* ----------------------------------------------------------------------------
-- SystemCoreClockUpdate()
---------------------------------------------------------------------------- */
void SystemCoreClockUpdate(void)
{
uint32_t MCGOUTClock; /* Variable to store output clock frequency of the MCG module */
uint16_t Divider;
if ((MCG->C1 & MCG_C1_CLKS_MASK) == 0x00U)
{
/* Output of FLL or PLL is selected */
if ((MCG->C6 & MCG_C6_PLLS_MASK) == 0x00U)
{
/* FLL is selected */
if ((MCG->C1 & MCG_C1_IREFS_MASK) == 0x00U)
{
/* External reference clock is selected */
switch (MCG->C7 & MCG_C7_OSCSEL_MASK)
{
case 0x00U:
MCGOUTClock = CPU_XTAL_CLK_HZ; /* System oscillator drives MCG clock */
break;
case 0x01U:
MCGOUTClock = CPU_XTAL32k_CLK_HZ; /* RTC 32 kHz oscillator drives MCG clock */
break;
case 0x02U:
default:
MCGOUTClock = CPU_INT_IRC_CLK_HZ; /* IRC 48MHz oscillator drives MCG clock */
break;
}
if (((MCG->C2 & MCG_C2_RANGE_MASK) != 0x00U) && ((MCG->C7 & MCG_C7_OSCSEL_MASK) != 0x01U))
{
switch (MCG->C1 & MCG_C1_FRDIV_MASK)
{
case 0x38U:
Divider = 1536U;
break;
case 0x30U:
Divider = 1280U;
break;
default:
Divider = (uint16_t)(32LU << ((MCG->C1 & MCG_C1_FRDIV_MASK) >> MCG_C1_FRDIV_SHIFT));
break;
}
}
else
{ /* ((MCG->C2 & MCG_C2_RANGE_MASK) != 0x00U) */
Divider = (uint16_t)(1LU << ((MCG->C1 & MCG_C1_FRDIV_MASK) >> MCG_C1_FRDIV_SHIFT));
}
MCGOUTClock = (MCGOUTClock / Divider); /* Calculate the divided FLL reference clock */
}
else
{ /* (!((MCG->C1 & MCG_C1_IREFS_MASK) == 0x00U)) */
MCGOUTClock = CPU_INT_SLOW_CLK_HZ; /* The slow internal reference clock is selected */
} /* (!((MCG->C1 & MCG_C1_IREFS_MASK) == 0x00U)) */
/* Select correct multiplier to calculate the MCG output clock */
switch (MCG->C4 & (MCG_C4_DMX32_MASK | MCG_C4_DRST_DRS_MASK))
{
case 0x00U:
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) == 0x00U)) */
/* PLL is selected */
Divider = (((uint16_t)MCG->C5 & MCG_C5_PRDIV_MASK) + 0x01U);
MCGOUTClock = (uint32_t)(CPU_XTAL_CLK_HZ / Divider); /* Calculate the PLL reference clock */
Divider = (((uint16_t)MCG->C6 & MCG_C6_VDIV_MASK) + 16U);
MCGOUTClock *= Divider; /* Calculate the VCO output clock */
MCGOUTClock /= 2; /* Calculate the MCG output clock */
} /* (!((MCG->C6 & MCG_C6_PLLS_MASK) == 0x00U)) */
}
else if ((MCG->C1 & MCG_C1_CLKS_MASK) == 0x40U)
{
/* Internal reference clock is selected */
if ((MCG->C2 & MCG_C2_IRCS_MASK) == 0x00U)
{
MCGOUTClock = CPU_INT_SLOW_CLK_HZ; /* Slow internal reference clock selected */
}
else
{ /* (!((MCG->C2 & MCG_C2_IRCS_MASK) == 0x00U)) */
Divider = (uint16_t)(0x01LU << ((MCG->SC & MCG_SC_FCRDIV_MASK) >> MCG_SC_FCRDIV_SHIFT));
MCGOUTClock = (uint32_t)(CPU_INT_FAST_CLK_HZ / Divider); /* Fast internal reference clock selected */
} /* (!((MCG->C2 & MCG_C2_IRCS_MASK) == 0x00U)) */
}
else if ((MCG->C1 & MCG_C1_CLKS_MASK) == 0x80U)
{
/* External reference clock is selected */
switch (MCG->C7 & MCG_C7_OSCSEL_MASK)
{
case 0x00U:
MCGOUTClock = CPU_XTAL_CLK_HZ; /* System oscillator drives MCG clock */
break;
case 0x01U:
MCGOUTClock = CPU_XTAL32k_CLK_HZ; /* RTC 32 kHz oscillator drives MCG clock */
break;
case 0x02U:
default:
MCGOUTClock = CPU_INT_IRC_CLK_HZ; /* IRC 48MHz oscillator drives MCG clock */
break;
}
}
else
{ /* (!((MCG->C1 & MCG_C1_CLKS_MASK) == 0x80U)) */
/* Reserved value */
return;
} /* (!((MCG->C1 & MCG_C1_CLKS_MASK) == 0x80U)) */
SystemCoreClock =
(MCGOUTClock / (0x01U + ((SIM->CLKDIV1 & SIM_CLKDIV1_OUTDIV1_MASK) >> SIM_CLKDIV1_OUTDIV1_SHIFT)));
}
@@ -0,0 +1,235 @@
/*
** ###################################################################
** Processors: MK82FN256CAx15
** MK82FN256VDC15
** MK82FN256VLL15
** MK82FN256VLQ15
**
** Compilers: Keil ARM C/C++ Compiler
** Freescale C/C++ for Embedded ARM
** GNU C Compiler
** GNU C Compiler - CodeSourcery Sourcery G++
** IAR ANSI C/C++ Compiler for ARM
**
** Reference manual: K82P121M150SF5RM, Rev. 0, May 2015
** Version: rev. 1.1, 2015-05-28
** Build: b150626
**
** 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 (c) 2015 Freescale Semiconductor, Inc.
** All rights reserved.
**
** Redistribution and use in source and binary forms, with or without modification,
** are permitted provided that the following conditions are met:
**
** o Redistributions of source code must retain the above copyright notice, this list
** of conditions and the following disclaimer.
**
** o 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.
**
** o Neither the name of Freescale Semiconductor, Inc. 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.
**
** http: www.freescale.com
** mail: support@freescale.com
**
** Revisions:
** - rev. 1.0 (2015-04-09)
** Initial version
** - rev. 1.1 (2015-05-28)
** Update according to the reference manual Rev. 0.
**
** ###################################################################
*/
/*!
* @file MK82F25615
* @version 1.1
* @date 2015-05-28
* @brief Device specific configuration file for MK82F25615 (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 "fsl_device_registers.h"
/*!
* @brief Defines the structure to set the Bootloader Configuration Area
*
* This type of variable is used to set the Bootloader Configuration Area
* of the chip.
*/
typedef struct SystemBootloaderConfig
{
uint32_t tag; /*!< Magic number to verify bootloader configuration is valid. Must be set to 'kcfg'. */
uint32_t crcStartAddress; /*!< Start address for application image CRC check. If the bits are all set then Kinetis
bootloader by default will not perform any CRC check. */
uint32_t crcByteCount; /*!< Byte count for application image CRC check. If the bits are all set then Kinetis
bootloader by default will not prform any CRC check. */
uint32_t crcExpectedValue; /*!< Expected CRC value for application CRC check. If the bits are all set then Kinetis
bootloader by default will not perform any CRC check.*/
uint8_t enabledPeripherals; /*!< Bitfield of peripherals to enable.
bit 0 - LPUART, bit 1 - I2C, bit 2 - SPI, bit 4 - USB
Kinetis bootloader will enable the peripheral if corresponding bit is set to 1. */
uint8_t i2cSlaveAddress; /*!< If not 0xFF, used as the 7-bit I2C slave address. If 0xFF, defaults to 0x10 for I2C
slave address */
uint16_t peripheralDetectionTimeoutMs; /*!< Timeout in milliseconds for active peripheral detection. If 0xFFFF,
defaults to 5 seconds. */
uint16_t usbVid; /*!< Sets the USB Vendor ID reported by the device during enumeration. If 0xFFFF, it defaults to
0x15A2. */
uint16_t usbPid; /*!< Sets the USB Product ID reported by the device during enumeration. */
uint32_t usbStringsPointer; /*!< Sets the USB Strings reported by the device during enumeration. */
uint8_t clockFlags; /*!< The flags in the clockFlags configuration field are enabled if the corresponding bit is
cleared (0).
bit 0 - HighSpeed Enable high speed mode (i.e., 48 MHz). */
uint8_t clockDivider; /*!< Inverted value of the divider to use for core and bus clocks when in high speed mode */
uint8_t bootFlags; /*!< If bit 0 is cleared, then Kinetis bootloader will jump to either Quad SPI Flash or internal
flash image depending on FOPT BOOTSRC_SEL bits.
If the bit is set, then Kinetis bootloader will prepare for host communication over serial
peripherals. */
uint8_t RESERVED1;
uint32_t mmcauConfigPointer; /*!< A pointer to the MMCAU configuration structure in memory. */
uint32_t keyBlobPointer; /*!< A pointer to the keyblob data in memory. */
uint8_t RESERVED2[8];
uint32_t qspiConfigBlockPtr; /*!< A pointer to the QSPI config block in internal flash array. */
uint8_t RESERVED3[12];
} system_bootloader_config_t;
/* Bootlader configuration area */
#if defined(__IAR_SYSTEMS_ICC__)
/* Pragma to place the Bootloader Configuration Array on correct location defined in linker file. */
#pragma language = extended
#pragma location = "BootloaderConfig"
__root const system_bootloader_config_t BootloaderConfig @"BootloaderConfig" =
#elif defined(__GNUC__)
__attribute__((section(".BootloaderConfig"))) const system_bootloader_config_t BootloaderConfig =
#elif defined(__CC_ARM)
__attribute__((section("BootloaderConfig"))) const system_bootloader_config_t BootloaderConfig __attribute__((used)) =
#else
#error Unsupported compiler!
#endif
{
.tag = 0x6766636BU, /* Magic Number */
.crcStartAddress = 0xFFFFFFFFU, /* Disable CRC check */
.crcByteCount = 0xFFFFFFFFU, /* Disable CRC check */
.crcExpectedValue = 0xFFFFFFFFU, /* Disable CRC check */
.enabledPeripherals = 0x17, /* Enable all peripherals */
.i2cSlaveAddress = 0xFF, /* Use default I2C address */
.peripheralDetectionTimeoutMs = 3000, /* timeout: 3000ms */
.usbVid = 0xFFFFU, /* Use default USB Vendor ID */
.usbPid = 0xFFFFU, /* Use default USB Product ID */
.usbStringsPointer = 0xFFFFFFFFU, /* Use default USB Strings */
.clockFlags = 0x01, /* Enable High speed mode */
.clockDivider = 0xFF, /* Use clock divider 1 */
.bootFlags = 0x01, /* Enable communication with host */
.mmcauConfigPointer = 0xFFFFFFFFU, /* No MMCAU configuration */
.keyBlobPointer = 0x000001000, /* keyblob data is at 0x1000 */
.qspiConfigBlockPtr = 0x2000, /* QCB is placed at 0x2000 */
};
/* ----------------------------------------------------------------------------
-- Core clock
---------------------------------------------------------------------------- */
uint32_t SystemCoreClock = 96000000ul;
/**
* A section located at 0x410 used for storing ROM patch code
*
* pseudo-code:
* int rom_patch(qspi_config_t *base)
* {
* volatile uint32_t *qspi_flshcr_reg = (volatile uint32_t*)QuadSPI0_FLSHCR_BASE;
*
* // Set QuadSPI_FLSHCR[TDH] to given parameters.
* *qspi_flshcr_reg &= (uint32_t)~QuadSPI_FLSHCR_TDH_MASK;
* *qspi_flshcr_reg |= (base->data_hold_time)<<QuadSPI0_FLSHCR_TDH_SHIFT;
*
* return kStatus_Success;
}
*/
#if defined(__IAR_SYSTEMS_ICC__)
/* Pragma to place the rom patch code on correct location defined in linker file. */
#pragma language = extended
#pragma section = "rom_patch_code"
const uint8_t s_rom_patch[124] @"rom_patch_code" =
#elif defined(__GNUC__)
__attribute__((section("rom_patch_code"))) const uint8_t s_rom_patch[124] __attribute__((used)) =
#elif defined(__CC_ARM)
__attribute__((section("rom_patch_code"))) const uint8_t s_rom_patch[124] __attribute__((used)) =
#else
#error Unsupported compiler!
#endif
{ 0x10, 0xB5, 0x01, 0x00, 0x17, 0x4A, 0x10, 0x00, 0x18, 0x30, 0x17, 0x4B, 0x1B, 0x68, 0xDB, 0x00, 0x02, 0xD5,
0x16, 0x4A, 0x10, 0x00, 0x18, 0x30, 0x13, 0x68, 0x15, 0x4C, 0x1C, 0x40, 0x14, 0x60, 0x13, 0x68, 0x0C, 0x69,
0x24, 0x04, 0x1C, 0x43, 0x14, 0x60, 0x02, 0x68, 0x11, 0x4B, 0x13, 0x40, 0x03, 0x60, 0xDA, 0x22, 0x52, 0x00,
0x89, 0x18, 0x02, 0x68, 0x0B, 0x68, 0x1B, 0x04, 0xFC, 0x24, 0xA4, 0x03, 0x1C, 0x40, 0x14, 0x43, 0x04, 0x60,
0x02, 0x68, 0x0B, 0x4B, 0x13, 0x40, 0x03, 0x60, 0x02, 0x68, 0x49, 0x68, 0x09, 0x06, 0xFC, 0x23, 0x9B, 0x05,
0x0B, 0x40, 0x13, 0x43, 0x03, 0x60, 0x00, 0x20, 0x10, 0xBD, 0x0C, 0xA0, 0x0D, 0x40, 0x24, 0x80, 0x04, 0x40,
0x0C, 0xA0, 0x05, 0x40, 0xFF, 0xFF, 0xFC, 0xFF, 0xFF, 0xFF, 0xC0, 0xFF, 0xFF, 0xFF, 0xFF, 0xC0 };
/*
* ROM patch handler for ROM patch code execution.
*/
#if defined(__IAR_SYSTEMS_ICC__)
/* Pragma to place the ROM_PatchHandler on correct location defined in linker file. */
#pragma language = extended
#pragma section = "BootloaderPatchHandler"
void ROM_PatchHandler(void) @"BootloaderPatchHandler"
#elif defined(__GNUC__)
__attribute__((section("BootloaderPatchHandler"))) void ROM_PatchHandler(void)
#elif defined(__CC_ARM)
__attribute__((section("BootloaderPatchHandler"))) void ROM_PatchHandler(void)
#else
#error Unsupported compiler!
#endif
{
typedef int (*patch_handler_t)(uint32_t);
#if defined(__IAR_SYSTEMS_ICC__)
uint32_t s_rom_patch_start = (uint32_t)__section_begin("rom_patch_code");
#elif defined(__CC_ARM)
extern uint32_t Load$$EXEC_m_rom_patch_code$$Base[];
uint32_t s_rom_patch_start = (uint32_t)&Load$$EXEC_m_rom_patch_code$$Base;
#elif defined(__GNUC__)
extern uint32_t rom_patch_code_start[];
uint32_t s_rom_patch_start = (uint32_t)&rom_patch_code_start;
#endif
uint32_t patch_start = s_rom_patch_start + 1;
patch_handler_t patch_run = (patch_handler_t)patch_start;
patch_run(BootloaderConfig.qspiConfigBlockPtr);
}
/* ----------------------------------------------------------------------------
-- SystemInit()
---------------------------------------------------------------------------- */
void SystemInit(void)
{
#if ((__FPU_PRESENT == 1) && (__FPU_USED == 1))
SCB->CPACR |= ((3UL << 10 * 2) | (3UL << 11 * 2)); /* set CP10, CP11 Full Access */
#endif /* ((__FPU_PRESENT == 1) && (__FPU_USED == 1)) */
}
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,462 @@
/* ---------------------------------------------------------------------------------------*/
/* @file: startup_MK82F25615.s */
/* @purpose: CMSIS Cortex-M4 Core Device Startup File */
/* MK82F25615 */
/* @version: 1.1 */
/* @date: 2015-5-28 */
/* @build: b150626 */
/* ---------------------------------------------------------------------------------------*/
/* */
/* Copyright (c) 1997 - 2015 , Freescale Semiconductor, Inc. */
/* All rights reserved. */
/* */
/* Redistribution and use in source and binary forms, with or without modification, */
/* are permitted provided that the following conditions are met: */
/* */
/* o Redistributions of source code must retain the above copyright notice, this list */
/* of conditions and the following disclaimer. */
/* */
/* o 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. */
/* */
/* o Neither the name of Freescale Semiconductor, Inc. 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. */
/*****************************************************************************/
/* Version: GCC for ARM Embedded Processors */
/*****************************************************************************/
.syntax unified
.arch armv7-m
.section .isr_vector, "a"
.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_DMA16_IRQHandler /* DMA channel 0,16 transfer complete*/
.long DMA1_DMA17_IRQHandler /* DMA channel 1,17 transfer complete*/
.long DMA2_DMA18_IRQHandler /* DMA channel 2,18 transfer complete*/
.long DMA3_DMA19_IRQHandler /* DMA channel 3,19 transfer complete*/
.long DMA4_DMA20_IRQHandler /* DMA channel 4,20 transfer complete*/
.long DMA5_DMA21_IRQHandler /* DMA channel 5,21 transfer complete*/
.long DMA6_DMA22_IRQHandler /* DMA channel 6,22 transfer complete*/
.long DMA7_DMA23_IRQHandler /* DMA channel 7,23 transfer complete*/
.long DMA8_DMA24_IRQHandler /* DMA channel 8,24 transfer complete*/
.long DMA9_DMA25_IRQHandler /* DMA channel 9,25 transfer complete*/
.long DMA10_DMA26_IRQHandler /* DMA channel 10,26 transfer complete*/
.long DMA11_DMA27_IRQHandler /* DMA channel 11,27 transfer complete*/
.long DMA12_DMA28_IRQHandler /* DMA channel 12,28 transfer complete*/
.long DMA13_DMA29_IRQHandler /* DMA channel 13,29 transfer complete*/
.long DMA14_DMA30_IRQHandler /* DMA channel 14,30 transfer complete*/
.long DMA15_DMA31_IRQHandler /* DMA channel 15,31 transfer complete*/
.long DMA_Error_IRQHandler /* DMA channel 0 - 31 error*/
.long MCM_IRQHandler /* MCM normal interrupt*/
.long FTFA_IRQHandler /* FTFA command complete*/
.long Read_Collision_IRQHandler /* FTFA read collision*/
.long LVD_LVW_IRQHandler /* PMC controller low-voltage detect, low-voltage warning*/
.long LLWU_IRQHandler /* Low leakage wakeup unit*/
.long WDOG_EWM_IRQHandler /* Single interrupt vector for WDOG and EWM*/
.long TRNG0_IRQHandler /* True randon number generator*/
.long I2C0_IRQHandler /* Inter-integrated circuit 0*/
.long I2C1_IRQHandler /* Inter-integrated circuit 1*/
.long SPI0_IRQHandler /* Serial peripheral Interface 0*/
.long SPI1_IRQHandler /* Serial peripheral Interface 1*/
.long I2S0_Tx_IRQHandler /* Integrated interchip sound 0 transmit interrupt*/
.long I2S0_Rx_IRQHandler /* Integrated interchip sound 0 receive interrupt*/
.long LPUART0_IRQHandler /* LPUART0 receive/transmit/error interrupt*/
.long LPUART1_IRQHandler /* LPUART1 receive/transmit/error interrupt*/
.long LPUART2_IRQHandler /* LPUART2 receive/transmit/error interrupt*/
.long LPUART3_IRQHandler /* LPUART3 receive/transmit/error interrupt*/
.long LPUART4_IRQHandler /* LPUART4 receive/transmit/error interrupt*/
.long Reserved51_IRQHandler /* Reserved interrupt*/
.long Reserved52_IRQHandler /* Reserved interrupt*/
.long EMVSIM0_IRQHandler /* EMVSIM0 common interrupt*/
.long EMVSIM1_IRQHandler /* EMVSIM1 common interrupt*/
.long ADC0_IRQHandler /* Analog-to-digital converter 0*/
.long CMP0_IRQHandler /* Comparator 0*/
.long CMP1_IRQHandler /* Comparator 1*/
.long FTM0_IRQHandler /* FlexTimer module 0 fault, overflow and channels interrupt*/
.long FTM1_IRQHandler /* FlexTimer module 1 fault, overflow and channels interrupt*/
.long FTM2_IRQHandler /* FlexTimer module 2 fault, overflow and channels interrupt*/
.long CMT_IRQHandler /* Carrier modulator transmitter*/
.long RTC_IRQHandler /* Real time clock*/
.long RTC_Seconds_IRQHandler /* Real time clock seconds*/
.long PIT0CH0_IRQHandler /* Periodic interrupt timer 0 channel 0*/
.long PIT0CH1_IRQHandler /* Periodic interrupt timer 0 channel 1*/
.long PIT0CH2_IRQHandler /* Periodic interrupt timer 0 channel 2*/
.long PIT0CH3_IRQHandler /* Periodic interrupt timer 0 channel 3*/
.long PDB0_IRQHandler /* Programmable delay block*/
.long USB0_IRQHandler /* USB OTG interrupt*/
.long USBDCD_IRQHandler /* USB charger detect*/
.long Reserved71_IRQHandler /* Reserved interrupt*/
.long DAC0_IRQHandler /* Digital-to-analog converter 0*/
.long MCG_IRQHandler /* Multipurpose clock generator*/
.long LPTMR0_LPTMR1_IRQHandler /* Single interrupt vector for Low Power Timer 0 and 1*/
.long PORTA_IRQHandler /* Port A pin detect interrupt*/
.long PORTB_IRQHandler /* Port B pin detect interrupt*/
.long PORTC_IRQHandler /* Port C pin detect interrupt*/
.long PORTD_IRQHandler /* Port D pin detect interrupt*/
.long PORTE_IRQHandler /* Port E pin detect interrupt*/
.long SWI_IRQHandler /* Software interrupt*/
.long SPI2_IRQHandler /* Serial peripheral Interface 2*/
.long Reserved82_IRQHandler /* Reserved interrupt*/
.long Reserved83_IRQHandler /* Reserved interrupt*/
.long Reserved84_IRQHandler /* Reserved interrupt*/
.long Reserved85_IRQHandler /* Reserved interrupt*/
.long FLEXIO0_IRQHandler /* FLEXIO0*/
.long FTM3_IRQHandler /* FlexTimer module 3 fault, overflow and channels interrupt*/
.long Reserved88_IRQHandler /* Reserved interrupt*/
.long Reserved89_IRQHandler /* Reserved interrupt*/
.long I2C2_IRQHandler /* Inter-integrated circuit 2*/
.long Reserved91_IRQHandler /* Reserved interrupt*/
.long Reserved92_IRQHandler /* Reserved interrupt*/
.long Reserved93_IRQHandler /* Reserved interrupt*/
.long Reserved94_IRQHandler /* Reserved interrupt*/
.long Reserved95_IRQHandler /* Reserved interrupt*/
.long Reserved96_IRQHandler /* Reserved interrupt*/
.long SDHC_IRQHandler /* Secured digital host controller*/
.long Reserved98_IRQHandler /* Reserved interrupt*/
.long Reserved99_IRQHandler /* Reserved interrupt*/
.long Reserved100_IRQHandler /* Reserved interrupt*/
.long Reserved101_IRQHandler /* Reserved interrupt*/
.long Reserved102_IRQHandler /* Reserved interrupt*/
.long TSI0_IRQHandler /* Touch Sensing Input*/
.long TPM1_IRQHandler /* TPM1 single interrupt vector for all sources*/
.long TPM2_IRQHandler /* TPM2 single interrupt vector for all sources*/
.long Reserved106_IRQHandler /* Reserved interrupt*/
.long I2C3_IRQHandler /* Inter-integrated circuit 3*/
.long Reserved108_IRQHandler /* Reserved interrupt*/
.long Reserved109_IRQHandler /* Reserved interrupt*/
.long Reserved110_IRQHandler /* Reserved interrupt*/
.long Reserved111_IRQHandler /* Reserved interrupt*/
.long Reserved112_IRQHandler /* Reserved interrupt*/
.long Reserved113_IRQHandler /* Reserved interrupt*/
.long Reserved114_IRQHandler /* Reserved interrupt*/
.long Reserved115_IRQHandler /* Reserved interrupt*/
.long QuadSPI0_IRQHandler /* qspi*/
.long Reserved117_IRQHandler /* Reserved interrupt*/
.long Reserved118_IRQHandler /* Reserved interrupt*/
.long Reserved119_IRQHandler /* Reserved interrupt*/
.long LTC0_IRQHandler /* LP Trusted Cryptography*/
.long Reserved121_IRQHandler /* Reserved interrupt*/
.long Reserved122_IRQHandler /* Reserved interrupt*/
.long DefaultISR /* 123*/
.long DefaultISR /* 124*/
.long DefaultISR /* 125*/
.long DefaultISR /* 126*/
.long DefaultISR /* 127*/
.long DefaultISR /* 128*/
.long DefaultISR /* 129*/
.long DefaultISR /* 130*/
.long DefaultISR /* 131*/
.long DefaultISR /* 132*/
.long DefaultISR /* 133*/
.long DefaultISR /* 134*/
.long DefaultISR /* 135*/
.long DefaultISR /* 136*/
.long DefaultISR /* 137*/
.long DefaultISR /* 138*/
.long DefaultISR /* 139*/
.long DefaultISR /* 140*/
.long DefaultISR /* 141*/
.long DefaultISR /* 142*/
.long DefaultISR /* 143*/
.long DefaultISR /* 144*/
.long DefaultISR /* 145*/
.long DefaultISR /* 146*/
.long DefaultISR /* 147*/
.long DefaultISR /* 148*/
.long DefaultISR /* 149*/
.long DefaultISR /* 150*/
.long DefaultISR /* 151*/
.long DefaultISR /* 152*/
.long DefaultISR /* 153*/
.long DefaultISR /* 154*/
.long DefaultISR /* 155*/
.long DefaultISR /* 156*/
.long DefaultISR /* 157*/
.long DefaultISR /* 158*/
.long DefaultISR /* 159*/
.long DefaultISR /* 160*/
.long DefaultISR /* 161*/
.long DefaultISR /* 162*/
.long DefaultISR /* 163*/
.long DefaultISR /* 164*/
.long DefaultISR /* 165*/
.long DefaultISR /* 166*/
.long DefaultISR /* 167*/
.long DefaultISR /* 168*/
.long DefaultISR /* 169*/
.long DefaultISR /* 170*/
.long DefaultISR /* 171*/
.long DefaultISR /* 172*/
.long DefaultISR /* 173*/
.long DefaultISR /* 174*/
.long DefaultISR /* 175*/
.long DefaultISR /* 176*/
.long DefaultISR /* 177*/
.long DefaultISR /* 178*/
.long DefaultISR /* 179*/
.long DefaultISR /* 180*/
.long DefaultISR /* 181*/
.long DefaultISR /* 182*/
.long DefaultISR /* 183*/
.long DefaultISR /* 184*/
.long DefaultISR /* 185*/
.long DefaultISR /* 186*/
.long DefaultISR /* 187*/
.long DefaultISR /* 188*/
.long DefaultISR /* 189*/
.long DefaultISR /* 190*/
.long DefaultISR /* 191*/
.long DefaultISR /* 192*/
.long DefaultISR /* 193*/
.long DefaultISR /* 194*/
.long DefaultISR /* 195*/
.long DefaultISR /* 196*/
.long DefaultISR /* 197*/
.long DefaultISR /* 198*/
.long DefaultISR /* 199*/
.long DefaultISR /* 200*/
.long DefaultISR /* 201*/
.long DefaultISR /* 202*/
.long DefaultISR /* 203*/
.long DefaultISR /* 204*/
.long DefaultISR /* 205*/
.long DefaultISR /* 206*/
.long DefaultISR /* 207*/
.long DefaultISR /* 208*/
.long DefaultISR /* 209*/
.long DefaultISR /* 210*/
.long DefaultISR /* 211*/
.long DefaultISR /* 212*/
.long DefaultISR /* 213*/
.long DefaultISR /* 214*/
.long DefaultISR /* 215*/
.long DefaultISR /* 216*/
.long DefaultISR /* 217*/
.long DefaultISR /* 218*/
.long DefaultISR /* 219*/
.long DefaultISR /* 220*/
.long DefaultISR /* 221*/
.long DefaultISR /* 222*/
.long DefaultISR /* 223*/
.long DefaultISR /* 224*/
.long DefaultISR /* 225*/
.long DefaultISR /* 226*/
.long DefaultISR /* 227*/
.long DefaultISR /* 228*/
.long DefaultISR /* 229*/
.long DefaultISR /* 230*/
.long DefaultISR /* 231*/
.long DefaultISR /* 232*/
.long DefaultISR /* 233*/
.long DefaultISR /* 234*/
.long DefaultISR /* 235*/
.long DefaultISR /* 236*/
.long DefaultISR /* 237*/
.long DefaultISR /* 238*/
.long DefaultISR /* 239*/
.size __isr_vector, . - __isr_vector
/* Flash Configuration */
.section .FlashConfig, "a"
.long 0xFFFFFFFF
.long 0xFFFFFFFF
.long 0xFFFFFFFF
.long 0xFFFF3DFE
.text
.thumb
/* Reset Handler */
.thumb_func
.align 2
.globl Reset_Handler
.weak Reset_Handler
.type Reset_Handler, %function
Reset_Handler:
cpsid i /* Mask interrupts */
#ifndef __NO_SYSTEM_INIT
bl SystemInit
#endif
bl init_data_bss
cpsie i /* Unmask interrupts */
#ifndef __START
#define __START _start
#endif
#ifndef __ATOLLIC__
bl __START
#else
bl __libc_init_array
bl main
#endif
.pool
.size Reset_Handler, . - Reset_Handler
.align 1
.thumb_func
.weak DefaultISR
.type DefaultISR, %function
DefaultISR:
b DefaultISR
.size DefaultISR, . - DefaultISR
/* Macro to define default handlers. Default handler
* will be weak symbol and just dead loops. They can be
* overwritten by other handlers */
.macro def_irq_handler handler_name
.weak \handler_name
.set \handler_name, DefaultISR
.endm
/* Exception Handlers */
def_irq_handler NMI_Handler
def_irq_handler HardFault_Handler
def_irq_handler MemManage_Handler
def_irq_handler BusFault_Handler
def_irq_handler UsageFault_Handler
def_irq_handler SVC_Handler
def_irq_handler DebugMon_Handler
def_irq_handler PendSV_Handler
def_irq_handler SysTick_Handler
def_irq_handler DMA0_DMA16_IRQHandler
def_irq_handler DMA1_DMA17_IRQHandler
def_irq_handler DMA2_DMA18_IRQHandler
def_irq_handler DMA3_DMA19_IRQHandler
def_irq_handler DMA4_DMA20_IRQHandler
def_irq_handler DMA5_DMA21_IRQHandler
def_irq_handler DMA6_DMA22_IRQHandler
def_irq_handler DMA7_DMA23_IRQHandler
def_irq_handler DMA8_DMA24_IRQHandler
def_irq_handler DMA9_DMA25_IRQHandler
def_irq_handler DMA10_DMA26_IRQHandler
def_irq_handler DMA11_DMA27_IRQHandler
def_irq_handler DMA12_DMA28_IRQHandler
def_irq_handler DMA13_DMA29_IRQHandler
def_irq_handler DMA14_DMA30_IRQHandler
def_irq_handler DMA15_DMA31_IRQHandler
def_irq_handler DMA_Error_IRQHandler
def_irq_handler MCM_IRQHandler
def_irq_handler FTFA_IRQHandler
def_irq_handler Read_Collision_IRQHandler
def_irq_handler LVD_LVW_IRQHandler
def_irq_handler LLWU_IRQHandler
def_irq_handler WDOG_EWM_IRQHandler
def_irq_handler TRNG0_IRQHandler
def_irq_handler I2C0_IRQHandler
def_irq_handler I2C1_IRQHandler
def_irq_handler SPI0_IRQHandler
def_irq_handler SPI1_IRQHandler
def_irq_handler I2S0_Tx_IRQHandler
def_irq_handler I2S0_Rx_IRQHandler
def_irq_handler LPUART0_IRQHandler
def_irq_handler LPUART1_IRQHandler
def_irq_handler LPUART2_IRQHandler
def_irq_handler LPUART3_IRQHandler
def_irq_handler LPUART4_IRQHandler
def_irq_handler Reserved51_IRQHandler
def_irq_handler Reserved52_IRQHandler
def_irq_handler EMVSIM0_IRQHandler
def_irq_handler EMVSIM1_IRQHandler
def_irq_handler ADC0_IRQHandler
def_irq_handler CMP0_IRQHandler
def_irq_handler CMP1_IRQHandler
def_irq_handler FTM0_IRQHandler
def_irq_handler FTM1_IRQHandler
def_irq_handler FTM2_IRQHandler
def_irq_handler CMT_IRQHandler
def_irq_handler RTC_IRQHandler
def_irq_handler RTC_Seconds_IRQHandler
def_irq_handler PIT0CH0_IRQHandler
def_irq_handler PIT0CH1_IRQHandler
def_irq_handler PIT0CH2_IRQHandler
def_irq_handler PIT0CH3_IRQHandler
def_irq_handler PDB0_IRQHandler
def_irq_handler USB0_IRQHandler
def_irq_handler USBDCD_IRQHandler
def_irq_handler Reserved71_IRQHandler
def_irq_handler DAC0_IRQHandler
def_irq_handler MCG_IRQHandler
def_irq_handler LPTMR0_LPTMR1_IRQHandler
def_irq_handler PORTA_IRQHandler
def_irq_handler PORTB_IRQHandler
def_irq_handler PORTC_IRQHandler
def_irq_handler PORTD_IRQHandler
def_irq_handler PORTE_IRQHandler
def_irq_handler SWI_IRQHandler
def_irq_handler SPI2_IRQHandler
def_irq_handler Reserved82_IRQHandler
def_irq_handler Reserved83_IRQHandler
def_irq_handler Reserved84_IRQHandler
def_irq_handler Reserved85_IRQHandler
def_irq_handler FLEXIO0_IRQHandler
def_irq_handler FTM3_IRQHandler
def_irq_handler Reserved88_IRQHandler
def_irq_handler Reserved89_IRQHandler
def_irq_handler I2C2_IRQHandler
def_irq_handler Reserved91_IRQHandler
def_irq_handler Reserved92_IRQHandler
def_irq_handler Reserved93_IRQHandler
def_irq_handler Reserved94_IRQHandler
def_irq_handler Reserved95_IRQHandler
def_irq_handler Reserved96_IRQHandler
def_irq_handler SDHC_IRQHandler
def_irq_handler Reserved98_IRQHandler
def_irq_handler Reserved99_IRQHandler
def_irq_handler Reserved100_IRQHandler
def_irq_handler Reserved101_IRQHandler
def_irq_handler Reserved102_IRQHandler
def_irq_handler TSI0_IRQHandler
def_irq_handler TPM1_IRQHandler
def_irq_handler TPM2_IRQHandler
def_irq_handler Reserved106_IRQHandler
def_irq_handler I2C3_IRQHandler
def_irq_handler Reserved108_IRQHandler
def_irq_handler Reserved109_IRQHandler
def_irq_handler Reserved110_IRQHandler
def_irq_handler Reserved111_IRQHandler
def_irq_handler Reserved112_IRQHandler
def_irq_handler Reserved113_IRQHandler
def_irq_handler Reserved114_IRQHandler
def_irq_handler Reserved115_IRQHandler
def_irq_handler QuadSPI0_IRQHandler
def_irq_handler Reserved117_IRQHandler
def_irq_handler Reserved118_IRQHandler
def_irq_handler Reserved119_IRQHandler
def_irq_handler LTC0_IRQHandler
def_irq_handler Reserved121_IRQHandler
def_irq_handler Reserved122_IRQHandler
.end
@@ -0,0 +1,462 @@
/* ---------------------------------------------------------------------------------------*/
/* @file: startup_MK82F25615.s */
/* @purpose: CMSIS Cortex-M4 Core Device Startup File */
/* MK82F25615 */
/* @version: 1.1 */
/* @date: 2015-5-28 */
/* @build: b150626 */
/* ---------------------------------------------------------------------------------------*/
/* */
/* Copyright (c) 1997 - 2015 , Freescale Semiconductor, Inc. */
/* All rights reserved. */
/* */
/* Redistribution and use in source and binary forms, with or without modification, */
/* are permitted provided that the following conditions are met: */
/* */
/* o Redistributions of source code must retain the above copyright notice, this list */
/* of conditions and the following disclaimer. */
/* */
/* o 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. */
/* */
/* o Neither the name of Freescale Semiconductor, Inc. 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. */
/*****************************************************************************/
/* Version: GCC for ARM Embedded Processors */
/*****************************************************************************/
.syntax unified
.arch armv7-m
.section .isr_vector, "a"
.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_DMA16_IRQHandler /* DMA channel 0,16 transfer complete*/
.long DMA1_DMA17_IRQHandler /* DMA channel 1,17 transfer complete*/
.long DMA2_DMA18_IRQHandler /* DMA channel 2,18 transfer complete*/
.long DMA3_DMA19_IRQHandler /* DMA channel 3,19 transfer complete*/
.long DMA4_DMA20_IRQHandler /* DMA channel 4,20 transfer complete*/
.long DMA5_DMA21_IRQHandler /* DMA channel 5,21 transfer complete*/
.long DMA6_DMA22_IRQHandler /* DMA channel 6,22 transfer complete*/
.long DMA7_DMA23_IRQHandler /* DMA channel 7,23 transfer complete*/
.long DMA8_DMA24_IRQHandler /* DMA channel 8,24 transfer complete*/
.long DMA9_DMA25_IRQHandler /* DMA channel 9,25 transfer complete*/
.long DMA10_DMA26_IRQHandler /* DMA channel 10,26 transfer complete*/
.long DMA11_DMA27_IRQHandler /* DMA channel 11,27 transfer complete*/
.long DMA12_DMA28_IRQHandler /* DMA channel 12,28 transfer complete*/
.long DMA13_DMA29_IRQHandler /* DMA channel 13,29 transfer complete*/
.long DMA14_DMA30_IRQHandler /* DMA channel 14,30 transfer complete*/
.long DMA15_DMA31_IRQHandler /* DMA channel 15,31 transfer complete*/
.long DMA_Error_IRQHandler /* DMA channel 0 - 31 error*/
.long MCM_IRQHandler /* MCM normal interrupt*/
.long FTFA_IRQHandler /* FTFA command complete*/
.long Read_Collision_IRQHandler /* FTFA read collision*/
.long LVD_LVW_IRQHandler /* PMC controller low-voltage detect, low-voltage warning*/
.long LLWU_IRQHandler /* Low leakage wakeup unit*/
.long WDOG_EWM_IRQHandler /* Single interrupt vector for WDOG and EWM*/
.long TRNG0_IRQHandler /* True randon number generator*/
.long I2C0_IRQHandler /* Inter-integrated circuit 0*/
.long I2C1_IRQHandler /* Inter-integrated circuit 1*/
.long SPI0_IRQHandler /* Serial peripheral Interface 0*/
.long SPI1_IRQHandler /* Serial peripheral Interface 1*/
.long I2S0_Tx_IRQHandler /* Integrated interchip sound 0 transmit interrupt*/
.long I2S0_Rx_IRQHandler /* Integrated interchip sound 0 receive interrupt*/
.long LPUART0_IRQHandler /* LPUART0 receive/transmit/error interrupt*/
.long LPUART1_IRQHandler /* LPUART1 receive/transmit/error interrupt*/
.long LPUART2_IRQHandler /* LPUART2 receive/transmit/error interrupt*/
.long LPUART3_IRQHandler /* LPUART3 receive/transmit/error interrupt*/
.long LPUART4_IRQHandler /* LPUART4 receive/transmit/error interrupt*/
.long Reserved51_IRQHandler /* Reserved interrupt*/
.long Reserved52_IRQHandler /* Reserved interrupt*/
.long EMVSIM0_IRQHandler /* EMVSIM0 common interrupt*/
.long EMVSIM1_IRQHandler /* EMVSIM1 common interrupt*/
.long ADC0_IRQHandler /* Analog-to-digital converter 0*/
.long CMP0_IRQHandler /* Comparator 0*/
.long CMP1_IRQHandler /* Comparator 1*/
.long FTM0_IRQHandler /* FlexTimer module 0 fault, overflow and channels interrupt*/
.long FTM1_IRQHandler /* FlexTimer module 1 fault, overflow and channels interrupt*/
.long FTM2_IRQHandler /* FlexTimer module 2 fault, overflow and channels interrupt*/
.long CMT_IRQHandler /* Carrier modulator transmitter*/
.long RTC_IRQHandler /* Real time clock*/
.long RTC_Seconds_IRQHandler /* Real time clock seconds*/
.long PIT0CH0_IRQHandler /* Periodic interrupt timer 0 channel 0*/
.long PIT0CH1_IRQHandler /* Periodic interrupt timer 0 channel 1*/
.long PIT0CH2_IRQHandler /* Periodic interrupt timer 0 channel 2*/
.long PIT0CH3_IRQHandler /* Periodic interrupt timer 0 channel 3*/
.long PDB0_IRQHandler /* Programmable delay block*/
.long USB0_IRQHandler /* USB OTG interrupt*/
.long USBDCD_IRQHandler /* USB charger detect*/
.long Reserved71_IRQHandler /* Reserved interrupt*/
.long DAC0_IRQHandler /* Digital-to-analog converter 0*/
.long MCG_IRQHandler /* Multipurpose clock generator*/
.long LPTMR0_LPTMR1_IRQHandler /* Single interrupt vector for Low Power Timer 0 and 1*/
.long PORTA_IRQHandler /* Port A pin detect interrupt*/
.long PORTB_IRQHandler /* Port B pin detect interrupt*/
.long PORTC_IRQHandler /* Port C pin detect interrupt*/
.long PORTD_IRQHandler /* Port D pin detect interrupt*/
.long PORTE_IRQHandler /* Port E pin detect interrupt*/
.long SWI_IRQHandler /* Software interrupt*/
.long SPI2_IRQHandler /* Serial peripheral Interface 2*/
.long Reserved82_IRQHandler /* Reserved interrupt*/
.long Reserved83_IRQHandler /* Reserved interrupt*/
.long Reserved84_IRQHandler /* Reserved interrupt*/
.long Reserved85_IRQHandler /* Reserved interrupt*/
.long FLEXIO0_IRQHandler /* FLEXIO0*/
.long FTM3_IRQHandler /* FlexTimer module 3 fault, overflow and channels interrupt*/
.long Reserved88_IRQHandler /* Reserved interrupt*/
.long Reserved89_IRQHandler /* Reserved interrupt*/
.long I2C2_IRQHandler /* Inter-integrated circuit 2*/
.long Reserved91_IRQHandler /* Reserved interrupt*/
.long Reserved92_IRQHandler /* Reserved interrupt*/
.long Reserved93_IRQHandler /* Reserved interrupt*/
.long Reserved94_IRQHandler /* Reserved interrupt*/
.long Reserved95_IRQHandler /* Reserved interrupt*/
.long Reserved96_IRQHandler /* Reserved interrupt*/
.long SDHC_IRQHandler /* Secured digital host controller*/
.long Reserved98_IRQHandler /* Reserved interrupt*/
.long Reserved99_IRQHandler /* Reserved interrupt*/
.long Reserved100_IRQHandler /* Reserved interrupt*/
.long Reserved101_IRQHandler /* Reserved interrupt*/
.long Reserved102_IRQHandler /* Reserved interrupt*/
.long TSI0_IRQHandler /* Touch Sensing Input*/
.long TPM1_IRQHandler /* TPM1 single interrupt vector for all sources*/
.long TPM2_IRQHandler /* TPM2 single interrupt vector for all sources*/
.long Reserved106_IRQHandler /* Reserved interrupt*/
.long I2C3_IRQHandler /* Inter-integrated circuit 3*/
.long Reserved108_IRQHandler /* Reserved interrupt*/
.long Reserved109_IRQHandler /* Reserved interrupt*/
.long Reserved110_IRQHandler /* Reserved interrupt*/
.long Reserved111_IRQHandler /* Reserved interrupt*/
.long Reserved112_IRQHandler /* Reserved interrupt*/
.long Reserved113_IRQHandler /* Reserved interrupt*/
.long Reserved114_IRQHandler /* Reserved interrupt*/
.long Reserved115_IRQHandler /* Reserved interrupt*/
.long QuadSPI0_IRQHandler /* qspi*/
.long Reserved117_IRQHandler /* Reserved interrupt*/
.long Reserved118_IRQHandler /* Reserved interrupt*/
.long Reserved119_IRQHandler /* Reserved interrupt*/
.long LTC0_IRQHandler /* LP Trusted Cryptography*/
.long Reserved121_IRQHandler /* Reserved interrupt*/
.long Reserved122_IRQHandler /* Reserved interrupt*/
.long DefaultISR /* 123*/
.long DefaultISR /* 124*/
.long DefaultISR /* 125*/
.long DefaultISR /* 126*/
.long DefaultISR /* 127*/
.long DefaultISR /* 128*/
.long DefaultISR /* 129*/
.long DefaultISR /* 130*/
.long DefaultISR /* 131*/
.long DefaultISR /* 132*/
.long DefaultISR /* 133*/
.long DefaultISR /* 134*/
.long DefaultISR /* 135*/
.long DefaultISR /* 136*/
.long DefaultISR /* 137*/
.long DefaultISR /* 138*/
.long DefaultISR /* 139*/
.long DefaultISR /* 140*/
.long DefaultISR /* 141*/
.long DefaultISR /* 142*/
.long DefaultISR /* 143*/
.long DefaultISR /* 144*/
.long DefaultISR /* 145*/
.long DefaultISR /* 146*/
.long DefaultISR /* 147*/
.long DefaultISR /* 148*/
.long DefaultISR /* 149*/
.long DefaultISR /* 150*/
.long DefaultISR /* 151*/
.long DefaultISR /* 152*/
.long DefaultISR /* 153*/
.long DefaultISR /* 154*/
.long DefaultISR /* 155*/
.long DefaultISR /* 156*/
.long DefaultISR /* 157*/
.long DefaultISR /* 158*/
.long DefaultISR /* 159*/
.long DefaultISR /* 160*/
.long DefaultISR /* 161*/
.long DefaultISR /* 162*/
.long DefaultISR /* 163*/
.long DefaultISR /* 164*/
.long DefaultISR /* 165*/
.long DefaultISR /* 166*/
.long DefaultISR /* 167*/
.long DefaultISR /* 168*/
.long DefaultISR /* 169*/
.long DefaultISR /* 170*/
.long DefaultISR /* 171*/
.long DefaultISR /* 172*/
.long DefaultISR /* 173*/
.long DefaultISR /* 174*/
.long DefaultISR /* 175*/
.long DefaultISR /* 176*/
.long DefaultISR /* 177*/
.long DefaultISR /* 178*/
.long DefaultISR /* 179*/
.long DefaultISR /* 180*/
.long DefaultISR /* 181*/
.long DefaultISR /* 182*/
.long DefaultISR /* 183*/
.long DefaultISR /* 184*/
.long DefaultISR /* 185*/
.long DefaultISR /* 186*/
.long DefaultISR /* 187*/
.long DefaultISR /* 188*/
.long DefaultISR /* 189*/
.long DefaultISR /* 190*/
.long DefaultISR /* 191*/
.long DefaultISR /* 192*/
.long DefaultISR /* 193*/
.long DefaultISR /* 194*/
.long DefaultISR /* 195*/
.long DefaultISR /* 196*/
.long DefaultISR /* 197*/
.long DefaultISR /* 198*/
.long DefaultISR /* 199*/
.long DefaultISR /* 200*/
.long DefaultISR /* 201*/
.long DefaultISR /* 202*/
.long DefaultISR /* 203*/
.long DefaultISR /* 204*/
.long DefaultISR /* 205*/
.long DefaultISR /* 206*/
.long DefaultISR /* 207*/
.long DefaultISR /* 208*/
.long DefaultISR /* 209*/
.long DefaultISR /* 210*/
.long DefaultISR /* 211*/
.long DefaultISR /* 212*/
.long DefaultISR /* 213*/
.long DefaultISR /* 214*/
.long DefaultISR /* 215*/
.long DefaultISR /* 216*/
.long DefaultISR /* 217*/
.long DefaultISR /* 218*/
.long DefaultISR /* 219*/
.long DefaultISR /* 220*/
.long DefaultISR /* 221*/
.long DefaultISR /* 222*/
.long DefaultISR /* 223*/
.long DefaultISR /* 224*/
.long DefaultISR /* 225*/
.long DefaultISR /* 226*/
.long DefaultISR /* 227*/
.long DefaultISR /* 228*/
.long DefaultISR /* 229*/
.long DefaultISR /* 230*/
.long DefaultISR /* 231*/
.long DefaultISR /* 232*/
.long DefaultISR /* 233*/
.long DefaultISR /* 234*/
.long DefaultISR /* 235*/
.long DefaultISR /* 236*/
.long DefaultISR /* 237*/
.long DefaultISR /* 238*/
.long DefaultISR /* 239*/
.size __isr_vector, . - __isr_vector
/* Flash Configuration */
.section .FlashConfig, "a"
.long 0xFFFFFFFF
.long 0xFFFFFFFF
.long 0xFFFFFFFF
.long 0xFFFFBDFE
.text
.thumb
/* Reset Handler */
.thumb_func
.align 2
.globl Reset_Handler
.weak Reset_Handler
.type Reset_Handler, %function
Reset_Handler:
cpsid i /* Mask interrupts */
#ifndef __NO_SYSTEM_INIT
bl SystemInit
#endif
bl init_data_bss
cpsie i /* Unmask interrupts */
#ifndef __START
#define __START _start
#endif
#ifndef __ATOLLIC__
bl __START
#else
bl __libc_init_array
bl main
#endif
.pool
.size Reset_Handler, . - Reset_Handler
.align 1
.thumb_func
.weak DefaultISR
.type DefaultISR, %function
DefaultISR:
b DefaultISR
.size DefaultISR, . - DefaultISR
/* Macro to define default handlers. Default handler
* will be weak symbol and just dead loops. They can be
* overwritten by other handlers */
.macro def_irq_handler handler_name
.weak \handler_name
.set \handler_name, DefaultISR
.endm
/* Exception Handlers */
def_irq_handler NMI_Handler
def_irq_handler HardFault_Handler
def_irq_handler MemManage_Handler
def_irq_handler BusFault_Handler
def_irq_handler UsageFault_Handler
def_irq_handler SVC_Handler
def_irq_handler DebugMon_Handler
def_irq_handler PendSV_Handler
def_irq_handler SysTick_Handler
def_irq_handler DMA0_DMA16_IRQHandler
def_irq_handler DMA1_DMA17_IRQHandler
def_irq_handler DMA2_DMA18_IRQHandler
def_irq_handler DMA3_DMA19_IRQHandler
def_irq_handler DMA4_DMA20_IRQHandler
def_irq_handler DMA5_DMA21_IRQHandler
def_irq_handler DMA6_DMA22_IRQHandler
def_irq_handler DMA7_DMA23_IRQHandler
def_irq_handler DMA8_DMA24_IRQHandler
def_irq_handler DMA9_DMA25_IRQHandler
def_irq_handler DMA10_DMA26_IRQHandler
def_irq_handler DMA11_DMA27_IRQHandler
def_irq_handler DMA12_DMA28_IRQHandler
def_irq_handler DMA13_DMA29_IRQHandler
def_irq_handler DMA14_DMA30_IRQHandler
def_irq_handler DMA15_DMA31_IRQHandler
def_irq_handler DMA_Error_IRQHandler
def_irq_handler MCM_IRQHandler
def_irq_handler FTFA_IRQHandler
def_irq_handler Read_Collision_IRQHandler
def_irq_handler LVD_LVW_IRQHandler
def_irq_handler LLWU_IRQHandler
def_irq_handler WDOG_EWM_IRQHandler
def_irq_handler TRNG0_IRQHandler
def_irq_handler I2C0_IRQHandler
def_irq_handler I2C1_IRQHandler
def_irq_handler SPI0_IRQHandler
def_irq_handler SPI1_IRQHandler
def_irq_handler I2S0_Tx_IRQHandler
def_irq_handler I2S0_Rx_IRQHandler
def_irq_handler LPUART0_IRQHandler
def_irq_handler LPUART1_IRQHandler
def_irq_handler LPUART2_IRQHandler
def_irq_handler LPUART3_IRQHandler
def_irq_handler LPUART4_IRQHandler
def_irq_handler Reserved51_IRQHandler
def_irq_handler Reserved52_IRQHandler
def_irq_handler EMVSIM0_IRQHandler
def_irq_handler EMVSIM1_IRQHandler
def_irq_handler ADC0_IRQHandler
def_irq_handler CMP0_IRQHandler
def_irq_handler CMP1_IRQHandler
def_irq_handler FTM0_IRQHandler
def_irq_handler FTM1_IRQHandler
def_irq_handler FTM2_IRQHandler
def_irq_handler CMT_IRQHandler
def_irq_handler RTC_IRQHandler
def_irq_handler RTC_Seconds_IRQHandler
def_irq_handler PIT0CH0_IRQHandler
def_irq_handler PIT0CH1_IRQHandler
def_irq_handler PIT0CH2_IRQHandler
def_irq_handler PIT0CH3_IRQHandler
def_irq_handler PDB0_IRQHandler
def_irq_handler USB0_IRQHandler
def_irq_handler USBDCD_IRQHandler
def_irq_handler Reserved71_IRQHandler
def_irq_handler DAC0_IRQHandler
def_irq_handler MCG_IRQHandler
def_irq_handler LPTMR0_LPTMR1_IRQHandler
def_irq_handler PORTA_IRQHandler
def_irq_handler PORTB_IRQHandler
def_irq_handler PORTC_IRQHandler
def_irq_handler PORTD_IRQHandler
def_irq_handler PORTE_IRQHandler
def_irq_handler SWI_IRQHandler
def_irq_handler SPI2_IRQHandler
def_irq_handler Reserved82_IRQHandler
def_irq_handler Reserved83_IRQHandler
def_irq_handler Reserved84_IRQHandler
def_irq_handler Reserved85_IRQHandler
def_irq_handler FLEXIO0_IRQHandler
def_irq_handler FTM3_IRQHandler
def_irq_handler Reserved88_IRQHandler
def_irq_handler Reserved89_IRQHandler
def_irq_handler I2C2_IRQHandler
def_irq_handler Reserved91_IRQHandler
def_irq_handler Reserved92_IRQHandler
def_irq_handler Reserved93_IRQHandler
def_irq_handler Reserved94_IRQHandler
def_irq_handler Reserved95_IRQHandler
def_irq_handler Reserved96_IRQHandler
def_irq_handler SDHC_IRQHandler
def_irq_handler Reserved98_IRQHandler
def_irq_handler Reserved99_IRQHandler
def_irq_handler Reserved100_IRQHandler
def_irq_handler Reserved101_IRQHandler
def_irq_handler Reserved102_IRQHandler
def_irq_handler TSI0_IRQHandler
def_irq_handler TPM1_IRQHandler
def_irq_handler TPM2_IRQHandler
def_irq_handler Reserved106_IRQHandler
def_irq_handler I2C3_IRQHandler
def_irq_handler Reserved108_IRQHandler
def_irq_handler Reserved109_IRQHandler
def_irq_handler Reserved110_IRQHandler
def_irq_handler Reserved111_IRQHandler
def_irq_handler Reserved112_IRQHandler
def_irq_handler Reserved113_IRQHandler
def_irq_handler Reserved114_IRQHandler
def_irq_handler Reserved115_IRQHandler
def_irq_handler QuadSPI0_IRQHandler
def_irq_handler Reserved117_IRQHandler
def_irq_handler Reserved118_IRQHandler
def_irq_handler Reserved119_IRQHandler
def_irq_handler LTC0_IRQHandler
def_irq_handler Reserved121_IRQHandler
def_irq_handler Reserved122_IRQHandler
.end
@@ -0,0 +1,470 @@
/* ---------------------------------------------------------------------------------------*/
/* @file: startup_MK82F25615.s */
/* @purpose: CMSIS Cortex-M4 Core Device Startup File */
/* MK82F25615 */
/* @version: 1.1 */
/* @date: 2015-5-28 */
/* @build: b150626 */
/* ---------------------------------------------------------------------------------------*/
/* */
/* Copyright (c) 1997 - 2015 , Freescale Semiconductor, Inc. */
/* All rights reserved. */
/* */
/* Redistribution and use in source and binary forms, with or without modification, */
/* are permitted provided that the following conditions are met: */
/* */
/* o Redistributions of source code must retain the above copyright notice, this list */
/* of conditions and the following disclaimer. */
/* */
/* o 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. */
/* */
/* o Neither the name of Freescale Semiconductor, Inc. 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. */
/*****************************************************************************/
/* Version: GCC for ARM Embedded Processors */
/*****************************************************************************/
.syntax unified
.arch armv7-m
.section .isr_vector, "a"
.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_DMA16_IRQHandler /* DMA channel 0,16 transfer complete*/
.long DMA1_DMA17_IRQHandler /* DMA channel 1,17 transfer complete*/
.long DMA2_DMA18_IRQHandler /* DMA channel 2,18 transfer complete*/
.long DMA3_DMA19_IRQHandler /* DMA channel 3,19 transfer complete*/
.long DMA4_DMA20_IRQHandler /* DMA channel 4,20 transfer complete*/
.long DMA5_DMA21_IRQHandler /* DMA channel 5,21 transfer complete*/
.long DMA6_DMA22_IRQHandler /* DMA channel 6,22 transfer complete*/
.long DMA7_DMA23_IRQHandler /* DMA channel 7,23 transfer complete*/
.long DMA8_DMA24_IRQHandler /* DMA channel 8,24 transfer complete*/
.long DMA9_DMA25_IRQHandler /* DMA channel 9,25 transfer complete*/
.long DMA10_DMA26_IRQHandler /* DMA channel 10,26 transfer complete*/
.long DMA11_DMA27_IRQHandler /* DMA channel 11,27 transfer complete*/
.long DMA12_DMA28_IRQHandler /* DMA channel 12,28 transfer complete*/
.long DMA13_DMA29_IRQHandler /* DMA channel 13,29 transfer complete*/
.long DMA14_DMA30_IRQHandler /* DMA channel 14,30 transfer complete*/
.long DMA15_DMA31_IRQHandler /* DMA channel 15,31 transfer complete*/
.long DMA_Error_IRQHandler /* DMA channel 0 - 31 error*/
.long MCM_IRQHandler /* MCM normal interrupt*/
.long FTFA_IRQHandler /* FTFA command complete*/
.long Read_Collision_IRQHandler /* FTFA read collision*/
.long LVD_LVW_IRQHandler /* PMC controller low-voltage detect, low-voltage warning*/
.long LLWU_IRQHandler /* Low leakage wakeup unit*/
.long WDOG_EWM_IRQHandler /* Single interrupt vector for WDOG and EWM*/
.long TRNG0_IRQHandler /* True randon number generator*/
.long I2C0_IRQHandler /* Inter-integrated circuit 0*/
.long I2C1_IRQHandler /* Inter-integrated circuit 1*/
.long SPI0_IRQHandler /* Serial peripheral Interface 0*/
.long SPI1_IRQHandler /* Serial peripheral Interface 1*/
.long I2S0_Tx_IRQHandler /* Integrated interchip sound 0 transmit interrupt*/
.long I2S0_Rx_IRQHandler /* Integrated interchip sound 0 receive interrupt*/
.long LPUART0_IRQHandler /* LPUART0 receive/transmit/error interrupt*/
.long LPUART1_IRQHandler /* LPUART1 receive/transmit/error interrupt*/
.long LPUART2_IRQHandler /* LPUART2 receive/transmit/error interrupt*/
.long LPUART3_IRQHandler /* LPUART3 receive/transmit/error interrupt*/
.long LPUART4_IRQHandler /* LPUART4 receive/transmit/error interrupt*/
.long Reserved51_IRQHandler /* Reserved interrupt*/
.long Reserved52_IRQHandler /* Reserved interrupt*/
.long EMVSIM0_IRQHandler /* EMVSIM0 common interrupt*/
.long EMVSIM1_IRQHandler /* EMVSIM1 common interrupt*/
.long ADC0_IRQHandler /* Analog-to-digital converter 0*/
.long CMP0_IRQHandler /* Comparator 0*/
.long CMP1_IRQHandler /* Comparator 1*/
.long FTM0_IRQHandler /* FlexTimer module 0 fault, overflow and channels interrupt*/
.long FTM1_IRQHandler /* FlexTimer module 1 fault, overflow and channels interrupt*/
.long FTM2_IRQHandler /* FlexTimer module 2 fault, overflow and channels interrupt*/
.long CMT_IRQHandler /* Carrier modulator transmitter*/
.long RTC_IRQHandler /* Real time clock*/
.long RTC_Seconds_IRQHandler /* Real time clock seconds*/
.long PIT0CH0_IRQHandler /* Periodic interrupt timer 0 channel 0*/
.long PIT0CH1_IRQHandler /* Periodic interrupt timer 0 channel 1*/
.long PIT0CH2_IRQHandler /* Periodic interrupt timer 0 channel 2*/
.long PIT0CH3_IRQHandler /* Periodic interrupt timer 0 channel 3*/
.long PDB0_IRQHandler /* Programmable delay block*/
.long USB0_IRQHandler /* USB OTG interrupt*/
.long USBDCD_IRQHandler /* USB charger detect*/
.long Reserved71_IRQHandler /* Reserved interrupt*/
.long DAC0_IRQHandler /* Digital-to-analog converter 0*/
.long MCG_IRQHandler /* Multipurpose clock generator*/
.long LPTMR0_LPTMR1_IRQHandler /* Single interrupt vector for Low Power Timer 0 and 1*/
.long PORTA_IRQHandler /* Port A pin detect interrupt*/
.long PORTB_IRQHandler /* Port B pin detect interrupt*/
.long PORTC_IRQHandler /* Port C pin detect interrupt*/
.long PORTD_IRQHandler /* Port D pin detect interrupt*/
.long PORTE_IRQHandler /* Port E pin detect interrupt*/
.long SWI_IRQHandler /* Software interrupt*/
.long SPI2_IRQHandler /* Serial peripheral Interface 2*/
.long Reserved82_IRQHandler /* Reserved interrupt*/
.long Reserved83_IRQHandler /* Reserved interrupt*/
.long Reserved84_IRQHandler /* Reserved interrupt*/
.long Reserved85_IRQHandler /* Reserved interrupt*/
.long FLEXIO0_IRQHandler /* FLEXIO0*/
.long FTM3_IRQHandler /* FlexTimer module 3 fault, overflow and channels interrupt*/
.long Reserved88_IRQHandler /* Reserved interrupt*/
.long Reserved89_IRQHandler /* Reserved interrupt*/
.long I2C2_IRQHandler /* Inter-integrated circuit 2*/
.long Reserved91_IRQHandler /* Reserved interrupt*/
.long Reserved92_IRQHandler /* Reserved interrupt*/
.long Reserved93_IRQHandler /* Reserved interrupt*/
.long Reserved94_IRQHandler /* Reserved interrupt*/
.long Reserved95_IRQHandler /* Reserved interrupt*/
.long Reserved96_IRQHandler /* Reserved interrupt*/
.long SDHC_IRQHandler /* Secured digital host controller*/
.long Reserved98_IRQHandler /* Reserved interrupt*/
.long Reserved99_IRQHandler /* Reserved interrupt*/
.long Reserved100_IRQHandler /* Reserved interrupt*/
.long Reserved101_IRQHandler /* Reserved interrupt*/
.long Reserved102_IRQHandler /* Reserved interrupt*/
.long TSI0_IRQHandler /* Touch Sensing Input*/
.long TPM1_IRQHandler /* TPM1 single interrupt vector for all sources*/
.long TPM2_IRQHandler /* TPM2 single interrupt vector for all sources*/
.long Reserved106_IRQHandler /* Reserved interrupt*/
.long I2C3_IRQHandler /* Inter-integrated circuit 3*/
.long Reserved108_IRQHandler /* Reserved interrupt*/
.long Reserved109_IRQHandler /* Reserved interrupt*/
.long Reserved110_IRQHandler /* Reserved interrupt*/
.long Reserved111_IRQHandler /* Reserved interrupt*/
.long Reserved112_IRQHandler /* Reserved interrupt*/
.long Reserved113_IRQHandler /* Reserved interrupt*/
.long Reserved114_IRQHandler /* Reserved interrupt*/
.long Reserved115_IRQHandler /* Reserved interrupt*/
.long QuadSPI0_IRQHandler /* qspi*/
.long Reserved117_IRQHandler /* Reserved interrupt*/
.long Reserved118_IRQHandler /* Reserved interrupt*/
.long Reserved119_IRQHandler /* Reserved interrupt*/
.long LTC0_IRQHandler /* LP Trusted Cryptography*/
.long Reserved121_IRQHandler /* Reserved interrupt*/
.long Reserved122_IRQHandler /* Reserved interrupt*/
.long DefaultISR /* 123*/
.long DefaultISR /* 124*/
.long DefaultISR /* 125*/
.long DefaultISR /* 126*/
.long DefaultISR /* 127*/
.long DefaultISR /* 128*/
.long DefaultISR /* 129*/
.long DefaultISR /* 130*/
.long DefaultISR /* 131*/
.long DefaultISR /* 132*/
.long DefaultISR /* 133*/
.long DefaultISR /* 134*/
.long DefaultISR /* 135*/
.long DefaultISR /* 136*/
.long DefaultISR /* 137*/
.long DefaultISR /* 138*/
.long DefaultISR /* 139*/
.long DefaultISR /* 140*/
.long DefaultISR /* 141*/
.long DefaultISR /* 142*/
.long DefaultISR /* 143*/
.long DefaultISR /* 144*/
.long DefaultISR /* 145*/
.long DefaultISR /* 146*/
.long DefaultISR /* 147*/
.long DefaultISR /* 148*/
.long DefaultISR /* 149*/
.long DefaultISR /* 150*/
.long DefaultISR /* 151*/
.long DefaultISR /* 152*/
.long DefaultISR /* 153*/
.long DefaultISR /* 154*/
.long DefaultISR /* 155*/
.long DefaultISR /* 156*/
.long DefaultISR /* 157*/
.long DefaultISR /* 158*/
.long DefaultISR /* 159*/
.long DefaultISR /* 160*/
.long DefaultISR /* 161*/
.long DefaultISR /* 162*/
.long DefaultISR /* 163*/
.long DefaultISR /* 164*/
.long DefaultISR /* 165*/
.long DefaultISR /* 166*/
.long DefaultISR /* 167*/
.long DefaultISR /* 168*/
.long DefaultISR /* 169*/
.long DefaultISR /* 170*/
.long DefaultISR /* 171*/
.long DefaultISR /* 172*/
.long DefaultISR /* 173*/
.long DefaultISR /* 174*/
.long DefaultISR /* 175*/
.long DefaultISR /* 176*/
.long DefaultISR /* 177*/
.long DefaultISR /* 178*/
.long DefaultISR /* 179*/
.long DefaultISR /* 180*/
.long DefaultISR /* 181*/
.long DefaultISR /* 182*/
.long DefaultISR /* 183*/
.long DefaultISR /* 184*/
.long DefaultISR /* 185*/
.long DefaultISR /* 186*/
.long DefaultISR /* 187*/
.long DefaultISR /* 188*/
.long DefaultISR /* 189*/
.long DefaultISR /* 190*/
.long DefaultISR /* 191*/
.long DefaultISR /* 192*/
.long DefaultISR /* 193*/
.long DefaultISR /* 194*/
.long DefaultISR /* 195*/
.long DefaultISR /* 196*/
.long DefaultISR /* 197*/
.long DefaultISR /* 198*/
.long DefaultISR /* 199*/
.long DefaultISR /* 200*/
.long DefaultISR /* 201*/
.long DefaultISR /* 202*/
.long DefaultISR /* 203*/
.long DefaultISR /* 204*/
.long DefaultISR /* 205*/
.long DefaultISR /* 206*/
.long DefaultISR /* 207*/
.long DefaultISR /* 208*/
.long DefaultISR /* 209*/
.long DefaultISR /* 210*/
.long DefaultISR /* 211*/
.long DefaultISR /* 212*/
.long DefaultISR /* 213*/
.long DefaultISR /* 214*/
.long DefaultISR /* 215*/
.long DefaultISR /* 216*/
.long DefaultISR /* 217*/
.long DefaultISR /* 218*/
.long DefaultISR /* 219*/
.long DefaultISR /* 220*/
.long DefaultISR /* 221*/
.long DefaultISR /* 222*/
.long DefaultISR /* 223*/
.long DefaultISR /* 224*/
.long DefaultISR /* 225*/
.long DefaultISR /* 226*/
.long DefaultISR /* 227*/
.long DefaultISR /* 228*/
.long DefaultISR /* 229*/
.long DefaultISR /* 230*/
.long DefaultISR /* 231*/
.long DefaultISR /* 232*/
.long DefaultISR /* 233*/
.long DefaultISR /* 234*/
.long DefaultISR /* 235*/
.long DefaultISR /* 236*/
.long DefaultISR /* 237*/
.long DefaultISR /* 238*/
.long DefaultISR /* 239*/
.size __isr_vector, . - __isr_vector
/* Flash Configuration */
.section .FlashConfig, "a"
.long 0xFFFFFFFF
.long 0xFFFFFFFF
.long 0xFFFFFFFF
.long 0xFFFFBDFE
.section BootloaderPatchHandler, "a"
.thumb
/* Reset Handler */
.thumb_func
.align 2
.globl Reset_Handler
.weak Reset_Handler
.type Reset_Handler, %function
Reset_Handler:
cpsid i /* Mask interrupts */
ldr r0, = ROM_PatchHandler
blx r0
#ifndef __NO_SYSTEM_INIT
ldr r0, = SystemInit
blx r0
#endif
ldr r0, = init_data_bss
blx r0
cpsie i /* Unmask interrupts */
#ifndef __START
#define __START _start
#endif
#ifndef __ATOLLIC__
ldr r0, = __START
blx r0
#else
ldr r0,= __libc_init_array
blx r0
ldr r0, = main,
bx r0
#endif
.pool
.size Reset_Handler, . - Reset_Handler
.text
.thumb
.align 1
.thumb_func
.weak DefaultISR
.type DefaultISR, %function
DefaultISR:
b DefaultISR
.size DefaultISR, . - DefaultISR
/* Macro to define default handlers. Default handler
* will be weak symbol and just dead loops. They can be
* overwritten by other handlers */
.macro def_irq_handler handler_name
.weak \handler_name
.set \handler_name, DefaultISR
.endm
/* Exception Handlers */
def_irq_handler NMI_Handler
def_irq_handler HardFault_Handler
def_irq_handler MemManage_Handler
def_irq_handler BusFault_Handler
def_irq_handler UsageFault_Handler
def_irq_handler SVC_Handler
def_irq_handler DebugMon_Handler
def_irq_handler PendSV_Handler
def_irq_handler SysTick_Handler
def_irq_handler DMA0_DMA16_IRQHandler
def_irq_handler DMA1_DMA17_IRQHandler
def_irq_handler DMA2_DMA18_IRQHandler
def_irq_handler DMA3_DMA19_IRQHandler
def_irq_handler DMA4_DMA20_IRQHandler
def_irq_handler DMA5_DMA21_IRQHandler
def_irq_handler DMA6_DMA22_IRQHandler
def_irq_handler DMA7_DMA23_IRQHandler
def_irq_handler DMA8_DMA24_IRQHandler
def_irq_handler DMA9_DMA25_IRQHandler
def_irq_handler DMA10_DMA26_IRQHandler
def_irq_handler DMA11_DMA27_IRQHandler
def_irq_handler DMA12_DMA28_IRQHandler
def_irq_handler DMA13_DMA29_IRQHandler
def_irq_handler DMA14_DMA30_IRQHandler
def_irq_handler DMA15_DMA31_IRQHandler
def_irq_handler DMA_Error_IRQHandler
def_irq_handler MCM_IRQHandler
def_irq_handler FTFA_IRQHandler
def_irq_handler Read_Collision_IRQHandler
def_irq_handler LVD_LVW_IRQHandler
def_irq_handler LLWU_IRQHandler
def_irq_handler WDOG_EWM_IRQHandler
def_irq_handler TRNG0_IRQHandler
def_irq_handler I2C0_IRQHandler
def_irq_handler I2C1_IRQHandler
def_irq_handler SPI0_IRQHandler
def_irq_handler SPI1_IRQHandler
def_irq_handler I2S0_Tx_IRQHandler
def_irq_handler I2S0_Rx_IRQHandler
def_irq_handler LPUART0_IRQHandler
def_irq_handler LPUART1_IRQHandler
def_irq_handler LPUART2_IRQHandler
def_irq_handler LPUART3_IRQHandler
def_irq_handler LPUART4_IRQHandler
def_irq_handler Reserved51_IRQHandler
def_irq_handler Reserved52_IRQHandler
def_irq_handler EMVSIM0_IRQHandler
def_irq_handler EMVSIM1_IRQHandler
def_irq_handler ADC0_IRQHandler
def_irq_handler CMP0_IRQHandler
def_irq_handler CMP1_IRQHandler
def_irq_handler FTM0_IRQHandler
def_irq_handler FTM1_IRQHandler
def_irq_handler FTM2_IRQHandler
def_irq_handler CMT_IRQHandler
def_irq_handler RTC_IRQHandler
def_irq_handler RTC_Seconds_IRQHandler
def_irq_handler PIT0CH0_IRQHandler
def_irq_handler PIT0CH1_IRQHandler
def_irq_handler PIT0CH2_IRQHandler
def_irq_handler PIT0CH3_IRQHandler
def_irq_handler PDB0_IRQHandler
def_irq_handler USB0_IRQHandler
def_irq_handler USBDCD_IRQHandler
def_irq_handler Reserved71_IRQHandler
def_irq_handler DAC0_IRQHandler
def_irq_handler MCG_IRQHandler
def_irq_handler LPTMR0_LPTMR1_IRQHandler
def_irq_handler PORTA_IRQHandler
def_irq_handler PORTB_IRQHandler
def_irq_handler PORTC_IRQHandler
def_irq_handler PORTD_IRQHandler
def_irq_handler PORTE_IRQHandler
def_irq_handler SWI_IRQHandler
def_irq_handler SPI2_IRQHandler
def_irq_handler Reserved82_IRQHandler
def_irq_handler Reserved83_IRQHandler
def_irq_handler Reserved84_IRQHandler
def_irq_handler Reserved85_IRQHandler
def_irq_handler FLEXIO0_IRQHandler
def_irq_handler FTM3_IRQHandler
def_irq_handler Reserved88_IRQHandler
def_irq_handler Reserved89_IRQHandler
def_irq_handler I2C2_IRQHandler
def_irq_handler Reserved91_IRQHandler
def_irq_handler Reserved92_IRQHandler
def_irq_handler Reserved93_IRQHandler
def_irq_handler Reserved94_IRQHandler
def_irq_handler Reserved95_IRQHandler
def_irq_handler Reserved96_IRQHandler
def_irq_handler SDHC_IRQHandler
def_irq_handler Reserved98_IRQHandler
def_irq_handler Reserved99_IRQHandler
def_irq_handler Reserved100_IRQHandler
def_irq_handler Reserved101_IRQHandler
def_irq_handler Reserved102_IRQHandler
def_irq_handler TSI0_IRQHandler
def_irq_handler TPM1_IRQHandler
def_irq_handler TPM2_IRQHandler
def_irq_handler Reserved106_IRQHandler
def_irq_handler I2C3_IRQHandler
def_irq_handler Reserved108_IRQHandler
def_irq_handler Reserved109_IRQHandler
def_irq_handler Reserved110_IRQHandler
def_irq_handler Reserved111_IRQHandler
def_irq_handler Reserved112_IRQHandler
def_irq_handler Reserved113_IRQHandler
def_irq_handler Reserved114_IRQHandler
def_irq_handler Reserved115_IRQHandler
def_irq_handler QuadSPI0_IRQHandler
def_irq_handler Reserved117_IRQHandler
def_irq_handler Reserved118_IRQHandler
def_irq_handler Reserved119_IRQHandler
def_irq_handler LTC0_IRQHandler
def_irq_handler Reserved121_IRQHandler
def_irq_handler Reserved122_IRQHandler
.end
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,316 @@
/*
** ###################################################################
** Processors: MK82FN256CAx15
** MK82FN256VDC15
** MK82FN256VLL15
** MK82FN256VLQ15
**
** Compilers: Keil ARM C/C++ Compiler
** Freescale C/C++ for Embedded ARM
** GNU C Compiler
** GNU C Compiler - CodeSourcery Sourcery G++
** IAR ANSI C/C++ Compiler for ARM
**
** Reference manual: K82P121M150SF5RM, Rev. 0, May 2015
** Version: rev. 1.1, 2015-05-28
** Build: b150626
**
** 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 (c) 2015 Freescale Semiconductor, Inc.
** All rights reserved.
**
** Redistribution and use in source and binary forms, with or without modification,
** are permitted provided that the following conditions are met:
**
** o Redistributions of source code must retain the above copyright notice, this list
** of conditions and the following disclaimer.
**
** o 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.
**
** o Neither the name of Freescale Semiconductor, Inc. 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.
**
** http: www.freescale.com
** mail: support@freescale.com
**
** Revisions:
** - rev. 1.0 (2015-04-09)
** Initial version
** - rev. 1.1 (2015-05-28)
** Update according to the reference manual Rev. 0.
**
** ###################################################################
*/
/*!
* @file MK82F25615
* @version 1.1
* @date 2015-05-28
* @brief Device specific configuration file for MK82F25615 (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 "fsl_device_registers.h"
/*!
* @brief Defines the structure to set the Bootloader Configuration Area
*
* This type of variable is used to set the Bootloader Configuration Area
* of the chip.
*/
typedef struct SystemBootloaderConfig
{
uint32_t tag; /*!< Magic number to verify bootloader configuration is valid. Must be set to 'kcfg'. */
uint32_t crcStartAddress; /*!< Start address for application image CRC check. If the bits are all set then Kinetis
bootloader by default will not perform any CRC check. */
uint32_t crcByteCount; /*!< Byte count for application image CRC check. If the bits are all set then Kinetis
bootloader by default will not prform any CRC check. */
uint32_t crcExpectedValue; /*!< Expected CRC value for application CRC check. If the bits are all set then Kinetis
bootloader by default will not perform any CRC check.*/
uint8_t enabledPeripherals; /*!< Bitfield of peripherals to enable.
bit 0 - LPUART, bit 1 - I2C, bit 2 - SPI, bit 4 - USB
Kinetis bootloader will enable the peripheral if corresponding bit is set to 1. */
uint8_t i2cSlaveAddress; /*!< If not 0xFF, used as the 7-bit I2C slave address. If 0xFF, defaults to 0x10 for I2C
slave address */
uint16_t peripheralDetectionTimeoutMs; /*!< Timeout in milliseconds for active peripheral detection. If 0xFFFF,
defaults to 5 seconds. */
uint16_t usbVid; /*!< Sets the USB Vendor ID reported by the device during enumeration. If 0xFFFF, it defaults to
0x15A2. */
uint16_t usbPid; /*!< Sets the USB Product ID reported by the device during enumeration. */
uint32_t usbStringsPointer; /*!< Sets the USB Strings reported by the device during enumeration. */
uint8_t clockFlags; /*!< The flags in the clockFlags configuration field are enabled if the corresponding bit is
cleared (0).
bit 0 - HighSpeed Enable high speed mode (i.e., 48 MHz). */
uint8_t clockDivider; /*!< Inverted value of the divider to use for core and bus clocks when in high speed mode */
uint8_t bootFlags; /*!< If bit 0 is cleared, then Kinetis bootloader will jump to either Quad SPI Flash or internal
flash image depending on FOPT BOOTSRC_SEL bits.
If the bit is set, then Kinetis bootloader will prepare for host communication over serial
peripherals. */
uint8_t RESERVED1;
uint32_t mmcauConfigPointer; /*!< A pointer to the MMCAU configuration structure in memory. */
uint32_t keyBlobPointer; /*!< A pointer to the keyblob data in memory. */
uint8_t RESERVED2[8];
uint32_t qspiConfigBlockPtr; /*!< A pointer to the QSPI config block in internal flash array. */
uint8_t RESERVED3[12];
} system_bootloader_config_t;
#ifdef BOOTLOADER_CONFIG
/* Bootlader configuration area */
#if defined(__IAR_SYSTEMS_ICC__)
/* Pragma to place the Bootloader Configuration Array on correct location defined in linker file. */
#pragma language = extended
#pragma location = "BootloaderConfig"
__root const system_bootloader_config_t BootloaderConfig @"BootloaderConfig" =
#elif defined(__GNUC__)
__attribute__((section(".BootloaderConfig"))) const system_bootloader_config_t BootloaderConfig =
#elif defined(__CC_ARM)
__attribute__((section("BootloaderConfig"))) const system_bootloader_config_t BootloaderConfig __attribute__((used)) =
#else
#error Unsupported compiler!
#endif
{
.tag = 0x6766636BU, /* Magic Number */
.crcStartAddress = 0xFFFFFFFFU, /* Disable CRC check */
.crcByteCount = 0xFFFFFFFFU, /* Disable CRC check */
.crcExpectedValue = 0xFFFFFFFFU, /* Disable CRC check */
.enabledPeripherals = 0x17, /* Enable all peripherals */
.i2cSlaveAddress = 0xFF, /* Use default I2C address */
.peripheralDetectionTimeoutMs = 0x01F4U, /* Timeout :500ms */
.usbVid = 0xFFFFU, /* Use default USB Vendor ID */
.usbPid = 0xFFFFU, /* Use default USB Product ID */
.usbStringsPointer = 0xFFFFFFFFU, /* Use default USB Strings */
.clockFlags = 0x01, /* Enable High speed mode */
.clockDivider = 0xFF, /* Use clock divider 1 */
.bootFlags = 0x01, /* Enable communication with host */
.mmcauConfigPointer = 0xFFFFFFFFU, /* No MMCAU configuration */
.keyBlobPointer = 0x00001000U, /* keyblob data is at 0x1000 */
.qspiConfigBlockPtr = 0xFFFFFFFFU /* No QSPI configuration */
};
#endif
/* ----------------------------------------------------------------------------
-- Core clock
---------------------------------------------------------------------------- */
uint32_t SystemCoreClock = 20971520u;
/* ----------------------------------------------------------------------------
-- SystemInit()
---------------------------------------------------------------------------- */
void SystemInit(void)
{
#if ((__FPU_PRESENT == 1) && (__FPU_USED == 1))
SCB->CPACR |= ((3UL << 10 * 2) | (3UL << 11 * 2)); /* set CP10, CP11 Full Access */
#endif /* ((__FPU_PRESENT == 1) && (__FPU_USED == 1)) */
#if (DISABLE_WDOG)
/* WDOG->UNLOCK: WDOGUNLOCK=0xC520 */
WDOG->UNLOCK = WDOG_UNLOCK_WDOGUNLOCK(0xC520); /* Key 1 */
/* WDOG->UNLOCK: WDOGUNLOCK=0xD928 */
WDOG->UNLOCK = WDOG_UNLOCK_WDOGUNLOCK(0xD928); /* Key 2 */
/* WDOG->STCTRLH:
* ?=0,DISTESTWDOG=0,BYTESEL=0,TESTSEL=0,TESTWDOG=0,?=0,?=1,WAITEN=1,STOPEN=1,DBGEN=0,ALLOWUPDATE=1,WINEN=0,IRQRSTEN=0,CLKSRC=1,WDOGEN=0
*/
WDOG->STCTRLH = WDOG_STCTRLH_BYTESEL(0x00) | WDOG_STCTRLH_WAITEN_MASK | WDOG_STCTRLH_STOPEN_MASK |
WDOG_STCTRLH_ALLOWUPDATE_MASK | WDOG_STCTRLH_CLKSRC_MASK | 0x0100U;
#endif /* (DISABLE_WDOG) */
}
/* ----------------------------------------------------------------------------
-- SystemCoreClockUpdate()
---------------------------------------------------------------------------- */
void SystemCoreClockUpdate(void)
{
uint32_t MCGOUTClock; /* Variable to store output clock frequency of the MCG module */
uint16_t Divider;
if ((MCG->C1 & MCG_C1_CLKS_MASK) == 0x00U)
{
/* Output of FLL or PLL is selected */
if ((MCG->C6 & MCG_C6_PLLS_MASK) == 0x00U)
{
/* FLL is selected */
if ((MCG->C1 & MCG_C1_IREFS_MASK) == 0x00U)
{
/* External reference clock is selected */
switch (MCG->C7 & MCG_C7_OSCSEL_MASK)
{
case 0x00U:
MCGOUTClock = CPU_XTAL_CLK_HZ; /* System oscillator drives MCG clock */
break;
case 0x01U:
MCGOUTClock = CPU_XTAL32k_CLK_HZ; /* RTC 32 kHz oscillator drives MCG clock */
break;
case 0x02U:
default:
MCGOUTClock = CPU_INT_IRC_CLK_HZ; /* IRC 48MHz oscillator drives MCG clock */
break;
}
if (((MCG->C2 & MCG_C2_RANGE_MASK) != 0x00U) && ((MCG->C7 & MCG_C7_OSCSEL_MASK) != 0x01U))
{
switch (MCG->C1 & MCG_C1_FRDIV_MASK)
{
case 0x38U:
Divider = 1536U;
break;
case 0x30U:
Divider = 1280U;
break;
default:
Divider = (uint16_t)(32LU << ((MCG->C1 & MCG_C1_FRDIV_MASK) >> MCG_C1_FRDIV_SHIFT));
break;
}
}
else
{ /* ((MCG->C2 & MCG_C2_RANGE_MASK) != 0x00U) */
Divider = (uint16_t)(1LU << ((MCG->C1 & MCG_C1_FRDIV_MASK) >> MCG_C1_FRDIV_SHIFT));
}
MCGOUTClock = (MCGOUTClock / Divider); /* Calculate the divided FLL reference clock */
}
else
{ /* (!((MCG->C1 & MCG_C1_IREFS_MASK) == 0x00U)) */
MCGOUTClock = CPU_INT_SLOW_CLK_HZ; /* The slow internal reference clock is selected */
} /* (!((MCG->C1 & MCG_C1_IREFS_MASK) == 0x00U)) */
/* Select correct multiplier to calculate the MCG output clock */
switch (MCG->C4 & (MCG_C4_DMX32_MASK | MCG_C4_DRST_DRS_MASK))
{
case 0x00U:
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) == 0x00U)) */
/* PLL is selected */
Divider = (((uint16_t)MCG->C5 & MCG_C5_PRDIV_MASK) + 0x01U);
MCGOUTClock = (uint32_t)(CPU_XTAL_CLK_HZ / Divider); /* Calculate the PLL reference clock */
Divider = (((uint16_t)MCG->C6 & MCG_C6_VDIV_MASK) + 16U);
MCGOUTClock *= Divider; /* Calculate the VCO output clock */
MCGOUTClock /= 2; /* Calculate the MCG output clock */
} /* (!((MCG->C6 & MCG_C6_PLLS_MASK) == 0x00U)) */
}
else if ((MCG->C1 & MCG_C1_CLKS_MASK) == 0x40U)
{
/* Internal reference clock is selected */
if ((MCG->C2 & MCG_C2_IRCS_MASK) == 0x00U)
{
MCGOUTClock = CPU_INT_SLOW_CLK_HZ; /* Slow internal reference clock selected */
}
else
{ /* (!((MCG->C2 & MCG_C2_IRCS_MASK) == 0x00U)) */
Divider = (uint16_t)(0x01LU << ((MCG->SC & MCG_SC_FCRDIV_MASK) >> MCG_SC_FCRDIV_SHIFT));
MCGOUTClock = (uint32_t)(CPU_INT_FAST_CLK_HZ / Divider); /* Fast internal reference clock selected */
} /* (!((MCG->C2 & MCG_C2_IRCS_MASK) == 0x00U)) */
}
else if ((MCG->C1 & MCG_C1_CLKS_MASK) == 0x80U)
{
/* External reference clock is selected */
switch (MCG->C7 & MCG_C7_OSCSEL_MASK)
{
case 0x00U:
MCGOUTClock = CPU_XTAL_CLK_HZ; /* System oscillator drives MCG clock */
break;
case 0x01U:
MCGOUTClock = CPU_XTAL32k_CLK_HZ; /* RTC 32 kHz oscillator drives MCG clock */
break;
case 0x02U:
default:
MCGOUTClock = CPU_INT_IRC_CLK_HZ; /* IRC 48MHz oscillator drives MCG clock */
break;
}
}
else
{ /* (!((MCG->C1 & MCG_C1_CLKS_MASK) == 0x80U)) */
/* Reserved value */
return;
} /* (!((MCG->C1 & MCG_C1_CLKS_MASK) == 0x80U)) */
SystemCoreClock =
(MCGOUTClock / (0x01U + ((SIM->CLKDIV1 & SIM_CLKDIV1_OUTDIV1_MASK) >> SIM_CLKDIV1_OUTDIV1_SHIFT)));
}
@@ -0,0 +1,383 @@
/*
** ###################################################################
** Processors: MK82FN256CAx15
** MK82FN256VDC15
** MK82FN256VLL15
** MK82FN256VLQ15
**
** Compilers: Keil ARM C/C++ Compiler
** Freescale C/C++ for Embedded ARM
** GNU C Compiler
** GNU C Compiler - CodeSourcery Sourcery G++
** IAR ANSI C/C++ Compiler for ARM
**
** Reference manual: K82P121M150SF5RM, Rev. 0, May 2015
** Version: rev. 1.1, 2015-05-28
** Build: b150626
**
** 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 (c) 2015 Freescale Semiconductor, Inc.
** All rights reserved.
**
** Redistribution and use in source and binary forms, with or without modification,
** are permitted provided that the following conditions are met:
**
** o Redistributions of source code must retain the above copyright notice, this list
** of conditions and the following disclaimer.
**
** o 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.
**
** o Neither the name of Freescale Semiconductor, Inc. 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.
**
** http: www.freescale.com
** mail: support@freescale.com
**
** Revisions:
** - rev. 1.0 (2015-04-09)
** Initial version
** - rev. 1.1 (2015-05-28)
** Update according to the reference manual Rev. 0.
**
** ###################################################################
*/
/*!
* @file MK82F25615
* @version 1.1
* @date 2015-05-28
* @brief Device specific configuration file for MK82F25615 (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_MK82F25615_H_
#define SYSTEM_MK82F25615_H_ /**< Symbol preventing repeated inclusion */
#ifdef __cplusplus
extern "C" {
#endif
#include <stdint.h>
#ifndef DISABLE_WDOG
#define DISABLE_WDOG 1
#endif
/* MCG mode constants */
#define MCG_MODE_FEI 0U
#define MCG_MODE_FBI 1U
#define MCG_MODE_BLPI 2U
#define MCG_MODE_FEE 3U
#define MCG_MODE_FBE 4U
#define MCG_MODE_BLPE 5U
#define MCG_MODE_PBE 6U
#define MCG_MODE_PEE 7U
/* Predefined clock setups
0 ... Default part configuration
Multipurpose Clock Generator (MCG) in FEI mode.
Reference clock source for MCG module: Slow internal reference clock
Core clock = 20.97152MHz
Bus clock = 20.97152MHz
1 ... Maximal speed configuration
Multipurpose Clock Generator (MCG) in PEE mode.
Reference clock source for MCG module: System oscillator 0 reference clock
Core clock = 150MHz
Bus clock = 75MHz
2 ... Chip internally clocked, ready for Very Low Power Run mode.
Multipurpose Clock Generator (MCG) in BLPI mode.
Reference clock source for MCG module: Fast internal reference clock
Core clock = 4MHz
Bus clock = 4MHz
3 ... Chip externally clocked, ready for Very Low Power Run mode.
Multipurpose Clock Generator (MCG) in BLPE mode.
Reference clock source for MCG module: System oscillator 0 reference clock
Core clock = 4MHz
Bus clock = 4MHz
4 ... USB clock setup.
Multipurpose Clock Generator (MCG) in PEE mode.
Reference clock source for MCG module: System oscillator 0 reference clock
Core clock = 144MHz
Bus clock = 72MHz
5 ... Maximum achievable clock frequency configuration in RUN mode.
Multipurpose Clock Generator (MCG) in PEE mode.
Reference clock source for MCG module: System oscillator 0 reference clock
Core clock = 120MHz
Bus clock = 60MHz
*/
/* Define clock source values */
#define CPU_XTAL_CLK_HZ \
12000000U /* Value of the external crystal or oscillator clock frequency of the system oscillator (OSC) in Hz */
#define CPU_XTAL32k_CLK_HZ \
32768U /* Value of the external 32k crystal or oscillator clock frequency of the RTC 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 CPU_INT_IRC_CLK_HZ 48000000U /* Value of the 48M internal oscillator clock frequency in Hz */
/* RTC oscillator setting */
/* RTC_CR: SC2P=0,SC4P=0,SC8P=0,SC16P=0,CLKO=1,OSCE=1,WPS=0,UM=0,SUP=0,WPE=0,SWR=0 */
#define SYSTEM_RTC_CR_VALUE 0x0300U /* RTC_CR */
/* Low power mode enable */
/* SMC_PMPROT: AHSRUN=1,AVLP=1,ALLS=1,AVLLS=1 */
#define SYSTEM_SMC_PMPROT_VALUE 0xAAU /* SMC_PMPROT */
/* Internal reference clock trim */
/* #undef SLOW_TRIM_ADDRESS */ /* Slow oscillator not trimmed. Commented out for MISRA compliance. */
/* #undef SLOW_FINE_TRIM_ADDRESS */ /* Slow oscillator not trimmed. Commented out for MISRA compliance. */
/* #undef FAST_TRIM_ADDRESS */ /* Fast oscillator not trimmed. Commented out for MISRA compliance. */
/* #undef FAST_FINE_TRIM_ADDRESS */ /* Fast oscillator not trimmed. Commented out for MISRA compliance. */
#ifdef CLOCK_SETUP
#if (CLOCK_SETUP == 0)
#define DEFAULT_SYSTEM_CLOCK 20971520U /* Default System clock value */
#define MCG_MODE MCG_MODE_FEI /* Clock generator mode */
/* MCG_C1: CLKS=0,FRDIV=0,IREFS=1,IRCLKEN=1,IREFSTEN=0 */
#define SYSTEM_MCG_C1_VALUE 0x06U /* MCG_C1 */
/* MCG_C2: LOCRE0=0,FCFTRIM=0,RANGE=2,HGO=0,EREFS=1,LP=0,IRCS=0 */
#define SYSTEM_MCG_C2_VALUE 0x24U /* MCG_C2 */
/* MCG_C4: DMX32=0,DRST_DRS=0,FCTRIM=0,SCFTRIM=0 */
#define SYSTEM_MCG_C4_VALUE 0x00U /* MCG_C4 */
/* MCG_SC: ATME=0,ATMS=0,ATMF=0,FLTPRSRV=0,FCRDIV=0,LOCS0=0 */
#define SYSTEM_MCG_SC_VALUE 0x00U /* MCG_SC */
/* MCG_C5: PLLCLKEN=0,PLLSTEN=0,PRDIV=0 */
#define SYSTEM_MCG_C5_VALUE 0x00U /* MCG_C5 */
/* MCG_C6: LOLIE0=0,PLLS=0,CME0=0,VDIV=0 */
#define SYSTEM_MCG_C6_VALUE 0x00U /* MCG_C6 */
/* MCG_C7: OSCSEL=0 */
#define SYSTEM_MCG_C7_VALUE 0x00U /* MCG_C7 */
/* OSC_CR: ERCLKEN=1,EREFSTEN=0,SC2P=0,SC4P=0,SC8P=0,SC16P=0 */
#define SYSTEM_OSC_CR_VALUE 0x80U /* OSC_CR */
/* SMC_PMCTRL: RUNM=0,STOPA=0,STOPM=0 */
#define SYSTEM_SMC_PMCTRL_VALUE 0x00U /* SMC_PMCTRL */
/* SIM_CLKDIV1: OUTDIV1=0,OUTDIV2=0,OUTDIV3=1,OUTDIV4=1 */
#define SYSTEM_SIM_CLKDIV1_VALUE 0x00110000U /* SIM_CLKDIV1 */
/* SIM_CLKDIV3: PLLFLLDIV=0,PLLFLLFRAC=0 */
#define SYSTEM_SIM_CLKDIV3_VALUE 0x00U /* SIM_CLKDIV3 */
/* SIM_SOPT1: USBREGEN=0,USBSSTBY=0,USBVSTBY=0,OSC32KSEL=2,RAMSIZE=0 */
#define SYSTEM_SIM_SOPT1_VALUE 0x00080000U /* SIM_SOPT1 */
/* SIM_SOPT2:
* EMVSIMSRC=0,SDHCSRC=0,LPUARTSRC=0,TPMSRC=1,FLEXIOSRC=0,USBSRC=0,PLLFLLSEL=0,TRACECLKSEL=0,FBSL=0,CLKOUTSEL=0,RTCCLKOUTSEL=0
*/
#define SYSTEM_SIM_SOPT2_VALUE 0x01000000U /* SIM_SOPT2 */
#elif(CLOCK_SETUP == 1)
#define DEFAULT_SYSTEM_CLOCK 150000000U /* Default System clock value */
#define MCG_MODE MCG_MODE_PEE /* Clock generator mode */
/* MCG_C1: CLKS=0,FRDIV=4,IREFS=0,IRCLKEN=1,IREFSTEN=0 */
#define SYSTEM_MCG_C1_VALUE 0x22U /* MCG_C1 */
/* MCG_C2: LOCRE0=0,FCFTRIM=0,RANGE=2,HGO=0,EREFS=1,LP=0,IRCS=0 */
#define SYSTEM_MCG_C2_VALUE 0x24U /* MCG_C2 */
/* MCG_C4: DMX32=0,DRST_DRS=0,FCTRIM=0,SCFTRIM=0 */
#define SYSTEM_MCG_C4_VALUE 0x00U /* MCG_C4 */
/* MCG_SC: ATME=0,ATMS=0,ATMF=0,FLTPRSRV=0,FCRDIV=0,LOCS0=0 */
#define SYSTEM_MCG_SC_VALUE 0x00U /* MCG_SC */
/* MCG_C5: PLLCLKEN=0,PLLSTEN=0,PRDIV=0 */
#define SYSTEM_MCG_C5_VALUE 0x00U /* MCG_C5 */
/* MCG_C6: LOLIE0=0,PLLS=1,CME0=0,VDIV=9 */
#define SYSTEM_MCG_C6_VALUE 0x49U /* MCG_C6 */
/* MCG_C7: OSCSEL=0 */
#define SYSTEM_MCG_C7_VALUE 0x00U /* MCG_C7 */
/* OSC_CR: ERCLKEN=1,EREFSTEN=0,SC2P=0,SC4P=0,SC8P=0,SC16P=0 */
#define SYSTEM_OSC_CR_VALUE 0x80U /* OSC_CR */
/* SMC_PMCTRL: RUNM=3,STOPA=0,STOPM=0 */
#define SYSTEM_SMC_PMCTRL_VALUE 0x60U /* SMC_PMCTRL */
/* SIM_CLKDIV1: OUTDIV1=0,OUTDIV2=1,OUTDIV3=1,OUTDIV4=5 */
#define SYSTEM_SIM_CLKDIV1_VALUE 0x01150000U /* SIM_CLKDIV1 */
/* SIM_CLKDIV3: PLLFLLDIV=0,PLLFLLFRAC=0 */
#define SYSTEM_SIM_CLKDIV3_VALUE 0x00U /* SIM_CLKDIV3 */
/* SIM_SOPT1: USBREGEN=0,USBSSTBY=0,USBVSTBY=0,OSC32KSEL=2,RAMSIZE=0 */
#define SYSTEM_SIM_SOPT1_VALUE 0x00080000U /* SIM_SOPT1 */
/* SIM_SOPT2:
* EMVSIMSRC=0,SDHCSRC=0,LPUARTSRC=0,TPMSRC=1,FLEXIOSRC=0,USBSRC=0,PLLFLLSEL=1,TRACECLKSEL=0,FBSL=0,CLKOUTSEL=0,RTCCLKOUTSEL=0
*/
#define SYSTEM_SIM_SOPT2_VALUE 0x01010000U /* SIM_SOPT2 */
#elif(CLOCK_SETUP == 2)
#define DEFAULT_SYSTEM_CLOCK 4000000U /* Default System clock value */
#define MCG_MODE MCG_MODE_BLPI /* Clock generator mode */
/* MCG_C1: CLKS=1,FRDIV=0,IREFS=1,IRCLKEN=1,IREFSTEN=0 */
#define SYSTEM_MCG_C1_VALUE 0x46U /* MCG_C1 */
/* MCG_C2: LOCRE0=0,FCFTRIM=0,RANGE=2,HGO=0,EREFS=1,LP=1,IRCS=1 */
#define SYSTEM_MCG_C2_VALUE 0x27U /* MCG_C2 */
/* MCG_C4: DMX32=0,DRST_DRS=0,FCTRIM=0,SCFTRIM=0 */
#define SYSTEM_MCG_C4_VALUE 0x00U /* MCG_C4 */
/* MCG_SC: ATME=0,ATMS=0,ATMF=0,FLTPRSRV=0,FCRDIV=0,LOCS0=0 */
#define SYSTEM_MCG_SC_VALUE 0x00U /* MCG_SC */
/* MCG_C5: PLLCLKEN=0,PLLSTEN=0,PRDIV=0 */
#define SYSTEM_MCG_C5_VALUE 0x00U /* MCG_C5 */
/* MCG_C6: LOLIE0=0,PLLS=0,CME0=0,VDIV=0 */
#define SYSTEM_MCG_C6_VALUE 0x00U /* MCG_C6 */
/* MCG_C7: OSCSEL=0 */
#define SYSTEM_MCG_C7_VALUE 0x00U /* MCG_C7 */
/* OSC_CR: ERCLKEN=1,EREFSTEN=0,SC2P=0,SC4P=0,SC8P=0,SC16P=0 */
#define SYSTEM_OSC_CR_VALUE 0x80U /* OSC_CR */
/* SMC_PMCTRL: RUNM=0,STOPA=0,STOPM=0 */
#define SYSTEM_SMC_PMCTRL_VALUE 0x00U /* SMC_PMCTRL */
/* SIM_CLKDIV1: OUTDIV1=0,OUTDIV2=0,OUTDIV3=0,OUTDIV4=4 */
#define SYSTEM_SIM_CLKDIV1_VALUE 0x00040000U /* SIM_CLKDIV1 */
/* SIM_CLKDIV3: PLLFLLDIV=0,PLLFLLFRAC=0 */
#define SYSTEM_SIM_CLKDIV3_VALUE 0x00U /* SIM_CLKDIV3 */
/* SIM_SOPT1: USBREGEN=0,USBSSTBY=0,USBVSTBY=0,OSC32KSEL=2,RAMSIZE=0 */
#define SYSTEM_SIM_SOPT1_VALUE 0x00080000U /* SIM_SOPT1 */
/* SIM_SOPT2:
* EMVSIMSRC=0,SDHCSRC=0,LPUARTSRC=0,TPMSRC=1,FLEXIOSRC=0,USBSRC=0,PLLFLLSEL=3,TRACECLKSEL=0,FBSL=0,CLKOUTSEL=0,RTCCLKOUTSEL=0
*/
#define SYSTEM_SIM_SOPT2_VALUE 0x01030000U /* SIM_SOPT2 */
#elif(CLOCK_SETUP == 3)
#define DEFAULT_SYSTEM_CLOCK 4000000U /* Default System clock value */
#define MCG_MODE MCG_MODE_BLPE /* Clock generator mode */
/* MCG_C1: CLKS=2,FRDIV=4,IREFS=0,IRCLKEN=1,IREFSTEN=0 */
#define SYSTEM_MCG_C1_VALUE 0xA2U /* MCG_C1 */
/* MCG_C2: LOCRE0=0,FCFTRIM=0,RANGE=2,HGO=0,EREFS=1,LP=1,IRCS=1 */
#define SYSTEM_MCG_C2_VALUE 0x27U /* MCG_C2 */
/* MCG_C4: DMX32=0,DRST_DRS=0,FCTRIM=0,SCFTRIM=0 */
#define SYSTEM_MCG_C4_VALUE 0x00U /* MCG_C4 */
/* MCG_SC: ATME=0,ATMS=0,ATMF=0,FLTPRSRV=0,FCRDIV=0,LOCS0=0 */
#define SYSTEM_MCG_SC_VALUE 0x00U /* MCG_SC */
/* MCG_C5: PLLCLKEN=0,PLLSTEN=0,PRDIV=0 */
#define SYSTEM_MCG_C5_VALUE 0x00U /* MCG_C5 */
/* MCG_C6: LOLIE0=0,PLLS=0,CME0=0,VDIV=0 */
#define SYSTEM_MCG_C6_VALUE 0x00U /* MCG_C6 */
/* MCG_C7: OSCSEL=0 */
#define SYSTEM_MCG_C7_VALUE 0x00U /* MCG_C7 */
/* OSC_CR: ERCLKEN=1,EREFSTEN=0,SC2P=0,SC4P=0,SC8P=0,SC16P=0 */
#define SYSTEM_OSC_CR_VALUE 0x80U /* OSC_CR */
/* SMC_PMCTRL: RUNM=0,STOPA=0,STOPM=0 */
#define SYSTEM_SMC_PMCTRL_VALUE 0x00U /* SMC_PMCTRL */
/* SIM_CLKDIV1: OUTDIV1=2,OUTDIV2=2,OUTDIV3=2,OUTDIV4=0x0B */
#define SYSTEM_SIM_CLKDIV1_VALUE 0x222B0000U /* SIM_CLKDIV1 */
/* SIM_CLKDIV3: PLLFLLDIV=0,PLLFLLFRAC=0 */
#define SYSTEM_SIM_CLKDIV3_VALUE 0x00U /* SIM_CLKDIV3 */
/* SIM_SOPT1: USBREGEN=0,USBSSTBY=0,USBVSTBY=0,OSC32KSEL=2,RAMSIZE=0 */
#define SYSTEM_SIM_SOPT1_VALUE 0x00080000U /* SIM_SOPT1 */
/* SIM_SOPT2:
* EMVSIMSRC=0,SDHCSRC=0,LPUARTSRC=0,TPMSRC=1,FLEXIOSRC=0,USBSRC=0,PLLFLLSEL=3,TRACECLKSEL=0,FBSL=0,CLKOUTSEL=0,RTCCLKOUTSEL=0
*/
#define SYSTEM_SIM_SOPT2_VALUE 0x01030000U /* SIM_SOPT2 */
#elif(CLOCK_SETUP == 4)
#define DEFAULT_SYSTEM_CLOCK 144000000U /* Default System clock value */
#define MCG_MODE MCG_MODE_PEE /* Clock generator mode */
/* MCG_C1: CLKS=0,FRDIV=4,IREFS=0,IRCLKEN=1,IREFSTEN=0 */
#define SYSTEM_MCG_C1_VALUE 0x22U /* MCG_C1 */
/* MCG_C2: LOCRE0=0,FCFTRIM=0,RANGE=2,HGO=0,EREFS=1,LP=0,IRCS=0 */
#define SYSTEM_MCG_C2_VALUE 0x24U /* MCG_C2 */
/* MCG_C4: DMX32=0,DRST_DRS=0,FCTRIM=0,SCFTRIM=0 */
#define SYSTEM_MCG_C4_VALUE 0x00U /* MCG_C4 */
/* MCG_SC: ATME=0,ATMS=0,ATMF=0,FLTPRSRV=0,FCRDIV=0,LOCS0=0 */
#define SYSTEM_MCG_SC_VALUE 0x00U /* MCG_SC */
/* MCG_C5: PLLCLKEN=0,PLLSTEN=0,PRDIV=0 */
#define SYSTEM_MCG_C5_VALUE 0x00U /* MCG_C5 */
/* MCG_C6: LOLIE0=0,PLLS=1,CME0=0,VDIV=8 */
#define SYSTEM_MCG_C6_VALUE 0x48U /* MCG_C6 */
/* MCG_C7: OSCSEL=0 */
#define SYSTEM_MCG_C7_VALUE 0x00U /* MCG_C7 */
/* OSC_CR: ERCLKEN=1,EREFSTEN=0,SC2P=0,SC4P=0,SC8P=0,SC16P=0 */
#define SYSTEM_OSC_CR_VALUE 0x80U /* OSC_CR */
/* SMC_PMCTRL: RUNM=3,STOPA=0,STOPM=0 */
#define SYSTEM_SMC_PMCTRL_VALUE 0x60U /* SMC_PMCTRL */
/* SIM_CLKDIV1: OUTDIV1=0,OUTDIV2=1,OUTDIV3=1,OUTDIV4=5 */
#define SYSTEM_SIM_CLKDIV1_VALUE 0x01150000U /* SIM_CLKDIV1 */
/* SIM_CLKDIV2: USBDIV=2,USBFRAC=0 */
#define SYSTEM_SIM_CLKDIV2_VALUE 0x04U /* SIM_CLKDIV2 */
/* SIM_CLKDIV3: PLLFLLDIV=0,PLLFLLFRAC=0 */
#define SYSTEM_SIM_CLKDIV3_VALUE 0x00U /* SIM_CLKDIV3 */
/* SIM_SOPT1: USBREGEN=0,USBSSTBY=0,USBVSTBY=0,OSC32KSEL=2,RAMSIZE=0 */
#define SYSTEM_SIM_SOPT1_VALUE 0x00080000U /* SIM_SOPT1 */
/* SIM_SOPT2:
* EMVSIMSRC=0,SDHCSRC=0,LPUARTSRC=0,TPMSRC=1,FLEXIOSRC=0,USBSRC=0,PLLFLLSEL=1,TRACECLKSEL=0,FBSL=0,CLKOUTSEL=0,RTCCLKOUTSEL=0
*/
#define SYSTEM_SIM_SOPT2_VALUE 0x01010000U /* SIM_SOPT2 */
#elif(CLOCK_SETUP == 5)
#define DEFAULT_SYSTEM_CLOCK 120000000U /* Default System clock value */
#define MCG_MODE MCG_MODE_PEE /* Clock generator mode */
/* MCG_C1: CLKS=0,FRDIV=4,IREFS=0,IRCLKEN=1,IREFSTEN=0 */
#define SYSTEM_MCG_C1_VALUE 0x22U /* MCG_C1 */
/* MCG_C2: LOCRE0=0,FCFTRIM=0,RANGE=2,HGO=0,EREFS=1,LP=0,IRCS=0 */
#define SYSTEM_MCG_C2_VALUE 0x24U /* MCG_C2 */
/* MCG_C4: DMX32=0,DRST_DRS=0,FCTRIM=0,SCFTRIM=0 */
#define SYSTEM_MCG_C4_VALUE 0x00U /* MCG_C4 */
/* MCG_SC: ATME=0,ATMS=0,ATMF=0,FLTPRSRV=0,FCRDIV=0,LOCS0=0 */
#define SYSTEM_MCG_SC_VALUE 0x00U /* MCG_SC */
/* MCG_C5: PLLCLKEN=0,PLLSTEN=0,PRDIV=0 */
#define SYSTEM_MCG_C5_VALUE 0x00U /* MCG_C5 */
/* MCG_C6: LOLIE0=0,PLLS=1,CME0=0,VDIV=4 */
#define SYSTEM_MCG_C6_VALUE 0x44U /* MCG_C6 */
/* MCG_C7: OSCSEL=0 */
#define SYSTEM_MCG_C7_VALUE 0x00U /* MCG_C7 */
/* OSC_CR: ERCLKEN=1,EREFSTEN=0,SC2P=0,SC4P=0,SC8P=0,SC16P=0 */
#define SYSTEM_OSC_CR_VALUE 0x80U /* OSC_CR */
/* SMC_PMCTRL: RUNM=0,STOPA=0,STOPM=0 */
#define SYSTEM_SMC_PMCTRL_VALUE 0x00U /* SMC_PMCTRL */
/* SIM_CLKDIV1: OUTDIV1=0,OUTDIV2=1,OUTDIV3=1,OUTDIV4=4 */
#define SYSTEM_SIM_CLKDIV1_VALUE 0x01140000U /* SIM_CLKDIV1 */
/* SIM_CLKDIV3: PLLFLLDIV=0,PLLFLLFRAC=0 */
#define SYSTEM_SIM_CLKDIV3_VALUE 0x00U /* SIM_CLKDIV3 */
/* SIM_SOPT1: USBREGEN=0,USBSSTBY=0,USBVSTBY=0,OSC32KSEL=2,RAMSIZE=0 */
#define SYSTEM_SIM_SOPT1_VALUE 0x00080000U /* SIM_SOPT1 */
/* SIM_SOPT2:
* EMVSIMSRC=0,SDHCSRC=0,LPUARTSRC=0,TPMSRC=1,FLEXIOSRC=0,USBSRC=0,PLLFLLSEL=1,TRACECLKSEL=0,FBSL=0,CLKOUTSEL=0,RTCCLKOUTSEL=0
*/
#define SYSTEM_SIM_SOPT2_VALUE 0x01010000U /* SIM_SOPT2 */
#endif
#else
#define DEFAULT_SYSTEM_CLOCK 20971520u
#endif
/**
* @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_MK82F25615_H_) */
@@ -0,0 +1,308 @@
/*
** ###################################################################
** Processors: MK82FN256CAx15
** MK82FN256VDC15
** MK82FN256VLL15
** MK82FN256VLQ15
**
** Compilers: Keil ARM C/C++ Compiler
** Freescale C/C++ for Embedded ARM
** GNU C Compiler
** GNU C Compiler - CodeSourcery Sourcery G++
** IAR ANSI C/C++ Compiler for ARM
**
** Reference manual: K82P121M150SF5RM, Rev. 0, May 2015
** Version: rev. 1.1, 2015-05-28
** Build: b150626
**
** 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 (c) 2015 Freescale Semiconductor, Inc.
** All rights reserved.
**
** Redistribution and use in source and binary forms, with or without modification,
** are permitted provided that the following conditions are met:
**
** o Redistributions of source code must retain the above copyright notice, this list
** of conditions and the following disclaimer.
**
** o 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.
**
** o Neither the name of Freescale Semiconductor, Inc. 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.
**
** http: www.freescale.com
** mail: support@freescale.com
**
** Revisions:
** - rev. 1.0 (2015-04-09)
** Initial version
** - rev. 1.1 (2015-05-28)
** Update according to the reference manual Rev. 0.
**
** ###################################################################
*/
/*!
* @file MK82F25615
* @version 1.1
* @date 2015-05-28
* @brief Device specific configuration file for MK82F25615 (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 "fsl_device_registers.h"
/*!
* @brief Defines the structure to set the Bootloader Configuration Area
*
* This type of variable is used to set the Bootloader Configuration Area
* of the chip.
*/
typedef struct SystemBootloaderConfig
{
uint32_t tag; /*!< Magic number to verify bootloader configuration is valid. Must be set to 'kcfg'. */
uint32_t crcStartAddress; /*!< Start address for application image CRC check. If the bits are all set then Kinetis
bootloader by default will not perform any CRC check. */
uint32_t crcByteCount; /*!< Byte count for application image CRC check. If the bits are all set then Kinetis
bootloader by default will not prform any CRC check. */
uint32_t crcExpectedValue; /*!< Expected CRC value for application CRC check. If the bits are all set then Kinetis
bootloader by default will not perform any CRC check.*/
uint8_t enabledPeripherals; /*!< Bitfield of peripherals to enable.
bit 0 - LPUART, bit 1 - I2C, bit 2 - SPI, bit 4 - USB
Kinetis bootloader will enable the peripheral if corresponding bit is set to 1. */
uint8_t i2cSlaveAddress; /*!< If not 0xFF, used as the 7-bit I2C slave address. If 0xFF, defaults to 0x10 for I2C
slave address */
uint16_t peripheralDetectionTimeoutMs; /*!< Timeout in milliseconds for active peripheral detection. If 0xFFFF,
defaults to 5 seconds. */
uint16_t usbVid; /*!< Sets the USB Vendor ID reported by the device during enumeration. If 0xFFFF, it defaults to
0x15A2. */
uint16_t usbPid; /*!< Sets the USB Product ID reported by the device during enumeration. */
uint32_t usbStringsPointer; /*!< Sets the USB Strings reported by the device during enumeration. */
uint8_t clockFlags; /*!< The flags in the clockFlags configuration field are enabled if the corresponding bit is
cleared (0).
bit 0 - HighSpeed Enable high speed mode (i.e., 48 MHz). */
uint8_t clockDivider; /*!< Inverted value of the divider to use for core and bus clocks when in high speed mode */
uint8_t bootFlags; /*!< If bit 0 is cleared, then Kinetis bootloader will jump to either Quad SPI Flash or internal
flash image depending on FOPT BOOTSRC_SEL bits.
If the bit is set, then Kinetis bootloader will prepare for host communication over serial
peripherals. */
uint8_t RESERVED1;
uint32_t mmcauConfigPointer; /*!< A pointer to the MMCAU configuration structure in memory. */
uint32_t keyBlobPointer; /*!< A pointer to the keyblob data in memory. */
uint8_t RESERVED2[8];
uint32_t qspiConfigBlockPtr; /*!< A pointer to the QSPI config block in internal flash array. */
uint8_t RESERVED3[12];
} system_bootloader_config_t;
#ifdef BOOTLOADER_CONFIG
/* Bootlader configuration area */
#if defined(__IAR_SYSTEMS_ICC__)
/* Pragma to place the Bootloader Configuration Array on correct location defined in linker file. */
#pragma language = extended
#pragma location = "BootloaderConfig"
__root const system_bootloader_config_t BootloaderConfig @"BootloaderConfig" =
#elif defined(__GNUC__)
__attribute__((section(".BootloaderConfig"))) const system_bootloader_config_t BootloaderConfig =
#elif defined(__CC_ARM)
__attribute__((section("BootloaderConfig"))) const system_bootloader_config_t BootloaderConfig __attribute__((used)) =
#else
#error Unsupported compiler!
#endif
{
.tag = 0x6766636BU, /* Magic Number */
.crcStartAddress = 0xFFFFFFFFU, /* Disable CRC check */
.crcByteCount = 0xFFFFFFFFU, /* Disable CRC check */
.crcExpectedValue = 0xFFFFFFFFU, /* Disable CRC check */
.enabledPeripherals = 0x17, /* Enable all peripherals */
.i2cSlaveAddress = 0xFF, /* Use default I2C address */
.peripheralDetectionTimeoutMs = 0x01F4U, /* timeout: 500ms */
.usbVid = 0xFFFFU, /* Use default USB Vendor ID */
.usbPid = 0xFFFFU, /* Use default USB Product ID */
.usbStringsPointer = 0xFFFFFFFFU, /* Use default USB Strings */
.clockFlags = 0x01, /* Enable High speed mode */
.clockDivider = 0xFF, /* Use clock divider 1 */
.bootFlags = 0x01, /* Enable communication with host */
.mmcauConfigPointer = 0xFFFFFFFFU, /* No MMCAU configuration */
#ifdef BL_TARGET_FLASH
.keyBlobPointer = 0x0000c000, /* keyblob data is ata 0xc000 */
#else
.keyBlobPointer = 0x000001000, /* keyblob data is at 0x1000 */
#endif // BL_TARGET_FLASH
.qspiConfigBlockPtr = 0xFFFFFFFFU /* No QSPI configuration */
};
#endif
/* ----------------------------------------------------------------------------
-- Core clock
---------------------------------------------------------------------------- */
uint32_t SystemCoreClock = 96000000ul;
/* ----------------------------------------------------------------------------
-- SystemInit()
---------------------------------------------------------------------------- */
void SystemInit(void)
{
#if ((__FPU_PRESENT == 1) && (__FPU_USED == 1))
SCB->CPACR |= ((3UL << 10 * 2) | (3UL << 11 * 2)); /* set CP10, CP11 Full Access */
#endif /* ((__FPU_PRESENT == 1) && (__FPU_USED == 1)) */
}
/* ----------------------------------------------------------------------------
-- SystemCoreClockUpdate()
---------------------------------------------------------------------------- */
void SystemCoreClockUpdate(void)
{
uint32_t MCGOUTClock; /* Variable to store output clock frequency of the MCG module */
uint16_t Divider;
if ((MCG->C1 & MCG_C1_CLKS_MASK) == 0x00U)
{
/* Output of FLL or PLL is selected */
if ((MCG->C6 & MCG_C6_PLLS_MASK) == 0x00U)
{
/* FLL is selected */
if ((MCG->C1 & MCG_C1_IREFS_MASK) == 0x00U)
{
/* External reference clock is selected */
switch (MCG->C7 & MCG_C7_OSCSEL_MASK)
{
case 0x00U:
MCGOUTClock = CPU_XTAL_CLK_HZ; /* System oscillator drives MCG clock */
break;
case 0x01U:
MCGOUTClock = CPU_XTAL32k_CLK_HZ; /* RTC 32 kHz oscillator drives MCG clock */
break;
case 0x02U:
default:
MCGOUTClock = CPU_INT_IRC_CLK_HZ; /* IRC 48MHz oscillator drives MCG clock */
break;
}
if (((MCG->C2 & MCG_C2_RANGE_MASK) != 0x00U) && ((MCG->C7 & MCG_C7_OSCSEL_MASK) != 0x01U))
{
switch (MCG->C1 & MCG_C1_FRDIV_MASK)
{
case 0x38U:
Divider = 1536U;
break;
case 0x30U:
Divider = 1280U;
break;
default:
Divider = (uint16_t)(32LU << ((MCG->C1 & MCG_C1_FRDIV_MASK) >> MCG_C1_FRDIV_SHIFT));
break;
}
}
else
{ /* ((MCG->C2 & MCG_C2_RANGE_MASK) != 0x00U) */
Divider = (uint16_t)(1LU << ((MCG->C1 & MCG_C1_FRDIV_MASK) >> MCG_C1_FRDIV_SHIFT));
}
MCGOUTClock = (MCGOUTClock / Divider); /* Calculate the divided FLL reference clock */
}
else
{ /* (!((MCG->C1 & MCG_C1_IREFS_MASK) == 0x00U)) */
MCGOUTClock = CPU_INT_SLOW_CLK_HZ; /* The slow internal reference clock is selected */
} /* (!((MCG->C1 & MCG_C1_IREFS_MASK) == 0x00U)) */
/* Select correct multiplier to calculate the MCG output clock */
switch (MCG->C4 & (MCG_C4_DMX32_MASK | MCG_C4_DRST_DRS_MASK))
{
case 0x00U:
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) == 0x00U)) */
/* PLL is selected */
Divider = (((uint16_t)MCG->C5 & MCG_C5_PRDIV_MASK) + 0x01U);
MCGOUTClock = (uint32_t)(CPU_XTAL_CLK_HZ / Divider); /* Calculate the PLL reference clock */
Divider = (((uint16_t)MCG->C6 & MCG_C6_VDIV_MASK) + 16U);
MCGOUTClock *= Divider; /* Calculate the VCO output clock */
MCGOUTClock /= 2; /* Calculate the MCG output clock */
} /* (!((MCG->C6 & MCG_C6_PLLS_MASK) == 0x00U)) */
}
else if ((MCG->C1 & MCG_C1_CLKS_MASK) == 0x40U)
{
/* Internal reference clock is selected */
if ((MCG->C2 & MCG_C2_IRCS_MASK) == 0x00U)
{
MCGOUTClock = CPU_INT_SLOW_CLK_HZ; /* Slow internal reference clock selected */
}
else
{ /* (!((MCG->C2 & MCG_C2_IRCS_MASK) == 0x00U)) */
Divider = (uint16_t)(0x01LU << ((MCG->SC & MCG_SC_FCRDIV_MASK) >> MCG_SC_FCRDIV_SHIFT));
MCGOUTClock = (uint32_t)(CPU_INT_FAST_CLK_HZ / Divider); /* Fast internal reference clock selected */
} /* (!((MCG->C2 & MCG_C2_IRCS_MASK) == 0x00U)) */
}
else if ((MCG->C1 & MCG_C1_CLKS_MASK) == 0x80U)
{
/* External reference clock is selected */
switch (MCG->C7 & MCG_C7_OSCSEL_MASK)
{
case 0x00U:
MCGOUTClock = CPU_XTAL_CLK_HZ; /* System oscillator drives MCG clock */
break;
case 0x01U:
MCGOUTClock = CPU_XTAL32k_CLK_HZ; /* RTC 32 kHz oscillator drives MCG clock */
break;
case 0x02U:
default:
MCGOUTClock = CPU_INT_IRC_CLK_HZ; /* IRC 48MHz oscillator drives MCG clock */
break;
}
}
else
{ /* (!((MCG->C1 & MCG_C1_CLKS_MASK) == 0x80U)) */
/* Reserved value */
return;
} /* (!((MCG->C1 & MCG_C1_CLKS_MASK) == 0x80U)) */
SystemCoreClock =
(MCGOUTClock / (0x01U + ((SIM->CLKDIV1 & SIM_CLKDIV1_OUTDIV1_MASK) >> SIM_CLKDIV1_OUTDIV1_SHIFT)));
}
@@ -0,0 +1,235 @@
/*
** ###################################################################
** Processors: MK82FN256CAx15
** MK82FN256VDC15
** MK82FN256VLL15
** MK82FN256VLQ15
**
** Compilers: Keil ARM C/C++ Compiler
** Freescale C/C++ for Embedded ARM
** GNU C Compiler
** GNU C Compiler - CodeSourcery Sourcery G++
** IAR ANSI C/C++ Compiler for ARM
**
** Reference manual: K82P121M150SF5RM, Rev. 0, May 2015
** Version: rev. 1.1, 2015-05-28
** Build: b150626
**
** 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 (c) 2015 Freescale Semiconductor, Inc.
** All rights reserved.
**
** Redistribution and use in source and binary forms, with or without modification,
** are permitted provided that the following conditions are met:
**
** o Redistributions of source code must retain the above copyright notice, this list
** of conditions and the following disclaimer.
**
** o 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.
**
** o Neither the name of Freescale Semiconductor, Inc. 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.
**
** http: www.freescale.com
** mail: support@freescale.com
**
** Revisions:
** - rev. 1.0 (2015-04-09)
** Initial version
** - rev. 1.1 (2015-05-28)
** Update according to the reference manual Rev. 0.
**
** ###################################################################
*/
/*!
* @file MK82F25615
* @version 1.1
* @date 2015-05-28
* @brief Device specific configuration file for MK82F25615 (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 "fsl_device_registers.h"
/*!
* @brief Defines the structure to set the Bootloader Configuration Area
*
* This type of variable is used to set the Bootloader Configuration Area
* of the chip.
*/
typedef struct SystemBootloaderConfig
{
uint32_t tag; /*!< Magic number to verify bootloader configuration is valid. Must be set to 'kcfg'. */
uint32_t crcStartAddress; /*!< Start address for application image CRC check. If the bits are all set then Kinetis
bootloader by default will not perform any CRC check. */
uint32_t crcByteCount; /*!< Byte count for application image CRC check. If the bits are all set then Kinetis
bootloader by default will not prform any CRC check. */
uint32_t crcExpectedValue; /*!< Expected CRC value for application CRC check. If the bits are all set then Kinetis
bootloader by default will not perform any CRC check.*/
uint8_t enabledPeripherals; /*!< Bitfield of peripherals to enable.
bit 0 - LPUART, bit 1 - I2C, bit 2 - SPI, bit 4 - USB
Kinetis bootloader will enable the peripheral if corresponding bit is set to 1. */
uint8_t i2cSlaveAddress; /*!< If not 0xFF, used as the 7-bit I2C slave address. If 0xFF, defaults to 0x10 for I2C
slave address */
uint16_t peripheralDetectionTimeoutMs; /*!< Timeout in milliseconds for active peripheral detection. If 0xFFFF,
defaults to 5 seconds. */
uint16_t usbVid; /*!< Sets the USB Vendor ID reported by the device during enumeration. If 0xFFFF, it defaults to
0x15A2. */
uint16_t usbPid; /*!< Sets the USB Product ID reported by the device during enumeration. */
uint32_t usbStringsPointer; /*!< Sets the USB Strings reported by the device during enumeration. */
uint8_t clockFlags; /*!< The flags in the clockFlags configuration field are enabled if the corresponding bit is
cleared (0).
bit 0 - HighSpeed Enable high speed mode (i.e., 48 MHz). */
uint8_t clockDivider; /*!< Inverted value of the divider to use for core and bus clocks when in high speed mode */
uint8_t bootFlags; /*!< If bit 0 is cleared, then Kinetis bootloader will jump to either Quad SPI Flash or internal
flash image depending on FOPT BOOTSRC_SEL bits.
If the bit is set, then Kinetis bootloader will prepare for host communication over serial
peripherals. */
uint8_t RESERVED1;
uint32_t mmcauConfigPointer; /*!< A pointer to the MMCAU configuration structure in memory. */
uint32_t keyBlobPointer; /*!< A pointer to the keyblob data in memory. */
uint8_t RESERVED2[8];
uint32_t qspiConfigBlockPtr; /*!< A pointer to the QSPI config block in internal flash array. */
uint8_t RESERVED3[12];
} system_bootloader_config_t;
/* Bootlader configuration area */
#if defined(__IAR_SYSTEMS_ICC__)
/* Pragma to place the Bootloader Configuration Array on correct location defined in linker file. */
#pragma language = extended
#pragma location = "BootloaderConfig"
__root const system_bootloader_config_t BootloaderConfig @"BootloaderConfig" =
#elif defined(__GNUC__)
__attribute__((section(".BootloaderConfig"))) const system_bootloader_config_t BootloaderConfig =
#elif defined(__CC_ARM)
__attribute__((section("BootloaderConfig"))) const system_bootloader_config_t BootloaderConfig __attribute__((used)) =
#else
#error Unsupported compiler!
#endif
{
.tag = 0x6766636BU, /* Magic Number */
.crcStartAddress = 0xFFFFFFFFU, /* Disable CRC check */
.crcByteCount = 0xFFFFFFFFU, /* Disable CRC check */
.crcExpectedValue = 0xFFFFFFFFU, /* Disable CRC check */
.enabledPeripherals = 0x17, /* Enable all peripherals */
.i2cSlaveAddress = 0xFF, /* Use default I2C address */
.peripheralDetectionTimeoutMs = 3000, /* timeout: 3000ms */
.usbVid = 0xFFFFU, /* Use default USB Vendor ID */
.usbPid = 0xFFFFU, /* Use default USB Product ID */
.usbStringsPointer = 0xFFFFFFFFU, /* Use default USB Strings */
.clockFlags = 0x01, /* Enable High speed mode */
.clockDivider = 0xFF, /* Use clock divider 1 */
.bootFlags = 0x01, /* Enable communication with host */
.mmcauConfigPointer = 0xFFFFFFFFU, /* No MMCAU configuration */
.keyBlobPointer = 0x000001000, /* keyblob data is at 0x1000 */
.qspiConfigBlockPtr = 0x2000, /* QCB is placed at 0x2000 */
};
/* ----------------------------------------------------------------------------
-- Core clock
---------------------------------------------------------------------------- */
uint32_t SystemCoreClock = 96000000ul;
/**
* A section located at 0x410 used for storing ROM patch code
*
* pseudo-code:
* int rom_patch(qspi_config_t *base)
* {
* volatile uint32_t *qspi_flshcr_reg = (volatile uint32_t*)QuadSPI0_FLSHCR_BASE;
*
* // Set QuadSPI_FLSHCR[TDH] to given parameters.
* *qspi_flshcr_reg &= (uint32_t)~QuadSPI_FLSHCR_TDH_MASK;
* *qspi_flshcr_reg |= (base->data_hold_time)<<QuadSPI0_FLSHCR_TDH_SHIFT;
*
* return kStatus_Success;
}
*/
#if defined(__IAR_SYSTEMS_ICC__)
/* Pragma to place the rom patch code on correct location defined in linker file. */
#pragma language = extended
#pragma section = "rom_patch_code"
const uint8_t s_rom_patch[124] @"rom_patch_code" =
#elif defined(__GNUC__)
__attribute__((section("rom_patch_code"))) const uint8_t s_rom_patch[124] __attribute__((used)) =
#elif defined(__CC_ARM)
__attribute__((section("rom_patch_code"))) const uint8_t s_rom_patch[124] __attribute__((used)) =
#else
#error Unsupported compiler!
#endif
{ 0x10, 0xB5, 0x01, 0x00, 0x17, 0x4A, 0x10, 0x00, 0x18, 0x30, 0x17, 0x4B, 0x1B, 0x68, 0xDB, 0x00, 0x02, 0xD5,
0x16, 0x4A, 0x10, 0x00, 0x18, 0x30, 0x13, 0x68, 0x15, 0x4C, 0x1C, 0x40, 0x14, 0x60, 0x13, 0x68, 0x0C, 0x69,
0x24, 0x04, 0x1C, 0x43, 0x14, 0x60, 0x02, 0x68, 0x11, 0x4B, 0x13, 0x40, 0x03, 0x60, 0xDA, 0x22, 0x52, 0x00,
0x89, 0x18, 0x02, 0x68, 0x0B, 0x68, 0x1B, 0x04, 0xFC, 0x24, 0xA4, 0x03, 0x1C, 0x40, 0x14, 0x43, 0x04, 0x60,
0x02, 0x68, 0x0B, 0x4B, 0x13, 0x40, 0x03, 0x60, 0x02, 0x68, 0x49, 0x68, 0x09, 0x06, 0xFC, 0x23, 0x9B, 0x05,
0x0B, 0x40, 0x13, 0x43, 0x03, 0x60, 0x00, 0x20, 0x10, 0xBD, 0x0C, 0xA0, 0x0D, 0x40, 0x24, 0x80, 0x04, 0x40,
0x0C, 0xA0, 0x05, 0x40, 0xFF, 0xFF, 0xFC, 0xFF, 0xFF, 0xFF, 0xC0, 0xFF, 0xFF, 0xFF, 0xFF, 0xC0 };
/*
* ROM patch handler for ROM patch code execution.
*/
#if defined(__IAR_SYSTEMS_ICC__)
/* Pragma to place the ROM_PatchHandler on correct location defined in linker file. */
#pragma language = extended
#pragma section = "BootloaderPatchHandler"
void ROM_PatchHandler(void) @"BootloaderPatchHandler"
#elif defined(__GNUC__)
__attribute__((section("BootloaderPatchHandler"))) void ROM_PatchHandler(void)
#elif defined(__CC_ARM)
__attribute__((section("BootloaderPatchHandler"))) void ROM_PatchHandler(void)
#else
#error Unsupported compiler!
#endif
{
typedef int (*patch_handler_t)(uint32_t);
#if defined(__IAR_SYSTEMS_ICC__)
uint32_t s_rom_patch_start = (uint32_t)__section_begin("rom_patch_code");
#elif defined(__CC_ARM)
extern uint32_t Load$$EXEC_m_rom_patch_code$$Base[];
uint32_t s_rom_patch_start = (uint32_t)&Load$$EXEC_m_rom_patch_code$$Base;
#elif defined(__GNUC__)
extern uint32_t rom_patch_code_start[];
uint32_t s_rom_patch_start = (uint32_t)&rom_patch_code_start;
#endif
uint32_t patch_start = s_rom_patch_start + 1;
patch_handler_t patch_run = (patch_handler_t)patch_start;
patch_run(BootloaderConfig.qspiConfigBlockPtr);
}
/* ----------------------------------------------------------------------------
-- SystemInit()
---------------------------------------------------------------------------- */
void SystemInit(void)
{
#if ((__FPU_PRESENT == 1) && (__FPU_USED == 1))
SCB->CPACR |= ((3UL << 10 * 2) | (3UL << 11 * 2)); /* set CP10, CP11 Full Access */
#endif /* ((__FPU_PRESENT == 1) && (__FPU_USED == 1)) */
}
@@ -0,0 +1,463 @@
; * ---------------------------------------------------------------------------------------
; * @file: startup_MKL82Z7.s
; * @purpose: CMSIS Cortex-M0P Core Device Startup File
; * MKL82Z7
; * @version: 1.4
; * @date: 2015-8-28
; * @build: b150910
; * ---------------------------------------------------------------------------------------
; *
; * Copyright (c) 1997 - 2015 , Freescale Semiconductor, Inc.
; * All rights reserved.
; *
; * Redistribution and use in source and binary forms, with or without modification,
; * are permitted provided that the following conditions are met:
; *
; * o Redistributions of source code must retain the above copyright notice, this list
; * of conditions and the following disclaimer.
; *
; * o 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.
; *
; * o Neither the name of Freescale Semiconductor, Inc. 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.
; *
; *------- <<< 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 0 ;Reserved
DCD 0 ;Reserved
DCD 0 ;Reserved
DCD 0 ;Reserved
DCD 0 ;Reserved
DCD 0 ;Reserved
DCD 0 ;Reserved
DCD SVC_Handler ;SVCall Handler
DCD 0 ;Reserved
DCD 0 ;Reserved
DCD PendSV_Handler ;PendSV Handler
DCD SysTick_Handler ;SysTick Handler
;External Interrupts
DCD DMA0_DMA4_IRQHandler ;DMA channel 0, 4 transfer complete
DCD DMA1_DMA5_IRQHandler ;DMA channel 1, 5 transfer complete
DCD DMA2_DMA6_IRQHandler ;DMA channel 2, 6 transfer complete
DCD DMA3_DMA7_IRQHandler ;DMA channel 3, 7 transfer complete
DCD DMA_Error_IRQHandler ;DMA channel 0 - 7 error
DCD FLEXIO0_IRQHandler ;Flexible IO
DCD TPM0_IRQHandler ;Timer/PWM module 0
DCD TPM1_IRQHandler ;Timer/PWM module 1
DCD TPM2_IRQHandler ;Timer/PWM module 2
DCD PIT0_IRQHandler ;Periodic Interrupt Timer 0
DCD SPI0_IRQHandler ;Serial Peripheral Interface 0
DCD EMVSIM0_IRQHandler ;EMVSIM0 common interrupt
DCD LPUART0_IRQHandler ;LPUART0 status and error
DCD LPUART1_IRQHandler ;LPUART1 status and error
DCD I2C0_IRQHandler ;Inter-Integrated Circuit 0
DCD QSPI0_IRQHandler ;QuadSPI0 interrupt
DCD Reserved32_IRQHandler ;DryIce tamper detect
DCD PORTA_IRQHandler ;Pin detect Port A
DCD PORTB_IRQHandler ;Pin detect Port B
DCD PORTC_IRQHandler ;Pin detect Port C
DCD PORTD_IRQHandler ;Pin detect Port D
DCD PORTE_IRQHandler ;Pin detect Port E
DCD LLWU_IRQHandler ;Low Leakage Wakeup
DCD LTC0_IRQHandler ;Low power trusted cryptographic
DCD USB0_IRQHandler ;USB OTG interrupt
DCD ADC0_IRQHandler ;Analog-to-Digital Converter 0
DCD LPTMR0_IRQHandler ;Low-Power Timer 0
DCD RTC_Seconds_IRQHandler ;RTC seconds
DCD INTMUX0_0_IRQHandler ;Selectable peripheral interrupt INTMUX0-0
DCD INTMUX0_1_IRQHandler ;Selectable peripheral interrupt INTMUX0-1
DCD INTMUX0_2_IRQHandler ;Selectable peripheral interrupt INTMUX0-2
DCD INTMUX0_3_IRQHandler ;Selectable peripheral interrupt INTMUX0-3
DCD LPTMR1_IRQHandler ;Low-Power Timer 1 (INTMUX source IRQ0)
DCD Reserved49_IRQHandler ;Reserved interrupt (INTMUX source IRQ1)
DCD Reserved50_IRQHandler ;Reserved interrupt (INTMUX source IRQ2)
DCD Reserved51_IRQHandler ;Reserved interrupt (INTMUX source IRQ3)
DCD SPI1_IRQHandler ;Serial Peripheral Interface 1 (INTMUX source IRQ4)
DCD LPUART2_IRQHandler ;LPUART2 status and error (INTMUX source IRQ5)
DCD EMVSIM1_IRQHandler ;EMVSIM1 common interrupt (INTMUX source IRQ6)
DCD I2C1_IRQHandler ;Inter-Integrated Circuit 1 (INTMUX source IRQ7)
DCD TSI0_IRQHandler ;Touch Sensing Input 0 (INTMUX source IRQ8)
DCD PMC_IRQHandler ;PMC controller low-voltage detect, low-voltage warning (INTMUX source IRQ9)
DCD FTFA_IRQHandler ;FTFA command complete/read collision (INTMUX source IRQ10)
DCD MCG_IRQHandler ;Multipurpose clock generator (INTMUX source IRQ11)
DCD WDOG_EWM_IRQHandler ;Single interrupt vector for WDOG and EWM (INTMUX source IRQ12)
DCD DAC0_IRQHandler ;Digital-to-analog converter 0 (INTMUX source IRQ13)
DCD TRNG0_IRQHandler ;True randon number generator (INTMUX source IRQ14)
DCD Reserved63_IRQHandler ;Reserved interrupt (INTMUX source IRQ15)
DCD CMP0_IRQHandler ;Comparator 0 (INTMUX source IRQ16)
DCD Reserved65_IRQHandler ;Reserved interrupt (INTMUX source IRQ17)
DCD RTC_Alarm_IRQHandler ;Real time clock (INTMUX source IRQ18)
DCD Reserved67_IRQHandler ;Reserved interrupt (INTMUX source IRQ19)
DCD Reserved68_IRQHandler ;Reserved interrupt (INTMUX source IRQ20)
DCD Reserved69_IRQHandler ;Reserved interrupt (INTMUX source IRQ21)
DCD Reserved70_IRQHandler ;Reserved interrupt (INTMUX source IRQ22)
DCD Reserved71_IRQHandler ;Reserved interrupt (INTMUX source IRQ23)
DCD DMA4_IRQHandler ;DMA channel 4 transfer complete (INTMUX source IRQ24)
DCD DMA5_IRQHandler ;DMA channel 5 transfer complete (INTMUX source IRQ25)
DCD DMA6_IRQHandler ;DMA channel 6 transfer complete (INTMUX source IRQ26)
DCD DMA7_IRQHandler ;DMA channel 7 transfer complete (INTMUX source IRQ27)
DCD Reserved76_IRQHandler ;Reserved interrupt (INTMUX source IRQ28)
DCD Reserved77_IRQHandler ;Reserved interrupt (INTMUX source IRQ29)
DCD Reserved78_IRQHandler ;Reserved interrupt (INTMUX source IRQ30)
DCD Reserved79_IRQHandler ;Reserved interrupt (INTMUX source IRQ31)
__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 access to the FTFL module.
; <h> Backdoor Comparison Key
; <o0> Backdoor Comparison Key 0. <0x0-0xFF:2>
; <o1> Backdoor Comparison Key 1. <0x0-0xFF:2>
; <o2> Backdoor Comparison Key 2. <0x0-0xFF:2>
; <o3> Backdoor Comparison Key 3. <0x0-0xFF:2>
; <o4> Backdoor Comparison Key 4. <0x0-0xFF:2>
; <o5> Backdoor Comparison Key 5. <0x0-0xFF:2>
; <o6> Backdoor Comparison Key 6. <0x0-0xFF:2>
; <o7> Backdoor Comparison 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 Region Protect Register 0
; <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> 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> BOOTPIN_OPT
; <0=> Force Boot from ROM if BOOTCFG0 asserted, where BOOTCFG0 is the boot config function which is muxed with NMI pin
; <1=> Boot source configured by FOPT (BOOTSRC_SEL) bits
; <o.2> NMI_DIS
; <0=> NMI interrupts are always blocked
; <1=> NMI_b pin/interrupts reset default to enabled
; <o.5> FAST_INIT
; <0=> Slower initialization
; <1=> Fast Initialization
; <o.6..7> BOOTSRC_SEL
; <0=> Boot from Flash
; <2=> Boot from ROM, configure QSPI0, and enter boot loader mode.
; <3=> Boot from ROM and enter boot loader mode.
; <i> Boot source selection
FOPT EQU 0x3D
; </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
; <o.2..3> FSLACC
; <2=> Freescale factory access denied
; <3=> Freescale factory access granted
; <i> Freescale Failure Analysis Access Code
; <o.4..5> MEEN
; <2=> Mass erase is disabled
; <3=> Mass erase is enabled
; <o.6..7> KEYEN
; <2=> Backdoor key access enabled
; <3=> Backdoor key access disabled
; <i> Backdoor Key Security Enable
FSEC EQU 0xFE
; </h>
; </h>
IF :LNOT::DEF:RAM_TARGET
AREA FlashConfig, DATA, READONLY
__FlashConfig
DCB BackDoorK0, BackDoorK1, BackDoorK2, BackDoorK3
DCB BackDoorK4, BackDoorK5, BackDoorK6, BackDoorK7
DCB FPROT0 , FPROT1 , FPROT2 , FPROT3
DCB FSEC , FOPT , 0xFF , 0xFF
ENDIF
AREA |.text|, CODE, READONLY
; Reset Handler
Reset_Handler PROC
EXPORT Reset_Handler [WEAK]
IMPORT SystemInit
IMPORT init_data_bss
IMPORT __main
IF :LNOT::DEF:RAM_TARGET
REQUIRE FlashConfig
ENDIF
CPSID I ; Mask interrupts
LDR R0, =SystemInit
BLX R0
LDR R0, =init_data_bss
BLX R0
CPSIE i ; Unmask interrupts
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
SVC_Handler\
PROC
EXPORT SVC_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_DMA4_IRQHandler [WEAK]
EXPORT DMA1_DMA5_IRQHandler [WEAK]
EXPORT DMA2_DMA6_IRQHandler [WEAK]
EXPORT DMA3_DMA7_IRQHandler [WEAK]
EXPORT DMA_Error_IRQHandler [WEAK]
EXPORT FLEXIO0_IRQHandler [WEAK]
EXPORT TPM0_IRQHandler [WEAK]
EXPORT TPM1_IRQHandler [WEAK]
EXPORT TPM2_IRQHandler [WEAK]
EXPORT PIT0_IRQHandler [WEAK]
EXPORT SPI0_IRQHandler [WEAK]
EXPORT EMVSIM0_IRQHandler [WEAK]
EXPORT LPUART0_IRQHandler [WEAK]
EXPORT LPUART1_IRQHandler [WEAK]
EXPORT I2C0_IRQHandler [WEAK]
EXPORT QSPI0_IRQHandler [WEAK]
EXPORT Reserved32_IRQHandler [WEAK]
EXPORT PORTA_IRQHandler [WEAK]
EXPORT PORTB_IRQHandler [WEAK]
EXPORT PORTC_IRQHandler [WEAK]
EXPORT PORTD_IRQHandler [WEAK]
EXPORT PORTE_IRQHandler [WEAK]
EXPORT LLWU_IRQHandler [WEAK]
EXPORT LTC0_IRQHandler [WEAK]
EXPORT USB0_IRQHandler [WEAK]
EXPORT ADC0_IRQHandler [WEAK]
EXPORT LPTMR0_IRQHandler [WEAK]
EXPORT RTC_Seconds_IRQHandler [WEAK]
EXPORT INTMUX0_0_IRQHandler [WEAK]
EXPORT INTMUX0_1_IRQHandler [WEAK]
EXPORT INTMUX0_2_IRQHandler [WEAK]
EXPORT INTMUX0_3_IRQHandler [WEAK]
EXPORT LPTMR1_IRQHandler [WEAK]
EXPORT Reserved49_IRQHandler [WEAK]
EXPORT Reserved50_IRQHandler [WEAK]
EXPORT Reserved51_IRQHandler [WEAK]
EXPORT SPI1_IRQHandler [WEAK]
EXPORT LPUART2_IRQHandler [WEAK]
EXPORT EMVSIM1_IRQHandler [WEAK]
EXPORT I2C1_IRQHandler [WEAK]
EXPORT TSI0_IRQHandler [WEAK]
EXPORT PMC_IRQHandler [WEAK]
EXPORT FTFA_IRQHandler [WEAK]
EXPORT MCG_IRQHandler [WEAK]
EXPORT WDOG_EWM_IRQHandler [WEAK]
EXPORT DAC0_IRQHandler [WEAK]
EXPORT TRNG0_IRQHandler [WEAK]
EXPORT Reserved63_IRQHandler [WEAK]
EXPORT CMP0_IRQHandler [WEAK]
EXPORT Reserved65_IRQHandler [WEAK]
EXPORT RTC_Alarm_IRQHandler [WEAK]
EXPORT Reserved67_IRQHandler [WEAK]
EXPORT Reserved68_IRQHandler [WEAK]
EXPORT Reserved69_IRQHandler [WEAK]
EXPORT Reserved70_IRQHandler [WEAK]
EXPORT Reserved71_IRQHandler [WEAK]
EXPORT DMA4_IRQHandler [WEAK]
EXPORT DMA5_IRQHandler [WEAK]
EXPORT DMA6_IRQHandler [WEAK]
EXPORT DMA7_IRQHandler [WEAK]
EXPORT Reserved76_IRQHandler [WEAK]
EXPORT Reserved77_IRQHandler [WEAK]
EXPORT Reserved78_IRQHandler [WEAK]
EXPORT Reserved79_IRQHandler [WEAK]
EXPORT DefaultISR [WEAK]
DMA0_DMA4_IRQHandler
DMA1_DMA5_IRQHandler
DMA2_DMA6_IRQHandler
DMA3_DMA7_IRQHandler
DMA_Error_IRQHandler
FLEXIO0_IRQHandler
TPM0_IRQHandler
TPM1_IRQHandler
TPM2_IRQHandler
PIT0_IRQHandler
SPI0_IRQHandler
EMVSIM0_IRQHandler
LPUART0_IRQHandler
LPUART1_IRQHandler
I2C0_IRQHandler
QSPI0_IRQHandler
Reserved32_IRQHandler
PORTA_IRQHandler
PORTB_IRQHandler
PORTC_IRQHandler
PORTD_IRQHandler
PORTE_IRQHandler
LLWU_IRQHandler
LTC0_IRQHandler
USB0_IRQHandler
ADC0_IRQHandler
LPTMR0_IRQHandler
RTC_Seconds_IRQHandler
INTMUX0_0_IRQHandler
INTMUX0_1_IRQHandler
INTMUX0_2_IRQHandler
INTMUX0_3_IRQHandler
LPTMR1_IRQHandler
Reserved49_IRQHandler
Reserved50_IRQHandler
Reserved51_IRQHandler
SPI1_IRQHandler
LPUART2_IRQHandler
EMVSIM1_IRQHandler
I2C1_IRQHandler
TSI0_IRQHandler
PMC_IRQHandler
FTFA_IRQHandler
MCG_IRQHandler
WDOG_EWM_IRQHandler
DAC0_IRQHandler
TRNG0_IRQHandler
Reserved63_IRQHandler
CMP0_IRQHandler
Reserved65_IRQHandler
RTC_Alarm_IRQHandler
Reserved67_IRQHandler
Reserved68_IRQHandler
Reserved69_IRQHandler
Reserved70_IRQHandler
Reserved71_IRQHandler
DMA4_IRQHandler
DMA5_IRQHandler
DMA6_IRQHandler
DMA7_IRQHandler
Reserved76_IRQHandler
Reserved77_IRQHandler
Reserved78_IRQHandler
Reserved79_IRQHandler
DefaultISR
LDR R0, =DefaultISR
BX R0
ENDP
ALIGN
END
@@ -0,0 +1,463 @@
; * ---------------------------------------------------------------------------------------
; * @file: startup_MKL82Z7.s
; * @purpose: CMSIS Cortex-M0P Core Device Startup File
; * MKL82Z7
; * @version: 1.4
; * @date: 2015-8-28
; * @build: b150910
; * ---------------------------------------------------------------------------------------
; *
; * Copyright (c) 1997 - 2015 , Freescale Semiconductor, Inc.
; * All rights reserved.
; *
; * Redistribution and use in source and binary forms, with or without modification,
; * are permitted provided that the following conditions are met:
; *
; * o Redistributions of source code must retain the above copyright notice, this list
; * of conditions and the following disclaimer.
; *
; * o 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.
; *
; * o Neither the name of Freescale Semiconductor, Inc. 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.
; *
; *------- <<< 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 0 ;Reserved
DCD 0 ;Reserved
DCD 0 ;Reserved
DCD 0 ;Reserved
DCD 0 ;Reserved
DCD 0 ;Reserved
DCD 0 ;Reserved
DCD SVC_Handler ;SVCall Handler
DCD 0 ;Reserved
DCD 0 ;Reserved
DCD PendSV_Handler ;PendSV Handler
DCD SysTick_Handler ;SysTick Handler
;External Interrupts
DCD DMA0_DMA4_IRQHandler ;DMA channel 0, 4 transfer complete
DCD DMA1_DMA5_IRQHandler ;DMA channel 1, 5 transfer complete
DCD DMA2_DMA6_IRQHandler ;DMA channel 2, 6 transfer complete
DCD DMA3_DMA7_IRQHandler ;DMA channel 3, 7 transfer complete
DCD DMA_Error_IRQHandler ;DMA channel 0 - 7 error
DCD FLEXIO0_IRQHandler ;Flexible IO
DCD TPM0_IRQHandler ;Timer/PWM module 0
DCD TPM1_IRQHandler ;Timer/PWM module 1
DCD TPM2_IRQHandler ;Timer/PWM module 2
DCD PIT0_IRQHandler ;Periodic Interrupt Timer 0
DCD SPI0_IRQHandler ;Serial Peripheral Interface 0
DCD EMVSIM0_IRQHandler ;EMVSIM0 common interrupt
DCD LPUART0_IRQHandler ;LPUART0 status and error
DCD LPUART1_IRQHandler ;LPUART1 status and error
DCD I2C0_IRQHandler ;Inter-Integrated Circuit 0
DCD QSPI0_IRQHandler ;QuadSPI0 interrupt
DCD Reserved32_IRQHandler ;DryIce tamper detect
DCD PORTA_IRQHandler ;Pin detect Port A
DCD PORTB_IRQHandler ;Pin detect Port B
DCD PORTC_IRQHandler ;Pin detect Port C
DCD PORTD_IRQHandler ;Pin detect Port D
DCD PORTE_IRQHandler ;Pin detect Port E
DCD LLWU_IRQHandler ;Low Leakage Wakeup
DCD LTC0_IRQHandler ;Low power trusted cryptographic
DCD USB0_IRQHandler ;USB OTG interrupt
DCD ADC0_IRQHandler ;Analog-to-Digital Converter 0
DCD LPTMR0_IRQHandler ;Low-Power Timer 0
DCD RTC_Seconds_IRQHandler ;RTC seconds
DCD INTMUX0_0_IRQHandler ;Selectable peripheral interrupt INTMUX0-0
DCD INTMUX0_1_IRQHandler ;Selectable peripheral interrupt INTMUX0-1
DCD INTMUX0_2_IRQHandler ;Selectable peripheral interrupt INTMUX0-2
DCD INTMUX0_3_IRQHandler ;Selectable peripheral interrupt INTMUX0-3
DCD LPTMR1_IRQHandler ;Low-Power Timer 1 (INTMUX source IRQ0)
DCD Reserved49_IRQHandler ;Reserved interrupt (INTMUX source IRQ1)
DCD Reserved50_IRQHandler ;Reserved interrupt (INTMUX source IRQ2)
DCD Reserved51_IRQHandler ;Reserved interrupt (INTMUX source IRQ3)
DCD SPI1_IRQHandler ;Serial Peripheral Interface 1 (INTMUX source IRQ4)
DCD LPUART2_IRQHandler ;LPUART2 status and error (INTMUX source IRQ5)
DCD EMVSIM1_IRQHandler ;EMVSIM1 common interrupt (INTMUX source IRQ6)
DCD I2C1_IRQHandler ;Inter-Integrated Circuit 1 (INTMUX source IRQ7)
DCD TSI0_IRQHandler ;Touch Sensing Input 0 (INTMUX source IRQ8)
DCD PMC_IRQHandler ;PMC controller low-voltage detect, low-voltage warning (INTMUX source IRQ9)
DCD FTFA_IRQHandler ;FTFA command complete/read collision (INTMUX source IRQ10)
DCD MCG_IRQHandler ;Multipurpose clock generator (INTMUX source IRQ11)
DCD WDOG_EWM_IRQHandler ;Single interrupt vector for WDOG and EWM (INTMUX source IRQ12)
DCD DAC0_IRQHandler ;Digital-to-analog converter 0 (INTMUX source IRQ13)
DCD TRNG0_IRQHandler ;True randon number generator (INTMUX source IRQ14)
DCD Reserved63_IRQHandler ;Reserved interrupt (INTMUX source IRQ15)
DCD CMP0_IRQHandler ;Comparator 0 (INTMUX source IRQ16)
DCD Reserved65_IRQHandler ;Reserved interrupt (INTMUX source IRQ17)
DCD RTC_Alarm_IRQHandler ;Real time clock (INTMUX source IRQ18)
DCD Reserved67_IRQHandler ;Reserved interrupt (INTMUX source IRQ19)
DCD Reserved68_IRQHandler ;Reserved interrupt (INTMUX source IRQ20)
DCD Reserved69_IRQHandler ;Reserved interrupt (INTMUX source IRQ21)
DCD Reserved70_IRQHandler ;Reserved interrupt (INTMUX source IRQ22)
DCD Reserved71_IRQHandler ;Reserved interrupt (INTMUX source IRQ23)
DCD DMA4_IRQHandler ;DMA channel 4 transfer complete (INTMUX source IRQ24)
DCD DMA5_IRQHandler ;DMA channel 5 transfer complete (INTMUX source IRQ25)
DCD DMA6_IRQHandler ;DMA channel 6 transfer complete (INTMUX source IRQ26)
DCD DMA7_IRQHandler ;DMA channel 7 transfer complete (INTMUX source IRQ27)
DCD Reserved76_IRQHandler ;Reserved interrupt (INTMUX source IRQ28)
DCD Reserved77_IRQHandler ;Reserved interrupt (INTMUX source IRQ29)
DCD Reserved78_IRQHandler ;Reserved interrupt (INTMUX source IRQ30)
DCD Reserved79_IRQHandler ;Reserved interrupt (INTMUX source IRQ31)
__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 access to the FTFL module.
; <h> Backdoor Comparison Key
; <o0> Backdoor Comparison Key 0. <0x0-0xFF:2>
; <o1> Backdoor Comparison Key 1. <0x0-0xFF:2>
; <o2> Backdoor Comparison Key 2. <0x0-0xFF:2>
; <o3> Backdoor Comparison Key 3. <0x0-0xFF:2>
; <o4> Backdoor Comparison Key 4. <0x0-0xFF:2>
; <o5> Backdoor Comparison Key 5. <0x0-0xFF:2>
; <o6> Backdoor Comparison Key 6. <0x0-0xFF:2>
; <o7> Backdoor Comparison 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 Region Protect Register 0
; <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> 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> BOOTPIN_OPT
; <0=> Force Boot from ROM if BOOTCFG0 asserted, where BOOTCFG0 is the boot config function which is muxed with NMI pin
; <1=> Boot source configured by FOPT (BOOTSRC_SEL) bits
; <o.2> NMI_DIS
; <0=> NMI interrupts are always blocked
; <1=> NMI_b pin/interrupts reset default to enabled
; <o.5> FAST_INIT
; <0=> Slower initialization
; <1=> Fast Initialization
; <o.6..7> BOOTSRC_SEL
; <0=> Boot from Flash
; <2=> Boot from ROM, configure QSPI0, and enter boot loader mode.
; <3=> Boot from ROM and enter boot loader mode.
; <i> Boot source selection
FOPT EQU 0xBD
; </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
; <o.2..3> FSLACC
; <2=> Freescale factory access denied
; <3=> Freescale factory access granted
; <i> Freescale Failure Analysis Access Code
; <o.4..5> MEEN
; <2=> Mass erase is disabled
; <3=> Mass erase is enabled
; <o.6..7> KEYEN
; <2=> Backdoor key access enabled
; <3=> Backdoor key access disabled
; <i> Backdoor Key Security Enable
FSEC EQU 0xFE
; </h>
; </h>
IF :LNOT::DEF:RAM_TARGET
AREA FlashConfig, DATA, READONLY
__FlashConfig
DCB BackDoorK0, BackDoorK1, BackDoorK2, BackDoorK3
DCB BackDoorK4, BackDoorK5, BackDoorK6, BackDoorK7
DCB FPROT0 , FPROT1 , FPROT2 , FPROT3
DCB FSEC , FOPT , 0xFF , 0xFF
ENDIF
AREA |.text|, CODE, READONLY
; Reset Handler
Reset_Handler PROC
EXPORT Reset_Handler [WEAK]
IMPORT SystemInit
IMPORT init_data_bss
IMPORT __main
IF :LNOT::DEF:RAM_TARGET
REQUIRE FlashConfig
ENDIF
CPSID I ; Mask interrupts
LDR R0, =SystemInit
BLX R0
LDR R0, =init_data_bss
BLX R0
CPSIE i ; Unmask interrupts
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
SVC_Handler\
PROC
EXPORT SVC_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_DMA4_IRQHandler [WEAK]
EXPORT DMA1_DMA5_IRQHandler [WEAK]
EXPORT DMA2_DMA6_IRQHandler [WEAK]
EXPORT DMA3_DMA7_IRQHandler [WEAK]
EXPORT DMA_Error_IRQHandler [WEAK]
EXPORT FLEXIO0_IRQHandler [WEAK]
EXPORT TPM0_IRQHandler [WEAK]
EXPORT TPM1_IRQHandler [WEAK]
EXPORT TPM2_IRQHandler [WEAK]
EXPORT PIT0_IRQHandler [WEAK]
EXPORT SPI0_IRQHandler [WEAK]
EXPORT EMVSIM0_IRQHandler [WEAK]
EXPORT LPUART0_IRQHandler [WEAK]
EXPORT LPUART1_IRQHandler [WEAK]
EXPORT I2C0_IRQHandler [WEAK]
EXPORT QSPI0_IRQHandler [WEAK]
EXPORT Reserved32_IRQHandler [WEAK]
EXPORT PORTA_IRQHandler [WEAK]
EXPORT PORTB_IRQHandler [WEAK]
EXPORT PORTC_IRQHandler [WEAK]
EXPORT PORTD_IRQHandler [WEAK]
EXPORT PORTE_IRQHandler [WEAK]
EXPORT LLWU_IRQHandler [WEAK]
EXPORT LTC0_IRQHandler [WEAK]
EXPORT USB0_IRQHandler [WEAK]
EXPORT ADC0_IRQHandler [WEAK]
EXPORT LPTMR0_IRQHandler [WEAK]
EXPORT RTC_Seconds_IRQHandler [WEAK]
EXPORT INTMUX0_0_IRQHandler [WEAK]
EXPORT INTMUX0_1_IRQHandler [WEAK]
EXPORT INTMUX0_2_IRQHandler [WEAK]
EXPORT INTMUX0_3_IRQHandler [WEAK]
EXPORT LPTMR1_IRQHandler [WEAK]
EXPORT Reserved49_IRQHandler [WEAK]
EXPORT Reserved50_IRQHandler [WEAK]
EXPORT Reserved51_IRQHandler [WEAK]
EXPORT SPI1_IRQHandler [WEAK]
EXPORT LPUART2_IRQHandler [WEAK]
EXPORT EMVSIM1_IRQHandler [WEAK]
EXPORT I2C1_IRQHandler [WEAK]
EXPORT TSI0_IRQHandler [WEAK]
EXPORT PMC_IRQHandler [WEAK]
EXPORT FTFA_IRQHandler [WEAK]
EXPORT MCG_IRQHandler [WEAK]
EXPORT WDOG_EWM_IRQHandler [WEAK]
EXPORT DAC0_IRQHandler [WEAK]
EXPORT TRNG0_IRQHandler [WEAK]
EXPORT Reserved63_IRQHandler [WEAK]
EXPORT CMP0_IRQHandler [WEAK]
EXPORT Reserved65_IRQHandler [WEAK]
EXPORT RTC_Alarm_IRQHandler [WEAK]
EXPORT Reserved67_IRQHandler [WEAK]
EXPORT Reserved68_IRQHandler [WEAK]
EXPORT Reserved69_IRQHandler [WEAK]
EXPORT Reserved70_IRQHandler [WEAK]
EXPORT Reserved71_IRQHandler [WEAK]
EXPORT DMA4_IRQHandler [WEAK]
EXPORT DMA5_IRQHandler [WEAK]
EXPORT DMA6_IRQHandler [WEAK]
EXPORT DMA7_IRQHandler [WEAK]
EXPORT Reserved76_IRQHandler [WEAK]
EXPORT Reserved77_IRQHandler [WEAK]
EXPORT Reserved78_IRQHandler [WEAK]
EXPORT Reserved79_IRQHandler [WEAK]
EXPORT DefaultISR [WEAK]
DMA0_DMA4_IRQHandler
DMA1_DMA5_IRQHandler
DMA2_DMA6_IRQHandler
DMA3_DMA7_IRQHandler
DMA_Error_IRQHandler
FLEXIO0_IRQHandler
TPM0_IRQHandler
TPM1_IRQHandler
TPM2_IRQHandler
PIT0_IRQHandler
SPI0_IRQHandler
EMVSIM0_IRQHandler
LPUART0_IRQHandler
LPUART1_IRQHandler
I2C0_IRQHandler
QSPI0_IRQHandler
Reserved32_IRQHandler
PORTA_IRQHandler
PORTB_IRQHandler
PORTC_IRQHandler
PORTD_IRQHandler
PORTE_IRQHandler
LLWU_IRQHandler
LTC0_IRQHandler
USB0_IRQHandler
ADC0_IRQHandler
LPTMR0_IRQHandler
RTC_Seconds_IRQHandler
INTMUX0_0_IRQHandler
INTMUX0_1_IRQHandler
INTMUX0_2_IRQHandler
INTMUX0_3_IRQHandler
LPTMR1_IRQHandler
Reserved49_IRQHandler
Reserved50_IRQHandler
Reserved51_IRQHandler
SPI1_IRQHandler
LPUART2_IRQHandler
EMVSIM1_IRQHandler
I2C1_IRQHandler
TSI0_IRQHandler
PMC_IRQHandler
FTFA_IRQHandler
MCG_IRQHandler
WDOG_EWM_IRQHandler
DAC0_IRQHandler
TRNG0_IRQHandler
Reserved63_IRQHandler
CMP0_IRQHandler
Reserved65_IRQHandler
RTC_Alarm_IRQHandler
Reserved67_IRQHandler
Reserved68_IRQHandler
Reserved69_IRQHandler
Reserved70_IRQHandler
Reserved71_IRQHandler
DMA4_IRQHandler
DMA5_IRQHandler
DMA6_IRQHandler
DMA7_IRQHandler
Reserved76_IRQHandler
Reserved77_IRQHandler
Reserved78_IRQHandler
Reserved79_IRQHandler
DefaultISR
LDR R0, =DefaultISR
BX R0
ENDP
ALIGN
END
@@ -0,0 +1,467 @@
; * ---------------------------------------------------------------------------------------
; * @file: startup_MKL82Z7.s
; * @purpose: CMSIS Cortex-M0P Core Device Startup File
; * MKL82Z7
; * @version: 1.4
; * @date: 2015-8-28
; * @build: b150910
; * ---------------------------------------------------------------------------------------
; *
; * Copyright (c) 1997 - 2015 , Freescale Semiconductor, Inc.
; * All rights reserved.
; *
; * Redistribution and use in source and binary forms, with or without modification,
; * are permitted provided that the following conditions are met:
; *
; * o Redistributions of source code must retain the above copyright notice, this list
; * of conditions and the following disclaimer.
; *
; * o 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.
; *
; * o Neither the name of Freescale Semiconductor, Inc. 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.
; *
; *------- <<< 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 0 ;Reserved
DCD 0 ;Reserved
DCD 0 ;Reserved
DCD 0 ;Reserved
DCD 0 ;Reserved
DCD 0 ;Reserved
DCD 0 ;Reserved
DCD SVC_Handler ;SVCall Handler
DCD 0 ;Reserved
DCD 0 ;Reserved
DCD PendSV_Handler ;PendSV Handler
DCD SysTick_Handler ;SysTick Handler
;External Interrupts
DCD DMA0_DMA4_IRQHandler ;DMA channel 0, 4 transfer complete
DCD DMA1_DMA5_IRQHandler ;DMA channel 1, 5 transfer complete
DCD DMA2_DMA6_IRQHandler ;DMA channel 2, 6 transfer complete
DCD DMA3_DMA7_IRQHandler ;DMA channel 3, 7 transfer complete
DCD DMA_Error_IRQHandler ;DMA channel 0 - 7 error
DCD FLEXIO0_IRQHandler ;Flexible IO
DCD TPM0_IRQHandler ;Timer/PWM module 0
DCD TPM1_IRQHandler ;Timer/PWM module 1
DCD TPM2_IRQHandler ;Timer/PWM module 2
DCD PIT0_IRQHandler ;Periodic Interrupt Timer 0
DCD SPI0_IRQHandler ;Serial Peripheral Interface 0
DCD EMVSIM0_IRQHandler ;EMVSIM0 common interrupt
DCD LPUART0_IRQHandler ;LPUART0 status and error
DCD LPUART1_IRQHandler ;LPUART1 status and error
DCD I2C0_IRQHandler ;Inter-Integrated Circuit 0
DCD QSPI0_IRQHandler ;QuadSPI0 interrupt
DCD Reserved32_IRQHandler ;DryIce tamper detect
DCD PORTA_IRQHandler ;Pin detect Port A
DCD PORTB_IRQHandler ;Pin detect Port B
DCD PORTC_IRQHandler ;Pin detect Port C
DCD PORTD_IRQHandler ;Pin detect Port D
DCD PORTE_IRQHandler ;Pin detect Port E
DCD LLWU_IRQHandler ;Low Leakage Wakeup
DCD LTC0_IRQHandler ;Low power trusted cryptographic
DCD USB0_IRQHandler ;USB OTG interrupt
DCD ADC0_IRQHandler ;Analog-to-Digital Converter 0
DCD LPTMR0_IRQHandler ;Low-Power Timer 0
DCD RTC_Seconds_IRQHandler ;RTC seconds
DCD INTMUX0_0_IRQHandler ;Selectable peripheral interrupt INTMUX0-0
DCD INTMUX0_1_IRQHandler ;Selectable peripheral interrupt INTMUX0-1
DCD INTMUX0_2_IRQHandler ;Selectable peripheral interrupt INTMUX0-2
DCD INTMUX0_3_IRQHandler ;Selectable peripheral interrupt INTMUX0-3
DCD LPTMR1_IRQHandler ;Low-Power Timer 1 (INTMUX source IRQ0)
DCD Reserved49_IRQHandler ;Reserved interrupt (INTMUX source IRQ1)
DCD Reserved50_IRQHandler ;Reserved interrupt (INTMUX source IRQ2)
DCD Reserved51_IRQHandler ;Reserved interrupt (INTMUX source IRQ3)
DCD SPI1_IRQHandler ;Serial Peripheral Interface 1 (INTMUX source IRQ4)
DCD LPUART2_IRQHandler ;LPUART2 status and error (INTMUX source IRQ5)
DCD EMVSIM1_IRQHandler ;EMVSIM1 common interrupt (INTMUX source IRQ6)
DCD I2C1_IRQHandler ;Inter-Integrated Circuit 1 (INTMUX source IRQ7)
DCD TSI0_IRQHandler ;Touch Sensing Input 0 (INTMUX source IRQ8)
DCD PMC_IRQHandler ;PMC controller low-voltage detect, low-voltage warning (INTMUX source IRQ9)
DCD FTFA_IRQHandler ;FTFA command complete/read collision (INTMUX source IRQ10)
DCD MCG_IRQHandler ;Multipurpose clock generator (INTMUX source IRQ11)
DCD WDOG_EWM_IRQHandler ;Single interrupt vector for WDOG and EWM (INTMUX source IRQ12)
DCD DAC0_IRQHandler ;Digital-to-analog converter 0 (INTMUX source IRQ13)
DCD TRNG0_IRQHandler ;True randon number generator (INTMUX source IRQ14)
DCD Reserved63_IRQHandler ;Reserved interrupt (INTMUX source IRQ15)
DCD CMP0_IRQHandler ;Comparator 0 (INTMUX source IRQ16)
DCD Reserved65_IRQHandler ;Reserved interrupt (INTMUX source IRQ17)
DCD RTC_Alarm_IRQHandler ;Real time clock (INTMUX source IRQ18)
DCD Reserved67_IRQHandler ;Reserved interrupt (INTMUX source IRQ19)
DCD Reserved68_IRQHandler ;Reserved interrupt (INTMUX source IRQ20)
DCD Reserved69_IRQHandler ;Reserved interrupt (INTMUX source IRQ21)
DCD Reserved70_IRQHandler ;Reserved interrupt (INTMUX source IRQ22)
DCD Reserved71_IRQHandler ;Reserved interrupt (INTMUX source IRQ23)
DCD DMA4_IRQHandler ;DMA channel 4 transfer complete (INTMUX source IRQ24)
DCD DMA5_IRQHandler ;DMA channel 5 transfer complete (INTMUX source IRQ25)
DCD DMA6_IRQHandler ;DMA channel 6 transfer complete (INTMUX source IRQ26)
DCD DMA7_IRQHandler ;DMA channel 7 transfer complete (INTMUX source IRQ27)
DCD Reserved76_IRQHandler ;Reserved interrupt (INTMUX source IRQ28)
DCD Reserved77_IRQHandler ;Reserved interrupt (INTMUX source IRQ29)
DCD Reserved78_IRQHandler ;Reserved interrupt (INTMUX source IRQ30)
DCD Reserved79_IRQHandler ;Reserved interrupt (INTMUX source IRQ31)
__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 access to the FTFL module.
; <h> Backdoor Comparison Key
; <o0> Backdoor Comparison Key 0. <0x0-0xFF:2>
; <o1> Backdoor Comparison Key 1. <0x0-0xFF:2>
; <o2> Backdoor Comparison Key 2. <0x0-0xFF:2>
; <o3> Backdoor Comparison Key 3. <0x0-0xFF:2>
; <o4> Backdoor Comparison Key 4. <0x0-0xFF:2>
; <o5> Backdoor Comparison Key 5. <0x0-0xFF:2>
; <o6> Backdoor Comparison Key 6. <0x0-0xFF:2>
; <o7> Backdoor Comparison 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 Region Protect Register 0
; <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> 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> BOOTPIN_OPT
; <0=> Force Boot from ROM if BOOTCFG0 asserted, where BOOTCFG0 is the boot config function which is muxed with NMI pin
; <1=> Boot source configured by FOPT (BOOTSRC_SEL) bits
; <o.2> NMI_DIS
; <0=> NMI interrupts are always blocked
; <1=> NMI_b pin/interrupts reset default to enabled
; <o.5> FAST_INIT
; <0=> Slower initialization
; <1=> Fast Initialization
; <o.6..7> BOOTSRC_SEL
; <0=> Boot from Flash
; <2=> Boot from ROM, configure QSPI0, and enter boot loader mode.
; <3=> Boot from ROM and enter boot loader mode.
; <i> Boot source selection
FOPT EQU 0xBD
; </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
; <o.2..3> FSLACC
; <2=> Freescale factory access denied
; <3=> Freescale factory access granted
; <i> Freescale Failure Analysis Access Code
; <o.4..5> MEEN
; <2=> Mass erase is disabled
; <3=> Mass erase is enabled
; <o.6..7> KEYEN
; <2=> Backdoor key access enabled
; <3=> Backdoor key access disabled
; <i> Backdoor Key Security Enable
FSEC EQU 0xFE
; </h>
; </h>
IF :LNOT::DEF:RAM_TARGET
AREA FlashConfig, DATA, READONLY
__FlashConfig
DCB BackDoorK0, BackDoorK1, BackDoorK2, BackDoorK3
DCB BackDoorK4, BackDoorK5, BackDoorK6, BackDoorK7
DCB FPROT0 , FPROT1 , FPROT2 , FPROT3
DCB FSEC , FOPT , 0xFF , 0xFF
ENDIF
; Reset Handler
AREA BootloaderPatchHandler, CODE, READONLY
Reset_Handler PROC
EXPORT Reset_Handler [WEAK]
IMPORT SystemInit
IMPORT init_data_bss
IMPORT ROM_PatchHandler
IMPORT __main
IF :LNOT::DEF:RAM_TARGET
LDR R0, =FlashConfig ; dummy read, workaround for flashConfig
ENDIF
CPSID I ; Mask interrupts
LDR R0, =ROM_PatchHandler
BLX R0
NOP
LDR R0, =SystemInit
BLX R0
LDR R0, =init_data_bss
BLX R0
CPSIE i ; Unmask interrupts
LDR R0, =__main
BX R0
ENDP
AREA |.text|, CODE, READONLY
; 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
SVC_Handler\
PROC
EXPORT SVC_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_DMA4_IRQHandler [WEAK]
EXPORT DMA1_DMA5_IRQHandler [WEAK]
EXPORT DMA2_DMA6_IRQHandler [WEAK]
EXPORT DMA3_DMA7_IRQHandler [WEAK]
EXPORT DMA_Error_IRQHandler [WEAK]
EXPORT FLEXIO0_IRQHandler [WEAK]
EXPORT TPM0_IRQHandler [WEAK]
EXPORT TPM1_IRQHandler [WEAK]
EXPORT TPM2_IRQHandler [WEAK]
EXPORT PIT0_IRQHandler [WEAK]
EXPORT SPI0_IRQHandler [WEAK]
EXPORT EMVSIM0_IRQHandler [WEAK]
EXPORT LPUART0_IRQHandler [WEAK]
EXPORT LPUART1_IRQHandler [WEAK]
EXPORT I2C0_IRQHandler [WEAK]
EXPORT QSPI0_IRQHandler [WEAK]
EXPORT Reserved32_IRQHandler [WEAK]
EXPORT PORTA_IRQHandler [WEAK]
EXPORT PORTB_IRQHandler [WEAK]
EXPORT PORTC_IRQHandler [WEAK]
EXPORT PORTD_IRQHandler [WEAK]
EXPORT PORTE_IRQHandler [WEAK]
EXPORT LLWU_IRQHandler [WEAK]
EXPORT LTC0_IRQHandler [WEAK]
EXPORT USB0_IRQHandler [WEAK]
EXPORT ADC0_IRQHandler [WEAK]
EXPORT LPTMR0_IRQHandler [WEAK]
EXPORT RTC_Seconds_IRQHandler [WEAK]
EXPORT INTMUX0_0_IRQHandler [WEAK]
EXPORT INTMUX0_1_IRQHandler [WEAK]
EXPORT INTMUX0_2_IRQHandler [WEAK]
EXPORT INTMUX0_3_IRQHandler [WEAK]
EXPORT LPTMR1_IRQHandler [WEAK]
EXPORT Reserved49_IRQHandler [WEAK]
EXPORT Reserved50_IRQHandler [WEAK]
EXPORT Reserved51_IRQHandler [WEAK]
EXPORT SPI1_IRQHandler [WEAK]
EXPORT LPUART2_IRQHandler [WEAK]
EXPORT EMVSIM1_IRQHandler [WEAK]
EXPORT I2C1_IRQHandler [WEAK]
EXPORT TSI0_IRQHandler [WEAK]
EXPORT PMC_IRQHandler [WEAK]
EXPORT FTFA_IRQHandler [WEAK]
EXPORT MCG_IRQHandler [WEAK]
EXPORT WDOG_EWM_IRQHandler [WEAK]
EXPORT DAC0_IRQHandler [WEAK]
EXPORT TRNG0_IRQHandler [WEAK]
EXPORT Reserved63_IRQHandler [WEAK]
EXPORT CMP0_IRQHandler [WEAK]
EXPORT Reserved65_IRQHandler [WEAK]
EXPORT RTC_Alarm_IRQHandler [WEAK]
EXPORT Reserved67_IRQHandler [WEAK]
EXPORT Reserved68_IRQHandler [WEAK]
EXPORT Reserved69_IRQHandler [WEAK]
EXPORT Reserved70_IRQHandler [WEAK]
EXPORT Reserved71_IRQHandler [WEAK]
EXPORT DMA4_IRQHandler [WEAK]
EXPORT DMA5_IRQHandler [WEAK]
EXPORT DMA6_IRQHandler [WEAK]
EXPORT DMA7_IRQHandler [WEAK]
EXPORT Reserved76_IRQHandler [WEAK]
EXPORT Reserved77_IRQHandler [WEAK]
EXPORT Reserved78_IRQHandler [WEAK]
EXPORT Reserved79_IRQHandler [WEAK]
EXPORT DefaultISR [WEAK]
DMA0_DMA4_IRQHandler
DMA1_DMA5_IRQHandler
DMA2_DMA6_IRQHandler
DMA3_DMA7_IRQHandler
DMA_Error_IRQHandler
FLEXIO0_IRQHandler
TPM0_IRQHandler
TPM1_IRQHandler
TPM2_IRQHandler
PIT0_IRQHandler
SPI0_IRQHandler
EMVSIM0_IRQHandler
LPUART0_IRQHandler
LPUART1_IRQHandler
I2C0_IRQHandler
QSPI0_IRQHandler
Reserved32_IRQHandler
PORTA_IRQHandler
PORTB_IRQHandler
PORTC_IRQHandler
PORTD_IRQHandler
PORTE_IRQHandler
LLWU_IRQHandler
LTC0_IRQHandler
USB0_IRQHandler
ADC0_IRQHandler
LPTMR0_IRQHandler
RTC_Seconds_IRQHandler
INTMUX0_0_IRQHandler
INTMUX0_1_IRQHandler
INTMUX0_2_IRQHandler
INTMUX0_3_IRQHandler
LPTMR1_IRQHandler
Reserved49_IRQHandler
Reserved50_IRQHandler
Reserved51_IRQHandler
SPI1_IRQHandler
LPUART2_IRQHandler
EMVSIM1_IRQHandler
I2C1_IRQHandler
TSI0_IRQHandler
PMC_IRQHandler
FTFA_IRQHandler
MCG_IRQHandler
WDOG_EWM_IRQHandler
DAC0_IRQHandler
TRNG0_IRQHandler
Reserved63_IRQHandler
CMP0_IRQHandler
Reserved65_IRQHandler
RTC_Alarm_IRQHandler
Reserved67_IRQHandler
Reserved68_IRQHandler
Reserved69_IRQHandler
Reserved70_IRQHandler
Reserved71_IRQHandler
DMA4_IRQHandler
DMA5_IRQHandler
DMA6_IRQHandler
DMA7_IRQHandler
Reserved76_IRQHandler
Reserved77_IRQHandler
Reserved78_IRQHandler
Reserved79_IRQHandler
DefaultISR
LDR R0, =DefaultISR
BX R0
ENDP
ALIGN
END
@@ -0,0 +1,256 @@
/* ---------------------------------------------------------------------------------------*/
/* @file: startup_MKL82Z7.s */
/* @purpose: CMSIS Cortex-M0P Core Device Startup File */
/* MKL82Z7 */
/* @version: 1.4 */
/* @date: 2015-8-28 */
/* @build: b150910 */
/* ---------------------------------------------------------------------------------------*/
/* */
/* Copyright (c) 1997 - 2015 , Freescale Semiconductor, Inc. */
/* All rights reserved. */
/* */
/* Redistribution and use in source and binary forms, with or without modification, */
/* are permitted provided that the following conditions are met: */
/* */
/* o Redistributions of source code must retain the above copyright notice, this list */
/* of conditions and the following disclaimer. */
/* */
/* o 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. */
/* */
/* o Neither the name of Freescale Semiconductor, Inc. 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. */
/*****************************************************************************/
/* Version: GCC for ARM Embedded Processors */
/*****************************************************************************/
.syntax unified
.arch armv6-m
.section .isr_vector, "a"
.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 0 /* Reserved*/
.long 0 /* Reserved*/
.long 0 /* Reserved*/
.long 0 /* Reserved*/
.long 0 /* Reserved*/
.long 0 /* Reserved*/
.long 0 /* Reserved*/
.long SVC_Handler /* SVCall Handler*/
.long 0 /* Reserved*/
.long 0 /* Reserved*/
.long PendSV_Handler /* PendSV Handler*/
.long SysTick_Handler /* SysTick Handler*/
/* External Interrupts*/
.long DMA0_DMA4_IRQHandler /* DMA channel 0, 4 transfer complete*/
.long DMA1_DMA5_IRQHandler /* DMA channel 1, 5 transfer complete*/
.long DMA2_DMA6_IRQHandler /* DMA channel 2, 6 transfer complete*/
.long DMA3_DMA7_IRQHandler /* DMA channel 3, 7 transfer complete*/
.long DMA_Error_IRQHandler /* DMA channel 0 - 7 error*/
.long FLEXIO0_IRQHandler /* Flexible IO*/
.long TPM0_IRQHandler /* Timer/PWM module 0*/
.long TPM1_IRQHandler /* Timer/PWM module 1*/
.long TPM2_IRQHandler /* Timer/PWM module 2*/
.long PIT0_IRQHandler /* Periodic Interrupt Timer 0*/
.long SPI0_IRQHandler /* Serial Peripheral Interface 0*/
.long EMVSIM0_IRQHandler /* EMVSIM0 common interrupt*/
.long LPUART0_IRQHandler /* LPUART0 status and error*/
.long LPUART1_IRQHandler /* LPUART1 status and error*/
.long I2C0_IRQHandler /* Inter-Integrated Circuit 0*/
.long QSPI0_IRQHandler /* QuadSPI0 interrupt*/
.long Reserved32_IRQHandler /* DryIce tamper detect*/
.long PORTA_IRQHandler /* Pin detect Port A*/
.long PORTB_IRQHandler /* Pin detect Port B*/
.long PORTC_IRQHandler /* Pin detect Port C*/
.long PORTD_IRQHandler /* Pin detect Port D*/
.long PORTE_IRQHandler /* Pin detect Port E*/
.long LLWU_IRQHandler /* Low Leakage Wakeup*/
.long LTC0_IRQHandler /* Low power trusted cryptographic*/
.long USB0_IRQHandler /* USB OTG interrupt*/
.long ADC0_IRQHandler /* Analog-to-Digital Converter 0*/
.long LPTMR0_IRQHandler /* Low-Power Timer 0*/
.long RTC_Seconds_IRQHandler /* RTC seconds*/
.long INTMUX0_0_IRQHandler /* Selectable peripheral interrupt INTMUX0-0*/
.long INTMUX0_1_IRQHandler /* Selectable peripheral interrupt INTMUX0-1*/
.long INTMUX0_2_IRQHandler /* Selectable peripheral interrupt INTMUX0-2*/
.long INTMUX0_3_IRQHandler /* Selectable peripheral interrupt INTMUX0-3*/
.long LPTMR1_IRQHandler /* Low-Power Timer 1 (INTMUX source IRQ0)*/
.long Reserved49_IRQHandler /* Reserved interrupt (INTMUX source IRQ1)*/
.long Reserved50_IRQHandler /* Reserved interrupt (INTMUX source IRQ2)*/
.long Reserved51_IRQHandler /* Reserved interrupt (INTMUX source IRQ3)*/
.long SPI1_IRQHandler /* Serial Peripheral Interface 1 (INTMUX source IRQ4)*/
.long LPUART2_IRQHandler /* LPUART2 status and error (INTMUX source IRQ5)*/
.long EMVSIM1_IRQHandler /* EMVSIM1 common interrupt (INTMUX source IRQ6)*/
.long I2C1_IRQHandler /* Inter-Integrated Circuit 1 (INTMUX source IRQ7)*/
.long TSI0_IRQHandler /* Touch Sensing Input 0 (INTMUX source IRQ8)*/
.long PMC_IRQHandler /* PMC controller low-voltage detect, low-voltage warning (INTMUX source IRQ9)*/
.long FTFA_IRQHandler /* FTFA command complete/read collision (INTMUX source IRQ10)*/
.long MCG_IRQHandler /* Multipurpose clock generator (INTMUX source IRQ11)*/
.long WDOG_EWM_IRQHandler /* Single interrupt vector for WDOG and EWM (INTMUX source IRQ12)*/
.long DAC0_IRQHandler /* Digital-to-analog converter 0 (INTMUX source IRQ13)*/
.long TRNG0_IRQHandler /* True randon number generator (INTMUX source IRQ14)*/
.long Reserved63_IRQHandler /* Reserved interrupt (INTMUX source IRQ15)*/
.long CMP0_IRQHandler /* Comparator 0 (INTMUX source IRQ16)*/
.long Reserved65_IRQHandler /* Reserved interrupt (INTMUX source IRQ17)*/
.long RTC_Alarm_IRQHandler /* Real time clock (INTMUX source IRQ18)*/
.long Reserved67_IRQHandler /* Reserved interrupt (INTMUX source IRQ19)*/
.long Reserved68_IRQHandler /* Reserved interrupt (INTMUX source IRQ20)*/
.long Reserved69_IRQHandler /* Reserved interrupt (INTMUX source IRQ21)*/
.long Reserved70_IRQHandler /* Reserved interrupt (INTMUX source IRQ22)*/
.long Reserved71_IRQHandler /* Reserved interrupt (INTMUX source IRQ23)*/
.long DMA4_IRQHandler /* DMA channel 4 transfer complete (INTMUX source IRQ24)*/
.long DMA5_IRQHandler /* DMA channel 5 transfer complete (INTMUX source IRQ25)*/
.long DMA6_IRQHandler /* DMA channel 6 transfer complete (INTMUX source IRQ26)*/
.long DMA7_IRQHandler /* DMA channel 7 transfer complete (INTMUX source IRQ27)*/
.long Reserved76_IRQHandler /* Reserved interrupt (INTMUX source IRQ28)*/
.long Reserved77_IRQHandler /* Reserved interrupt (INTMUX source IRQ29)*/
.long Reserved78_IRQHandler /* Reserved interrupt (INTMUX source IRQ30)*/
.long Reserved79_IRQHandler /* Reserved interrupt (INTMUX source IRQ31)*/
.size __isr_vector, . - __isr_vector
/* Flash Configuration */
.section .FlashConfig, "a"
.long 0xFFFFFFFF
.long 0xFFFFFFFF
.long 0xFFFFFFFF
.long 0xFFFF3DFE
.text
.thumb
/* Reset Handler */
.thumb_func
.align 2
.globl Reset_Handler
.weak Reset_Handler
.type Reset_Handler, %function
Reset_Handler:
cpsid i /* Mask interrupts */
#ifndef __NO_SYSTEM_INIT
bl SystemInit
#endif
bl init_data_bss
cpsie i /* Unmask interrupts */
#ifndef __START
#define __START _start
#endif
#ifndef __ATOLLIC__
bl __START
#else
bl __libc_init_array
bl main
#endif
.pool
.size Reset_Handler, . - Reset_Handler
.align 1
.thumb_func
.weak DefaultISR
.type DefaultISR, %function
DefaultISR:
ldr r0, =DefaultISR
bx r0
.size DefaultISR, . - DefaultISR
/* Macro to define default handlers. Default handler
* will be weak symbol and just dead loops. They can be
* overwritten by other handlers */
.macro def_irq_handler handler_name
.weak \handler_name
.set \handler_name, DefaultISR
.endm
/* Exception Handlers */
def_irq_handler NMI_Handler
def_irq_handler HardFault_Handler
def_irq_handler SVC_Handler
def_irq_handler PendSV_Handler
def_irq_handler SysTick_Handler
def_irq_handler DMA0_DMA4_IRQHandler
def_irq_handler DMA1_DMA5_IRQHandler
def_irq_handler DMA2_DMA6_IRQHandler
def_irq_handler DMA3_DMA7_IRQHandler
def_irq_handler DMA_Error_IRQHandler
def_irq_handler FLEXIO0_IRQHandler
def_irq_handler TPM0_IRQHandler
def_irq_handler TPM1_IRQHandler
def_irq_handler TPM2_IRQHandler
def_irq_handler PIT0_IRQHandler
def_irq_handler SPI0_IRQHandler
def_irq_handler EMVSIM0_IRQHandler
def_irq_handler LPUART0_IRQHandler
def_irq_handler LPUART1_IRQHandler
def_irq_handler I2C0_IRQHandler
def_irq_handler QSPI0_IRQHandler
def_irq_handler Reserved32_IRQHandler
def_irq_handler PORTA_IRQHandler
def_irq_handler PORTB_IRQHandler
def_irq_handler PORTC_IRQHandler
def_irq_handler PORTD_IRQHandler
def_irq_handler PORTE_IRQHandler
def_irq_handler LLWU_IRQHandler
def_irq_handler LTC0_IRQHandler
def_irq_handler USB0_IRQHandler
def_irq_handler ADC0_IRQHandler
def_irq_handler LPTMR0_IRQHandler
def_irq_handler RTC_Seconds_IRQHandler
def_irq_handler INTMUX0_0_IRQHandler
def_irq_handler INTMUX0_1_IRQHandler
def_irq_handler INTMUX0_2_IRQHandler
def_irq_handler INTMUX0_3_IRQHandler
def_irq_handler LPTMR1_IRQHandler
def_irq_handler Reserved49_IRQHandler
def_irq_handler Reserved50_IRQHandler
def_irq_handler Reserved51_IRQHandler
def_irq_handler SPI1_IRQHandler
def_irq_handler LPUART2_IRQHandler
def_irq_handler EMVSIM1_IRQHandler
def_irq_handler I2C1_IRQHandler
def_irq_handler TSI0_IRQHandler
def_irq_handler PMC_IRQHandler
def_irq_handler FTFA_IRQHandler
def_irq_handler MCG_IRQHandler
def_irq_handler WDOG_EWM_IRQHandler
def_irq_handler DAC0_IRQHandler
def_irq_handler TRNG0_IRQHandler
def_irq_handler Reserved63_IRQHandler
def_irq_handler CMP0_IRQHandler
def_irq_handler Reserved65_IRQHandler
def_irq_handler RTC_Alarm_IRQHandler
def_irq_handler Reserved67_IRQHandler
def_irq_handler Reserved68_IRQHandler
def_irq_handler Reserved69_IRQHandler
def_irq_handler Reserved70_IRQHandler
def_irq_handler Reserved71_IRQHandler
def_irq_handler DMA4_IRQHandler
def_irq_handler DMA5_IRQHandler
def_irq_handler DMA6_IRQHandler
def_irq_handler DMA7_IRQHandler
def_irq_handler Reserved76_IRQHandler
def_irq_handler Reserved77_IRQHandler
def_irq_handler Reserved78_IRQHandler
def_irq_handler Reserved79_IRQHandler
.end
@@ -0,0 +1,256 @@
/* ---------------------------------------------------------------------------------------*/
/* @file: startup_MKL82Z7.s */
/* @purpose: CMSIS Cortex-M0P Core Device Startup File */
/* MKL82Z7 */
/* @version: 1.4 */
/* @date: 2015-8-28 */
/* @build: b150910 */
/* ---------------------------------------------------------------------------------------*/
/* */
/* Copyright (c) 1997 - 2015 , Freescale Semiconductor, Inc. */
/* All rights reserved. */
/* */
/* Redistribution and use in source and binary forms, with or without modification, */
/* are permitted provided that the following conditions are met: */
/* */
/* o Redistributions of source code must retain the above copyright notice, this list */
/* of conditions and the following disclaimer. */
/* */
/* o 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. */
/* */
/* o Neither the name of Freescale Semiconductor, Inc. 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. */
/*****************************************************************************/
/* Version: GCC for ARM Embedded Processors */
/*****************************************************************************/
.syntax unified
.arch armv6-m
.section .isr_vector, "a"
.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 0 /* Reserved*/
.long 0 /* Reserved*/
.long 0 /* Reserved*/
.long 0 /* Reserved*/
.long 0 /* Reserved*/
.long 0 /* Reserved*/
.long 0 /* Reserved*/
.long SVC_Handler /* SVCall Handler*/
.long 0 /* Reserved*/
.long 0 /* Reserved*/
.long PendSV_Handler /* PendSV Handler*/
.long SysTick_Handler /* SysTick Handler*/
/* External Interrupts*/
.long DMA0_DMA4_IRQHandler /* DMA channel 0, 4 transfer complete*/
.long DMA1_DMA5_IRQHandler /* DMA channel 1, 5 transfer complete*/
.long DMA2_DMA6_IRQHandler /* DMA channel 2, 6 transfer complete*/
.long DMA3_DMA7_IRQHandler /* DMA channel 3, 7 transfer complete*/
.long DMA_Error_IRQHandler /* DMA channel 0 - 7 error*/
.long FLEXIO0_IRQHandler /* Flexible IO*/
.long TPM0_IRQHandler /* Timer/PWM module 0*/
.long TPM1_IRQHandler /* Timer/PWM module 1*/
.long TPM2_IRQHandler /* Timer/PWM module 2*/
.long PIT0_IRQHandler /* Periodic Interrupt Timer 0*/
.long SPI0_IRQHandler /* Serial Peripheral Interface 0*/
.long EMVSIM0_IRQHandler /* EMVSIM0 common interrupt*/
.long LPUART0_IRQHandler /* LPUART0 status and error*/
.long LPUART1_IRQHandler /* LPUART1 status and error*/
.long I2C0_IRQHandler /* Inter-Integrated Circuit 0*/
.long QSPI0_IRQHandler /* QuadSPI0 interrupt*/
.long Reserved32_IRQHandler /* DryIce tamper detect*/
.long PORTA_IRQHandler /* Pin detect Port A*/
.long PORTB_IRQHandler /* Pin detect Port B*/
.long PORTC_IRQHandler /* Pin detect Port C*/
.long PORTD_IRQHandler /* Pin detect Port D*/
.long PORTE_IRQHandler /* Pin detect Port E*/
.long LLWU_IRQHandler /* Low Leakage Wakeup*/
.long LTC0_IRQHandler /* Low power trusted cryptographic*/
.long USB0_IRQHandler /* USB OTG interrupt*/
.long ADC0_IRQHandler /* Analog-to-Digital Converter 0*/
.long LPTMR0_IRQHandler /* Low-Power Timer 0*/
.long RTC_Seconds_IRQHandler /* RTC seconds*/
.long INTMUX0_0_IRQHandler /* Selectable peripheral interrupt INTMUX0-0*/
.long INTMUX0_1_IRQHandler /* Selectable peripheral interrupt INTMUX0-1*/
.long INTMUX0_2_IRQHandler /* Selectable peripheral interrupt INTMUX0-2*/
.long INTMUX0_3_IRQHandler /* Selectable peripheral interrupt INTMUX0-3*/
.long LPTMR1_IRQHandler /* Low-Power Timer 1 (INTMUX source IRQ0)*/
.long Reserved49_IRQHandler /* Reserved interrupt (INTMUX source IRQ1)*/
.long Reserved50_IRQHandler /* Reserved interrupt (INTMUX source IRQ2)*/
.long Reserved51_IRQHandler /* Reserved interrupt (INTMUX source IRQ3)*/
.long SPI1_IRQHandler /* Serial Peripheral Interface 1 (INTMUX source IRQ4)*/
.long LPUART2_IRQHandler /* LPUART2 status and error (INTMUX source IRQ5)*/
.long EMVSIM1_IRQHandler /* EMVSIM1 common interrupt (INTMUX source IRQ6)*/
.long I2C1_IRQHandler /* Inter-Integrated Circuit 1 (INTMUX source IRQ7)*/
.long TSI0_IRQHandler /* Touch Sensing Input 0 (INTMUX source IRQ8)*/
.long PMC_IRQHandler /* PMC controller low-voltage detect, low-voltage warning (INTMUX source IRQ9)*/
.long FTFA_IRQHandler /* FTFA command complete/read collision (INTMUX source IRQ10)*/
.long MCG_IRQHandler /* Multipurpose clock generator (INTMUX source IRQ11)*/
.long WDOG_EWM_IRQHandler /* Single interrupt vector for WDOG and EWM (INTMUX source IRQ12)*/
.long DAC0_IRQHandler /* Digital-to-analog converter 0 (INTMUX source IRQ13)*/
.long TRNG0_IRQHandler /* True randon number generator (INTMUX source IRQ14)*/
.long Reserved63_IRQHandler /* Reserved interrupt (INTMUX source IRQ15)*/
.long CMP0_IRQHandler /* Comparator 0 (INTMUX source IRQ16)*/
.long Reserved65_IRQHandler /* Reserved interrupt (INTMUX source IRQ17)*/
.long RTC_Alarm_IRQHandler /* Real time clock (INTMUX source IRQ18)*/
.long Reserved67_IRQHandler /* Reserved interrupt (INTMUX source IRQ19)*/
.long Reserved68_IRQHandler /* Reserved interrupt (INTMUX source IRQ20)*/
.long Reserved69_IRQHandler /* Reserved interrupt (INTMUX source IRQ21)*/
.long Reserved70_IRQHandler /* Reserved interrupt (INTMUX source IRQ22)*/
.long Reserved71_IRQHandler /* Reserved interrupt (INTMUX source IRQ23)*/
.long DMA4_IRQHandler /* DMA channel 4 transfer complete (INTMUX source IRQ24)*/
.long DMA5_IRQHandler /* DMA channel 5 transfer complete (INTMUX source IRQ25)*/
.long DMA6_IRQHandler /* DMA channel 6 transfer complete (INTMUX source IRQ26)*/
.long DMA7_IRQHandler /* DMA channel 7 transfer complete (INTMUX source IRQ27)*/
.long Reserved76_IRQHandler /* Reserved interrupt (INTMUX source IRQ28)*/
.long Reserved77_IRQHandler /* Reserved interrupt (INTMUX source IRQ29)*/
.long Reserved78_IRQHandler /* Reserved interrupt (INTMUX source IRQ30)*/
.long Reserved79_IRQHandler /* Reserved interrupt (INTMUX source IRQ31)*/
.size __isr_vector, . - __isr_vector
/* Flash Configuration */
.section .FlashConfig, "a"
.long 0xFFFFFFFF
.long 0xFFFFFFFF
.long 0xFFFFFFFF
.long 0xFFFFBDFE
.text
.thumb
/* Reset Handler */
.thumb_func
.align 2
.globl Reset_Handler
.weak Reset_Handler
.type Reset_Handler, %function
Reset_Handler:
cpsid i /* Mask interrupts */
#ifndef __NO_SYSTEM_INIT
bl SystemInit
#endif
bl init_data_bss
cpsie i /* Unmask interrupts */
#ifndef __START
#define __START _start
#endif
#ifndef __ATOLLIC__
bl __START
#else
bl __libc_init_array
bl main
#endif
.pool
.size Reset_Handler, . - Reset_Handler
.align 1
.thumb_func
.weak DefaultISR
.type DefaultISR, %function
DefaultISR:
ldr r0, =DefaultISR
bx r0
.size DefaultISR, . - DefaultISR
/* Macro to define default handlers. Default handler
* will be weak symbol and just dead loops. They can be
* overwritten by other handlers */
.macro def_irq_handler handler_name
.weak \handler_name
.set \handler_name, DefaultISR
.endm
/* Exception Handlers */
def_irq_handler NMI_Handler
def_irq_handler HardFault_Handler
def_irq_handler SVC_Handler
def_irq_handler PendSV_Handler
def_irq_handler SysTick_Handler
def_irq_handler DMA0_DMA4_IRQHandler
def_irq_handler DMA1_DMA5_IRQHandler
def_irq_handler DMA2_DMA6_IRQHandler
def_irq_handler DMA3_DMA7_IRQHandler
def_irq_handler DMA_Error_IRQHandler
def_irq_handler FLEXIO0_IRQHandler
def_irq_handler TPM0_IRQHandler
def_irq_handler TPM1_IRQHandler
def_irq_handler TPM2_IRQHandler
def_irq_handler PIT0_IRQHandler
def_irq_handler SPI0_IRQHandler
def_irq_handler EMVSIM0_IRQHandler
def_irq_handler LPUART0_IRQHandler
def_irq_handler LPUART1_IRQHandler
def_irq_handler I2C0_IRQHandler
def_irq_handler QSPI0_IRQHandler
def_irq_handler Reserved32_IRQHandler
def_irq_handler PORTA_IRQHandler
def_irq_handler PORTB_IRQHandler
def_irq_handler PORTC_IRQHandler
def_irq_handler PORTD_IRQHandler
def_irq_handler PORTE_IRQHandler
def_irq_handler LLWU_IRQHandler
def_irq_handler LTC0_IRQHandler
def_irq_handler USB0_IRQHandler
def_irq_handler ADC0_IRQHandler
def_irq_handler LPTMR0_IRQHandler
def_irq_handler RTC_Seconds_IRQHandler
def_irq_handler INTMUX0_0_IRQHandler
def_irq_handler INTMUX0_1_IRQHandler
def_irq_handler INTMUX0_2_IRQHandler
def_irq_handler INTMUX0_3_IRQHandler
def_irq_handler LPTMR1_IRQHandler
def_irq_handler Reserved49_IRQHandler
def_irq_handler Reserved50_IRQHandler
def_irq_handler Reserved51_IRQHandler
def_irq_handler SPI1_IRQHandler
def_irq_handler LPUART2_IRQHandler
def_irq_handler EMVSIM1_IRQHandler
def_irq_handler I2C1_IRQHandler
def_irq_handler TSI0_IRQHandler
def_irq_handler PMC_IRQHandler
def_irq_handler FTFA_IRQHandler
def_irq_handler MCG_IRQHandler
def_irq_handler WDOG_EWM_IRQHandler
def_irq_handler DAC0_IRQHandler
def_irq_handler TRNG0_IRQHandler
def_irq_handler Reserved63_IRQHandler
def_irq_handler CMP0_IRQHandler
def_irq_handler Reserved65_IRQHandler
def_irq_handler RTC_Alarm_IRQHandler
def_irq_handler Reserved67_IRQHandler
def_irq_handler Reserved68_IRQHandler
def_irq_handler Reserved69_IRQHandler
def_irq_handler Reserved70_IRQHandler
def_irq_handler Reserved71_IRQHandler
def_irq_handler DMA4_IRQHandler
def_irq_handler DMA5_IRQHandler
def_irq_handler DMA6_IRQHandler
def_irq_handler DMA7_IRQHandler
def_irq_handler Reserved76_IRQHandler
def_irq_handler Reserved77_IRQHandler
def_irq_handler Reserved78_IRQHandler
def_irq_handler Reserved79_IRQHandler
.end
@@ -0,0 +1,266 @@
/* ---------------------------------------------------------------------------------------*/
/* @file: startup_MKL82Z7.s */
/* @purpose: CMSIS Cortex-M0P Core Device Startup File */
/* MKL82Z7 */
/* @version: 1.4 */
/* @date: 2015-8-28 */
/* @build: b150910 */
/* ---------------------------------------------------------------------------------------*/
/* */
/* Copyright (c) 1997 - 2015 , Freescale Semiconductor, Inc. */
/* All rights reserved. */
/* */
/* Redistribution and use in source and binary forms, with or without modification, */
/* are permitted provided that the following conditions are met: */
/* */
/* o Redistributions of source code must retain the above copyright notice, this list */
/* of conditions and the following disclaimer. */
/* */
/* o 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. */
/* */
/* o Neither the name of Freescale Semiconductor, Inc. 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. */
/*****************************************************************************/
/* Version: GCC for ARM Embedded Processors */
/*****************************************************************************/
.syntax unified
.arch armv6-m
.section .isr_vector, "a"
.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 0 /* Reserved*/
.long 0 /* Reserved*/
.long 0 /* Reserved*/
.long 0 /* Reserved*/
.long 0 /* Reserved*/
.long 0 /* Reserved*/
.long 0 /* Reserved*/
.long SVC_Handler /* SVCall Handler*/
.long 0 /* Reserved*/
.long 0 /* Reserved*/
.long PendSV_Handler /* PendSV Handler*/
.long SysTick_Handler /* SysTick Handler*/
/* External Interrupts*/
.long DMA0_DMA4_IRQHandler /* DMA channel 0, 4 transfer complete*/
.long DMA1_DMA5_IRQHandler /* DMA channel 1, 5 transfer complete*/
.long DMA2_DMA6_IRQHandler /* DMA channel 2, 6 transfer complete*/
.long DMA3_DMA7_IRQHandler /* DMA channel 3, 7 transfer complete*/
.long DMA_Error_IRQHandler /* DMA channel 0 - 7 error*/
.long FLEXIO0_IRQHandler /* Flexible IO*/
.long TPM0_IRQHandler /* Timer/PWM module 0*/
.long TPM1_IRQHandler /* Timer/PWM module 1*/
.long TPM2_IRQHandler /* Timer/PWM module 2*/
.long PIT0_IRQHandler /* Periodic Interrupt Timer 0*/
.long SPI0_IRQHandler /* Serial Peripheral Interface 0*/
.long EMVSIM0_IRQHandler /* EMVSIM0 common interrupt*/
.long LPUART0_IRQHandler /* LPUART0 status and error*/
.long LPUART1_IRQHandler /* LPUART1 status and error*/
.long I2C0_IRQHandler /* Inter-Integrated Circuit 0*/
.long QSPI0_IRQHandler /* QuadSPI0 interrupt*/
.long Reserved32_IRQHandler /* DryIce tamper detect*/
.long PORTA_IRQHandler /* Pin detect Port A*/
.long PORTB_IRQHandler /* Pin detect Port B*/
.long PORTC_IRQHandler /* Pin detect Port C*/
.long PORTD_IRQHandler /* Pin detect Port D*/
.long PORTE_IRQHandler /* Pin detect Port E*/
.long LLWU_IRQHandler /* Low Leakage Wakeup*/
.long LTC0_IRQHandler /* Low power trusted cryptographic*/
.long USB0_IRQHandler /* USB OTG interrupt*/
.long ADC0_IRQHandler /* Analog-to-Digital Converter 0*/
.long LPTMR0_IRQHandler /* Low-Power Timer 0*/
.long RTC_Seconds_IRQHandler /* RTC seconds*/
.long INTMUX0_0_IRQHandler /* Selectable peripheral interrupt INTMUX0-0*/
.long INTMUX0_1_IRQHandler /* Selectable peripheral interrupt INTMUX0-1*/
.long INTMUX0_2_IRQHandler /* Selectable peripheral interrupt INTMUX0-2*/
.long INTMUX0_3_IRQHandler /* Selectable peripheral interrupt INTMUX0-3*/
.long LPTMR1_IRQHandler /* Low-Power Timer 1 (INTMUX source IRQ0)*/
.long Reserved49_IRQHandler /* Reserved interrupt (INTMUX source IRQ1)*/
.long Reserved50_IRQHandler /* Reserved interrupt (INTMUX source IRQ2)*/
.long Reserved51_IRQHandler /* Reserved interrupt (INTMUX source IRQ3)*/
.long SPI1_IRQHandler /* Serial Peripheral Interface 1 (INTMUX source IRQ4)*/
.long LPUART2_IRQHandler /* LPUART2 status and error (INTMUX source IRQ5)*/
.long EMVSIM1_IRQHandler /* EMVSIM1 common interrupt (INTMUX source IRQ6)*/
.long I2C1_IRQHandler /* Inter-Integrated Circuit 1 (INTMUX source IRQ7)*/
.long TSI0_IRQHandler /* Touch Sensing Input 0 (INTMUX source IRQ8)*/
.long PMC_IRQHandler /* PMC controller low-voltage detect, low-voltage warning (INTMUX source IRQ9)*/
.long FTFA_IRQHandler /* FTFA command complete/read collision (INTMUX source IRQ10)*/
.long MCG_IRQHandler /* Multipurpose clock generator (INTMUX source IRQ11)*/
.long WDOG_EWM_IRQHandler /* Single interrupt vector for WDOG and EWM (INTMUX source IRQ12)*/
.long DAC0_IRQHandler /* Digital-to-analog converter 0 (INTMUX source IRQ13)*/
.long TRNG0_IRQHandler /* True randon number generator (INTMUX source IRQ14)*/
.long Reserved63_IRQHandler /* Reserved interrupt (INTMUX source IRQ15)*/
.long CMP0_IRQHandler /* Comparator 0 (INTMUX source IRQ16)*/
.long Reserved65_IRQHandler /* Reserved interrupt (INTMUX source IRQ17)*/
.long RTC_Alarm_IRQHandler /* Real time clock (INTMUX source IRQ18)*/
.long Reserved67_IRQHandler /* Reserved interrupt (INTMUX source IRQ19)*/
.long Reserved68_IRQHandler /* Reserved interrupt (INTMUX source IRQ20)*/
.long Reserved69_IRQHandler /* Reserved interrupt (INTMUX source IRQ21)*/
.long Reserved70_IRQHandler /* Reserved interrupt (INTMUX source IRQ22)*/
.long Reserved71_IRQHandler /* Reserved interrupt (INTMUX source IRQ23)*/
.long DMA4_IRQHandler /* DMA channel 4 transfer complete (INTMUX source IRQ24)*/
.long DMA5_IRQHandler /* DMA channel 5 transfer complete (INTMUX source IRQ25)*/
.long DMA6_IRQHandler /* DMA channel 6 transfer complete (INTMUX source IRQ26)*/
.long DMA7_IRQHandler /* DMA channel 7 transfer complete (INTMUX source IRQ27)*/
.long Reserved76_IRQHandler /* Reserved interrupt (INTMUX source IRQ28)*/
.long Reserved77_IRQHandler /* Reserved interrupt (INTMUX source IRQ29)*/
.long Reserved78_IRQHandler /* Reserved interrupt (INTMUX source IRQ30)*/
.long Reserved79_IRQHandler /* Reserved interrupt (INTMUX source IRQ31)*/
.size __isr_vector, . - __isr_vector
/* Flash Configuration */
.section .FlashConfig, "a"
.long 0xFFFFFFFF
.long 0xFFFFFFFF
.long 0xFFFFFFFF
.long 0xFFFFBDFE
.section BootloaderPatchHandler, "a"
.thumb
/* Reset Handler */
.thumb_func
.align 2
.globl Reset_Handler
.weak Reset_Handler
.type Reset_Handler, %function
Reset_Handler:
cpsid i /* Mask interrupts */
ldr r0, = ROM_PatchHandler
blx r0
#ifndef __NO_SYSTEM_INIT
ldr r0, = SystemInit
blx r0
#endif
ldr r0, = init_data_bss
blx r0
cpsie i /* Unmask interrupts */
#ifndef __START
#define __START _start
#endif
#ifndef __ATOLLIC__
ldr r0, = __START
blx r0
#else
ldr r0,= __libc_init_array
blx r0
ldr r0, = main,
bx r0
#endif
.pool
.size Reset_Handler, . - Reset_Handler
.text
.thumb
.align 1
.thumb_func
.weak DefaultISR
.type DefaultISR, %function
DefaultISR:
ldr r0, =DefaultISR
bx r0
.size DefaultISR, . - DefaultISR
/* Macro to define default handlers. Default handler
* will be weak symbol and just dead loops. They can be
* overwritten by other handlers */
.macro def_irq_handler handler_name
.weak \handler_name
.set \handler_name, DefaultISR
.endm
/* Exception Handlers */
def_irq_handler NMI_Handler
def_irq_handler HardFault_Handler
def_irq_handler SVC_Handler
def_irq_handler PendSV_Handler
def_irq_handler SysTick_Handler
def_irq_handler DMA0_DMA4_IRQHandler
def_irq_handler DMA1_DMA5_IRQHandler
def_irq_handler DMA2_DMA6_IRQHandler
def_irq_handler DMA3_DMA7_IRQHandler
def_irq_handler DMA_Error_IRQHandler
def_irq_handler FLEXIO0_IRQHandler
def_irq_handler TPM0_IRQHandler
def_irq_handler TPM1_IRQHandler
def_irq_handler TPM2_IRQHandler
def_irq_handler PIT0_IRQHandler
def_irq_handler SPI0_IRQHandler
def_irq_handler EMVSIM0_IRQHandler
def_irq_handler LPUART0_IRQHandler
def_irq_handler LPUART1_IRQHandler
def_irq_handler I2C0_IRQHandler
def_irq_handler QSPI0_IRQHandler
def_irq_handler Reserved32_IRQHandler
def_irq_handler PORTA_IRQHandler
def_irq_handler PORTB_IRQHandler
def_irq_handler PORTC_IRQHandler
def_irq_handler PORTD_IRQHandler
def_irq_handler PORTE_IRQHandler
def_irq_handler LLWU_IRQHandler
def_irq_handler LTC0_IRQHandler
def_irq_handler USB0_IRQHandler
def_irq_handler ADC0_IRQHandler
def_irq_handler LPTMR0_IRQHandler
def_irq_handler RTC_Seconds_IRQHandler
def_irq_handler INTMUX0_0_IRQHandler
def_irq_handler INTMUX0_1_IRQHandler
def_irq_handler INTMUX0_2_IRQHandler
def_irq_handler INTMUX0_3_IRQHandler
def_irq_handler LPTMR1_IRQHandler
def_irq_handler Reserved49_IRQHandler
def_irq_handler Reserved50_IRQHandler
def_irq_handler Reserved51_IRQHandler
def_irq_handler SPI1_IRQHandler
def_irq_handler LPUART2_IRQHandler
def_irq_handler EMVSIM1_IRQHandler
def_irq_handler I2C1_IRQHandler
def_irq_handler TSI0_IRQHandler
def_irq_handler PMC_IRQHandler
def_irq_handler FTFA_IRQHandler
def_irq_handler MCG_IRQHandler
def_irq_handler WDOG_EWM_IRQHandler
def_irq_handler DAC0_IRQHandler
def_irq_handler TRNG0_IRQHandler
def_irq_handler Reserved63_IRQHandler
def_irq_handler CMP0_IRQHandler
def_irq_handler Reserved65_IRQHandler
def_irq_handler RTC_Alarm_IRQHandler
def_irq_handler Reserved67_IRQHandler
def_irq_handler Reserved68_IRQHandler
def_irq_handler Reserved69_IRQHandler
def_irq_handler Reserved70_IRQHandler
def_irq_handler Reserved71_IRQHandler
def_irq_handler DMA4_IRQHandler
def_irq_handler DMA5_IRQHandler
def_irq_handler DMA6_IRQHandler
def_irq_handler DMA7_IRQHandler
def_irq_handler Reserved76_IRQHandler
def_irq_handler Reserved77_IRQHandler
def_irq_handler Reserved78_IRQHandler
def_irq_handler Reserved79_IRQHandler
.end
@@ -0,0 +1,347 @@
; ---------------------------------------------------------------------------------------
; @file: startup_MKL82Z7.s
; @purpose: CMSIS Cortex-M0P Core Device Startup File
; MKL82Z7
; @version: 1.4
; @date: 2015-8-28
; @build: b150910
; ---------------------------------------------------------------------------------------
;
; Copyright (c) 1997 - 2015 , Freescale Semiconductor, Inc.
; All rights reserved.
;
; Redistribution and use in source and binary forms, with or without modification,
; are permitted provided that the following conditions are met:
;
; o Redistributions of source code must retain the above copyright notice, this list
; of conditions and the following disclaimer.
;
; o 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.
;
; o Neither the name of Freescale Semiconductor, Inc. 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.
;
; The modules in this file are included in the libraries, and may be replaced
; by any user-defined modules that define the PUBLIC symbol _program_start or
; a user defined start symbol.
; To override the cstartup defined in the library, simply add your modified
; version to the workbench project.
;
; The vector table is normally located at address 0.
; When debugging in RAM, it can be located in RAM, aligned to at least 2^6.
; The name "__vector_table" has special meaning for C-SPY:
; it is where the SP start value is found, and the NVIC vector
; table register (VTOR) is initialized to this address if != 0.
;
; Cortex-M version
;
MODULE ?cstartup
;; Forward declaration of sections.
SECTION CSTACK:DATA:NOROOT(3)
SECTION .intvec:CODE:NOROOT(2)
EXTERN __iar_program_start
EXTERN SystemInit
EXTERN init_data_bss
PUBLIC __vector_table
PUBLIC __vector_table_0x1c
PUBLIC __Vectors
PUBLIC __Vectors_End
PUBLIC __Vectors_Size
DATA
__vector_table
DCD sfe(CSTACK)
DCD Reset_Handler
DCD NMI_Handler ;NMI Handler
DCD HardFault_Handler ;Hard Fault Handler
DCD 0 ;Reserved
DCD 0 ;Reserved
DCD 0 ;Reserved
__vector_table_0x1c
DCD 0 ;Reserved
DCD 0 ;Reserved
DCD 0 ;Reserved
DCD 0 ;Reserved
DCD SVC_Handler ;SVCall Handler
DCD 0 ;Reserved
DCD 0 ;Reserved
DCD PendSV_Handler ;PendSV Handler
DCD SysTick_Handler ;SysTick Handler
;External Interrupts
DCD DMA0_DMA4_IRQHandler ;DMA channel 0, 4 transfer complete
DCD DMA1_DMA5_IRQHandler ;DMA channel 1, 5 transfer complete
DCD DMA2_DMA6_IRQHandler ;DMA channel 2, 6 transfer complete
DCD DMA3_DMA7_IRQHandler ;DMA channel 3, 7 transfer complete
DCD DMA_Error_IRQHandler ;DMA channel 0 - 7 error
DCD FLEXIO0_IRQHandler ;Flexible IO
DCD TPM0_IRQHandler ;Timer/PWM module 0
DCD TPM1_IRQHandler ;Timer/PWM module 1
DCD TPM2_IRQHandler ;Timer/PWM module 2
DCD PIT0_IRQHandler ;Periodic Interrupt Timer 0
DCD SPI0_IRQHandler ;Serial Peripheral Interface 0
DCD EMVSIM0_IRQHandler ;EMVSIM0 common interrupt
DCD LPUART0_IRQHandler ;LPUART0 status and error
DCD LPUART1_IRQHandler ;LPUART1 status and error
DCD I2C0_IRQHandler ;Inter-Integrated Circuit 0
DCD QSPI0_IRQHandler ;QuadSPI0 interrupt
DCD Reserved32_IRQHandler ;DryIce tamper detect
DCD PORTA_IRQHandler ;Pin detect Port A
DCD PORTB_IRQHandler ;Pin detect Port B
DCD PORTC_IRQHandler ;Pin detect Port C
DCD PORTD_IRQHandler ;Pin detect Port D
DCD PORTE_IRQHandler ;Pin detect Port E
DCD LLWU_IRQHandler ;Low Leakage Wakeup
DCD LTC0_IRQHandler ;Low power trusted cryptographic
DCD USB0_IRQHandler ;USB OTG interrupt
DCD ADC0_IRQHandler ;Analog-to-Digital Converter 0
DCD LPTMR0_IRQHandler ;Low-Power Timer 0
DCD RTC_Seconds_IRQHandler ;RTC seconds
DCD INTMUX0_0_IRQHandler ;Selectable peripheral interrupt INTMUX0-0
DCD INTMUX0_1_IRQHandler ;Selectable peripheral interrupt INTMUX0-1
DCD INTMUX0_2_IRQHandler ;Selectable peripheral interrupt INTMUX0-2
DCD INTMUX0_3_IRQHandler ;Selectable peripheral interrupt INTMUX0-3
DCD LPTMR1_IRQHandler ;Low-Power Timer 1 (INTMUX source IRQ0)
DCD Reserved49_IRQHandler ;Reserved interrupt (INTMUX source IRQ1)
DCD Reserved50_IRQHandler ;Reserved interrupt (INTMUX source IRQ2)
DCD Reserved51_IRQHandler ;Reserved interrupt (INTMUX source IRQ3)
DCD SPI1_IRQHandler ;Serial Peripheral Interface 1 (INTMUX source IRQ4)
DCD LPUART2_IRQHandler ;LPUART2 status and error (INTMUX source IRQ5)
DCD EMVSIM1_IRQHandler ;EMVSIM1 common interrupt (INTMUX source IRQ6)
DCD I2C1_IRQHandler ;Inter-Integrated Circuit 1 (INTMUX source IRQ7)
DCD TSI0_IRQHandler ;Touch Sensing Input 0 (INTMUX source IRQ8)
DCD PMC_IRQHandler ;PMC controller low-voltage detect, low-voltage warning (INTMUX source IRQ9)
DCD FTFA_IRQHandler ;FTFA command complete/read collision (INTMUX source IRQ10)
DCD MCG_IRQHandler ;Multipurpose clock generator (INTMUX source IRQ11)
DCD WDOG_EWM_IRQHandler ;Single interrupt vector for WDOG and EWM (INTMUX source IRQ12)
DCD DAC0_IRQHandler ;Digital-to-analog converter 0 (INTMUX source IRQ13)
DCD TRNG0_IRQHandler ;True randon number generator (INTMUX source IRQ14)
DCD Reserved63_IRQHandler ;Reserved interrupt (INTMUX source IRQ15)
DCD CMP0_IRQHandler ;Comparator 0 (INTMUX source IRQ16)
DCD Reserved65_IRQHandler ;Reserved interrupt (INTMUX source IRQ17)
DCD RTC_Alarm_IRQHandler ;Real time clock (INTMUX source IRQ18)
DCD Reserved67_IRQHandler ;Reserved interrupt (INTMUX source IRQ19)
DCD Reserved68_IRQHandler ;Reserved interrupt (INTMUX source IRQ20)
DCD Reserved69_IRQHandler ;Reserved interrupt (INTMUX source IRQ21)
DCD Reserved70_IRQHandler ;Reserved interrupt (INTMUX source IRQ22)
DCD Reserved71_IRQHandler ;Reserved interrupt (INTMUX source IRQ23)
DCD DMA4_IRQHandler ;DMA channel 4 transfer complete (INTMUX source IRQ24)
DCD DMA5_IRQHandler ;DMA channel 5 transfer complete (INTMUX source IRQ25)
DCD DMA6_IRQHandler ;DMA channel 6 transfer complete (INTMUX source IRQ26)
DCD DMA7_IRQHandler ;DMA channel 7 transfer complete (INTMUX source IRQ27)
DCD Reserved76_IRQHandler ;Reserved interrupt (INTMUX source IRQ28)
DCD Reserved77_IRQHandler ;Reserved interrupt (INTMUX source IRQ29)
DCD Reserved78_IRQHandler ;Reserved interrupt (INTMUX source IRQ30)
DCD Reserved79_IRQHandler ;Reserved interrupt (INTMUX source IRQ31)
__Vectors_End
SECTION FlashConfig:CODE
__FlashConfig
DCD 0xFFFFFFFF
DCD 0xFFFFFFFF
DCD 0xFFFFFFFF
DCD 0xFFFF3DFE
__FlashConfig_End
__Vectors EQU __vector_table
__Vectors_Size EQU __Vectors_End - __Vectors
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
;; Default interrupt handlers.
;;
THUMB
PUBWEAK Reset_Handler
SECTION .text:CODE:REORDER:NOROOT(2)
Reset_Handler
CPSID I ; Mask interrupts
LDR R0, =SystemInit
BLX R0
LDR R0, =init_data_bss
BLX R0
CPSIE I ; Unmask interrupts
LDR R0, =__iar_program_start
BX R0
PUBWEAK NMI_Handler
SECTION .text:CODE:REORDER:NOROOT(1)
NMI_Handler
B .
PUBWEAK HardFault_Handler
SECTION .text:CODE:REORDER:NOROOT(1)
HardFault_Handler
B .
PUBWEAK SVC_Handler
SECTION .text:CODE:REORDER:NOROOT(1)
SVC_Handler
B .
PUBWEAK PendSV_Handler
SECTION .text:CODE:REORDER:NOROOT(1)
PendSV_Handler
B .
PUBWEAK SysTick_Handler
SECTION .text:CODE:REORDER:NOROOT(1)
SysTick_Handler
B .
PUBWEAK DMA0_DMA4_IRQHandler
PUBWEAK DMA1_DMA5_IRQHandler
PUBWEAK DMA2_DMA6_IRQHandler
PUBWEAK DMA3_DMA7_IRQHandler
PUBWEAK DMA_Error_IRQHandler
PUBWEAK FLEXIO0_IRQHandler
PUBWEAK TPM0_IRQHandler
PUBWEAK TPM1_IRQHandler
PUBWEAK TPM2_IRQHandler
PUBWEAK PIT0_IRQHandler
PUBWEAK SPI0_IRQHandler
PUBWEAK EMVSIM0_IRQHandler
PUBWEAK LPUART0_IRQHandler
PUBWEAK LPUART1_IRQHandler
PUBWEAK I2C0_IRQHandler
PUBWEAK QSPI0_IRQHandler
PUBWEAK Reserved32_IRQHandler
PUBWEAK PORTA_IRQHandler
PUBWEAK PORTB_IRQHandler
PUBWEAK PORTC_IRQHandler
PUBWEAK PORTD_IRQHandler
PUBWEAK PORTE_IRQHandler
PUBWEAK LLWU_IRQHandler
PUBWEAK LTC0_IRQHandler
PUBWEAK USB0_IRQHandler
PUBWEAK ADC0_IRQHandler
PUBWEAK LPTMR0_IRQHandler
PUBWEAK RTC_Seconds_IRQHandler
PUBWEAK INTMUX0_0_IRQHandler
PUBWEAK INTMUX0_1_IRQHandler
PUBWEAK INTMUX0_2_IRQHandler
PUBWEAK INTMUX0_3_IRQHandler
PUBWEAK LPTMR1_IRQHandler
PUBWEAK Reserved49_IRQHandler
PUBWEAK Reserved50_IRQHandler
PUBWEAK Reserved51_IRQHandler
PUBWEAK SPI1_IRQHandler
PUBWEAK LPUART2_IRQHandler
PUBWEAK EMVSIM1_IRQHandler
PUBWEAK I2C1_IRQHandler
PUBWEAK TSI0_IRQHandler
PUBWEAK PMC_IRQHandler
PUBWEAK FTFA_IRQHandler
PUBWEAK MCG_IRQHandler
PUBWEAK WDOG_EWM_IRQHandler
PUBWEAK DAC0_IRQHandler
PUBWEAK TRNG0_IRQHandler
PUBWEAK Reserved63_IRQHandler
PUBWEAK CMP0_IRQHandler
PUBWEAK Reserved65_IRQHandler
PUBWEAK RTC_Alarm_IRQHandler
PUBWEAK Reserved67_IRQHandler
PUBWEAK Reserved68_IRQHandler
PUBWEAK Reserved69_IRQHandler
PUBWEAK Reserved70_IRQHandler
PUBWEAK Reserved71_IRQHandler
PUBWEAK DMA4_IRQHandler
PUBWEAK DMA5_IRQHandler
PUBWEAK DMA6_IRQHandler
PUBWEAK DMA7_IRQHandler
PUBWEAK Reserved76_IRQHandler
PUBWEAK Reserved77_IRQHandler
PUBWEAK Reserved78_IRQHandler
PUBWEAK Reserved79_IRQHandler
PUBWEAK DefaultISR
SECTION .text:CODE:REORDER:NOROOT(2)
DMA0_DMA4_IRQHandler
DMA1_DMA5_IRQHandler
DMA2_DMA6_IRQHandler
DMA3_DMA7_IRQHandler
DMA_Error_IRQHandler
FLEXIO0_IRQHandler
TPM0_IRQHandler
TPM1_IRQHandler
TPM2_IRQHandler
PIT0_IRQHandler
SPI0_IRQHandler
EMVSIM0_IRQHandler
LPUART0_IRQHandler
LPUART1_IRQHandler
I2C0_IRQHandler
QSPI0_IRQHandler
Reserved32_IRQHandler
PORTA_IRQHandler
PORTB_IRQHandler
PORTC_IRQHandler
PORTD_IRQHandler
PORTE_IRQHandler
LLWU_IRQHandler
LTC0_IRQHandler
USB0_IRQHandler
ADC0_IRQHandler
LPTMR0_IRQHandler
RTC_Seconds_IRQHandler
INTMUX0_0_IRQHandler
INTMUX0_1_IRQHandler
INTMUX0_2_IRQHandler
INTMUX0_3_IRQHandler
LPTMR1_IRQHandler
Reserved49_IRQHandler
Reserved50_IRQHandler
Reserved51_IRQHandler
SPI1_IRQHandler
LPUART2_IRQHandler
EMVSIM1_IRQHandler
I2C1_IRQHandler
TSI0_IRQHandler
PMC_IRQHandler
FTFA_IRQHandler
MCG_IRQHandler
WDOG_EWM_IRQHandler
DAC0_IRQHandler
TRNG0_IRQHandler
Reserved63_IRQHandler
CMP0_IRQHandler
Reserved65_IRQHandler
RTC_Alarm_IRQHandler
Reserved67_IRQHandler
Reserved68_IRQHandler
Reserved69_IRQHandler
Reserved70_IRQHandler
Reserved71_IRQHandler
DMA4_IRQHandler
DMA5_IRQHandler
DMA6_IRQHandler
DMA7_IRQHandler
Reserved76_IRQHandler
Reserved77_IRQHandler
Reserved78_IRQHandler
Reserved79_IRQHandler
DefaultISR
LDR R0, =DefaultISR
BX R0
END
@@ -0,0 +1,347 @@
; ---------------------------------------------------------------------------------------
; @file: startup_MKL82Z7.s
; @purpose: CMSIS Cortex-M0P Core Device Startup File
; MKL82Z7
; @version: 1.4
; @date: 2015-8-28
; @build: b150910
; ---------------------------------------------------------------------------------------
;
; Copyright (c) 1997 - 2015 , Freescale Semiconductor, Inc.
; All rights reserved.
;
; Redistribution and use in source and binary forms, with or without modification,
; are permitted provided that the following conditions are met:
;
; o Redistributions of source code must retain the above copyright notice, this list
; of conditions and the following disclaimer.
;
; o 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.
;
; o Neither the name of Freescale Semiconductor, Inc. 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.
;
; The modules in this file are included in the libraries, and may be replaced
; by any user-defined modules that define the PUBLIC symbol _program_start or
; a user defined start symbol.
; To override the cstartup defined in the library, simply add your modified
; version to the workbench project.
;
; The vector table is normally located at address 0.
; When debugging in RAM, it can be located in RAM, aligned to at least 2^6.
; The name "__vector_table" has special meaning for C-SPY:
; it is where the SP start value is found, and the NVIC vector
; table register (VTOR) is initialized to this address if != 0.
;
; Cortex-M version
;
MODULE ?cstartup
;; Forward declaration of sections.
SECTION CSTACK:DATA:NOROOT(3)
SECTION .intvec:CODE:NOROOT(2)
EXTERN __iar_program_start
EXTERN SystemInit
EXTERN init_data_bss
PUBLIC __vector_table
PUBLIC __vector_table_0x1c
PUBLIC __Vectors
PUBLIC __Vectors_End
PUBLIC __Vectors_Size
DATA
__vector_table
DCD sfe(CSTACK)
DCD Reset_Handler
DCD NMI_Handler ;NMI Handler
DCD HardFault_Handler ;Hard Fault Handler
DCD 0 ;Reserved
DCD 0 ;Reserved
DCD 0 ;Reserved
__vector_table_0x1c
DCD 0 ;Reserved
DCD 0 ;Reserved
DCD 0 ;Reserved
DCD 0 ;Reserved
DCD SVC_Handler ;SVCall Handler
DCD 0 ;Reserved
DCD 0 ;Reserved
DCD PendSV_Handler ;PendSV Handler
DCD SysTick_Handler ;SysTick Handler
;External Interrupts
DCD DMA0_DMA4_IRQHandler ;DMA channel 0, 4 transfer complete
DCD DMA1_DMA5_IRQHandler ;DMA channel 1, 5 transfer complete
DCD DMA2_DMA6_IRQHandler ;DMA channel 2, 6 transfer complete
DCD DMA3_DMA7_IRQHandler ;DMA channel 3, 7 transfer complete
DCD DMA_Error_IRQHandler ;DMA channel 0 - 7 error
DCD FLEXIO0_IRQHandler ;Flexible IO
DCD TPM0_IRQHandler ;Timer/PWM module 0
DCD TPM1_IRQHandler ;Timer/PWM module 1
DCD TPM2_IRQHandler ;Timer/PWM module 2
DCD PIT0_IRQHandler ;Periodic Interrupt Timer 0
DCD SPI0_IRQHandler ;Serial Peripheral Interface 0
DCD EMVSIM0_IRQHandler ;EMVSIM0 common interrupt
DCD LPUART0_IRQHandler ;LPUART0 status and error
DCD LPUART1_IRQHandler ;LPUART1 status and error
DCD I2C0_IRQHandler ;Inter-Integrated Circuit 0
DCD QSPI0_IRQHandler ;QuadSPI0 interrupt
DCD Reserved32_IRQHandler ;DryIce tamper detect
DCD PORTA_IRQHandler ;Pin detect Port A
DCD PORTB_IRQHandler ;Pin detect Port B
DCD PORTC_IRQHandler ;Pin detect Port C
DCD PORTD_IRQHandler ;Pin detect Port D
DCD PORTE_IRQHandler ;Pin detect Port E
DCD LLWU_IRQHandler ;Low Leakage Wakeup
DCD LTC0_IRQHandler ;Low power trusted cryptographic
DCD USB0_IRQHandler ;USB OTG interrupt
DCD ADC0_IRQHandler ;Analog-to-Digital Converter 0
DCD LPTMR0_IRQHandler ;Low-Power Timer 0
DCD RTC_Seconds_IRQHandler ;RTC seconds
DCD INTMUX0_0_IRQHandler ;Selectable peripheral interrupt INTMUX0-0
DCD INTMUX0_1_IRQHandler ;Selectable peripheral interrupt INTMUX0-1
DCD INTMUX0_2_IRQHandler ;Selectable peripheral interrupt INTMUX0-2
DCD INTMUX0_3_IRQHandler ;Selectable peripheral interrupt INTMUX0-3
DCD LPTMR1_IRQHandler ;Low-Power Timer 1 (INTMUX source IRQ0)
DCD Reserved49_IRQHandler ;Reserved interrupt (INTMUX source IRQ1)
DCD Reserved50_IRQHandler ;Reserved interrupt (INTMUX source IRQ2)
DCD Reserved51_IRQHandler ;Reserved interrupt (INTMUX source IRQ3)
DCD SPI1_IRQHandler ;Serial Peripheral Interface 1 (INTMUX source IRQ4)
DCD LPUART2_IRQHandler ;LPUART2 status and error (INTMUX source IRQ5)
DCD EMVSIM1_IRQHandler ;EMVSIM1 common interrupt (INTMUX source IRQ6)
DCD I2C1_IRQHandler ;Inter-Integrated Circuit 1 (INTMUX source IRQ7)
DCD TSI0_IRQHandler ;Touch Sensing Input 0 (INTMUX source IRQ8)
DCD PMC_IRQHandler ;PMC controller low-voltage detect, low-voltage warning (INTMUX source IRQ9)
DCD FTFA_IRQHandler ;FTFA command complete/read collision (INTMUX source IRQ10)
DCD MCG_IRQHandler ;Multipurpose clock generator (INTMUX source IRQ11)
DCD WDOG_EWM_IRQHandler ;Single interrupt vector for WDOG and EWM (INTMUX source IRQ12)
DCD DAC0_IRQHandler ;Digital-to-analog converter 0 (INTMUX source IRQ13)
DCD TRNG0_IRQHandler ;True randon number generator (INTMUX source IRQ14)
DCD Reserved63_IRQHandler ;Reserved interrupt (INTMUX source IRQ15)
DCD CMP0_IRQHandler ;Comparator 0 (INTMUX source IRQ16)
DCD Reserved65_IRQHandler ;Reserved interrupt (INTMUX source IRQ17)
DCD RTC_Alarm_IRQHandler ;Real time clock (INTMUX source IRQ18)
DCD Reserved67_IRQHandler ;Reserved interrupt (INTMUX source IRQ19)
DCD Reserved68_IRQHandler ;Reserved interrupt (INTMUX source IRQ20)
DCD Reserved69_IRQHandler ;Reserved interrupt (INTMUX source IRQ21)
DCD Reserved70_IRQHandler ;Reserved interrupt (INTMUX source IRQ22)
DCD Reserved71_IRQHandler ;Reserved interrupt (INTMUX source IRQ23)
DCD DMA4_IRQHandler ;DMA channel 4 transfer complete (INTMUX source IRQ24)
DCD DMA5_IRQHandler ;DMA channel 5 transfer complete (INTMUX source IRQ25)
DCD DMA6_IRQHandler ;DMA channel 6 transfer complete (INTMUX source IRQ26)
DCD DMA7_IRQHandler ;DMA channel 7 transfer complete (INTMUX source IRQ27)
DCD Reserved76_IRQHandler ;Reserved interrupt (INTMUX source IRQ28)
DCD Reserved77_IRQHandler ;Reserved interrupt (INTMUX source IRQ29)
DCD Reserved78_IRQHandler ;Reserved interrupt (INTMUX source IRQ30)
DCD Reserved79_IRQHandler ;Reserved interrupt (INTMUX source IRQ31)
__Vectors_End
SECTION FlashConfig:CODE
__FlashConfig
DCD 0xFFFFFFFF
DCD 0xFFFFFFFF
DCD 0xFFFFFFFF
DCD 0xFFFFBDFE
__FlashConfig_End
__Vectors EQU __vector_table
__Vectors_Size EQU __Vectors_End - __Vectors
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
;; Default interrupt handlers.
;;
THUMB
PUBWEAK Reset_Handler
SECTION .text:CODE:REORDER:NOROOT(2)
Reset_Handler
CPSID I ; Mask interrupts
LDR R0, =SystemInit
BLX R0
LDR R0, =init_data_bss
BLX R0
CPSIE I ; Unmask interrupts
LDR R0, =__iar_program_start
BX R0
PUBWEAK NMI_Handler
SECTION .text:CODE:REORDER:NOROOT(1)
NMI_Handler
B .
PUBWEAK HardFault_Handler
SECTION .text:CODE:REORDER:NOROOT(1)
HardFault_Handler
B .
PUBWEAK SVC_Handler
SECTION .text:CODE:REORDER:NOROOT(1)
SVC_Handler
B .
PUBWEAK PendSV_Handler
SECTION .text:CODE:REORDER:NOROOT(1)
PendSV_Handler
B .
PUBWEAK SysTick_Handler
SECTION .text:CODE:REORDER:NOROOT(1)
SysTick_Handler
B .
PUBWEAK DMA0_DMA4_IRQHandler
PUBWEAK DMA1_DMA5_IRQHandler
PUBWEAK DMA2_DMA6_IRQHandler
PUBWEAK DMA3_DMA7_IRQHandler
PUBWEAK DMA_Error_IRQHandler
PUBWEAK FLEXIO0_IRQHandler
PUBWEAK TPM0_IRQHandler
PUBWEAK TPM1_IRQHandler
PUBWEAK TPM2_IRQHandler
PUBWEAK PIT0_IRQHandler
PUBWEAK SPI0_IRQHandler
PUBWEAK EMVSIM0_IRQHandler
PUBWEAK LPUART0_IRQHandler
PUBWEAK LPUART1_IRQHandler
PUBWEAK I2C0_IRQHandler
PUBWEAK QSPI0_IRQHandler
PUBWEAK Reserved32_IRQHandler
PUBWEAK PORTA_IRQHandler
PUBWEAK PORTB_IRQHandler
PUBWEAK PORTC_IRQHandler
PUBWEAK PORTD_IRQHandler
PUBWEAK PORTE_IRQHandler
PUBWEAK LLWU_IRQHandler
PUBWEAK LTC0_IRQHandler
PUBWEAK USB0_IRQHandler
PUBWEAK ADC0_IRQHandler
PUBWEAK LPTMR0_IRQHandler
PUBWEAK RTC_Seconds_IRQHandler
PUBWEAK INTMUX0_0_IRQHandler
PUBWEAK INTMUX0_1_IRQHandler
PUBWEAK INTMUX0_2_IRQHandler
PUBWEAK INTMUX0_3_IRQHandler
PUBWEAK LPTMR1_IRQHandler
PUBWEAK Reserved49_IRQHandler
PUBWEAK Reserved50_IRQHandler
PUBWEAK Reserved51_IRQHandler
PUBWEAK SPI1_IRQHandler
PUBWEAK LPUART2_IRQHandler
PUBWEAK EMVSIM1_IRQHandler
PUBWEAK I2C1_IRQHandler
PUBWEAK TSI0_IRQHandler
PUBWEAK PMC_IRQHandler
PUBWEAK FTFA_IRQHandler
PUBWEAK MCG_IRQHandler
PUBWEAK WDOG_EWM_IRQHandler
PUBWEAK DAC0_IRQHandler
PUBWEAK TRNG0_IRQHandler
PUBWEAK Reserved63_IRQHandler
PUBWEAK CMP0_IRQHandler
PUBWEAK Reserved65_IRQHandler
PUBWEAK RTC_Alarm_IRQHandler
PUBWEAK Reserved67_IRQHandler
PUBWEAK Reserved68_IRQHandler
PUBWEAK Reserved69_IRQHandler
PUBWEAK Reserved70_IRQHandler
PUBWEAK Reserved71_IRQHandler
PUBWEAK DMA4_IRQHandler
PUBWEAK DMA5_IRQHandler
PUBWEAK DMA6_IRQHandler
PUBWEAK DMA7_IRQHandler
PUBWEAK Reserved76_IRQHandler
PUBWEAK Reserved77_IRQHandler
PUBWEAK Reserved78_IRQHandler
PUBWEAK Reserved79_IRQHandler
PUBWEAK DefaultISR
SECTION .text:CODE:REORDER:NOROOT(2)
DMA0_DMA4_IRQHandler
DMA1_DMA5_IRQHandler
DMA2_DMA6_IRQHandler
DMA3_DMA7_IRQHandler
DMA_Error_IRQHandler
FLEXIO0_IRQHandler
TPM0_IRQHandler
TPM1_IRQHandler
TPM2_IRQHandler
PIT0_IRQHandler
SPI0_IRQHandler
EMVSIM0_IRQHandler
LPUART0_IRQHandler
LPUART1_IRQHandler
I2C0_IRQHandler
QSPI0_IRQHandler
Reserved32_IRQHandler
PORTA_IRQHandler
PORTB_IRQHandler
PORTC_IRQHandler
PORTD_IRQHandler
PORTE_IRQHandler
LLWU_IRQHandler
LTC0_IRQHandler
USB0_IRQHandler
ADC0_IRQHandler
LPTMR0_IRQHandler
RTC_Seconds_IRQHandler
INTMUX0_0_IRQHandler
INTMUX0_1_IRQHandler
INTMUX0_2_IRQHandler
INTMUX0_3_IRQHandler
LPTMR1_IRQHandler
Reserved49_IRQHandler
Reserved50_IRQHandler
Reserved51_IRQHandler
SPI1_IRQHandler
LPUART2_IRQHandler
EMVSIM1_IRQHandler
I2C1_IRQHandler
TSI0_IRQHandler
PMC_IRQHandler
FTFA_IRQHandler
MCG_IRQHandler
WDOG_EWM_IRQHandler
DAC0_IRQHandler
TRNG0_IRQHandler
Reserved63_IRQHandler
CMP0_IRQHandler
Reserved65_IRQHandler
RTC_Alarm_IRQHandler
Reserved67_IRQHandler
Reserved68_IRQHandler
Reserved69_IRQHandler
Reserved70_IRQHandler
Reserved71_IRQHandler
DMA4_IRQHandler
DMA5_IRQHandler
DMA6_IRQHandler
DMA7_IRQHandler
Reserved76_IRQHandler
Reserved77_IRQHandler
Reserved78_IRQHandler
Reserved79_IRQHandler
DefaultISR
LDR R0, =DefaultISR
BX R0
END
@@ -0,0 +1,350 @@
; ---------------------------------------------------------------------------------------
; @file: startup_MKL82Z7.s
; @purpose: CMSIS Cortex-M0P Core Device Startup File
; MKL82Z7
; @version: 1.4
; @date: 2015-8-28
; @build: b150910
; ---------------------------------------------------------------------------------------
;
; Copyright (c) 1997 - 2015 , Freescale Semiconductor, Inc.
; All rights reserved.
;
; Redistribution and use in source and binary forms, with or without modification,
; are permitted provided that the following conditions are met:
;
; o Redistributions of source code must retain the above copyright notice, this list
; of conditions and the following disclaimer.
;
; o 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.
;
; o Neither the name of Freescale Semiconductor, Inc. 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.
;
; The modules in this file are included in the libraries, and may be replaced
; by any user-defined modules that define the PUBLIC symbol _program_start or
; a user defined start symbol.
; To override the cstartup defined in the library, simply add your modified
; version to the workbench project.
;
; The vector table is normally located at address 0.
; When debugging in RAM, it can be located in RAM, aligned to at least 2^6.
; The name "__vector_table" has special meaning for C-SPY:
; it is where the SP start value is found, and the NVIC vector
; table register (VTOR) is initialized to this address if != 0.
;
; Cortex-M version
;
MODULE ?cstartup
;; Forward declaration of sections.
SECTION CSTACK:DATA:NOROOT(3)
SECTION .intvec:CODE:NOROOT(2)
EXTERN __iar_program_start
EXTERN SystemInit
EXTERN ROM_PatchHandler
EXTERN init_data_bss
PUBLIC __vector_table
PUBLIC __vector_table_0x1c
PUBLIC __Vectors
PUBLIC __Vectors_End
PUBLIC __Vectors_Size
DATA
__vector_table
DCD sfe(CSTACK)
DCD Reset_Handler
DCD NMI_Handler ;NMI Handler
DCD HardFault_Handler ;Hard Fault Handler
DCD 0 ;Reserved
DCD 0 ;Reserved
DCD 0 ;Reserved
__vector_table_0x1c
DCD 0 ;Reserved
DCD 0 ;Reserved
DCD 0 ;Reserved
DCD 0 ;Reserved
DCD SVC_Handler ;SVCall Handler
DCD 0 ;Reserved
DCD 0 ;Reserved
DCD PendSV_Handler ;PendSV Handler
DCD SysTick_Handler ;SysTick Handler
;External Interrupts
DCD DMA0_DMA4_IRQHandler ;DMA channel 0, 4 transfer complete
DCD DMA1_DMA5_IRQHandler ;DMA channel 1, 5 transfer complete
DCD DMA2_DMA6_IRQHandler ;DMA channel 2, 6 transfer complete
DCD DMA3_DMA7_IRQHandler ;DMA channel 3, 7 transfer complete
DCD DMA_Error_IRQHandler ;DMA channel 0 - 7 error
DCD FLEXIO0_IRQHandler ;Flexible IO
DCD TPM0_IRQHandler ;Timer/PWM module 0
DCD TPM1_IRQHandler ;Timer/PWM module 1
DCD TPM2_IRQHandler ;Timer/PWM module 2
DCD PIT0_IRQHandler ;Periodic Interrupt Timer 0
DCD SPI0_IRQHandler ;Serial Peripheral Interface 0
DCD EMVSIM0_IRQHandler ;EMVSIM0 common interrupt
DCD LPUART0_IRQHandler ;LPUART0 status and error
DCD LPUART1_IRQHandler ;LPUART1 status and error
DCD I2C0_IRQHandler ;Inter-Integrated Circuit 0
DCD QSPI0_IRQHandler ;QuadSPI0 interrupt
DCD Reserved32_IRQHandler ;DryIce tamper detect
DCD PORTA_IRQHandler ;Pin detect Port A
DCD PORTB_IRQHandler ;Pin detect Port B
DCD PORTC_IRQHandler ;Pin detect Port C
DCD PORTD_IRQHandler ;Pin detect Port D
DCD PORTE_IRQHandler ;Pin detect Port E
DCD LLWU_IRQHandler ;Low Leakage Wakeup
DCD LTC0_IRQHandler ;Low power trusted cryptographic
DCD USB0_IRQHandler ;USB OTG interrupt
DCD ADC0_IRQHandler ;Analog-to-Digital Converter 0
DCD LPTMR0_IRQHandler ;Low-Power Timer 0
DCD RTC_Seconds_IRQHandler ;RTC seconds
DCD INTMUX0_0_IRQHandler ;Selectable peripheral interrupt INTMUX0-0
DCD INTMUX0_1_IRQHandler ;Selectable peripheral interrupt INTMUX0-1
DCD INTMUX0_2_IRQHandler ;Selectable peripheral interrupt INTMUX0-2
DCD INTMUX0_3_IRQHandler ;Selectable peripheral interrupt INTMUX0-3
DCD LPTMR1_IRQHandler ;Low-Power Timer 1 (INTMUX source IRQ0)
DCD Reserved49_IRQHandler ;Reserved interrupt (INTMUX source IRQ1)
DCD Reserved50_IRQHandler ;Reserved interrupt (INTMUX source IRQ2)
DCD Reserved51_IRQHandler ;Reserved interrupt (INTMUX source IRQ3)
DCD SPI1_IRQHandler ;Serial Peripheral Interface 1 (INTMUX source IRQ4)
DCD LPUART2_IRQHandler ;LPUART2 status and error (INTMUX source IRQ5)
DCD EMVSIM1_IRQHandler ;EMVSIM1 common interrupt (INTMUX source IRQ6)
DCD I2C1_IRQHandler ;Inter-Integrated Circuit 1 (INTMUX source IRQ7)
DCD TSI0_IRQHandler ;Touch Sensing Input 0 (INTMUX source IRQ8)
DCD PMC_IRQHandler ;PMC controller low-voltage detect, low-voltage warning (INTMUX source IRQ9)
DCD FTFA_IRQHandler ;FTFA command complete/read collision (INTMUX source IRQ10)
DCD MCG_IRQHandler ;Multipurpose clock generator (INTMUX source IRQ11)
DCD WDOG_EWM_IRQHandler ;Single interrupt vector for WDOG and EWM (INTMUX source IRQ12)
DCD DAC0_IRQHandler ;Digital-to-analog converter 0 (INTMUX source IRQ13)
DCD TRNG0_IRQHandler ;True randon number generator (INTMUX source IRQ14)
DCD Reserved63_IRQHandler ;Reserved interrupt (INTMUX source IRQ15)
DCD CMP0_IRQHandler ;Comparator 0 (INTMUX source IRQ16)
DCD Reserved65_IRQHandler ;Reserved interrupt (INTMUX source IRQ17)
DCD RTC_Alarm_IRQHandler ;Real time clock (INTMUX source IRQ18)
DCD Reserved67_IRQHandler ;Reserved interrupt (INTMUX source IRQ19)
DCD Reserved68_IRQHandler ;Reserved interrupt (INTMUX source IRQ20)
DCD Reserved69_IRQHandler ;Reserved interrupt (INTMUX source IRQ21)
DCD Reserved70_IRQHandler ;Reserved interrupt (INTMUX source IRQ22)
DCD Reserved71_IRQHandler ;Reserved interrupt (INTMUX source IRQ23)
DCD DMA4_IRQHandler ;DMA channel 4 transfer complete (INTMUX source IRQ24)
DCD DMA5_IRQHandler ;DMA channel 5 transfer complete (INTMUX source IRQ25)
DCD DMA6_IRQHandler ;DMA channel 6 transfer complete (INTMUX source IRQ26)
DCD DMA7_IRQHandler ;DMA channel 7 transfer complete (INTMUX source IRQ27)
DCD Reserved76_IRQHandler ;Reserved interrupt (INTMUX source IRQ28)
DCD Reserved77_IRQHandler ;Reserved interrupt (INTMUX source IRQ29)
DCD Reserved78_IRQHandler ;Reserved interrupt (INTMUX source IRQ30)
DCD Reserved79_IRQHandler ;Reserved interrupt (INTMUX source IRQ31)
__Vectors_End
SECTION FlashConfig:CODE
__FlashConfig
DCD 0xFFFFFFFF
DCD 0xFFFFFFFF
DCD 0xFFFFFFFF
DCD 0xFFFFBDFE
__FlashConfig_End
__Vectors EQU __vector_table
__Vectors_Size EQU __Vectors_End - __Vectors
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
;; Default interrupt handlers.
;;
THUMB
PUBWEAK Reset_Handler
SECTION BootloaderPatchHandler:CODE:REORDER:NOROOT(2)
Reset_Handler
CPSID I ; Mask interrupts
LDR R0, =ROM_PatchHandler
BLX R0
LDR R0, =SystemInit
BLX R0
LDR R0, =init_data_bss
BLX R0
CPSIE I ; Unmask interrupts
LDR R0, =__iar_program_start
BX R0
PUBWEAK NMI_Handler
SECTION .text:CODE:REORDER:NOROOT(1)
NMI_Handler
B .
PUBWEAK HardFault_Handler
SECTION .text:CODE:REORDER:NOROOT(1)
HardFault_Handler
B .
PUBWEAK SVC_Handler
SECTION .text:CODE:REORDER:NOROOT(1)
SVC_Handler
B .
PUBWEAK PendSV_Handler
SECTION .text:CODE:REORDER:NOROOT(1)
PendSV_Handler
B .
PUBWEAK SysTick_Handler
SECTION .text:CODE:REORDER:NOROOT(1)
SysTick_Handler
B .
PUBWEAK DMA0_DMA4_IRQHandler
PUBWEAK DMA1_DMA5_IRQHandler
PUBWEAK DMA2_DMA6_IRQHandler
PUBWEAK DMA3_DMA7_IRQHandler
PUBWEAK DMA_Error_IRQHandler
PUBWEAK FLEXIO0_IRQHandler
PUBWEAK TPM0_IRQHandler
PUBWEAK TPM1_IRQHandler
PUBWEAK TPM2_IRQHandler
PUBWEAK PIT0_IRQHandler
PUBWEAK SPI0_IRQHandler
PUBWEAK EMVSIM0_IRQHandler
PUBWEAK LPUART0_IRQHandler
PUBWEAK LPUART1_IRQHandler
PUBWEAK I2C0_IRQHandler
PUBWEAK QSPI0_IRQHandler
PUBWEAK Reserved32_IRQHandler
PUBWEAK PORTA_IRQHandler
PUBWEAK PORTB_IRQHandler
PUBWEAK PORTC_IRQHandler
PUBWEAK PORTD_IRQHandler
PUBWEAK PORTE_IRQHandler
PUBWEAK LLWU_IRQHandler
PUBWEAK LTC0_IRQHandler
PUBWEAK USB0_IRQHandler
PUBWEAK ADC0_IRQHandler
PUBWEAK LPTMR0_IRQHandler
PUBWEAK RTC_Seconds_IRQHandler
PUBWEAK INTMUX0_0_IRQHandler
PUBWEAK INTMUX0_1_IRQHandler
PUBWEAK INTMUX0_2_IRQHandler
PUBWEAK INTMUX0_3_IRQHandler
PUBWEAK LPTMR1_IRQHandler
PUBWEAK Reserved49_IRQHandler
PUBWEAK Reserved50_IRQHandler
PUBWEAK Reserved51_IRQHandler
PUBWEAK SPI1_IRQHandler
PUBWEAK LPUART2_IRQHandler
PUBWEAK EMVSIM1_IRQHandler
PUBWEAK I2C1_IRQHandler
PUBWEAK TSI0_IRQHandler
PUBWEAK PMC_IRQHandler
PUBWEAK FTFA_IRQHandler
PUBWEAK MCG_IRQHandler
PUBWEAK WDOG_EWM_IRQHandler
PUBWEAK DAC0_IRQHandler
PUBWEAK TRNG0_IRQHandler
PUBWEAK Reserved63_IRQHandler
PUBWEAK CMP0_IRQHandler
PUBWEAK Reserved65_IRQHandler
PUBWEAK RTC_Alarm_IRQHandler
PUBWEAK Reserved67_IRQHandler
PUBWEAK Reserved68_IRQHandler
PUBWEAK Reserved69_IRQHandler
PUBWEAK Reserved70_IRQHandler
PUBWEAK Reserved71_IRQHandler
PUBWEAK DMA4_IRQHandler
PUBWEAK DMA5_IRQHandler
PUBWEAK DMA6_IRQHandler
PUBWEAK DMA7_IRQHandler
PUBWEAK Reserved76_IRQHandler
PUBWEAK Reserved77_IRQHandler
PUBWEAK Reserved78_IRQHandler
PUBWEAK Reserved79_IRQHandler
PUBWEAK DefaultISR
SECTION .text:CODE:REORDER:NOROOT(2)
DMA0_DMA4_IRQHandler
DMA1_DMA5_IRQHandler
DMA2_DMA6_IRQHandler
DMA3_DMA7_IRQHandler
DMA_Error_IRQHandler
FLEXIO0_IRQHandler
TPM0_IRQHandler
TPM1_IRQHandler
TPM2_IRQHandler
PIT0_IRQHandler
SPI0_IRQHandler
EMVSIM0_IRQHandler
LPUART0_IRQHandler
LPUART1_IRQHandler
I2C0_IRQHandler
QSPI0_IRQHandler
Reserved32_IRQHandler
PORTA_IRQHandler
PORTB_IRQHandler
PORTC_IRQHandler
PORTD_IRQHandler
PORTE_IRQHandler
LLWU_IRQHandler
LTC0_IRQHandler
USB0_IRQHandler
ADC0_IRQHandler
LPTMR0_IRQHandler
RTC_Seconds_IRQHandler
INTMUX0_0_IRQHandler
INTMUX0_1_IRQHandler
INTMUX0_2_IRQHandler
INTMUX0_3_IRQHandler
LPTMR1_IRQHandler
Reserved49_IRQHandler
Reserved50_IRQHandler
Reserved51_IRQHandler
SPI1_IRQHandler
LPUART2_IRQHandler
EMVSIM1_IRQHandler
I2C1_IRQHandler
TSI0_IRQHandler
PMC_IRQHandler
FTFA_IRQHandler
MCG_IRQHandler
WDOG_EWM_IRQHandler
DAC0_IRQHandler
TRNG0_IRQHandler
Reserved63_IRQHandler
CMP0_IRQHandler
Reserved65_IRQHandler
RTC_Alarm_IRQHandler
Reserved67_IRQHandler
Reserved68_IRQHandler
Reserved69_IRQHandler
Reserved70_IRQHandler
Reserved71_IRQHandler
DMA4_IRQHandler
DMA5_IRQHandler
DMA6_IRQHandler
DMA7_IRQHandler
Reserved76_IRQHandler
Reserved77_IRQHandler
Reserved78_IRQHandler
Reserved79_IRQHandler
DefaultISR
LDR R0, =DefaultISR
BX R0
END
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,390 @@
/*
** ###################################################################
** Processors: MKL82Z128VLH7
** MKL82Z128VLK7
** MKL82Z128VLL7
** MKL82Z128VMC7
** MKL82Z128VMP7
**
** Compilers: Keil ARM C/C++ Compiler
** Freescale C/C++ for Embedded ARM
** GNU C Compiler
** GNU C Compiler - CodeSourcery Sourcery G++
** IAR ANSI C/C++ Compiler for ARM
**
** Reference manual: KL82P121M72SF0RM, Rev.0.3 June 2015
** Version: rev. 1.4, 2015-08-28
** Build: b150910
**
** 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 (c) 2015 Freescale Semiconductor, Inc.
** All rights reserved.
**
** Redistribution and use in source and binary forms, with or without modification,
** are permitted provided that the following conditions are met:
**
** o Redistributions of source code must retain the above copyright notice, this list
** of conditions and the following disclaimer.
**
** o 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.
**
** o Neither the name of Freescale Semiconductor, Inc. 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.
**
** http: www.freescale.com
** mail: support@freescale.com
**
** Revisions:
** - rev. 1.0 (2015-04-18)
** Initial version.
** - rev. 1.1 (2015-05-04)
** Update SIM, EVMSIM, QuadSPI, and I2C based on Rev0 document.
** - rev. 1.2 (2015-08-11)
** Correct clock configuration.
** - rev. 1.3 (2015-08-20)
** Align with RM Rev.1.
** - rev. 1.4 (2015-08-28)
** Update LPUART to add FIFO.
**
** ###################################################################
*/
/*!
* @file MKL82Z7
* @version 1.4
* @date 2015-08-28
* @brief Device specific configuration file for MKL82Z7 (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_MKL82Z7_H_
#define SYSTEM_MKL82Z7_H_ /**< Symbol preventing repeated inclusion */
#ifdef __cplusplus
extern "C" {
#endif
#include <stdint.h>
#ifndef DISABLE_WDOG
#define DISABLE_WDOG 1
#endif
/* MCG mode constants */
#define MCG_MODE_FEI 0U
#define MCG_MODE_FBI 1U
#define MCG_MODE_BLPI 2U
#define MCG_MODE_FEE 3U
#define MCG_MODE_FBE 4U
#define MCG_MODE_BLPE 5U
#define MCG_MODE_PBE 6U
#define MCG_MODE_PEE 7U
/* Predefined clock setups
0 ... Default part configuration
Multipurpose Clock Generator (MCG) in FEI mode.
Reference clock source for MCG module: Slow internal reference clock
Core clock = 20.97152MHz
Bus clock = 20.97152MHz
1 ... Maximal speed configuration
Multipurpose Clock Generator (MCG) in PEE mode.
Reference clock source for MCG module: System oscillator 0 reference clock
Core clock = 96MHz
Bus clock = 24MHz
2 ... Chip internally clocked, ready for Very Low Power Run mode.
Multipurpose Clock Generator (MCG) in BLPI mode.
Reference clock source for MCG module: Fast internal reference clock
Core clock = 4MHz
Bus clock = 4MHz
3 ... Chip externally clocked, ready for Very Low Power Run mode.
Multipurpose Clock Generator (MCG) in BLPE mode.
Reference clock source for MCG module: System oscillator 0 reference clock
Core clock = 4MHz
Bus clock = 4MHz
4 ... USB clock setup
Multipurpose Clock Generator (MCG) in PEE mode.
Reference clock source for MCG module: System oscillator 0 reference clock
Core clock = 96MHz
Bus clock = 24MHz
5 ... Maximum achievable clock frequency configuration in RUN mode
Multipurpose Clock Generator (MCG) in PEE mode.
Reference clock source for MCG module: System oscillator 0 reference clock
Core clock = 72MHz
Bus clock = 24MHz
*/
/* Define clock source values */
#define CPU_XTAL_CLK_HZ \
12000000U /* Value of the external crystal or oscillator clock frequency of the system oscillator (OSC) in Hz */
#define CPU_XTAL32k_CLK_HZ \
32768U /* Value of the external 32k crystal or oscillator clock frequency of the RTC 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 CPU_INT_IRC_CLK_HZ 48000000U /* Value of the 48M internal oscillator clock frequency in Hz */
/* RTC oscillator setting */
/* RTC_CR: SC2P=0,SC4P=0,SC8P=0,SC16P=0,CLKO=1,OSCE=1,WPS=0,UM=0,SUP=0,WPE=0,SWR=0 */
#define SYSTEM_RTC_CR_VALUE 0x0300U /* RTC_CR */
/* Low power mode enable */
/* SMC_PMPROT: AHSRUN=1,AVLP=1,ALLS=1,AVLLS=1 */
#define SYSTEM_SMC_PMPROT_VALUE 0xAAU /* SMC_PMPROT */
/* Internal reference clock trim */
/* #undef SLOW_TRIM_ADDRESS */ /* Slow oscillator not trimmed. Commented out for MISRA compliance. */
/* #undef SLOW_FINE_TRIM_ADDRESS */ /* Slow oscillator not trimmed. Commented out for MISRA compliance. */
/* #undef FAST_TRIM_ADDRESS */ /* Fast oscillator not trimmed. Commented out for MISRA compliance. */
/* #undef FAST_FINE_TRIM_ADDRESS */ /* Fast oscillator not trimmed. Commented out for MISRA compliance. */
#ifdef CLOCK_SETUP
#if (CLOCK_SETUP == 0)
#define DEFAULT_SYSTEM_CLOCK 20971520U /* Default System clock value */
#define MCG_MODE MCG_MODE_FEI /* Clock generator mode */
/* MCG_C1: CLKS=0,FRDIV=0,IREFS=1,IRCLKEN=1,IREFSTEN=0 */
#define SYSTEM_MCG_C1_VALUE 0x06U /* MCG_C1 */
/* MCG_C2: LOCRE0=0,FCFTRIM=0,RANGE=2,HGO=0,EREFS=1,LP=0,IRCS=0 */
#define SYSTEM_MCG_C2_VALUE 0x24U /* MCG_C2 */
/* MCG_C4: DMX32=0,DRST_DRS=0,FCTRIM=0,SCFTRIM=0 */
#define SYSTEM_MCG_C4_VALUE 0x00U /* MCG_C4 */
/* MCG_SC: ATME=0,ATMS=0,ATMF=0,FLTPRSRV=0,FCRDIV=0,LOCS0=0 */
#define SYSTEM_MCG_SC_VALUE 0x00U /* MCG_SC */
/* MCG_C5: PLLCLKEN=0,PLLSTEN=0,PRDIV=0 */
#define SYSTEM_MCG_C5_VALUE 0x00U /* MCG_C5 */
/* MCG_C6: LOLIE0=0,PLLS=0,CME0=0,VDIV=0 */
#define SYSTEM_MCG_C6_VALUE 0x00U /* MCG_C6 */
/* MCG_C7: OSCSEL=0 */
#define SYSTEM_MCG_C7_VALUE 0x00U /* MCG_C7 */
/* OSC_CR: ERCLKEN=1,EREFSTEN=0,SC2P=0,SC4P=0,SC8P=0,SC16P=0 */
#define SYSTEM_OSC_CR_VALUE 0x80U /* OSC_CR */
/* SMC_PMCTRL: RUNM=0,STOPA=0,STOPM=0 */
#define SYSTEM_SMC_PMCTRL_VALUE 0x00U /* SMC_PMCTRL */
/* SIM_CLKDIV1: OUTDIV1=0,OUTDIV2=0,OUTDIV4=1,OUTDIV5=1 */
#define SYSTEM_SIM_CLKDIV1_VALUE 0x00011000U /* SIM_CLKDIV1 */
/* SIM_CLKDIV3: PLLFLLDIV=0,PLLFLLFRAC=0 */
#define SYSTEM_SIM_CLKDIV3_VALUE 0x00U /* SIM_CLKDIV3 */
/* SIM_SOPT1: USBREGEN=0,USBSSTBY=0,USBVSTBY=0,OSC32KSEL=2,RAMSIZE=0 */
#define SYSTEM_SIM_SOPT1_VALUE 0x00080000U /* SIM_SOPT1 */
/* SIM_SOPT2:
* EMVSIMSRC=0,SDHCSRC=0,LPUARTSRC=0,TPMSRC=1,FLEXIOSRC=0,USBSRC=0,PLLFLLSEL=0,TRACECLKSEL=0,FBSL=0,CLKOUTSEL=0,RTCCLKOUTSEL=0
*/
#define SYSTEM_SIM_SOPT2_VALUE 0x01000000U /* SIM_SOPT2 */
#elif(CLOCK_SETUP == 1)
#define DEFAULT_SYSTEM_CLOCK 96000000U /* Default System clock value */
#define MCG_MODE MCG_MODE_PEE /* Clock generator mode */
/* MCG_C1: CLKS=0,FRDIV=4,IREFS=0,IRCLKEN=1,IREFSTEN=0 */
#define SYSTEM_MCG_C1_VALUE 0x22U /* MCG_C1 */
/* MCG_C2: LOCRE0=0,FCFTRIM=0,RANGE=2,HGO=0,EREFS=1,LP=0,IRCS=0 */
#define SYSTEM_MCG_C2_VALUE 0x24U /* MCG_C2 */
/* MCG_C4: DMX32=0,DRST_DRS=0,FCTRIM=0,SCFTRIM=0 */
#define SYSTEM_MCG_C4_VALUE 0x00U /* MCG_C4 */
/* MCG_SC: ATME=0,ATMS=0,ATMF=0,FLTPRSRV=0,FCRDIV=0,LOCS0=0 */
#define SYSTEM_MCG_SC_VALUE 0x00U /* MCG_SC */
/* MCG_C5: PLLCLKEN=0,PLLSTEN=0,PRDIV=0 */
#define SYSTEM_MCG_C5_VALUE 0x00U /* MCG_C5 */
/* MCG_C6: LOLIE0=0,PLLS=1,CME0=0,VDIV=0 */
#define SYSTEM_MCG_C6_VALUE 0x40U /* MCG_C6 */
/* MCG_C7: OSCSEL=0 */
#define SYSTEM_MCG_C7_VALUE 0x00U /* MCG_C7 */
/* OSC_CR: ERCLKEN=1,EREFSTEN=0,SC2P=0,SC4P=0,SC8P=0,SC16P=0 */
#define SYSTEM_OSC_CR_VALUE 0x80U /* OSC_CR */
/* SMC_PMCTRL: RUNM=3,STOPA=0,STOPM=0 */
#define SYSTEM_SMC_PMCTRL_VALUE 0x60U /* SMC_PMCTRL */
/* SIM_CLKDIV1: OUTDIV1=0,OUTDIV2=3,OUTDIV4=3,OUTDIV5=0 */
#define SYSTEM_SIM_CLKDIV1_VALUE 0x03030000U /* SIM_CLKDIV1 */
/* SIM_CLKDIV3: PLLFLLDIV=0,PLLFLLFRAC=0 */
#define SYSTEM_SIM_CLKDIV3_VALUE 0x00U /* SIM_CLKDIV3 */
/* SIM_SOPT1: USBREGEN=0,USBSSTBY=0,USBVSTBY=0,OSC32KSEL=2,RAMSIZE=0 */
#define SYSTEM_SIM_SOPT1_VALUE 0x00080000U /* SIM_SOPT1 */
/* SIM_SOPT2:
* EMVSIMSRC=0,SDHCSRC=0,LPUARTSRC=0,TPMSRC=1,FLEXIOSRC=0,USBSRC=0,PLLFLLSEL=1,TRACECLKSEL=0,FBSL=0,CLKOUTSEL=0,RTCCLKOUTSEL=0
*/
#define SYSTEM_SIM_SOPT2_VALUE 0x01010000U /* SIM_SOPT2 */
#elif(CLOCK_SETUP == 2)
#define DEFAULT_SYSTEM_CLOCK 4000000U /* Default System clock value */
#define MCG_MODE MCG_MODE_BLPI /* Clock generator mode */
/* MCG_C1: CLKS=1,FRDIV=0,IREFS=1,IRCLKEN=1,IREFSTEN=0 */
#define SYSTEM_MCG_C1_VALUE 0x46U /* MCG_C1 */
/* MCG_C2: LOCRE0=0,FCFTRIM=0,RANGE=2,HGO=0,EREFS=1,LP=1,IRCS=1 */
#define SYSTEM_MCG_C2_VALUE 0x27U /* MCG_C2 */
/* MCG_C4: DMX32=0,DRST_DRS=0,FCTRIM=0,SCFTRIM=0 */
#define SYSTEM_MCG_C4_VALUE 0x00U /* MCG_C4 */
/* MCG_SC: ATME=0,ATMS=0,ATMF=0,FLTPRSRV=0,FCRDIV=0,LOCS0=0 */
#define SYSTEM_MCG_SC_VALUE 0x00U /* MCG_SC */
/* MCG_C5: PLLCLKEN=0,PLLSTEN=0,PRDIV=0 */
#define SYSTEM_MCG_C5_VALUE 0x00U /* MCG_C5 */
/* MCG_C6: LOLIE0=0,PLLS=0,CME0=0,VDIV=0 */
#define SYSTEM_MCG_C6_VALUE 0x00U /* MCG_C6 */
/* MCG_C7: OSCSEL=0 */
#define SYSTEM_MCG_C7_VALUE 0x00U /* MCG_C7 */
/* OSC_CR: ERCLKEN=1,EREFSTEN=0,SC2P=0,SC4P=0,SC8P=0,SC16P=0 */
#define SYSTEM_OSC_CR_VALUE 0x80U /* OSC_CR */
/* SMC_PMCTRL: RUNM=0,STOPA=0,STOPM=0 */
#define SYSTEM_SMC_PMCTRL_VALUE 0x00U /* SMC_PMCTRL */
/* SIM_CLKDIV1: OUTDIV1=0,OUTDIV2=3,OUTDIV4=4,OUTDIV5=0 */
#define SYSTEM_SIM_CLKDIV1_VALUE 0x03040000U /* SIM_CLKDIV1 */
/* SIM_CLKDIV3: PLLFLLDIV=0,PLLFLLFRAC=0 */
#define SYSTEM_SIM_CLKDIV3_VALUE 0x00U /* SIM_CLKDIV3 */
/* SIM_SOPT1: USBREGEN=0,USBSSTBY=0,USBVSTBY=0,OSC32KSEL=2,RAMSIZE=0 */
#define SYSTEM_SIM_SOPT1_VALUE 0x00080000U /* SIM_SOPT1 */
/* SIM_SOPT2:
* EMVSIMSRC=0,SDHCSRC=0,LPUARTSRC=0,TPMSRC=1,FLEXIOSRC=0,USBSRC=0,PLLFLLSEL=3,TRACECLKSEL=0,FBSL=0,CLKOUTSEL=0,RTCCLKOUTSEL=0
*/
#define SYSTEM_SIM_SOPT2_VALUE 0x01030000U /* SIM_SOPT2 */
#elif(CLOCK_SETUP == 3)
#define DEFAULT_SYSTEM_CLOCK 4000000U /* Default System clock value */
#define MCG_MODE MCG_MODE_BLPE /* Clock generator mode */
/* MCG_C1: CLKS=2,FRDIV=4,IREFS=0,IRCLKEN=1,IREFSTEN=0 */
#define SYSTEM_MCG_C1_VALUE 0xA2U /* MCG_C1 */
/* MCG_C2: LOCRE0=0,FCFTRIM=0,RANGE=2,HGO=0,EREFS=1,LP=1,IRCS=1 */
#define SYSTEM_MCG_C2_VALUE 0x27U /* MCG_C2 */
/* MCG_C4: DMX32=0,DRST_DRS=0,FCTRIM=0,SCFTRIM=0 */
#define SYSTEM_MCG_C4_VALUE 0x00U /* MCG_C4 */
/* MCG_SC: ATME=0,ATMS=0,ATMF=0,FLTPRSRV=0,FCRDIV=1,LOCS0=0 */
#define SYSTEM_MCG_SC_VALUE 0x02U /* MCG_SC */
/* MCG_C5: PLLCLKEN=0,PLLSTEN=0,PRDIV=0 */
#define SYSTEM_MCG_C5_VALUE 0x00U /* MCG_C5 */
/* MCG_C6: LOLIE0=0,PLLS=0,CME0=0,VDIV=0 */
#define SYSTEM_MCG_C6_VALUE 0x00U /* MCG_C6 */
/* MCG_C7: OSCSEL=0 */
#define SYSTEM_MCG_C7_VALUE 0x00U /* MCG_C7 */
/* OSC_CR: ERCLKEN=1,EREFSTEN=0,SC2P=0,SC4P=0,SC8P=0,SC16P=0 */
#define SYSTEM_OSC_CR_VALUE 0x80U /* OSC_CR */
/* SMC_PMCTRL: RUNM=0,STOPA=0,STOPM=0 */
#define SYSTEM_SMC_PMCTRL_VALUE 0x00U /* SMC_PMCTRL */
/* SIM_CLKDIV1: OUTDIV1=0,OUTDIV2=3,OUTDIV4=3,OUTDIV5=0x0B */
#define SYSTEM_SIM_CLKDIV1_VALUE 0x03030000U /* SIM_CLKDIV1 */
/* SIM_CLKDIV3: PLLFLLDIV=0,PLLFLLFRAC=0 */
#define SYSTEM_SIM_CLKDIV3_VALUE 0x00U /* SIM_CLKDIV3 */
/* SIM_SOPT1: USBREGEN=0,USBSSTBY=0,USBVSTBY=0,OSC32KSEL=2,RAMSIZE=0 */
#define SYSTEM_SIM_SOPT1_VALUE 0x00080000U /* SIM_SOPT1 */
/* SIM_SOPT2:
* EMVSIMSRC=0,SDHCSRC=0,LPUARTSRC=0,TPMSRC=1,FLEXIOSRC=0,USBSRC=0,PLLFLLSEL=3,TRACECLKSEL=0,FBSL=0,CLKOUTSEL=0,RTCCLKOUTSEL=0
*/
#define SYSTEM_SIM_SOPT2_VALUE 0x01030000U /* SIM_SOPT2 */
#elif(CLOCK_SETUP == 4)
#define DEFAULT_SYSTEM_CLOCK 96000000U /* Default System clock value */
#define MCG_MODE MCG_MODE_PEE /* Clock generator mode */
/* MCG_C1: CLKS=0,FRDIV=4,IREFS=0,IRCLKEN=1,IREFSTEN=0 */
#define SYSTEM_MCG_C1_VALUE 0x22U /* MCG_C1 */
/* MCG_C2: LOCRE0=0,FCFTRIM=0,RANGE=2,HGO=0,EREFS=1,LP=0,IRCS=0 */
#define SYSTEM_MCG_C2_VALUE 0x24U /* MCG_C2 */
/* MCG_C4: DMX32=0,DRST_DRS=0,FCTRIM=0,SCFTRIM=0 */
#define SYSTEM_MCG_C4_VALUE 0x00U /* MCG_C4 */
/* MCG_SC: ATME=0,ATMS=0,ATMF=0,FLTPRSRV=0,FCRDIV=0,LOCS0=0 */
#define SYSTEM_MCG_SC_VALUE 0x00U /* MCG_SC */
/* MCG_C5: PLLCLKEN=0,PLLSTEN=0,PRDIV=0 */
#define SYSTEM_MCG_C5_VALUE 0x00U /* MCG_C5 */
/* MCG_C6: LOLIE0=0,PLLS=1,CME0=0,VDIV=0 */
#define SYSTEM_MCG_C6_VALUE 0x40U /* MCG_C6 */
/* MCG_C7: OSCSEL=0 */
#define SYSTEM_MCG_C7_VALUE 0x00U /* MCG_C7 */
/* OSC_CR: ERCLKEN=1,EREFSTEN=0,SC2P=0,SC4P=0,SC8P=0,SC16P=0 */
#define SYSTEM_OSC_CR_VALUE 0x80U /* OSC_CR */
/* SMC_PMCTRL: RUNM=3,STOPA=0,STOPM=0 */
#define SYSTEM_SMC_PMCTRL_VALUE 0x60U /* SMC_PMCTRL */
/* SIM_CLKDIV1: OUTDIV1=0,OUTDIV2=3,OUTDIV4=3,OUTDIV5=0 */
#define SYSTEM_SIM_CLKDIV1_VALUE 0x03030000U /* SIM_CLKDIV1 */
/* SIM_CLKDIV2: USBDIV=3,USBFRAC=0 */
#define SYSTEM_SIM_CLKDIV2_VALUE 0x03U /* SIM_CLKDIV2 */
/* SIM_CLKDIV3: PLLFLLDIV=0,PLLFLLFRAC=0 */
#define SYSTEM_SIM_CLKDIV3_VALUE 0x00U /* SIM_CLKDIV3 */
/* SIM_SOPT1: USBREGEN=0,USBSSTBY=0,USBVSTBY=0,OSC32KSEL=2,RAMSIZE=0 */
#define SYSTEM_SIM_SOPT1_VALUE 0x00080000U /* SIM_SOPT1 */
/* SIM_SOPT2:
* EMVSIMSRC=0,SDHCSRC=0,LPUARTSRC=0,TPMSRC=1,FLEXIOSRC=0,USBSRC=0,PLLFLLSEL=1,TRACECLKSEL=0,FBSL=0,CLKOUTSEL=0,RTCCLKOUTSEL=0
*/
#define SYSTEM_SIM_SOPT2_VALUE 0x01010000U /* SIM_SOPT2 */
#elif(CLOCK_SETUP == 5)
#define DEFAULT_SYSTEM_CLOCK 72000000U /* Default System clock value */
#define MCG_MODE MCG_MODE_PEE /* Clock generator mode */
/* MCG_C1: CLKS=0,FRDIV=4,IREFS=0,IRCLKEN=1,IREFSTEN=0 */
#define SYSTEM_MCG_C1_VALUE 0x22U /* MCG_C1 */
/* MCG_C2: LOCRE0=0,FCFTRIM=0,RANGE=2,HGO=0,EREFS=1,LP=0,IRCS=0 */
#define SYSTEM_MCG_C2_VALUE 0x24U /* MCG_C2 */
/* MCG_C4: DMX32=0,DRST_DRS=0,FCTRIM=0,SCFTRIM=0 */
#define SYSTEM_MCG_C4_VALUE 0x00U /* MCG_C4 */
/* MCG_SC: ATME=0,ATMS=0,ATMF=0,FLTPRSRV=0,FCRDIV=0,LOCS0=0 */
#define SYSTEM_MCG_SC_VALUE 0x00U /* MCG_SC */
/* MCG_C5: PLLCLKEN=0,PLLSTEN=0,PRDIV=1 */
#define SYSTEM_MCG_C5_VALUE 0x01U /* MCG_C5 */
/* MCG_C6: LOLIE0=0,PLLS=1,CME0=0,VDIV=8 */
#define SYSTEM_MCG_C6_VALUE 0x48U /* MCG_C6 */
/* MCG_C7: OSCSEL=0 */
#define SYSTEM_MCG_C7_VALUE 0x00U /* MCG_C7 */
/* OSC_CR: ERCLKEN=1,EREFSTEN=0,SC2P=0,SC4P=0,SC8P=0,SC16P=0 */
#define SYSTEM_OSC_CR_VALUE 0x80U /* OSC_CR */
/* SMC_PMCTRL: RUNM=0,STOPA=0,STOPM=0 */
#define SYSTEM_SMC_PMCTRL_VALUE 0x00U /* SMC_PMCTRL */
/* SIM_CLKDIV1: OUTDIV1=0,OUTDIV2=2,OUTDIV4=2,OUTDIV5=0 */
#define SYSTEM_SIM_CLKDIV1_VALUE 0x02020000U /* SIM_CLKDIV1 */
/* SIM_CLKDIV3: PLLFLLDIV=0,PLLFLLFRAC=0 */
#define SYSTEM_SIM_CLKDIV3_VALUE 0x00U /* SIM_CLKDIV3 */
/* SIM_SOPT1: USBREGEN=0,USBSSTBY=0,USBVSTBY=0,OSC32KSEL=2,RAMSIZE=0 */
#define SYSTEM_SIM_SOPT1_VALUE 0x00080000U /* SIM_SOPT1 */
/* SIM_SOPT2:
* EMVSIMSRC=0,SDHCSRC=0,LPUARTSRC=0,TPMSRC=1,FLEXIOSRC=0,USBSRC=0,PLLFLLSEL=1,TRACECLKSEL=0,FBSL=0,CLKOUTSEL=0,RTCCLKOUTSEL=0
*/
#define SYSTEM_SIM_SOPT2_VALUE 0x01010000U /* SIM_SOPT2 */
#endif
#else
#define DEFAULT_SYSTEM_CLOCK 20971520u
#endif
/**
* @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_MKL82Z7_H_) */
@@ -0,0 +1,309 @@
/*
** ###################################################################
** Processors: MKL82Z128VLH7
** MKL82Z128VLK7
** MKL82Z128VLL7
** MKL82Z128VMC7
** MKL82Z128VMP7
**
** Compilers: Keil ARM C/C++ Compiler
** Freescale C/C++ for Embedded ARM
** GNU C Compiler
** GNU C Compiler - CodeSourcery Sourcery G++
** IAR ANSI C/C++ Compiler for ARM
**
** Reference manual: KL82P121M72SF0RM, Rev.0.3 June 2015
** Version: rev. 1.4, 2015-08-28
** Build: b150910
**
** 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 (c) 2015 Freescale Semiconductor, Inc.
** All rights reserved.
**
** Redistribution and use in source and binary forms, with or without modification,
** are permitted provided that the following conditions are met:
**
** o Redistributions of source code must retain the above copyright notice, this list
** of conditions and the following disclaimer.
**
** o 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.
**
** o Neither the name of Freescale Semiconductor, Inc. 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.
**
** http: www.freescale.com
** mail: support@freescale.com
**
** Revisions:
** - rev. 1.0 (2015-04-18)
** Initial version.
** - rev. 1.1 (2015-05-04)
** Update SIM, EVMSIM, QuadSPI, and I2C based on Rev0 document.
** - rev. 1.2 (2015-08-11)
** Correct clock configuration.
** - rev. 1.3 (2015-08-20)
** Align with RM Rev.1.
** - rev. 1.4 (2015-08-28)
** Update LPUART to add FIFO.
**
** ###################################################################
*/
/*!
* @file MKL82Z7
* @version 1.4
* @date 2015-08-28
* @brief Device specific configuration file for MKL82Z7 (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 "fsl_device_registers.h"
/*!
* @brief Defines the structure to set the Bootloader Configuration Area
*
* This type of variable is used to set the Bootloader Configuration Area
* of the chip.
*/
typedef struct SystemBootloaderConfig
{
uint32_t tag; /*!< Magic number to verify bootloader configuration is valid. Must be set to 'kcfg'. */
uint32_t crcStartAddress; /*!< Start address for application image CRC check. If the bits are all set then Kinetis
bootloader by default will not perform any CRC check. */
uint32_t crcByteCount; /*!< Byte count for application image CRC check. If the bits are all set then Kinetis
bootloader by default will not prform any CRC check. */
uint32_t crcExpectedValue; /*!< Expected CRC value for application CRC check. If the bits are all set then Kinetis
bootloader by default will not perform any CRC check.*/
uint8_t enabledPeripherals; /*!< Bitfield of peripherals to enable.
bit 0 - LPUART, bit 1 - I2C, bit 2 - SPI, bit 4 - USB
Kinetis bootloader will enable the peripheral if corresponding bit is set to 1. */
uint8_t i2cSlaveAddress; /*!< If not 0xFF, used as the 7-bit I2C slave address. If 0xFF, defaults to 0x10 for I2C
slave address */
uint16_t peripheralDetectionTimeoutMs; /*!< Timeout in milliseconds for active peripheral detection. If 0xFFFF,
defaults to 5 seconds. */
uint16_t usbVid; /*!< Sets the USB Vendor ID reported by the device during enumeration. If 0xFFFF, it defaults to
0x15A2. */
uint16_t usbPid; /*!< Sets the USB Product ID reported by the device during enumeration. */
uint32_t usbStringsPointer; /*!< Sets the USB Strings reported by the device during enumeration. */
uint8_t clockFlags; /*!< The flags in the clockFlags configuration field are enabled if the corresponding bit is
cleared (0).
bit 0 - HighSpeed Enable high speed mode (i.e., 48 MHz). */
uint8_t clockDivider; /*!< Inverted value of the divider to use for core and bus clocks when in high speed mode */
uint8_t bootFlags; /*!< If bit 0 is cleared, then Kinetis bootloader will jump to either Quad SPI Flash or internal
flash image depending on FOPT BOOTSRC_SEL bits.
If the bit is set, then Kinetis bootloader will prepare for host communication over serial
peripherals. */
uint8_t RESERVED1;
uint32_t RESERVED2[2];
uint8_t RESERVED3[8];
uint32_t qspiConfigBlockPtr; /*!< A pointer to the QSPI config block in internal flash array. */
uint8_t RESERVED4[12];
} system_bootloader_config_t;
#ifndef BOOTLOADER_CONFIG
#define BOOTLOADER_CONFIG 1 /* Enable BootloaderConfig Area by default */
#endif
#if (BOOTLOADER_CONFIG)
/* Bootlader configuration area */
#if defined(__IAR_SYSTEMS_ICC__)
/* Pragma to place the Bootloader Configuration Array on correct location defined in linker file. */
#pragma language = extended
#pragma location = "BootloaderConfig"
__root const system_bootloader_config_t BootloaderConfig @"BootloaderConfig" =
#elif defined(__GNUC__)
__attribute__((section(".BootloaderConfig"))) const system_bootloader_config_t BootloaderConfig =
#elif defined(__CC_ARM)
__attribute__((section("BootloaderConfig"))) const system_bootloader_config_t BootloaderConfig __attribute__((used)) =
#else
#error Unsupported compiler!
#endif
{
.tag = 0x6766636BU, /* Magic Number */
.crcStartAddress = 0xFFFFFFFFU, /* Disable CRC check */
.crcByteCount = 0xFFFFFFFFU, /* Disable CRC check */
.crcExpectedValue = 0xFFFFFFFFU, /* Disable CRC check */
.enabledPeripherals = 0x17, /* Enable all peripherals */
.i2cSlaveAddress = 0xFF, /* Use default I2C address */
.peripheralDetectionTimeoutMs = 0xFFFFU, /* Use default timeout */
.usbVid = 0xFFFFU, /* Use default USB Vendor ID */
.usbPid = 0xFFFFU, /* Use default USB Product ID */
.usbStringsPointer = 0xFFFFFFFFU, /* Use default USB Strings */
.clockFlags = 0x01, /* Enable High speed mode */
.clockDivider = 0xFF, /* Use clock divider 1 */
.bootFlags = 0x01, /* Enable communication with host */
.qspiConfigBlockPtr = 0xFFFFFFFFU /* No QSPI configuration */
};
#endif
/* ----------------------------------------------------------------------------
-- Core clock
---------------------------------------------------------------------------- */
uint32_t SystemCoreClock = 72000000ul;
/* ----------------------------------------------------------------------------
-- SystemInit()
---------------------------------------------------------------------------- */
void SystemInit(void)
{
}
/* ----------------------------------------------------------------------------
-- SystemCoreClockUpdate()
---------------------------------------------------------------------------- */
void SystemCoreClockUpdate(void)
{
uint32_t MCGOUTClock; /* Variable to store output clock frequency of the MCG module */
uint16_t Divider;
if ((MCG->C1 & MCG_C1_CLKS_MASK) == 0x00U)
{
/* Output of FLL or PLL is selected */
if ((MCG->C6 & MCG_C6_PLLS_MASK) == 0x00U)
{
/* FLL is selected */
if ((MCG->C1 & MCG_C1_IREFS_MASK) == 0x00U)
{
/* External reference clock is selected */
switch (MCG->C7 & MCG_C7_OSCSEL_MASK)
{
case 0x00U:
MCGOUTClock = CPU_XTAL_CLK_HZ; /* System oscillator drives MCG clock */
break;
case 0x01U:
MCGOUTClock = CPU_XTAL32k_CLK_HZ; /* RTC 32 kHz oscillator drives MCG clock */
break;
case 0x02U:
default:
MCGOUTClock = CPU_INT_IRC_CLK_HZ; /* IRC 48MHz oscillator drives MCG clock */
break;
}
if (((MCG->C2 & MCG_C2_RANGE_MASK) != 0x00U) && ((MCG->C7 & MCG_C7_OSCSEL_MASK) != 0x01U))
{
switch (MCG->C1 & MCG_C1_FRDIV_MASK)
{
case 0x38U:
Divider = 1536U;
break;
case 0x30U:
Divider = 1280U;
break;
default:
Divider = (uint16_t)(32LU << ((MCG->C1 & MCG_C1_FRDIV_MASK) >> MCG_C1_FRDIV_SHIFT));
break;
}
}
else
{ /* ((MCG->C2 & MCG_C2_RANGE_MASK) != 0x00U) */
Divider = (uint16_t)(1LU << ((MCG->C1 & MCG_C1_FRDIV_MASK) >> MCG_C1_FRDIV_SHIFT));
}
MCGOUTClock = (MCGOUTClock / Divider); /* Calculate the divided FLL reference clock */
}
else
{ /* (!((MCG->C1 & MCG_C1_IREFS_MASK) == 0x00U)) */
MCGOUTClock = CPU_INT_SLOW_CLK_HZ; /* The slow internal reference clock is selected */
} /* (!((MCG->C1 & MCG_C1_IREFS_MASK) == 0x00U)) */
/* Select correct multiplier to calculate the MCG output clock */
switch (MCG->C4 & (MCG_C4_DMX32_MASK | MCG_C4_DRST_DRS_MASK))
{
case 0x00U:
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) == 0x00U)) */
/* PLL is selected */
Divider = (((uint16_t)MCG->C5 & MCG_C5_PRDIV_MASK) + 0x01U);
MCGOUTClock = (uint32_t)(CPU_XTAL_CLK_HZ / Divider); /* Calculate the PLL reference clock */
Divider = (((uint16_t)MCG->C6 & MCG_C6_VDIV_MASK) + 16U);
MCGOUTClock *= Divider; /* Calculate the VCO output clock */
MCGOUTClock /= 2; /* Calculate the MCG output clock */
} /* (!((MCG->C6 & MCG_C6_PLLS_MASK) == 0x00U)) */
}
else if ((MCG->C1 & MCG_C1_CLKS_MASK) == 0x40U)
{
/* Internal reference clock is selected */
if ((MCG->C2 & MCG_C2_IRCS_MASK) == 0x00U)
{
MCGOUTClock = CPU_INT_SLOW_CLK_HZ; /* Slow internal reference clock selected */
}
else
{ /* (!((MCG->C2 & MCG_C2_IRCS_MASK) == 0x00U)) */
Divider = (uint16_t)(0x01LU << ((MCG->SC & MCG_SC_FCRDIV_MASK) >> MCG_SC_FCRDIV_SHIFT));
MCGOUTClock = (uint32_t)(CPU_INT_FAST_CLK_HZ / Divider); /* Fast internal reference clock selected */
} /* (!((MCG->C2 & MCG_C2_IRCS_MASK) == 0x00U)) */
}
else if ((MCG->C1 & MCG_C1_CLKS_MASK) == 0x80U)
{
/* External reference clock is selected */
switch (MCG->C7 & MCG_C7_OSCSEL_MASK)
{
case 0x00U:
MCGOUTClock = CPU_XTAL_CLK_HZ; /* System oscillator drives MCG clock */
break;
case 0x01U:
MCGOUTClock = CPU_XTAL32k_CLK_HZ; /* RTC 32 kHz oscillator drives MCG clock */
break;
case 0x02U:
default:
MCGOUTClock = CPU_INT_IRC_CLK_HZ; /* IRC 48MHz oscillator drives MCG clock */
break;
}
}
else
{ /* (!((MCG->C1 & MCG_C1_CLKS_MASK) == 0x80U)) */
/* Reserved value */
return;
} /* (!((MCG->C1 & MCG_C1_CLKS_MASK) == 0x80U)) */
SystemCoreClock =
(MCGOUTClock / (0x01U + ((SIM->CLKDIV1 & SIM_CLKDIV1_OUTDIV1_MASK) >> SIM_CLKDIV1_OUTDIV1_SHIFT)));
}
@@ -0,0 +1,230 @@
/*
** ###################################################################
** Processors: MKL82Z128VLH7
** MKL82Z128VLK7
** MKL82Z128VLL7
** MKL82Z128VMC7
** MKL82Z128VMP7
**
** Compilers: Keil ARM C/C++ Compiler
** Freescale C/C++ for Embedded ARM
** GNU C Compiler
** GNU C Compiler - CodeSourcery Sourcery G++
** IAR ANSI C/C++ Compiler for ARM
**
** Reference manual: KL82P121M72SF0RM, Rev.0.3 June 2015
** Version: rev. 1.4, 2015-08-28
** Build: b150910
**
** 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 (c) 2015 Freescale Semiconductor, Inc.
** All rights reserved.
**
** Redistribution and use in source and binary forms, with or without modification,
** are permitted provided that the following conditions are met:
**
** o Redistributions of source code must retain the above copyright notice, this list
** of conditions and the following disclaimer.
**
** o 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.
**
** o Neither the name of Freescale Semiconductor, Inc. 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.
**
** http: www.freescale.com
** mail: support@freescale.com
**
** Revisions:
** - rev. 1.0 (2015-04-18)
** Initial version.
** - rev. 1.1 (2015-05-04)
** Update SIM, EVMSIM, QuadSPI, and I2C based on Rev0 document.
** - rev. 1.2 (2015-08-11)
** Correct clock configuration.
** - rev. 1.3 (2015-08-20)
** Align with RM Rev.1.
** - rev. 1.4 (2015-08-28)
** Update LPUART to add FIFO.
**
** ###################################################################
*/
/*!
* @file MKL82Z7
* @version 1.4
* @date 2015-08-28
* @brief Device specific configuration file for MKL82Z7 (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 "fsl_device_registers.h"
/*!
* @brief Defines the structure to set the Bootloader Configuration Area
*
* This type of variable is used to set the Bootloader Configuration Area
* of the chip.
*/
typedef struct SystemBootloaderConfig
{
uint32_t tag; /*!< Magic number to verify bootloader configuration is valid. Must be set to 'kcfg'. */
uint32_t crcStartAddress; /*!< Start address for application image CRC check. If the bits are all set then Kinetis
bootloader by default will not perform any CRC check. */
uint32_t crcByteCount; /*!< Byte count for application image CRC check. If the bits are all set then Kinetis
bootloader by default will not prform any CRC check. */
uint32_t crcExpectedValue; /*!< Expected CRC value for application CRC check. If the bits are all set then Kinetis
bootloader by default will not perform any CRC check.*/
uint8_t enabledPeripherals; /*!< Bitfield of peripherals to enable.
bit 0 - LPUART, bit 1 - I2C, bit 2 - SPI, bit 4 - USB
Kinetis bootloader will enable the peripheral if corresponding bit is set to 1. */
uint8_t i2cSlaveAddress; /*!< If not 0xFF, used as the 7-bit I2C slave address. If 0xFF, defaults to 0x10 for I2C
slave address */
uint16_t peripheralDetectionTimeoutMs; /*!< Timeout in milliseconds for active peripheral detection. If 0xFFFF,
defaults to 5 seconds. */
uint16_t usbVid; /*!< Sets the USB Vendor ID reported by the device during enumeration. If 0xFFFF, it defaults to
0x15A2. */
uint16_t usbPid; /*!< Sets the USB Product ID reported by the device during enumeration. */
uint32_t usbStringsPointer; /*!< Sets the USB Strings reported by the device during enumeration. */
uint8_t clockFlags; /*!< The flags in the clockFlags configuration field are enabled if the corresponding bit is
cleared (0).
bit 0 - HighSpeed Enable high speed mode (i.e., 48 MHz). */
uint8_t clockDivider; /*!< Inverted value of the divider to use for core and bus clocks when in high speed mode */
uint8_t bootFlags; /*!< If bit 0 is cleared, then Kinetis bootloader will jump to either Quad SPI Flash or internal
flash image depending on FOPT BOOTSRC_SEL bits.
If the bit is set, then Kinetis bootloader will prepare for host communication over serial
peripherals. */
uint8_t RESERVED1;
uint32_t RESERVED2[2];
uint8_t RESERVED3[8];
uint32_t qspiConfigBlockPtr; /*!< A pointer to the QSPI config block in internal flash array. */
uint8_t RESERVED4[12];
} system_bootloader_config_t;
#ifndef BOOTLOADER_CONFIG
#define BOOTLOADER_CONFIG 1 /* Enable BootloaderConfig Area by default */
#endif
#if (BOOTLOADER_CONFIG)
/* Bootlader configuration area */
#if defined(__IAR_SYSTEMS_ICC__)
/* Pragma to place the Bootloader Configuration Array on correct location defined in linker file. */
#pragma language = extended
#pragma location = "BootloaderConfig"
__root const system_bootloader_config_t BootloaderConfig @"BootloaderConfig" =
#elif defined(__GNUC__)
__attribute__((section(".BootloaderConfig"))) const system_bootloader_config_t BootloaderConfig =
#elif defined(__CC_ARM)
__attribute__((section("BootloaderConfig"))) const system_bootloader_config_t BootloaderConfig __attribute__((used)) =
#else
#error Unsupported compiler!
#endif
{
.tag = 0x6766636BU, /* Magic Number */
.crcStartAddress = 0xFFFFFFFFU, /* Disable CRC check */
.crcByteCount = 0xFFFFFFFFU, /* Disable CRC check */
.crcExpectedValue = 0xFFFFFFFFU, /* Disable CRC check */
.enabledPeripherals = 0x17, /* Enable all peripherals */
.i2cSlaveAddress = 0xFF, /* Use default I2C address */
.peripheralDetectionTimeoutMs = 0xFFFFU, /* Use default timeout */
.usbVid = 0xFFFFU, /* Use default USB Vendor ID */
.usbPid = 0xFFFFU, /* Use default USB Product ID */
.usbStringsPointer = 0xFFFFFFFFU, /* Use default USB Strings */
.clockFlags = 0x01, /* Enable High speed mode */
.clockDivider = 0xFF, /* Use clock divider 1 */
.bootFlags = 0x01, /* Enable communication with host */
.qspiConfigBlockPtr = 0x2000, /* QCB is placed at 0x2000 */
};
#endif
/* ----------------------------------------------------------------------------
-- Core clock
---------------------------------------------------------------------------- */
uint32_t SystemCoreClock = 72000000ul;
/* ----------------------------------------------------------------------------
-- SystemInit()
---------------------------------------------------------------------------- */
#if defined(__IAR_SYSTEMS_ICC__)
/* Pragma to place the rom patch code on correct location defined in linker file. */
#pragma language = extended
#pragma section = "rom_patch_code"
const uint8_t s_rom_patch[124] @"rom_patch_code" =
#elif defined(__GNUC__)
__attribute__((section("rom_patch_code"))) const uint8_t s_rom_patch[124] __attribute__((used)) =
#elif defined(__CC_ARM)
__attribute__((section("rom_patch_code"))) const uint8_t s_rom_patch[124] __attribute__((used)) =
#else
#error Unsupported compiler!
#endif
{ 0x10, 0xB5, 0x01, 0x00, 0x17, 0x4A, 0x10, 0x00, 0x18, 0x30, 0x17, 0x4B, 0x1B, 0x68, 0xDB, 0x00, 0x02, 0xD5,
0x16, 0x4A, 0x10, 0x00, 0x18, 0x30, 0x13, 0x68, 0x15, 0x4C, 0x1C, 0x40, 0x14, 0x60, 0x13, 0x68, 0x0C, 0x69,
0x24, 0x04, 0x1C, 0x43, 0x14, 0x60, 0x02, 0x68, 0x11, 0x4B, 0x13, 0x40, 0x03, 0x60, 0xDA, 0x22, 0x52, 0x00,
0x89, 0x18, 0x02, 0x68, 0x0B, 0x68, 0x1B, 0x04, 0xFC, 0x24, 0xA4, 0x03, 0x1C, 0x40, 0x14, 0x43, 0x04, 0x60,
0x02, 0x68, 0x0B, 0x4B, 0x13, 0x40, 0x03, 0x60, 0x02, 0x68, 0x49, 0x68, 0x09, 0x06, 0xFC, 0x23, 0x9B, 0x05,
0x0B, 0x40, 0x13, 0x43, 0x03, 0x60, 0x00, 0x20, 0x10, 0xBD, 0x0C, 0xA0, 0x0D, 0x40, 0x24, 0x80, 0x04, 0x40,
0x0C, 0xA0, 0x05, 0x40, 0xFF, 0xFF, 0xFC, 0xFF, 0xFF, 0xFF, 0xC0, 0xFF, 0xFF, 0xFF, 0xFF, 0xC0 };
/*
* ROM patch handler for ROM patch code execution.
*/
#if defined(__IAR_SYSTEMS_ICC__)
/* Pragma to place the ROM_PatchHandler on correct location defined in linker file. */
#pragma language = extended
#pragma section = "BootloaderPatchHandler"
void ROM_PatchHandler(void) @"BootloaderPatchHandler"
#elif defined(__GNUC__)
__attribute__((section("BootloaderPatchHandler"))) void ROM_PatchHandler(void)
#elif defined(__CC_ARM)
__attribute__((section("BootloaderPatchHandler"))) void ROM_PatchHandler(void)
#else
#error Unsupported compiler!
#endif
{
typedef int (*patch_handler_t)(uint32_t);
#if defined(__IAR_SYSTEMS_ICC__)
uint32_t s_rom_patch_start = (uint32_t)__section_begin("rom_patch_code");
#elif defined(__CC_ARM)
extern uint32_t Load$$EXEC_m_rom_patch_code$$Base[];
uint32_t s_rom_patch_start = (uint32_t)&Load$$EXEC_m_rom_patch_code$$Base;
#elif defined(__GNUC__)
extern uint32_t rom_patch_code_start[];
uint32_t s_rom_patch_start = (uint32_t)&rom_patch_code_start;
#endif
uint32_t patch_start = s_rom_patch_start + 1;
patch_handler_t patch_run = (patch_handler_t)patch_start;
patch_run(BootloaderConfig.qspiConfigBlockPtr);
}
/* ----------------------------------------------------------------------------
-- SystemInit()
---------------------------------------------------------------------------- */
void SystemInit(void)
{
}
@@ -0,0 +1,463 @@
; * ---------------------------------------------------------------------------------------
; * @file: startup_MKL82Z7.s
; * @purpose: CMSIS Cortex-M0P Core Device Startup File
; * MKL82Z7
; * @version: 1.4
; * @date: 2015-8-28
; * @build: b150910
; * ---------------------------------------------------------------------------------------
; *
; * Copyright (c) 1997 - 2015 , Freescale Semiconductor, Inc.
; * All rights reserved.
; *
; * Redistribution and use in source and binary forms, with or without modification,
; * are permitted provided that the following conditions are met:
; *
; * o Redistributions of source code must retain the above copyright notice, this list
; * of conditions and the following disclaimer.
; *
; * o 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.
; *
; * o Neither the name of Freescale Semiconductor, Inc. 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.
; *
; *------- <<< 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 0 ;Reserved
DCD 0 ;Reserved
DCD 0 ;Reserved
DCD 0 ;Reserved
DCD 0 ;Reserved
DCD 0 ;Reserved
DCD 0 ;Reserved
DCD SVC_Handler ;SVCall Handler
DCD 0 ;Reserved
DCD 0 ;Reserved
DCD PendSV_Handler ;PendSV Handler
DCD SysTick_Handler ;SysTick Handler
;External Interrupts
DCD DMA0_DMA4_IRQHandler ;DMA channel 0, 4 transfer complete
DCD DMA1_DMA5_IRQHandler ;DMA channel 1, 5 transfer complete
DCD DMA2_DMA6_IRQHandler ;DMA channel 2, 6 transfer complete
DCD DMA3_DMA7_IRQHandler ;DMA channel 3, 7 transfer complete
DCD DMA_Error_IRQHandler ;DMA channel 0 - 7 error
DCD FLEXIO0_IRQHandler ;Flexible IO
DCD TPM0_IRQHandler ;Timer/PWM module 0
DCD TPM1_IRQHandler ;Timer/PWM module 1
DCD TPM2_IRQHandler ;Timer/PWM module 2
DCD PIT0_IRQHandler ;Periodic Interrupt Timer 0
DCD SPI0_IRQHandler ;Serial Peripheral Interface 0
DCD EMVSIM0_IRQHandler ;EMVSIM0 common interrupt
DCD LPUART0_IRQHandler ;LPUART0 status and error
DCD LPUART1_IRQHandler ;LPUART1 status and error
DCD I2C0_IRQHandler ;Inter-Integrated Circuit 0
DCD QSPI0_IRQHandler ;QuadSPI0 interrupt
DCD Reserved32_IRQHandler ;DryIce tamper detect
DCD PORTA_IRQHandler ;Pin detect Port A
DCD PORTB_IRQHandler ;Pin detect Port B
DCD PORTC_IRQHandler ;Pin detect Port C
DCD PORTD_IRQHandler ;Pin detect Port D
DCD PORTE_IRQHandler ;Pin detect Port E
DCD LLWU_IRQHandler ;Low Leakage Wakeup
DCD LTC0_IRQHandler ;Low power trusted cryptographic
DCD USB0_IRQHandler ;USB OTG interrupt
DCD ADC0_IRQHandler ;Analog-to-Digital Converter 0
DCD LPTMR0_IRQHandler ;Low-Power Timer 0
DCD RTC_Seconds_IRQHandler ;RTC seconds
DCD INTMUX0_0_IRQHandler ;Selectable peripheral interrupt INTMUX0-0
DCD INTMUX0_1_IRQHandler ;Selectable peripheral interrupt INTMUX0-1
DCD INTMUX0_2_IRQHandler ;Selectable peripheral interrupt INTMUX0-2
DCD INTMUX0_3_IRQHandler ;Selectable peripheral interrupt INTMUX0-3
DCD LPTMR1_IRQHandler ;Low-Power Timer 1 (INTMUX source IRQ0)
DCD Reserved49_IRQHandler ;Reserved interrupt (INTMUX source IRQ1)
DCD Reserved50_IRQHandler ;Reserved interrupt (INTMUX source IRQ2)
DCD Reserved51_IRQHandler ;Reserved interrupt (INTMUX source IRQ3)
DCD SPI1_IRQHandler ;Serial Peripheral Interface 1 (INTMUX source IRQ4)
DCD LPUART2_IRQHandler ;LPUART2 status and error (INTMUX source IRQ5)
DCD EMVSIM1_IRQHandler ;EMVSIM1 common interrupt (INTMUX source IRQ6)
DCD I2C1_IRQHandler ;Inter-Integrated Circuit 1 (INTMUX source IRQ7)
DCD TSI0_IRQHandler ;Touch Sensing Input 0 (INTMUX source IRQ8)
DCD PMC_IRQHandler ;PMC controller low-voltage detect, low-voltage warning (INTMUX source IRQ9)
DCD FTFA_IRQHandler ;FTFA command complete/read collision (INTMUX source IRQ10)
DCD MCG_IRQHandler ;Multipurpose clock generator (INTMUX source IRQ11)
DCD WDOG_EWM_IRQHandler ;Single interrupt vector for WDOG and EWM (INTMUX source IRQ12)
DCD DAC0_IRQHandler ;Digital-to-analog converter 0 (INTMUX source IRQ13)
DCD TRNG0_IRQHandler ;True randon number generator (INTMUX source IRQ14)
DCD Reserved63_IRQHandler ;Reserved interrupt (INTMUX source IRQ15)
DCD CMP0_IRQHandler ;Comparator 0 (INTMUX source IRQ16)
DCD Reserved65_IRQHandler ;Reserved interrupt (INTMUX source IRQ17)
DCD RTC_Alarm_IRQHandler ;Real time clock (INTMUX source IRQ18)
DCD Reserved67_IRQHandler ;Reserved interrupt (INTMUX source IRQ19)
DCD Reserved68_IRQHandler ;Reserved interrupt (INTMUX source IRQ20)
DCD Reserved69_IRQHandler ;Reserved interrupt (INTMUX source IRQ21)
DCD Reserved70_IRQHandler ;Reserved interrupt (INTMUX source IRQ22)
DCD Reserved71_IRQHandler ;Reserved interrupt (INTMUX source IRQ23)
DCD DMA4_IRQHandler ;DMA channel 4 transfer complete (INTMUX source IRQ24)
DCD DMA5_IRQHandler ;DMA channel 5 transfer complete (INTMUX source IRQ25)
DCD DMA6_IRQHandler ;DMA channel 6 transfer complete (INTMUX source IRQ26)
DCD DMA7_IRQHandler ;DMA channel 7 transfer complete (INTMUX source IRQ27)
DCD Reserved76_IRQHandler ;Reserved interrupt (INTMUX source IRQ28)
DCD Reserved77_IRQHandler ;Reserved interrupt (INTMUX source IRQ29)
DCD Reserved78_IRQHandler ;Reserved interrupt (INTMUX source IRQ30)
DCD Reserved79_IRQHandler ;Reserved interrupt (INTMUX source IRQ31)
__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 access to the FTFL module.
; <h> Backdoor Comparison Key
; <o0> Backdoor Comparison Key 0. <0x0-0xFF:2>
; <o1> Backdoor Comparison Key 1. <0x0-0xFF:2>
; <o2> Backdoor Comparison Key 2. <0x0-0xFF:2>
; <o3> Backdoor Comparison Key 3. <0x0-0xFF:2>
; <o4> Backdoor Comparison Key 4. <0x0-0xFF:2>
; <o5> Backdoor Comparison Key 5. <0x0-0xFF:2>
; <o6> Backdoor Comparison Key 6. <0x0-0xFF:2>
; <o7> Backdoor Comparison 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 Region Protect Register 0
; <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> 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> BOOTPIN_OPT
; <0=> Force Boot from ROM if BOOTCFG0 asserted, where BOOTCFG0 is the boot config function which is muxed with NMI pin
; <1=> Boot source configured by FOPT (BOOTSRC_SEL) bits
; <o.2> NMI_DIS
; <0=> NMI interrupts are always blocked
; <1=> NMI_b pin/interrupts reset default to enabled
; <o.5> FAST_INIT
; <0=> Slower initialization
; <1=> Fast Initialization
; <o.6..7> BOOTSRC_SEL
; <0=> Boot from Flash
; <2=> Boot from ROM, configure QSPI0, and enter boot loader mode.
; <3=> Boot from ROM and enter boot loader mode.
; <i> Boot source selection
FOPT EQU 0x3D
; </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
; <o.2..3> FSLACC
; <2=> Freescale factory access denied
; <3=> Freescale factory access granted
; <i> Freescale Failure Analysis Access Code
; <o.4..5> MEEN
; <2=> Mass erase is disabled
; <3=> Mass erase is enabled
; <o.6..7> KEYEN
; <2=> Backdoor key access enabled
; <3=> Backdoor key access disabled
; <i> Backdoor Key Security Enable
FSEC EQU 0xFE
; </h>
; </h>
IF :LNOT::DEF:RAM_TARGET
AREA FlashConfig, DATA, READONLY
__FlashConfig
DCB BackDoorK0, BackDoorK1, BackDoorK2, BackDoorK3
DCB BackDoorK4, BackDoorK5, BackDoorK6, BackDoorK7
DCB FPROT0 , FPROT1 , FPROT2 , FPROT3
DCB FSEC , FOPT , 0xFF , 0xFF
ENDIF
AREA |.text|, CODE, READONLY
; Reset Handler
Reset_Handler PROC
EXPORT Reset_Handler [WEAK]
IMPORT SystemInit
IMPORT init_data_bss
IMPORT __main
IF :LNOT::DEF:RAM_TARGET
REQUIRE FlashConfig
ENDIF
CPSID I ; Mask interrupts
LDR R0, =SystemInit
BLX R0
LDR R0, =init_data_bss
BLX R0
CPSIE i ; Unmask interrupts
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
SVC_Handler\
PROC
EXPORT SVC_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_DMA4_IRQHandler [WEAK]
EXPORT DMA1_DMA5_IRQHandler [WEAK]
EXPORT DMA2_DMA6_IRQHandler [WEAK]
EXPORT DMA3_DMA7_IRQHandler [WEAK]
EXPORT DMA_Error_IRQHandler [WEAK]
EXPORT FLEXIO0_IRQHandler [WEAK]
EXPORT TPM0_IRQHandler [WEAK]
EXPORT TPM1_IRQHandler [WEAK]
EXPORT TPM2_IRQHandler [WEAK]
EXPORT PIT0_IRQHandler [WEAK]
EXPORT SPI0_IRQHandler [WEAK]
EXPORT EMVSIM0_IRQHandler [WEAK]
EXPORT LPUART0_IRQHandler [WEAK]
EXPORT LPUART1_IRQHandler [WEAK]
EXPORT I2C0_IRQHandler [WEAK]
EXPORT QSPI0_IRQHandler [WEAK]
EXPORT Reserved32_IRQHandler [WEAK]
EXPORT PORTA_IRQHandler [WEAK]
EXPORT PORTB_IRQHandler [WEAK]
EXPORT PORTC_IRQHandler [WEAK]
EXPORT PORTD_IRQHandler [WEAK]
EXPORT PORTE_IRQHandler [WEAK]
EXPORT LLWU_IRQHandler [WEAK]
EXPORT LTC0_IRQHandler [WEAK]
EXPORT USB0_IRQHandler [WEAK]
EXPORT ADC0_IRQHandler [WEAK]
EXPORT LPTMR0_IRQHandler [WEAK]
EXPORT RTC_Seconds_IRQHandler [WEAK]
EXPORT INTMUX0_0_IRQHandler [WEAK]
EXPORT INTMUX0_1_IRQHandler [WEAK]
EXPORT INTMUX0_2_IRQHandler [WEAK]
EXPORT INTMUX0_3_IRQHandler [WEAK]
EXPORT LPTMR1_IRQHandler [WEAK]
EXPORT Reserved49_IRQHandler [WEAK]
EXPORT Reserved50_IRQHandler [WEAK]
EXPORT Reserved51_IRQHandler [WEAK]
EXPORT SPI1_IRQHandler [WEAK]
EXPORT LPUART2_IRQHandler [WEAK]
EXPORT EMVSIM1_IRQHandler [WEAK]
EXPORT I2C1_IRQHandler [WEAK]
EXPORT TSI0_IRQHandler [WEAK]
EXPORT PMC_IRQHandler [WEAK]
EXPORT FTFA_IRQHandler [WEAK]
EXPORT MCG_IRQHandler [WEAK]
EXPORT WDOG_EWM_IRQHandler [WEAK]
EXPORT DAC0_IRQHandler [WEAK]
EXPORT TRNG0_IRQHandler [WEAK]
EXPORT Reserved63_IRQHandler [WEAK]
EXPORT CMP0_IRQHandler [WEAK]
EXPORT Reserved65_IRQHandler [WEAK]
EXPORT RTC_Alarm_IRQHandler [WEAK]
EXPORT Reserved67_IRQHandler [WEAK]
EXPORT Reserved68_IRQHandler [WEAK]
EXPORT Reserved69_IRQHandler [WEAK]
EXPORT Reserved70_IRQHandler [WEAK]
EXPORT Reserved71_IRQHandler [WEAK]
EXPORT DMA4_IRQHandler [WEAK]
EXPORT DMA5_IRQHandler [WEAK]
EXPORT DMA6_IRQHandler [WEAK]
EXPORT DMA7_IRQHandler [WEAK]
EXPORT Reserved76_IRQHandler [WEAK]
EXPORT Reserved77_IRQHandler [WEAK]
EXPORT Reserved78_IRQHandler [WEAK]
EXPORT Reserved79_IRQHandler [WEAK]
EXPORT DefaultISR [WEAK]
DMA0_DMA4_IRQHandler
DMA1_DMA5_IRQHandler
DMA2_DMA6_IRQHandler
DMA3_DMA7_IRQHandler
DMA_Error_IRQHandler
FLEXIO0_IRQHandler
TPM0_IRQHandler
TPM1_IRQHandler
TPM2_IRQHandler
PIT0_IRQHandler
SPI0_IRQHandler
EMVSIM0_IRQHandler
LPUART0_IRQHandler
LPUART1_IRQHandler
I2C0_IRQHandler
QSPI0_IRQHandler
Reserved32_IRQHandler
PORTA_IRQHandler
PORTB_IRQHandler
PORTC_IRQHandler
PORTD_IRQHandler
PORTE_IRQHandler
LLWU_IRQHandler
LTC0_IRQHandler
USB0_IRQHandler
ADC0_IRQHandler
LPTMR0_IRQHandler
RTC_Seconds_IRQHandler
INTMUX0_0_IRQHandler
INTMUX0_1_IRQHandler
INTMUX0_2_IRQHandler
INTMUX0_3_IRQHandler
LPTMR1_IRQHandler
Reserved49_IRQHandler
Reserved50_IRQHandler
Reserved51_IRQHandler
SPI1_IRQHandler
LPUART2_IRQHandler
EMVSIM1_IRQHandler
I2C1_IRQHandler
TSI0_IRQHandler
PMC_IRQHandler
FTFA_IRQHandler
MCG_IRQHandler
WDOG_EWM_IRQHandler
DAC0_IRQHandler
TRNG0_IRQHandler
Reserved63_IRQHandler
CMP0_IRQHandler
Reserved65_IRQHandler
RTC_Alarm_IRQHandler
Reserved67_IRQHandler
Reserved68_IRQHandler
Reserved69_IRQHandler
Reserved70_IRQHandler
Reserved71_IRQHandler
DMA4_IRQHandler
DMA5_IRQHandler
DMA6_IRQHandler
DMA7_IRQHandler
Reserved76_IRQHandler
Reserved77_IRQHandler
Reserved78_IRQHandler
Reserved79_IRQHandler
DefaultISR
LDR R0, =DefaultISR
BX R0
ENDP
ALIGN
END
@@ -0,0 +1,463 @@
; * ---------------------------------------------------------------------------------------
; * @file: startup_MKL82Z7.s
; * @purpose: CMSIS Cortex-M0P Core Device Startup File
; * MKL82Z7
; * @version: 1.4
; * @date: 2015-8-28
; * @build: b150910
; * ---------------------------------------------------------------------------------------
; *
; * Copyright (c) 1997 - 2015 , Freescale Semiconductor, Inc.
; * All rights reserved.
; *
; * Redistribution and use in source and binary forms, with or without modification,
; * are permitted provided that the following conditions are met:
; *
; * o Redistributions of source code must retain the above copyright notice, this list
; * of conditions and the following disclaimer.
; *
; * o 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.
; *
; * o Neither the name of Freescale Semiconductor, Inc. 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.
; *
; *------- <<< 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 0 ;Reserved
DCD 0 ;Reserved
DCD 0 ;Reserved
DCD 0 ;Reserved
DCD 0 ;Reserved
DCD 0 ;Reserved
DCD 0 ;Reserved
DCD SVC_Handler ;SVCall Handler
DCD 0 ;Reserved
DCD 0 ;Reserved
DCD PendSV_Handler ;PendSV Handler
DCD SysTick_Handler ;SysTick Handler
;External Interrupts
DCD DMA0_DMA4_IRQHandler ;DMA channel 0, 4 transfer complete
DCD DMA1_DMA5_IRQHandler ;DMA channel 1, 5 transfer complete
DCD DMA2_DMA6_IRQHandler ;DMA channel 2, 6 transfer complete
DCD DMA3_DMA7_IRQHandler ;DMA channel 3, 7 transfer complete
DCD DMA_Error_IRQHandler ;DMA channel 0 - 7 error
DCD FLEXIO0_IRQHandler ;Flexible IO
DCD TPM0_IRQHandler ;Timer/PWM module 0
DCD TPM1_IRQHandler ;Timer/PWM module 1
DCD TPM2_IRQHandler ;Timer/PWM module 2
DCD PIT0_IRQHandler ;Periodic Interrupt Timer 0
DCD SPI0_IRQHandler ;Serial Peripheral Interface 0
DCD EMVSIM0_IRQHandler ;EMVSIM0 common interrupt
DCD LPUART0_IRQHandler ;LPUART0 status and error
DCD LPUART1_IRQHandler ;LPUART1 status and error
DCD I2C0_IRQHandler ;Inter-Integrated Circuit 0
DCD QSPI0_IRQHandler ;QuadSPI0 interrupt
DCD Reserved32_IRQHandler ;DryIce tamper detect
DCD PORTA_IRQHandler ;Pin detect Port A
DCD PORTB_IRQHandler ;Pin detect Port B
DCD PORTC_IRQHandler ;Pin detect Port C
DCD PORTD_IRQHandler ;Pin detect Port D
DCD PORTE_IRQHandler ;Pin detect Port E
DCD LLWU_IRQHandler ;Low Leakage Wakeup
DCD LTC0_IRQHandler ;Low power trusted cryptographic
DCD USB0_IRQHandler ;USB OTG interrupt
DCD ADC0_IRQHandler ;Analog-to-Digital Converter 0
DCD LPTMR0_IRQHandler ;Low-Power Timer 0
DCD RTC_Seconds_IRQHandler ;RTC seconds
DCD INTMUX0_0_IRQHandler ;Selectable peripheral interrupt INTMUX0-0
DCD INTMUX0_1_IRQHandler ;Selectable peripheral interrupt INTMUX0-1
DCD INTMUX0_2_IRQHandler ;Selectable peripheral interrupt INTMUX0-2
DCD INTMUX0_3_IRQHandler ;Selectable peripheral interrupt INTMUX0-3
DCD LPTMR1_IRQHandler ;Low-Power Timer 1 (INTMUX source IRQ0)
DCD Reserved49_IRQHandler ;Reserved interrupt (INTMUX source IRQ1)
DCD Reserved50_IRQHandler ;Reserved interrupt (INTMUX source IRQ2)
DCD Reserved51_IRQHandler ;Reserved interrupt (INTMUX source IRQ3)
DCD SPI1_IRQHandler ;Serial Peripheral Interface 1 (INTMUX source IRQ4)
DCD LPUART2_IRQHandler ;LPUART2 status and error (INTMUX source IRQ5)
DCD EMVSIM1_IRQHandler ;EMVSIM1 common interrupt (INTMUX source IRQ6)
DCD I2C1_IRQHandler ;Inter-Integrated Circuit 1 (INTMUX source IRQ7)
DCD TSI0_IRQHandler ;Touch Sensing Input 0 (INTMUX source IRQ8)
DCD PMC_IRQHandler ;PMC controller low-voltage detect, low-voltage warning (INTMUX source IRQ9)
DCD FTFA_IRQHandler ;FTFA command complete/read collision (INTMUX source IRQ10)
DCD MCG_IRQHandler ;Multipurpose clock generator (INTMUX source IRQ11)
DCD WDOG_EWM_IRQHandler ;Single interrupt vector for WDOG and EWM (INTMUX source IRQ12)
DCD DAC0_IRQHandler ;Digital-to-analog converter 0 (INTMUX source IRQ13)
DCD TRNG0_IRQHandler ;True randon number generator (INTMUX source IRQ14)
DCD Reserved63_IRQHandler ;Reserved interrupt (INTMUX source IRQ15)
DCD CMP0_IRQHandler ;Comparator 0 (INTMUX source IRQ16)
DCD Reserved65_IRQHandler ;Reserved interrupt (INTMUX source IRQ17)
DCD RTC_Alarm_IRQHandler ;Real time clock (INTMUX source IRQ18)
DCD Reserved67_IRQHandler ;Reserved interrupt (INTMUX source IRQ19)
DCD Reserved68_IRQHandler ;Reserved interrupt (INTMUX source IRQ20)
DCD Reserved69_IRQHandler ;Reserved interrupt (INTMUX source IRQ21)
DCD Reserved70_IRQHandler ;Reserved interrupt (INTMUX source IRQ22)
DCD Reserved71_IRQHandler ;Reserved interrupt (INTMUX source IRQ23)
DCD DMA4_IRQHandler ;DMA channel 4 transfer complete (INTMUX source IRQ24)
DCD DMA5_IRQHandler ;DMA channel 5 transfer complete (INTMUX source IRQ25)
DCD DMA6_IRQHandler ;DMA channel 6 transfer complete (INTMUX source IRQ26)
DCD DMA7_IRQHandler ;DMA channel 7 transfer complete (INTMUX source IRQ27)
DCD Reserved76_IRQHandler ;Reserved interrupt (INTMUX source IRQ28)
DCD Reserved77_IRQHandler ;Reserved interrupt (INTMUX source IRQ29)
DCD Reserved78_IRQHandler ;Reserved interrupt (INTMUX source IRQ30)
DCD Reserved79_IRQHandler ;Reserved interrupt (INTMUX source IRQ31)
__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 access to the FTFL module.
; <h> Backdoor Comparison Key
; <o0> Backdoor Comparison Key 0. <0x0-0xFF:2>
; <o1> Backdoor Comparison Key 1. <0x0-0xFF:2>
; <o2> Backdoor Comparison Key 2. <0x0-0xFF:2>
; <o3> Backdoor Comparison Key 3. <0x0-0xFF:2>
; <o4> Backdoor Comparison Key 4. <0x0-0xFF:2>
; <o5> Backdoor Comparison Key 5. <0x0-0xFF:2>
; <o6> Backdoor Comparison Key 6. <0x0-0xFF:2>
; <o7> Backdoor Comparison 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 Region Protect Register 0
; <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> 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> BOOTPIN_OPT
; <0=> Force Boot from ROM if BOOTCFG0 asserted, where BOOTCFG0 is the boot config function which is muxed with NMI pin
; <1=> Boot source configured by FOPT (BOOTSRC_SEL) bits
; <o.2> NMI_DIS
; <0=> NMI interrupts are always blocked
; <1=> NMI_b pin/interrupts reset default to enabled
; <o.5> FAST_INIT
; <0=> Slower initialization
; <1=> Fast Initialization
; <o.6..7> BOOTSRC_SEL
; <0=> Boot from Flash
; <2=> Boot from ROM, configure QSPI0, and enter boot loader mode.
; <3=> Boot from ROM and enter boot loader mode.
; <i> Boot source selection
FOPT EQU 0xBD
; </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
; <o.2..3> FSLACC
; <2=> Freescale factory access denied
; <3=> Freescale factory access granted
; <i> Freescale Failure Analysis Access Code
; <o.4..5> MEEN
; <2=> Mass erase is disabled
; <3=> Mass erase is enabled
; <o.6..7> KEYEN
; <2=> Backdoor key access enabled
; <3=> Backdoor key access disabled
; <i> Backdoor Key Security Enable
FSEC EQU 0xFE
; </h>
; </h>
IF :LNOT::DEF:RAM_TARGET
AREA FlashConfig, DATA, READONLY
__FlashConfig
DCB BackDoorK0, BackDoorK1, BackDoorK2, BackDoorK3
DCB BackDoorK4, BackDoorK5, BackDoorK6, BackDoorK7
DCB FPROT0 , FPROT1 , FPROT2 , FPROT3
DCB FSEC , FOPT , 0xFF , 0xFF
ENDIF
AREA |.text|, CODE, READONLY
; Reset Handler
Reset_Handler PROC
EXPORT Reset_Handler [WEAK]
IMPORT SystemInit
IMPORT init_data_bss
IMPORT __main
IF :LNOT::DEF:RAM_TARGET
REQUIRE FlashConfig
ENDIF
CPSID I ; Mask interrupts
LDR R0, =SystemInit
BLX R0
LDR R0, =init_data_bss
BLX R0
CPSIE i ; Unmask interrupts
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
SVC_Handler\
PROC
EXPORT SVC_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_DMA4_IRQHandler [WEAK]
EXPORT DMA1_DMA5_IRQHandler [WEAK]
EXPORT DMA2_DMA6_IRQHandler [WEAK]
EXPORT DMA3_DMA7_IRQHandler [WEAK]
EXPORT DMA_Error_IRQHandler [WEAK]
EXPORT FLEXIO0_IRQHandler [WEAK]
EXPORT TPM0_IRQHandler [WEAK]
EXPORT TPM1_IRQHandler [WEAK]
EXPORT TPM2_IRQHandler [WEAK]
EXPORT PIT0_IRQHandler [WEAK]
EXPORT SPI0_IRQHandler [WEAK]
EXPORT EMVSIM0_IRQHandler [WEAK]
EXPORT LPUART0_IRQHandler [WEAK]
EXPORT LPUART1_IRQHandler [WEAK]
EXPORT I2C0_IRQHandler [WEAK]
EXPORT QSPI0_IRQHandler [WEAK]
EXPORT Reserved32_IRQHandler [WEAK]
EXPORT PORTA_IRQHandler [WEAK]
EXPORT PORTB_IRQHandler [WEAK]
EXPORT PORTC_IRQHandler [WEAK]
EXPORT PORTD_IRQHandler [WEAK]
EXPORT PORTE_IRQHandler [WEAK]
EXPORT LLWU_IRQHandler [WEAK]
EXPORT LTC0_IRQHandler [WEAK]
EXPORT USB0_IRQHandler [WEAK]
EXPORT ADC0_IRQHandler [WEAK]
EXPORT LPTMR0_IRQHandler [WEAK]
EXPORT RTC_Seconds_IRQHandler [WEAK]
EXPORT INTMUX0_0_IRQHandler [WEAK]
EXPORT INTMUX0_1_IRQHandler [WEAK]
EXPORT INTMUX0_2_IRQHandler [WEAK]
EXPORT INTMUX0_3_IRQHandler [WEAK]
EXPORT LPTMR1_IRQHandler [WEAK]
EXPORT Reserved49_IRQHandler [WEAK]
EXPORT Reserved50_IRQHandler [WEAK]
EXPORT Reserved51_IRQHandler [WEAK]
EXPORT SPI1_IRQHandler [WEAK]
EXPORT LPUART2_IRQHandler [WEAK]
EXPORT EMVSIM1_IRQHandler [WEAK]
EXPORT I2C1_IRQHandler [WEAK]
EXPORT TSI0_IRQHandler [WEAK]
EXPORT PMC_IRQHandler [WEAK]
EXPORT FTFA_IRQHandler [WEAK]
EXPORT MCG_IRQHandler [WEAK]
EXPORT WDOG_EWM_IRQHandler [WEAK]
EXPORT DAC0_IRQHandler [WEAK]
EXPORT TRNG0_IRQHandler [WEAK]
EXPORT Reserved63_IRQHandler [WEAK]
EXPORT CMP0_IRQHandler [WEAK]
EXPORT Reserved65_IRQHandler [WEAK]
EXPORT RTC_Alarm_IRQHandler [WEAK]
EXPORT Reserved67_IRQHandler [WEAK]
EXPORT Reserved68_IRQHandler [WEAK]
EXPORT Reserved69_IRQHandler [WEAK]
EXPORT Reserved70_IRQHandler [WEAK]
EXPORT Reserved71_IRQHandler [WEAK]
EXPORT DMA4_IRQHandler [WEAK]
EXPORT DMA5_IRQHandler [WEAK]
EXPORT DMA6_IRQHandler [WEAK]
EXPORT DMA7_IRQHandler [WEAK]
EXPORT Reserved76_IRQHandler [WEAK]
EXPORT Reserved77_IRQHandler [WEAK]
EXPORT Reserved78_IRQHandler [WEAK]
EXPORT Reserved79_IRQHandler [WEAK]
EXPORT DefaultISR [WEAK]
DMA0_DMA4_IRQHandler
DMA1_DMA5_IRQHandler
DMA2_DMA6_IRQHandler
DMA3_DMA7_IRQHandler
DMA_Error_IRQHandler
FLEXIO0_IRQHandler
TPM0_IRQHandler
TPM1_IRQHandler
TPM2_IRQHandler
PIT0_IRQHandler
SPI0_IRQHandler
EMVSIM0_IRQHandler
LPUART0_IRQHandler
LPUART1_IRQHandler
I2C0_IRQHandler
QSPI0_IRQHandler
Reserved32_IRQHandler
PORTA_IRQHandler
PORTB_IRQHandler
PORTC_IRQHandler
PORTD_IRQHandler
PORTE_IRQHandler
LLWU_IRQHandler
LTC0_IRQHandler
USB0_IRQHandler
ADC0_IRQHandler
LPTMR0_IRQHandler
RTC_Seconds_IRQHandler
INTMUX0_0_IRQHandler
INTMUX0_1_IRQHandler
INTMUX0_2_IRQHandler
INTMUX0_3_IRQHandler
LPTMR1_IRQHandler
Reserved49_IRQHandler
Reserved50_IRQHandler
Reserved51_IRQHandler
SPI1_IRQHandler
LPUART2_IRQHandler
EMVSIM1_IRQHandler
I2C1_IRQHandler
TSI0_IRQHandler
PMC_IRQHandler
FTFA_IRQHandler
MCG_IRQHandler
WDOG_EWM_IRQHandler
DAC0_IRQHandler
TRNG0_IRQHandler
Reserved63_IRQHandler
CMP0_IRQHandler
Reserved65_IRQHandler
RTC_Alarm_IRQHandler
Reserved67_IRQHandler
Reserved68_IRQHandler
Reserved69_IRQHandler
Reserved70_IRQHandler
Reserved71_IRQHandler
DMA4_IRQHandler
DMA5_IRQHandler
DMA6_IRQHandler
DMA7_IRQHandler
Reserved76_IRQHandler
Reserved77_IRQHandler
Reserved78_IRQHandler
Reserved79_IRQHandler
DefaultISR
LDR R0, =DefaultISR
BX R0
ENDP
ALIGN
END
@@ -0,0 +1,467 @@
; * ---------------------------------------------------------------------------------------
; * @file: startup_MKL82Z7.s
; * @purpose: CMSIS Cortex-M0P Core Device Startup File
; * MKL82Z7
; * @version: 1.4
; * @date: 2015-8-28
; * @build: b150910
; * ---------------------------------------------------------------------------------------
; *
; * Copyright (c) 1997 - 2015 , Freescale Semiconductor, Inc.
; * All rights reserved.
; *
; * Redistribution and use in source and binary forms, with or without modification,
; * are permitted provided that the following conditions are met:
; *
; * o Redistributions of source code must retain the above copyright notice, this list
; * of conditions and the following disclaimer.
; *
; * o 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.
; *
; * o Neither the name of Freescale Semiconductor, Inc. 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.
; *
; *------- <<< 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 0 ;Reserved
DCD 0 ;Reserved
DCD 0 ;Reserved
DCD 0 ;Reserved
DCD 0 ;Reserved
DCD 0 ;Reserved
DCD 0 ;Reserved
DCD SVC_Handler ;SVCall Handler
DCD 0 ;Reserved
DCD 0 ;Reserved
DCD PendSV_Handler ;PendSV Handler
DCD SysTick_Handler ;SysTick Handler
;External Interrupts
DCD DMA0_DMA4_IRQHandler ;DMA channel 0, 4 transfer complete
DCD DMA1_DMA5_IRQHandler ;DMA channel 1, 5 transfer complete
DCD DMA2_DMA6_IRQHandler ;DMA channel 2, 6 transfer complete
DCD DMA3_DMA7_IRQHandler ;DMA channel 3, 7 transfer complete
DCD DMA_Error_IRQHandler ;DMA channel 0 - 7 error
DCD FLEXIO0_IRQHandler ;Flexible IO
DCD TPM0_IRQHandler ;Timer/PWM module 0
DCD TPM1_IRQHandler ;Timer/PWM module 1
DCD TPM2_IRQHandler ;Timer/PWM module 2
DCD PIT0_IRQHandler ;Periodic Interrupt Timer 0
DCD SPI0_IRQHandler ;Serial Peripheral Interface 0
DCD EMVSIM0_IRQHandler ;EMVSIM0 common interrupt
DCD LPUART0_IRQHandler ;LPUART0 status and error
DCD LPUART1_IRQHandler ;LPUART1 status and error
DCD I2C0_IRQHandler ;Inter-Integrated Circuit 0
DCD QSPI0_IRQHandler ;QuadSPI0 interrupt
DCD Reserved32_IRQHandler ;DryIce tamper detect
DCD PORTA_IRQHandler ;Pin detect Port A
DCD PORTB_IRQHandler ;Pin detect Port B
DCD PORTC_IRQHandler ;Pin detect Port C
DCD PORTD_IRQHandler ;Pin detect Port D
DCD PORTE_IRQHandler ;Pin detect Port E
DCD LLWU_IRQHandler ;Low Leakage Wakeup
DCD LTC0_IRQHandler ;Low power trusted cryptographic
DCD USB0_IRQHandler ;USB OTG interrupt
DCD ADC0_IRQHandler ;Analog-to-Digital Converter 0
DCD LPTMR0_IRQHandler ;Low-Power Timer 0
DCD RTC_Seconds_IRQHandler ;RTC seconds
DCD INTMUX0_0_IRQHandler ;Selectable peripheral interrupt INTMUX0-0
DCD INTMUX0_1_IRQHandler ;Selectable peripheral interrupt INTMUX0-1
DCD INTMUX0_2_IRQHandler ;Selectable peripheral interrupt INTMUX0-2
DCD INTMUX0_3_IRQHandler ;Selectable peripheral interrupt INTMUX0-3
DCD LPTMR1_IRQHandler ;Low-Power Timer 1 (INTMUX source IRQ0)
DCD Reserved49_IRQHandler ;Reserved interrupt (INTMUX source IRQ1)
DCD Reserved50_IRQHandler ;Reserved interrupt (INTMUX source IRQ2)
DCD Reserved51_IRQHandler ;Reserved interrupt (INTMUX source IRQ3)
DCD SPI1_IRQHandler ;Serial Peripheral Interface 1 (INTMUX source IRQ4)
DCD LPUART2_IRQHandler ;LPUART2 status and error (INTMUX source IRQ5)
DCD EMVSIM1_IRQHandler ;EMVSIM1 common interrupt (INTMUX source IRQ6)
DCD I2C1_IRQHandler ;Inter-Integrated Circuit 1 (INTMUX source IRQ7)
DCD TSI0_IRQHandler ;Touch Sensing Input 0 (INTMUX source IRQ8)
DCD PMC_IRQHandler ;PMC controller low-voltage detect, low-voltage warning (INTMUX source IRQ9)
DCD FTFA_IRQHandler ;FTFA command complete/read collision (INTMUX source IRQ10)
DCD MCG_IRQHandler ;Multipurpose clock generator (INTMUX source IRQ11)
DCD WDOG_EWM_IRQHandler ;Single interrupt vector for WDOG and EWM (INTMUX source IRQ12)
DCD DAC0_IRQHandler ;Digital-to-analog converter 0 (INTMUX source IRQ13)
DCD TRNG0_IRQHandler ;True randon number generator (INTMUX source IRQ14)
DCD Reserved63_IRQHandler ;Reserved interrupt (INTMUX source IRQ15)
DCD CMP0_IRQHandler ;Comparator 0 (INTMUX source IRQ16)
DCD Reserved65_IRQHandler ;Reserved interrupt (INTMUX source IRQ17)
DCD RTC_Alarm_IRQHandler ;Real time clock (INTMUX source IRQ18)
DCD Reserved67_IRQHandler ;Reserved interrupt (INTMUX source IRQ19)
DCD Reserved68_IRQHandler ;Reserved interrupt (INTMUX source IRQ20)
DCD Reserved69_IRQHandler ;Reserved interrupt (INTMUX source IRQ21)
DCD Reserved70_IRQHandler ;Reserved interrupt (INTMUX source IRQ22)
DCD Reserved71_IRQHandler ;Reserved interrupt (INTMUX source IRQ23)
DCD DMA4_IRQHandler ;DMA channel 4 transfer complete (INTMUX source IRQ24)
DCD DMA5_IRQHandler ;DMA channel 5 transfer complete (INTMUX source IRQ25)
DCD DMA6_IRQHandler ;DMA channel 6 transfer complete (INTMUX source IRQ26)
DCD DMA7_IRQHandler ;DMA channel 7 transfer complete (INTMUX source IRQ27)
DCD Reserved76_IRQHandler ;Reserved interrupt (INTMUX source IRQ28)
DCD Reserved77_IRQHandler ;Reserved interrupt (INTMUX source IRQ29)
DCD Reserved78_IRQHandler ;Reserved interrupt (INTMUX source IRQ30)
DCD Reserved79_IRQHandler ;Reserved interrupt (INTMUX source IRQ31)
__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 access to the FTFL module.
; <h> Backdoor Comparison Key
; <o0> Backdoor Comparison Key 0. <0x0-0xFF:2>
; <o1> Backdoor Comparison Key 1. <0x0-0xFF:2>
; <o2> Backdoor Comparison Key 2. <0x0-0xFF:2>
; <o3> Backdoor Comparison Key 3. <0x0-0xFF:2>
; <o4> Backdoor Comparison Key 4. <0x0-0xFF:2>
; <o5> Backdoor Comparison Key 5. <0x0-0xFF:2>
; <o6> Backdoor Comparison Key 6. <0x0-0xFF:2>
; <o7> Backdoor Comparison 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 Region Protect Register 0
; <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> 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> BOOTPIN_OPT
; <0=> Force Boot from ROM if BOOTCFG0 asserted, where BOOTCFG0 is the boot config function which is muxed with NMI pin
; <1=> Boot source configured by FOPT (BOOTSRC_SEL) bits
; <o.2> NMI_DIS
; <0=> NMI interrupts are always blocked
; <1=> NMI_b pin/interrupts reset default to enabled
; <o.5> FAST_INIT
; <0=> Slower initialization
; <1=> Fast Initialization
; <o.6..7> BOOTSRC_SEL
; <0=> Boot from Flash
; <2=> Boot from ROM, configure QSPI0, and enter boot loader mode.
; <3=> Boot from ROM and enter boot loader mode.
; <i> Boot source selection
FOPT EQU 0xBD
; </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
; <o.2..3> FSLACC
; <2=> Freescale factory access denied
; <3=> Freescale factory access granted
; <i> Freescale Failure Analysis Access Code
; <o.4..5> MEEN
; <2=> Mass erase is disabled
; <3=> Mass erase is enabled
; <o.6..7> KEYEN
; <2=> Backdoor key access enabled
; <3=> Backdoor key access disabled
; <i> Backdoor Key Security Enable
FSEC EQU 0xFE
; </h>
; </h>
IF :LNOT::DEF:RAM_TARGET
AREA FlashConfig, DATA, READONLY
__FlashConfig
DCB BackDoorK0, BackDoorK1, BackDoorK2, BackDoorK3
DCB BackDoorK4, BackDoorK5, BackDoorK6, BackDoorK7
DCB FPROT0 , FPROT1 , FPROT2 , FPROT3
DCB FSEC , FOPT , 0xFF , 0xFF
ENDIF
; Reset Handler
AREA BootloaderPatchHandler, CODE, READONLY
Reset_Handler PROC
EXPORT Reset_Handler [WEAK]
IMPORT SystemInit
IMPORT init_data_bss
IMPORT ROM_PatchHandler
IMPORT __main
IF :LNOT::DEF:RAM_TARGET
LDR R0, =FlashConfig ; dummy read, workaround for flashConfig
ENDIF
CPSID I ; Mask interrupts
LDR R0, =ROM_PatchHandler
BLX R0
NOP
LDR R0, =SystemInit
BLX R0
LDR R0, =init_data_bss
BLX R0
CPSIE i ; Unmask interrupts
LDR R0, =__main
BX R0
ENDP
AREA |.text|, CODE, READONLY
; 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
SVC_Handler\
PROC
EXPORT SVC_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_DMA4_IRQHandler [WEAK]
EXPORT DMA1_DMA5_IRQHandler [WEAK]
EXPORT DMA2_DMA6_IRQHandler [WEAK]
EXPORT DMA3_DMA7_IRQHandler [WEAK]
EXPORT DMA_Error_IRQHandler [WEAK]
EXPORT FLEXIO0_IRQHandler [WEAK]
EXPORT TPM0_IRQHandler [WEAK]
EXPORT TPM1_IRQHandler [WEAK]
EXPORT TPM2_IRQHandler [WEAK]
EXPORT PIT0_IRQHandler [WEAK]
EXPORT SPI0_IRQHandler [WEAK]
EXPORT EMVSIM0_IRQHandler [WEAK]
EXPORT LPUART0_IRQHandler [WEAK]
EXPORT LPUART1_IRQHandler [WEAK]
EXPORT I2C0_IRQHandler [WEAK]
EXPORT QSPI0_IRQHandler [WEAK]
EXPORT Reserved32_IRQHandler [WEAK]
EXPORT PORTA_IRQHandler [WEAK]
EXPORT PORTB_IRQHandler [WEAK]
EXPORT PORTC_IRQHandler [WEAK]
EXPORT PORTD_IRQHandler [WEAK]
EXPORT PORTE_IRQHandler [WEAK]
EXPORT LLWU_IRQHandler [WEAK]
EXPORT LTC0_IRQHandler [WEAK]
EXPORT USB0_IRQHandler [WEAK]
EXPORT ADC0_IRQHandler [WEAK]
EXPORT LPTMR0_IRQHandler [WEAK]
EXPORT RTC_Seconds_IRQHandler [WEAK]
EXPORT INTMUX0_0_IRQHandler [WEAK]
EXPORT INTMUX0_1_IRQHandler [WEAK]
EXPORT INTMUX0_2_IRQHandler [WEAK]
EXPORT INTMUX0_3_IRQHandler [WEAK]
EXPORT LPTMR1_IRQHandler [WEAK]
EXPORT Reserved49_IRQHandler [WEAK]
EXPORT Reserved50_IRQHandler [WEAK]
EXPORT Reserved51_IRQHandler [WEAK]
EXPORT SPI1_IRQHandler [WEAK]
EXPORT LPUART2_IRQHandler [WEAK]
EXPORT EMVSIM1_IRQHandler [WEAK]
EXPORT I2C1_IRQHandler [WEAK]
EXPORT TSI0_IRQHandler [WEAK]
EXPORT PMC_IRQHandler [WEAK]
EXPORT FTFA_IRQHandler [WEAK]
EXPORT MCG_IRQHandler [WEAK]
EXPORT WDOG_EWM_IRQHandler [WEAK]
EXPORT DAC0_IRQHandler [WEAK]
EXPORT TRNG0_IRQHandler [WEAK]
EXPORT Reserved63_IRQHandler [WEAK]
EXPORT CMP0_IRQHandler [WEAK]
EXPORT Reserved65_IRQHandler [WEAK]
EXPORT RTC_Alarm_IRQHandler [WEAK]
EXPORT Reserved67_IRQHandler [WEAK]
EXPORT Reserved68_IRQHandler [WEAK]
EXPORT Reserved69_IRQHandler [WEAK]
EXPORT Reserved70_IRQHandler [WEAK]
EXPORT Reserved71_IRQHandler [WEAK]
EXPORT DMA4_IRQHandler [WEAK]
EXPORT DMA5_IRQHandler [WEAK]
EXPORT DMA6_IRQHandler [WEAK]
EXPORT DMA7_IRQHandler [WEAK]
EXPORT Reserved76_IRQHandler [WEAK]
EXPORT Reserved77_IRQHandler [WEAK]
EXPORT Reserved78_IRQHandler [WEAK]
EXPORT Reserved79_IRQHandler [WEAK]
EXPORT DefaultISR [WEAK]
DMA0_DMA4_IRQHandler
DMA1_DMA5_IRQHandler
DMA2_DMA6_IRQHandler
DMA3_DMA7_IRQHandler
DMA_Error_IRQHandler
FLEXIO0_IRQHandler
TPM0_IRQHandler
TPM1_IRQHandler
TPM2_IRQHandler
PIT0_IRQHandler
SPI0_IRQHandler
EMVSIM0_IRQHandler
LPUART0_IRQHandler
LPUART1_IRQHandler
I2C0_IRQHandler
QSPI0_IRQHandler
Reserved32_IRQHandler
PORTA_IRQHandler
PORTB_IRQHandler
PORTC_IRQHandler
PORTD_IRQHandler
PORTE_IRQHandler
LLWU_IRQHandler
LTC0_IRQHandler
USB0_IRQHandler
ADC0_IRQHandler
LPTMR0_IRQHandler
RTC_Seconds_IRQHandler
INTMUX0_0_IRQHandler
INTMUX0_1_IRQHandler
INTMUX0_2_IRQHandler
INTMUX0_3_IRQHandler
LPTMR1_IRQHandler
Reserved49_IRQHandler
Reserved50_IRQHandler
Reserved51_IRQHandler
SPI1_IRQHandler
LPUART2_IRQHandler
EMVSIM1_IRQHandler
I2C1_IRQHandler
TSI0_IRQHandler
PMC_IRQHandler
FTFA_IRQHandler
MCG_IRQHandler
WDOG_EWM_IRQHandler
DAC0_IRQHandler
TRNG0_IRQHandler
Reserved63_IRQHandler
CMP0_IRQHandler
Reserved65_IRQHandler
RTC_Alarm_IRQHandler
Reserved67_IRQHandler
Reserved68_IRQHandler
Reserved69_IRQHandler
Reserved70_IRQHandler
Reserved71_IRQHandler
DMA4_IRQHandler
DMA5_IRQHandler
DMA6_IRQHandler
DMA7_IRQHandler
Reserved76_IRQHandler
Reserved77_IRQHandler
Reserved78_IRQHandler
Reserved79_IRQHandler
DefaultISR
LDR R0, =DefaultISR
BX R0
ENDP
ALIGN
END
@@ -0,0 +1,256 @@
/* ---------------------------------------------------------------------------------------*/
/* @file: startup_MKL82Z7.s */
/* @purpose: CMSIS Cortex-M0P Core Device Startup File */
/* MKL82Z7 */
/* @version: 1.4 */
/* @date: 2015-8-28 */
/* @build: b150910 */
/* ---------------------------------------------------------------------------------------*/
/* */
/* Copyright (c) 1997 - 2015 , Freescale Semiconductor, Inc. */
/* All rights reserved. */
/* */
/* Redistribution and use in source and binary forms, with or without modification, */
/* are permitted provided that the following conditions are met: */
/* */
/* o Redistributions of source code must retain the above copyright notice, this list */
/* of conditions and the following disclaimer. */
/* */
/* o 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. */
/* */
/* o Neither the name of Freescale Semiconductor, Inc. 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. */
/*****************************************************************************/
/* Version: GCC for ARM Embedded Processors */
/*****************************************************************************/
.syntax unified
.arch armv6-m
.section .isr_vector, "a"
.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 0 /* Reserved*/
.long 0 /* Reserved*/
.long 0 /* Reserved*/
.long 0 /* Reserved*/
.long 0 /* Reserved*/
.long 0 /* Reserved*/
.long 0 /* Reserved*/
.long SVC_Handler /* SVCall Handler*/
.long 0 /* Reserved*/
.long 0 /* Reserved*/
.long PendSV_Handler /* PendSV Handler*/
.long SysTick_Handler /* SysTick Handler*/
/* External Interrupts*/
.long DMA0_DMA4_IRQHandler /* DMA channel 0, 4 transfer complete*/
.long DMA1_DMA5_IRQHandler /* DMA channel 1, 5 transfer complete*/
.long DMA2_DMA6_IRQHandler /* DMA channel 2, 6 transfer complete*/
.long DMA3_DMA7_IRQHandler /* DMA channel 3, 7 transfer complete*/
.long DMA_Error_IRQHandler /* DMA channel 0 - 7 error*/
.long FLEXIO0_IRQHandler /* Flexible IO*/
.long TPM0_IRQHandler /* Timer/PWM module 0*/
.long TPM1_IRQHandler /* Timer/PWM module 1*/
.long TPM2_IRQHandler /* Timer/PWM module 2*/
.long PIT0_IRQHandler /* Periodic Interrupt Timer 0*/
.long SPI0_IRQHandler /* Serial Peripheral Interface 0*/
.long EMVSIM0_IRQHandler /* EMVSIM0 common interrupt*/
.long LPUART0_IRQHandler /* LPUART0 status and error*/
.long LPUART1_IRQHandler /* LPUART1 status and error*/
.long I2C0_IRQHandler /* Inter-Integrated Circuit 0*/
.long QSPI0_IRQHandler /* QuadSPI0 interrupt*/
.long Reserved32_IRQHandler /* DryIce tamper detect*/
.long PORTA_IRQHandler /* Pin detect Port A*/
.long PORTB_IRQHandler /* Pin detect Port B*/
.long PORTC_IRQHandler /* Pin detect Port C*/
.long PORTD_IRQHandler /* Pin detect Port D*/
.long PORTE_IRQHandler /* Pin detect Port E*/
.long LLWU_IRQHandler /* Low Leakage Wakeup*/
.long LTC0_IRQHandler /* Low power trusted cryptographic*/
.long USB0_IRQHandler /* USB OTG interrupt*/
.long ADC0_IRQHandler /* Analog-to-Digital Converter 0*/
.long LPTMR0_IRQHandler /* Low-Power Timer 0*/
.long RTC_Seconds_IRQHandler /* RTC seconds*/
.long INTMUX0_0_IRQHandler /* Selectable peripheral interrupt INTMUX0-0*/
.long INTMUX0_1_IRQHandler /* Selectable peripheral interrupt INTMUX0-1*/
.long INTMUX0_2_IRQHandler /* Selectable peripheral interrupt INTMUX0-2*/
.long INTMUX0_3_IRQHandler /* Selectable peripheral interrupt INTMUX0-3*/
.long LPTMR1_IRQHandler /* Low-Power Timer 1 (INTMUX source IRQ0)*/
.long Reserved49_IRQHandler /* Reserved interrupt (INTMUX source IRQ1)*/
.long Reserved50_IRQHandler /* Reserved interrupt (INTMUX source IRQ2)*/
.long Reserved51_IRQHandler /* Reserved interrupt (INTMUX source IRQ3)*/
.long SPI1_IRQHandler /* Serial Peripheral Interface 1 (INTMUX source IRQ4)*/
.long LPUART2_IRQHandler /* LPUART2 status and error (INTMUX source IRQ5)*/
.long EMVSIM1_IRQHandler /* EMVSIM1 common interrupt (INTMUX source IRQ6)*/
.long I2C1_IRQHandler /* Inter-Integrated Circuit 1 (INTMUX source IRQ7)*/
.long TSI0_IRQHandler /* Touch Sensing Input 0 (INTMUX source IRQ8)*/
.long PMC_IRQHandler /* PMC controller low-voltage detect, low-voltage warning (INTMUX source IRQ9)*/
.long FTFA_IRQHandler /* FTFA command complete/read collision (INTMUX source IRQ10)*/
.long MCG_IRQHandler /* Multipurpose clock generator (INTMUX source IRQ11)*/
.long WDOG_EWM_IRQHandler /* Single interrupt vector for WDOG and EWM (INTMUX source IRQ12)*/
.long DAC0_IRQHandler /* Digital-to-analog converter 0 (INTMUX source IRQ13)*/
.long TRNG0_IRQHandler /* True randon number generator (INTMUX source IRQ14)*/
.long Reserved63_IRQHandler /* Reserved interrupt (INTMUX source IRQ15)*/
.long CMP0_IRQHandler /* Comparator 0 (INTMUX source IRQ16)*/
.long Reserved65_IRQHandler /* Reserved interrupt (INTMUX source IRQ17)*/
.long RTC_Alarm_IRQHandler /* Real time clock (INTMUX source IRQ18)*/
.long Reserved67_IRQHandler /* Reserved interrupt (INTMUX source IRQ19)*/
.long Reserved68_IRQHandler /* Reserved interrupt (INTMUX source IRQ20)*/
.long Reserved69_IRQHandler /* Reserved interrupt (INTMUX source IRQ21)*/
.long Reserved70_IRQHandler /* Reserved interrupt (INTMUX source IRQ22)*/
.long Reserved71_IRQHandler /* Reserved interrupt (INTMUX source IRQ23)*/
.long DMA4_IRQHandler /* DMA channel 4 transfer complete (INTMUX source IRQ24)*/
.long DMA5_IRQHandler /* DMA channel 5 transfer complete (INTMUX source IRQ25)*/
.long DMA6_IRQHandler /* DMA channel 6 transfer complete (INTMUX source IRQ26)*/
.long DMA7_IRQHandler /* DMA channel 7 transfer complete (INTMUX source IRQ27)*/
.long Reserved76_IRQHandler /* Reserved interrupt (INTMUX source IRQ28)*/
.long Reserved77_IRQHandler /* Reserved interrupt (INTMUX source IRQ29)*/
.long Reserved78_IRQHandler /* Reserved interrupt (INTMUX source IRQ30)*/
.long Reserved79_IRQHandler /* Reserved interrupt (INTMUX source IRQ31)*/
.size __isr_vector, . - __isr_vector
/* Flash Configuration */
.section .FlashConfig, "a"
.long 0xFFFFFFFF
.long 0xFFFFFFFF
.long 0xFFFFFFFF
.long 0xFFFF3DFE
.text
.thumb
/* Reset Handler */
.thumb_func
.align 2
.globl Reset_Handler
.weak Reset_Handler
.type Reset_Handler, %function
Reset_Handler:
cpsid i /* Mask interrupts */
#ifndef __NO_SYSTEM_INIT
bl SystemInit
#endif
bl init_data_bss
cpsie i /* Unmask interrupts */
#ifndef __START
#define __START _start
#endif
#ifndef __ATOLLIC__
bl __START
#else
bl __libc_init_array
bl main
#endif
.pool
.size Reset_Handler, . - Reset_Handler
.align 1
.thumb_func
.weak DefaultISR
.type DefaultISR, %function
DefaultISR:
ldr r0, =DefaultISR
bx r0
.size DefaultISR, . - DefaultISR
/* Macro to define default handlers. Default handler
* will be weak symbol and just dead loops. They can be
* overwritten by other handlers */
.macro def_irq_handler handler_name
.weak \handler_name
.set \handler_name, DefaultISR
.endm
/* Exception Handlers */
def_irq_handler NMI_Handler
def_irq_handler HardFault_Handler
def_irq_handler SVC_Handler
def_irq_handler PendSV_Handler
def_irq_handler SysTick_Handler
def_irq_handler DMA0_DMA4_IRQHandler
def_irq_handler DMA1_DMA5_IRQHandler
def_irq_handler DMA2_DMA6_IRQHandler
def_irq_handler DMA3_DMA7_IRQHandler
def_irq_handler DMA_Error_IRQHandler
def_irq_handler FLEXIO0_IRQHandler
def_irq_handler TPM0_IRQHandler
def_irq_handler TPM1_IRQHandler
def_irq_handler TPM2_IRQHandler
def_irq_handler PIT0_IRQHandler
def_irq_handler SPI0_IRQHandler
def_irq_handler EMVSIM0_IRQHandler
def_irq_handler LPUART0_IRQHandler
def_irq_handler LPUART1_IRQHandler
def_irq_handler I2C0_IRQHandler
def_irq_handler QSPI0_IRQHandler
def_irq_handler Reserved32_IRQHandler
def_irq_handler PORTA_IRQHandler
def_irq_handler PORTB_IRQHandler
def_irq_handler PORTC_IRQHandler
def_irq_handler PORTD_IRQHandler
def_irq_handler PORTE_IRQHandler
def_irq_handler LLWU_IRQHandler
def_irq_handler LTC0_IRQHandler
def_irq_handler USB0_IRQHandler
def_irq_handler ADC0_IRQHandler
def_irq_handler LPTMR0_IRQHandler
def_irq_handler RTC_Seconds_IRQHandler
def_irq_handler INTMUX0_0_IRQHandler
def_irq_handler INTMUX0_1_IRQHandler
def_irq_handler INTMUX0_2_IRQHandler
def_irq_handler INTMUX0_3_IRQHandler
def_irq_handler LPTMR1_IRQHandler
def_irq_handler Reserved49_IRQHandler
def_irq_handler Reserved50_IRQHandler
def_irq_handler Reserved51_IRQHandler
def_irq_handler SPI1_IRQHandler
def_irq_handler LPUART2_IRQHandler
def_irq_handler EMVSIM1_IRQHandler
def_irq_handler I2C1_IRQHandler
def_irq_handler TSI0_IRQHandler
def_irq_handler PMC_IRQHandler
def_irq_handler FTFA_IRQHandler
def_irq_handler MCG_IRQHandler
def_irq_handler WDOG_EWM_IRQHandler
def_irq_handler DAC0_IRQHandler
def_irq_handler TRNG0_IRQHandler
def_irq_handler Reserved63_IRQHandler
def_irq_handler CMP0_IRQHandler
def_irq_handler Reserved65_IRQHandler
def_irq_handler RTC_Alarm_IRQHandler
def_irq_handler Reserved67_IRQHandler
def_irq_handler Reserved68_IRQHandler
def_irq_handler Reserved69_IRQHandler
def_irq_handler Reserved70_IRQHandler
def_irq_handler Reserved71_IRQHandler
def_irq_handler DMA4_IRQHandler
def_irq_handler DMA5_IRQHandler
def_irq_handler DMA6_IRQHandler
def_irq_handler DMA7_IRQHandler
def_irq_handler Reserved76_IRQHandler
def_irq_handler Reserved77_IRQHandler
def_irq_handler Reserved78_IRQHandler
def_irq_handler Reserved79_IRQHandler
.end
@@ -0,0 +1,256 @@
/* ---------------------------------------------------------------------------------------*/
/* @file: startup_MKL82Z7.s */
/* @purpose: CMSIS Cortex-M0P Core Device Startup File */
/* MKL82Z7 */
/* @version: 1.4 */
/* @date: 2015-8-28 */
/* @build: b150910 */
/* ---------------------------------------------------------------------------------------*/
/* */
/* Copyright (c) 1997 - 2015 , Freescale Semiconductor, Inc. */
/* All rights reserved. */
/* */
/* Redistribution and use in source and binary forms, with or without modification, */
/* are permitted provided that the following conditions are met: */
/* */
/* o Redistributions of source code must retain the above copyright notice, this list */
/* of conditions and the following disclaimer. */
/* */
/* o 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. */
/* */
/* o Neither the name of Freescale Semiconductor, Inc. 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. */
/*****************************************************************************/
/* Version: GCC for ARM Embedded Processors */
/*****************************************************************************/
.syntax unified
.arch armv6-m
.section .isr_vector, "a"
.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 0 /* Reserved*/
.long 0 /* Reserved*/
.long 0 /* Reserved*/
.long 0 /* Reserved*/
.long 0 /* Reserved*/
.long 0 /* Reserved*/
.long 0 /* Reserved*/
.long SVC_Handler /* SVCall Handler*/
.long 0 /* Reserved*/
.long 0 /* Reserved*/
.long PendSV_Handler /* PendSV Handler*/
.long SysTick_Handler /* SysTick Handler*/
/* External Interrupts*/
.long DMA0_DMA4_IRQHandler /* DMA channel 0, 4 transfer complete*/
.long DMA1_DMA5_IRQHandler /* DMA channel 1, 5 transfer complete*/
.long DMA2_DMA6_IRQHandler /* DMA channel 2, 6 transfer complete*/
.long DMA3_DMA7_IRQHandler /* DMA channel 3, 7 transfer complete*/
.long DMA_Error_IRQHandler /* DMA channel 0 - 7 error*/
.long FLEXIO0_IRQHandler /* Flexible IO*/
.long TPM0_IRQHandler /* Timer/PWM module 0*/
.long TPM1_IRQHandler /* Timer/PWM module 1*/
.long TPM2_IRQHandler /* Timer/PWM module 2*/
.long PIT0_IRQHandler /* Periodic Interrupt Timer 0*/
.long SPI0_IRQHandler /* Serial Peripheral Interface 0*/
.long EMVSIM0_IRQHandler /* EMVSIM0 common interrupt*/
.long LPUART0_IRQHandler /* LPUART0 status and error*/
.long LPUART1_IRQHandler /* LPUART1 status and error*/
.long I2C0_IRQHandler /* Inter-Integrated Circuit 0*/
.long QSPI0_IRQHandler /* QuadSPI0 interrupt*/
.long Reserved32_IRQHandler /* DryIce tamper detect*/
.long PORTA_IRQHandler /* Pin detect Port A*/
.long PORTB_IRQHandler /* Pin detect Port B*/
.long PORTC_IRQHandler /* Pin detect Port C*/
.long PORTD_IRQHandler /* Pin detect Port D*/
.long PORTE_IRQHandler /* Pin detect Port E*/
.long LLWU_IRQHandler /* Low Leakage Wakeup*/
.long LTC0_IRQHandler /* Low power trusted cryptographic*/
.long USB0_IRQHandler /* USB OTG interrupt*/
.long ADC0_IRQHandler /* Analog-to-Digital Converter 0*/
.long LPTMR0_IRQHandler /* Low-Power Timer 0*/
.long RTC_Seconds_IRQHandler /* RTC seconds*/
.long INTMUX0_0_IRQHandler /* Selectable peripheral interrupt INTMUX0-0*/
.long INTMUX0_1_IRQHandler /* Selectable peripheral interrupt INTMUX0-1*/
.long INTMUX0_2_IRQHandler /* Selectable peripheral interrupt INTMUX0-2*/
.long INTMUX0_3_IRQHandler /* Selectable peripheral interrupt INTMUX0-3*/
.long LPTMR1_IRQHandler /* Low-Power Timer 1 (INTMUX source IRQ0)*/
.long Reserved49_IRQHandler /* Reserved interrupt (INTMUX source IRQ1)*/
.long Reserved50_IRQHandler /* Reserved interrupt (INTMUX source IRQ2)*/
.long Reserved51_IRQHandler /* Reserved interrupt (INTMUX source IRQ3)*/
.long SPI1_IRQHandler /* Serial Peripheral Interface 1 (INTMUX source IRQ4)*/
.long LPUART2_IRQHandler /* LPUART2 status and error (INTMUX source IRQ5)*/
.long EMVSIM1_IRQHandler /* EMVSIM1 common interrupt (INTMUX source IRQ6)*/
.long I2C1_IRQHandler /* Inter-Integrated Circuit 1 (INTMUX source IRQ7)*/
.long TSI0_IRQHandler /* Touch Sensing Input 0 (INTMUX source IRQ8)*/
.long PMC_IRQHandler /* PMC controller low-voltage detect, low-voltage warning (INTMUX source IRQ9)*/
.long FTFA_IRQHandler /* FTFA command complete/read collision (INTMUX source IRQ10)*/
.long MCG_IRQHandler /* Multipurpose clock generator (INTMUX source IRQ11)*/
.long WDOG_EWM_IRQHandler /* Single interrupt vector for WDOG and EWM (INTMUX source IRQ12)*/
.long DAC0_IRQHandler /* Digital-to-analog converter 0 (INTMUX source IRQ13)*/
.long TRNG0_IRQHandler /* True randon number generator (INTMUX source IRQ14)*/
.long Reserved63_IRQHandler /* Reserved interrupt (INTMUX source IRQ15)*/
.long CMP0_IRQHandler /* Comparator 0 (INTMUX source IRQ16)*/
.long Reserved65_IRQHandler /* Reserved interrupt (INTMUX source IRQ17)*/
.long RTC_Alarm_IRQHandler /* Real time clock (INTMUX source IRQ18)*/
.long Reserved67_IRQHandler /* Reserved interrupt (INTMUX source IRQ19)*/
.long Reserved68_IRQHandler /* Reserved interrupt (INTMUX source IRQ20)*/
.long Reserved69_IRQHandler /* Reserved interrupt (INTMUX source IRQ21)*/
.long Reserved70_IRQHandler /* Reserved interrupt (INTMUX source IRQ22)*/
.long Reserved71_IRQHandler /* Reserved interrupt (INTMUX source IRQ23)*/
.long DMA4_IRQHandler /* DMA channel 4 transfer complete (INTMUX source IRQ24)*/
.long DMA5_IRQHandler /* DMA channel 5 transfer complete (INTMUX source IRQ25)*/
.long DMA6_IRQHandler /* DMA channel 6 transfer complete (INTMUX source IRQ26)*/
.long DMA7_IRQHandler /* DMA channel 7 transfer complete (INTMUX source IRQ27)*/
.long Reserved76_IRQHandler /* Reserved interrupt (INTMUX source IRQ28)*/
.long Reserved77_IRQHandler /* Reserved interrupt (INTMUX source IRQ29)*/
.long Reserved78_IRQHandler /* Reserved interrupt (INTMUX source IRQ30)*/
.long Reserved79_IRQHandler /* Reserved interrupt (INTMUX source IRQ31)*/
.size __isr_vector, . - __isr_vector
/* Flash Configuration */
.section .FlashConfig, "a"
.long 0xFFFFFFFF
.long 0xFFFFFFFF
.long 0xFFFFFFFF
.long 0xFFFFBDFE
.text
.thumb
/* Reset Handler */
.thumb_func
.align 2
.globl Reset_Handler
.weak Reset_Handler
.type Reset_Handler, %function
Reset_Handler:
cpsid i /* Mask interrupts */
#ifndef __NO_SYSTEM_INIT
bl SystemInit
#endif
bl init_data_bss
cpsie i /* Unmask interrupts */
#ifndef __START
#define __START _start
#endif
#ifndef __ATOLLIC__
bl __START
#else
bl __libc_init_array
bl main
#endif
.pool
.size Reset_Handler, . - Reset_Handler
.align 1
.thumb_func
.weak DefaultISR
.type DefaultISR, %function
DefaultISR:
ldr r0, =DefaultISR
bx r0
.size DefaultISR, . - DefaultISR
/* Macro to define default handlers. Default handler
* will be weak symbol and just dead loops. They can be
* overwritten by other handlers */
.macro def_irq_handler handler_name
.weak \handler_name
.set \handler_name, DefaultISR
.endm
/* Exception Handlers */
def_irq_handler NMI_Handler
def_irq_handler HardFault_Handler
def_irq_handler SVC_Handler
def_irq_handler PendSV_Handler
def_irq_handler SysTick_Handler
def_irq_handler DMA0_DMA4_IRQHandler
def_irq_handler DMA1_DMA5_IRQHandler
def_irq_handler DMA2_DMA6_IRQHandler
def_irq_handler DMA3_DMA7_IRQHandler
def_irq_handler DMA_Error_IRQHandler
def_irq_handler FLEXIO0_IRQHandler
def_irq_handler TPM0_IRQHandler
def_irq_handler TPM1_IRQHandler
def_irq_handler TPM2_IRQHandler
def_irq_handler PIT0_IRQHandler
def_irq_handler SPI0_IRQHandler
def_irq_handler EMVSIM0_IRQHandler
def_irq_handler LPUART0_IRQHandler
def_irq_handler LPUART1_IRQHandler
def_irq_handler I2C0_IRQHandler
def_irq_handler QSPI0_IRQHandler
def_irq_handler Reserved32_IRQHandler
def_irq_handler PORTA_IRQHandler
def_irq_handler PORTB_IRQHandler
def_irq_handler PORTC_IRQHandler
def_irq_handler PORTD_IRQHandler
def_irq_handler PORTE_IRQHandler
def_irq_handler LLWU_IRQHandler
def_irq_handler LTC0_IRQHandler
def_irq_handler USB0_IRQHandler
def_irq_handler ADC0_IRQHandler
def_irq_handler LPTMR0_IRQHandler
def_irq_handler RTC_Seconds_IRQHandler
def_irq_handler INTMUX0_0_IRQHandler
def_irq_handler INTMUX0_1_IRQHandler
def_irq_handler INTMUX0_2_IRQHandler
def_irq_handler INTMUX0_3_IRQHandler
def_irq_handler LPTMR1_IRQHandler
def_irq_handler Reserved49_IRQHandler
def_irq_handler Reserved50_IRQHandler
def_irq_handler Reserved51_IRQHandler
def_irq_handler SPI1_IRQHandler
def_irq_handler LPUART2_IRQHandler
def_irq_handler EMVSIM1_IRQHandler
def_irq_handler I2C1_IRQHandler
def_irq_handler TSI0_IRQHandler
def_irq_handler PMC_IRQHandler
def_irq_handler FTFA_IRQHandler
def_irq_handler MCG_IRQHandler
def_irq_handler WDOG_EWM_IRQHandler
def_irq_handler DAC0_IRQHandler
def_irq_handler TRNG0_IRQHandler
def_irq_handler Reserved63_IRQHandler
def_irq_handler CMP0_IRQHandler
def_irq_handler Reserved65_IRQHandler
def_irq_handler RTC_Alarm_IRQHandler
def_irq_handler Reserved67_IRQHandler
def_irq_handler Reserved68_IRQHandler
def_irq_handler Reserved69_IRQHandler
def_irq_handler Reserved70_IRQHandler
def_irq_handler Reserved71_IRQHandler
def_irq_handler DMA4_IRQHandler
def_irq_handler DMA5_IRQHandler
def_irq_handler DMA6_IRQHandler
def_irq_handler DMA7_IRQHandler
def_irq_handler Reserved76_IRQHandler
def_irq_handler Reserved77_IRQHandler
def_irq_handler Reserved78_IRQHandler
def_irq_handler Reserved79_IRQHandler
.end
@@ -0,0 +1,266 @@
/* ---------------------------------------------------------------------------------------*/
/* @file: startup_MKL82Z7.s */
/* @purpose: CMSIS Cortex-M0P Core Device Startup File */
/* MKL82Z7 */
/* @version: 1.4 */
/* @date: 2015-8-28 */
/* @build: b150910 */
/* ---------------------------------------------------------------------------------------*/
/* */
/* Copyright (c) 1997 - 2015 , Freescale Semiconductor, Inc. */
/* All rights reserved. */
/* */
/* Redistribution and use in source and binary forms, with or without modification, */
/* are permitted provided that the following conditions are met: */
/* */
/* o Redistributions of source code must retain the above copyright notice, this list */
/* of conditions and the following disclaimer. */
/* */
/* o 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. */
/* */
/* o Neither the name of Freescale Semiconductor, Inc. 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. */
/*****************************************************************************/
/* Version: GCC for ARM Embedded Processors */
/*****************************************************************************/
.syntax unified
.arch armv6-m
.section .isr_vector, "a"
.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 0 /* Reserved*/
.long 0 /* Reserved*/
.long 0 /* Reserved*/
.long 0 /* Reserved*/
.long 0 /* Reserved*/
.long 0 /* Reserved*/
.long 0 /* Reserved*/
.long SVC_Handler /* SVCall Handler*/
.long 0 /* Reserved*/
.long 0 /* Reserved*/
.long PendSV_Handler /* PendSV Handler*/
.long SysTick_Handler /* SysTick Handler*/
/* External Interrupts*/
.long DMA0_DMA4_IRQHandler /* DMA channel 0, 4 transfer complete*/
.long DMA1_DMA5_IRQHandler /* DMA channel 1, 5 transfer complete*/
.long DMA2_DMA6_IRQHandler /* DMA channel 2, 6 transfer complete*/
.long DMA3_DMA7_IRQHandler /* DMA channel 3, 7 transfer complete*/
.long DMA_Error_IRQHandler /* DMA channel 0 - 7 error*/
.long FLEXIO0_IRQHandler /* Flexible IO*/
.long TPM0_IRQHandler /* Timer/PWM module 0*/
.long TPM1_IRQHandler /* Timer/PWM module 1*/
.long TPM2_IRQHandler /* Timer/PWM module 2*/
.long PIT0_IRQHandler /* Periodic Interrupt Timer 0*/
.long SPI0_IRQHandler /* Serial Peripheral Interface 0*/
.long EMVSIM0_IRQHandler /* EMVSIM0 common interrupt*/
.long LPUART0_IRQHandler /* LPUART0 status and error*/
.long LPUART1_IRQHandler /* LPUART1 status and error*/
.long I2C0_IRQHandler /* Inter-Integrated Circuit 0*/
.long QSPI0_IRQHandler /* QuadSPI0 interrupt*/
.long Reserved32_IRQHandler /* DryIce tamper detect*/
.long PORTA_IRQHandler /* Pin detect Port A*/
.long PORTB_IRQHandler /* Pin detect Port B*/
.long PORTC_IRQHandler /* Pin detect Port C*/
.long PORTD_IRQHandler /* Pin detect Port D*/
.long PORTE_IRQHandler /* Pin detect Port E*/
.long LLWU_IRQHandler /* Low Leakage Wakeup*/
.long LTC0_IRQHandler /* Low power trusted cryptographic*/
.long USB0_IRQHandler /* USB OTG interrupt*/
.long ADC0_IRQHandler /* Analog-to-Digital Converter 0*/
.long LPTMR0_IRQHandler /* Low-Power Timer 0*/
.long RTC_Seconds_IRQHandler /* RTC seconds*/
.long INTMUX0_0_IRQHandler /* Selectable peripheral interrupt INTMUX0-0*/
.long INTMUX0_1_IRQHandler /* Selectable peripheral interrupt INTMUX0-1*/
.long INTMUX0_2_IRQHandler /* Selectable peripheral interrupt INTMUX0-2*/
.long INTMUX0_3_IRQHandler /* Selectable peripheral interrupt INTMUX0-3*/
.long LPTMR1_IRQHandler /* Low-Power Timer 1 (INTMUX source IRQ0)*/
.long Reserved49_IRQHandler /* Reserved interrupt (INTMUX source IRQ1)*/
.long Reserved50_IRQHandler /* Reserved interrupt (INTMUX source IRQ2)*/
.long Reserved51_IRQHandler /* Reserved interrupt (INTMUX source IRQ3)*/
.long SPI1_IRQHandler /* Serial Peripheral Interface 1 (INTMUX source IRQ4)*/
.long LPUART2_IRQHandler /* LPUART2 status and error (INTMUX source IRQ5)*/
.long EMVSIM1_IRQHandler /* EMVSIM1 common interrupt (INTMUX source IRQ6)*/
.long I2C1_IRQHandler /* Inter-Integrated Circuit 1 (INTMUX source IRQ7)*/
.long TSI0_IRQHandler /* Touch Sensing Input 0 (INTMUX source IRQ8)*/
.long PMC_IRQHandler /* PMC controller low-voltage detect, low-voltage warning (INTMUX source IRQ9)*/
.long FTFA_IRQHandler /* FTFA command complete/read collision (INTMUX source IRQ10)*/
.long MCG_IRQHandler /* Multipurpose clock generator (INTMUX source IRQ11)*/
.long WDOG_EWM_IRQHandler /* Single interrupt vector for WDOG and EWM (INTMUX source IRQ12)*/
.long DAC0_IRQHandler /* Digital-to-analog converter 0 (INTMUX source IRQ13)*/
.long TRNG0_IRQHandler /* True randon number generator (INTMUX source IRQ14)*/
.long Reserved63_IRQHandler /* Reserved interrupt (INTMUX source IRQ15)*/
.long CMP0_IRQHandler /* Comparator 0 (INTMUX source IRQ16)*/
.long Reserved65_IRQHandler /* Reserved interrupt (INTMUX source IRQ17)*/
.long RTC_Alarm_IRQHandler /* Real time clock (INTMUX source IRQ18)*/
.long Reserved67_IRQHandler /* Reserved interrupt (INTMUX source IRQ19)*/
.long Reserved68_IRQHandler /* Reserved interrupt (INTMUX source IRQ20)*/
.long Reserved69_IRQHandler /* Reserved interrupt (INTMUX source IRQ21)*/
.long Reserved70_IRQHandler /* Reserved interrupt (INTMUX source IRQ22)*/
.long Reserved71_IRQHandler /* Reserved interrupt (INTMUX source IRQ23)*/
.long DMA4_IRQHandler /* DMA channel 4 transfer complete (INTMUX source IRQ24)*/
.long DMA5_IRQHandler /* DMA channel 5 transfer complete (INTMUX source IRQ25)*/
.long DMA6_IRQHandler /* DMA channel 6 transfer complete (INTMUX source IRQ26)*/
.long DMA7_IRQHandler /* DMA channel 7 transfer complete (INTMUX source IRQ27)*/
.long Reserved76_IRQHandler /* Reserved interrupt (INTMUX source IRQ28)*/
.long Reserved77_IRQHandler /* Reserved interrupt (INTMUX source IRQ29)*/
.long Reserved78_IRQHandler /* Reserved interrupt (INTMUX source IRQ30)*/
.long Reserved79_IRQHandler /* Reserved interrupt (INTMUX source IRQ31)*/
.size __isr_vector, . - __isr_vector
/* Flash Configuration */
.section .FlashConfig, "a"
.long 0xFFFFFFFF
.long 0xFFFFFFFF
.long 0xFFFFFFFF
.long 0xFFFFBDFE
.section BootloaderPatchHandler, "a"
.thumb
/* Reset Handler */
.thumb_func
.align 2
.globl Reset_Handler
.weak Reset_Handler
.type Reset_Handler, %function
Reset_Handler:
cpsid i /* Mask interrupts */
ldr r0, = ROM_PatchHandler
blx r0
#ifndef __NO_SYSTEM_INIT
ldr r0, = SystemInit
blx r0
#endif
ldr r0, = init_data_bss
blx r0
cpsie i /* Unmask interrupts */
#ifndef __START
#define __START _start
#endif
#ifndef __ATOLLIC__
ldr r0, = __START
blx r0
#else
ldr r0,= __libc_init_array
blx r0
ldr r0, = main,
bx r0
#endif
.pool
.size Reset_Handler, . - Reset_Handler
.text
.thumb
.align 1
.thumb_func
.weak DefaultISR
.type DefaultISR, %function
DefaultISR:
ldr r0, =DefaultISR
bx r0
.size DefaultISR, . - DefaultISR
/* Macro to define default handlers. Default handler
* will be weak symbol and just dead loops. They can be
* overwritten by other handlers */
.macro def_irq_handler handler_name
.weak \handler_name
.set \handler_name, DefaultISR
.endm
/* Exception Handlers */
def_irq_handler NMI_Handler
def_irq_handler HardFault_Handler
def_irq_handler SVC_Handler
def_irq_handler PendSV_Handler
def_irq_handler SysTick_Handler
def_irq_handler DMA0_DMA4_IRQHandler
def_irq_handler DMA1_DMA5_IRQHandler
def_irq_handler DMA2_DMA6_IRQHandler
def_irq_handler DMA3_DMA7_IRQHandler
def_irq_handler DMA_Error_IRQHandler
def_irq_handler FLEXIO0_IRQHandler
def_irq_handler TPM0_IRQHandler
def_irq_handler TPM1_IRQHandler
def_irq_handler TPM2_IRQHandler
def_irq_handler PIT0_IRQHandler
def_irq_handler SPI0_IRQHandler
def_irq_handler EMVSIM0_IRQHandler
def_irq_handler LPUART0_IRQHandler
def_irq_handler LPUART1_IRQHandler
def_irq_handler I2C0_IRQHandler
def_irq_handler QSPI0_IRQHandler
def_irq_handler Reserved32_IRQHandler
def_irq_handler PORTA_IRQHandler
def_irq_handler PORTB_IRQHandler
def_irq_handler PORTC_IRQHandler
def_irq_handler PORTD_IRQHandler
def_irq_handler PORTE_IRQHandler
def_irq_handler LLWU_IRQHandler
def_irq_handler LTC0_IRQHandler
def_irq_handler USB0_IRQHandler
def_irq_handler ADC0_IRQHandler
def_irq_handler LPTMR0_IRQHandler
def_irq_handler RTC_Seconds_IRQHandler
def_irq_handler INTMUX0_0_IRQHandler
def_irq_handler INTMUX0_1_IRQHandler
def_irq_handler INTMUX0_2_IRQHandler
def_irq_handler INTMUX0_3_IRQHandler
def_irq_handler LPTMR1_IRQHandler
def_irq_handler Reserved49_IRQHandler
def_irq_handler Reserved50_IRQHandler
def_irq_handler Reserved51_IRQHandler
def_irq_handler SPI1_IRQHandler
def_irq_handler LPUART2_IRQHandler
def_irq_handler EMVSIM1_IRQHandler
def_irq_handler I2C1_IRQHandler
def_irq_handler TSI0_IRQHandler
def_irq_handler PMC_IRQHandler
def_irq_handler FTFA_IRQHandler
def_irq_handler MCG_IRQHandler
def_irq_handler WDOG_EWM_IRQHandler
def_irq_handler DAC0_IRQHandler
def_irq_handler TRNG0_IRQHandler
def_irq_handler Reserved63_IRQHandler
def_irq_handler CMP0_IRQHandler
def_irq_handler Reserved65_IRQHandler
def_irq_handler RTC_Alarm_IRQHandler
def_irq_handler Reserved67_IRQHandler
def_irq_handler Reserved68_IRQHandler
def_irq_handler Reserved69_IRQHandler
def_irq_handler Reserved70_IRQHandler
def_irq_handler Reserved71_IRQHandler
def_irq_handler DMA4_IRQHandler
def_irq_handler DMA5_IRQHandler
def_irq_handler DMA6_IRQHandler
def_irq_handler DMA7_IRQHandler
def_irq_handler Reserved76_IRQHandler
def_irq_handler Reserved77_IRQHandler
def_irq_handler Reserved78_IRQHandler
def_irq_handler Reserved79_IRQHandler
.end
@@ -0,0 +1,347 @@
; ---------------------------------------------------------------------------------------
; @file: startup_MKL82Z7.s
; @purpose: CMSIS Cortex-M0P Core Device Startup File
; MKL82Z7
; @version: 1.4
; @date: 2015-8-28
; @build: b150910
; ---------------------------------------------------------------------------------------
;
; Copyright (c) 1997 - 2015 , Freescale Semiconductor, Inc.
; All rights reserved.
;
; Redistribution and use in source and binary forms, with or without modification,
; are permitted provided that the following conditions are met:
;
; o Redistributions of source code must retain the above copyright notice, this list
; of conditions and the following disclaimer.
;
; o 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.
;
; o Neither the name of Freescale Semiconductor, Inc. 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.
;
; The modules in this file are included in the libraries, and may be replaced
; by any user-defined modules that define the PUBLIC symbol _program_start or
; a user defined start symbol.
; To override the cstartup defined in the library, simply add your modified
; version to the workbench project.
;
; The vector table is normally located at address 0.
; When debugging in RAM, it can be located in RAM, aligned to at least 2^6.
; The name "__vector_table" has special meaning for C-SPY:
; it is where the SP start value is found, and the NVIC vector
; table register (VTOR) is initialized to this address if != 0.
;
; Cortex-M version
;
MODULE ?cstartup
;; Forward declaration of sections.
SECTION CSTACK:DATA:NOROOT(3)
SECTION .intvec:CODE:NOROOT(2)
EXTERN __iar_program_start
EXTERN SystemInit
EXTERN init_data_bss
PUBLIC __vector_table
PUBLIC __vector_table_0x1c
PUBLIC __Vectors
PUBLIC __Vectors_End
PUBLIC __Vectors_Size
DATA
__vector_table
DCD sfe(CSTACK)
DCD Reset_Handler
DCD NMI_Handler ;NMI Handler
DCD HardFault_Handler ;Hard Fault Handler
DCD 0 ;Reserved
DCD 0 ;Reserved
DCD 0 ;Reserved
__vector_table_0x1c
DCD 0 ;Reserved
DCD 0 ;Reserved
DCD 0 ;Reserved
DCD 0 ;Reserved
DCD SVC_Handler ;SVCall Handler
DCD 0 ;Reserved
DCD 0 ;Reserved
DCD PendSV_Handler ;PendSV Handler
DCD SysTick_Handler ;SysTick Handler
;External Interrupts
DCD DMA0_DMA4_IRQHandler ;DMA channel 0, 4 transfer complete
DCD DMA1_DMA5_IRQHandler ;DMA channel 1, 5 transfer complete
DCD DMA2_DMA6_IRQHandler ;DMA channel 2, 6 transfer complete
DCD DMA3_DMA7_IRQHandler ;DMA channel 3, 7 transfer complete
DCD DMA_Error_IRQHandler ;DMA channel 0 - 7 error
DCD FLEXIO0_IRQHandler ;Flexible IO
DCD TPM0_IRQHandler ;Timer/PWM module 0
DCD TPM1_IRQHandler ;Timer/PWM module 1
DCD TPM2_IRQHandler ;Timer/PWM module 2
DCD PIT0_IRQHandler ;Periodic Interrupt Timer 0
DCD SPI0_IRQHandler ;Serial Peripheral Interface 0
DCD EMVSIM0_IRQHandler ;EMVSIM0 common interrupt
DCD LPUART0_IRQHandler ;LPUART0 status and error
DCD LPUART1_IRQHandler ;LPUART1 status and error
DCD I2C0_IRQHandler ;Inter-Integrated Circuit 0
DCD QSPI0_IRQHandler ;QuadSPI0 interrupt
DCD Reserved32_IRQHandler ;DryIce tamper detect
DCD PORTA_IRQHandler ;Pin detect Port A
DCD PORTB_IRQHandler ;Pin detect Port B
DCD PORTC_IRQHandler ;Pin detect Port C
DCD PORTD_IRQHandler ;Pin detect Port D
DCD PORTE_IRQHandler ;Pin detect Port E
DCD LLWU_IRQHandler ;Low Leakage Wakeup
DCD LTC0_IRQHandler ;Low power trusted cryptographic
DCD USB0_IRQHandler ;USB OTG interrupt
DCD ADC0_IRQHandler ;Analog-to-Digital Converter 0
DCD LPTMR0_IRQHandler ;Low-Power Timer 0
DCD RTC_Seconds_IRQHandler ;RTC seconds
DCD INTMUX0_0_IRQHandler ;Selectable peripheral interrupt INTMUX0-0
DCD INTMUX0_1_IRQHandler ;Selectable peripheral interrupt INTMUX0-1
DCD INTMUX0_2_IRQHandler ;Selectable peripheral interrupt INTMUX0-2
DCD INTMUX0_3_IRQHandler ;Selectable peripheral interrupt INTMUX0-3
DCD LPTMR1_IRQHandler ;Low-Power Timer 1 (INTMUX source IRQ0)
DCD Reserved49_IRQHandler ;Reserved interrupt (INTMUX source IRQ1)
DCD Reserved50_IRQHandler ;Reserved interrupt (INTMUX source IRQ2)
DCD Reserved51_IRQHandler ;Reserved interrupt (INTMUX source IRQ3)
DCD SPI1_IRQHandler ;Serial Peripheral Interface 1 (INTMUX source IRQ4)
DCD LPUART2_IRQHandler ;LPUART2 status and error (INTMUX source IRQ5)
DCD EMVSIM1_IRQHandler ;EMVSIM1 common interrupt (INTMUX source IRQ6)
DCD I2C1_IRQHandler ;Inter-Integrated Circuit 1 (INTMUX source IRQ7)
DCD TSI0_IRQHandler ;Touch Sensing Input 0 (INTMUX source IRQ8)
DCD PMC_IRQHandler ;PMC controller low-voltage detect, low-voltage warning (INTMUX source IRQ9)
DCD FTFA_IRQHandler ;FTFA command complete/read collision (INTMUX source IRQ10)
DCD MCG_IRQHandler ;Multipurpose clock generator (INTMUX source IRQ11)
DCD WDOG_EWM_IRQHandler ;Single interrupt vector for WDOG and EWM (INTMUX source IRQ12)
DCD DAC0_IRQHandler ;Digital-to-analog converter 0 (INTMUX source IRQ13)
DCD TRNG0_IRQHandler ;True randon number generator (INTMUX source IRQ14)
DCD Reserved63_IRQHandler ;Reserved interrupt (INTMUX source IRQ15)
DCD CMP0_IRQHandler ;Comparator 0 (INTMUX source IRQ16)
DCD Reserved65_IRQHandler ;Reserved interrupt (INTMUX source IRQ17)
DCD RTC_Alarm_IRQHandler ;Real time clock (INTMUX source IRQ18)
DCD Reserved67_IRQHandler ;Reserved interrupt (INTMUX source IRQ19)
DCD Reserved68_IRQHandler ;Reserved interrupt (INTMUX source IRQ20)
DCD Reserved69_IRQHandler ;Reserved interrupt (INTMUX source IRQ21)
DCD Reserved70_IRQHandler ;Reserved interrupt (INTMUX source IRQ22)
DCD Reserved71_IRQHandler ;Reserved interrupt (INTMUX source IRQ23)
DCD DMA4_IRQHandler ;DMA channel 4 transfer complete (INTMUX source IRQ24)
DCD DMA5_IRQHandler ;DMA channel 5 transfer complete (INTMUX source IRQ25)
DCD DMA6_IRQHandler ;DMA channel 6 transfer complete (INTMUX source IRQ26)
DCD DMA7_IRQHandler ;DMA channel 7 transfer complete (INTMUX source IRQ27)
DCD Reserved76_IRQHandler ;Reserved interrupt (INTMUX source IRQ28)
DCD Reserved77_IRQHandler ;Reserved interrupt (INTMUX source IRQ29)
DCD Reserved78_IRQHandler ;Reserved interrupt (INTMUX source IRQ30)
DCD Reserved79_IRQHandler ;Reserved interrupt (INTMUX source IRQ31)
__Vectors_End
SECTION FlashConfig:CODE
__FlashConfig
DCD 0xFFFFFFFF
DCD 0xFFFFFFFF
DCD 0xFFFFFFFF
DCD 0xFFFF3DFE
__FlashConfig_End
__Vectors EQU __vector_table
__Vectors_Size EQU __Vectors_End - __Vectors
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
;; Default interrupt handlers.
;;
THUMB
PUBWEAK Reset_Handler
SECTION .text:CODE:REORDER:NOROOT(2)
Reset_Handler
CPSID I ; Mask interrupts
LDR R0, =SystemInit
BLX R0
LDR R0, =init_data_bss
BLX R0
CPSIE I ; Unmask interrupts
LDR R0, =__iar_program_start
BX R0
PUBWEAK NMI_Handler
SECTION .text:CODE:REORDER:NOROOT(1)
NMI_Handler
B .
PUBWEAK HardFault_Handler
SECTION .text:CODE:REORDER:NOROOT(1)
HardFault_Handler
B .
PUBWEAK SVC_Handler
SECTION .text:CODE:REORDER:NOROOT(1)
SVC_Handler
B .
PUBWEAK PendSV_Handler
SECTION .text:CODE:REORDER:NOROOT(1)
PendSV_Handler
B .
PUBWEAK SysTick_Handler
SECTION .text:CODE:REORDER:NOROOT(1)
SysTick_Handler
B .
PUBWEAK DMA0_DMA4_IRQHandler
PUBWEAK DMA1_DMA5_IRQHandler
PUBWEAK DMA2_DMA6_IRQHandler
PUBWEAK DMA3_DMA7_IRQHandler
PUBWEAK DMA_Error_IRQHandler
PUBWEAK FLEXIO0_IRQHandler
PUBWEAK TPM0_IRQHandler
PUBWEAK TPM1_IRQHandler
PUBWEAK TPM2_IRQHandler
PUBWEAK PIT0_IRQHandler
PUBWEAK SPI0_IRQHandler
PUBWEAK EMVSIM0_IRQHandler
PUBWEAK LPUART0_IRQHandler
PUBWEAK LPUART1_IRQHandler
PUBWEAK I2C0_IRQHandler
PUBWEAK QSPI0_IRQHandler
PUBWEAK Reserved32_IRQHandler
PUBWEAK PORTA_IRQHandler
PUBWEAK PORTB_IRQHandler
PUBWEAK PORTC_IRQHandler
PUBWEAK PORTD_IRQHandler
PUBWEAK PORTE_IRQHandler
PUBWEAK LLWU_IRQHandler
PUBWEAK LTC0_IRQHandler
PUBWEAK USB0_IRQHandler
PUBWEAK ADC0_IRQHandler
PUBWEAK LPTMR0_IRQHandler
PUBWEAK RTC_Seconds_IRQHandler
PUBWEAK INTMUX0_0_IRQHandler
PUBWEAK INTMUX0_1_IRQHandler
PUBWEAK INTMUX0_2_IRQHandler
PUBWEAK INTMUX0_3_IRQHandler
PUBWEAK LPTMR1_IRQHandler
PUBWEAK Reserved49_IRQHandler
PUBWEAK Reserved50_IRQHandler
PUBWEAK Reserved51_IRQHandler
PUBWEAK SPI1_IRQHandler
PUBWEAK LPUART2_IRQHandler
PUBWEAK EMVSIM1_IRQHandler
PUBWEAK I2C1_IRQHandler
PUBWEAK TSI0_IRQHandler
PUBWEAK PMC_IRQHandler
PUBWEAK FTFA_IRQHandler
PUBWEAK MCG_IRQHandler
PUBWEAK WDOG_EWM_IRQHandler
PUBWEAK DAC0_IRQHandler
PUBWEAK TRNG0_IRQHandler
PUBWEAK Reserved63_IRQHandler
PUBWEAK CMP0_IRQHandler
PUBWEAK Reserved65_IRQHandler
PUBWEAK RTC_Alarm_IRQHandler
PUBWEAK Reserved67_IRQHandler
PUBWEAK Reserved68_IRQHandler
PUBWEAK Reserved69_IRQHandler
PUBWEAK Reserved70_IRQHandler
PUBWEAK Reserved71_IRQHandler
PUBWEAK DMA4_IRQHandler
PUBWEAK DMA5_IRQHandler
PUBWEAK DMA6_IRQHandler
PUBWEAK DMA7_IRQHandler
PUBWEAK Reserved76_IRQHandler
PUBWEAK Reserved77_IRQHandler
PUBWEAK Reserved78_IRQHandler
PUBWEAK Reserved79_IRQHandler
PUBWEAK DefaultISR
SECTION .text:CODE:REORDER:NOROOT(2)
DMA0_DMA4_IRQHandler
DMA1_DMA5_IRQHandler
DMA2_DMA6_IRQHandler
DMA3_DMA7_IRQHandler
DMA_Error_IRQHandler
FLEXIO0_IRQHandler
TPM0_IRQHandler
TPM1_IRQHandler
TPM2_IRQHandler
PIT0_IRQHandler
SPI0_IRQHandler
EMVSIM0_IRQHandler
LPUART0_IRQHandler
LPUART1_IRQHandler
I2C0_IRQHandler
QSPI0_IRQHandler
Reserved32_IRQHandler
PORTA_IRQHandler
PORTB_IRQHandler
PORTC_IRQHandler
PORTD_IRQHandler
PORTE_IRQHandler
LLWU_IRQHandler
LTC0_IRQHandler
USB0_IRQHandler
ADC0_IRQHandler
LPTMR0_IRQHandler
RTC_Seconds_IRQHandler
INTMUX0_0_IRQHandler
INTMUX0_1_IRQHandler
INTMUX0_2_IRQHandler
INTMUX0_3_IRQHandler
LPTMR1_IRQHandler
Reserved49_IRQHandler
Reserved50_IRQHandler
Reserved51_IRQHandler
SPI1_IRQHandler
LPUART2_IRQHandler
EMVSIM1_IRQHandler
I2C1_IRQHandler
TSI0_IRQHandler
PMC_IRQHandler
FTFA_IRQHandler
MCG_IRQHandler
WDOG_EWM_IRQHandler
DAC0_IRQHandler
TRNG0_IRQHandler
Reserved63_IRQHandler
CMP0_IRQHandler
Reserved65_IRQHandler
RTC_Alarm_IRQHandler
Reserved67_IRQHandler
Reserved68_IRQHandler
Reserved69_IRQHandler
Reserved70_IRQHandler
Reserved71_IRQHandler
DMA4_IRQHandler
DMA5_IRQHandler
DMA6_IRQHandler
DMA7_IRQHandler
Reserved76_IRQHandler
Reserved77_IRQHandler
Reserved78_IRQHandler
Reserved79_IRQHandler
DefaultISR
LDR R0, =DefaultISR
BX R0
END
@@ -0,0 +1,347 @@
; ---------------------------------------------------------------------------------------
; @file: startup_MKL82Z7.s
; @purpose: CMSIS Cortex-M0P Core Device Startup File
; MKL82Z7
; @version: 1.4
; @date: 2015-8-28
; @build: b150910
; ---------------------------------------------------------------------------------------
;
; Copyright (c) 1997 - 2015 , Freescale Semiconductor, Inc.
; All rights reserved.
;
; Redistribution and use in source and binary forms, with or without modification,
; are permitted provided that the following conditions are met:
;
; o Redistributions of source code must retain the above copyright notice, this list
; of conditions and the following disclaimer.
;
; o 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.
;
; o Neither the name of Freescale Semiconductor, Inc. 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.
;
; The modules in this file are included in the libraries, and may be replaced
; by any user-defined modules that define the PUBLIC symbol _program_start or
; a user defined start symbol.
; To override the cstartup defined in the library, simply add your modified
; version to the workbench project.
;
; The vector table is normally located at address 0.
; When debugging in RAM, it can be located in RAM, aligned to at least 2^6.
; The name "__vector_table" has special meaning for C-SPY:
; it is where the SP start value is found, and the NVIC vector
; table register (VTOR) is initialized to this address if != 0.
;
; Cortex-M version
;
MODULE ?cstartup
;; Forward declaration of sections.
SECTION CSTACK:DATA:NOROOT(3)
SECTION .intvec:CODE:NOROOT(2)
EXTERN __iar_program_start
EXTERN SystemInit
EXTERN init_data_bss
PUBLIC __vector_table
PUBLIC __vector_table_0x1c
PUBLIC __Vectors
PUBLIC __Vectors_End
PUBLIC __Vectors_Size
DATA
__vector_table
DCD sfe(CSTACK)
DCD Reset_Handler
DCD NMI_Handler ;NMI Handler
DCD HardFault_Handler ;Hard Fault Handler
DCD 0 ;Reserved
DCD 0 ;Reserved
DCD 0 ;Reserved
__vector_table_0x1c
DCD 0 ;Reserved
DCD 0 ;Reserved
DCD 0 ;Reserved
DCD 0 ;Reserved
DCD SVC_Handler ;SVCall Handler
DCD 0 ;Reserved
DCD 0 ;Reserved
DCD PendSV_Handler ;PendSV Handler
DCD SysTick_Handler ;SysTick Handler
;External Interrupts
DCD DMA0_DMA4_IRQHandler ;DMA channel 0, 4 transfer complete
DCD DMA1_DMA5_IRQHandler ;DMA channel 1, 5 transfer complete
DCD DMA2_DMA6_IRQHandler ;DMA channel 2, 6 transfer complete
DCD DMA3_DMA7_IRQHandler ;DMA channel 3, 7 transfer complete
DCD DMA_Error_IRQHandler ;DMA channel 0 - 7 error
DCD FLEXIO0_IRQHandler ;Flexible IO
DCD TPM0_IRQHandler ;Timer/PWM module 0
DCD TPM1_IRQHandler ;Timer/PWM module 1
DCD TPM2_IRQHandler ;Timer/PWM module 2
DCD PIT0_IRQHandler ;Periodic Interrupt Timer 0
DCD SPI0_IRQHandler ;Serial Peripheral Interface 0
DCD EMVSIM0_IRQHandler ;EMVSIM0 common interrupt
DCD LPUART0_IRQHandler ;LPUART0 status and error
DCD LPUART1_IRQHandler ;LPUART1 status and error
DCD I2C0_IRQHandler ;Inter-Integrated Circuit 0
DCD QSPI0_IRQHandler ;QuadSPI0 interrupt
DCD Reserved32_IRQHandler ;DryIce tamper detect
DCD PORTA_IRQHandler ;Pin detect Port A
DCD PORTB_IRQHandler ;Pin detect Port B
DCD PORTC_IRQHandler ;Pin detect Port C
DCD PORTD_IRQHandler ;Pin detect Port D
DCD PORTE_IRQHandler ;Pin detect Port E
DCD LLWU_IRQHandler ;Low Leakage Wakeup
DCD LTC0_IRQHandler ;Low power trusted cryptographic
DCD USB0_IRQHandler ;USB OTG interrupt
DCD ADC0_IRQHandler ;Analog-to-Digital Converter 0
DCD LPTMR0_IRQHandler ;Low-Power Timer 0
DCD RTC_Seconds_IRQHandler ;RTC seconds
DCD INTMUX0_0_IRQHandler ;Selectable peripheral interrupt INTMUX0-0
DCD INTMUX0_1_IRQHandler ;Selectable peripheral interrupt INTMUX0-1
DCD INTMUX0_2_IRQHandler ;Selectable peripheral interrupt INTMUX0-2
DCD INTMUX0_3_IRQHandler ;Selectable peripheral interrupt INTMUX0-3
DCD LPTMR1_IRQHandler ;Low-Power Timer 1 (INTMUX source IRQ0)
DCD Reserved49_IRQHandler ;Reserved interrupt (INTMUX source IRQ1)
DCD Reserved50_IRQHandler ;Reserved interrupt (INTMUX source IRQ2)
DCD Reserved51_IRQHandler ;Reserved interrupt (INTMUX source IRQ3)
DCD SPI1_IRQHandler ;Serial Peripheral Interface 1 (INTMUX source IRQ4)
DCD LPUART2_IRQHandler ;LPUART2 status and error (INTMUX source IRQ5)
DCD EMVSIM1_IRQHandler ;EMVSIM1 common interrupt (INTMUX source IRQ6)
DCD I2C1_IRQHandler ;Inter-Integrated Circuit 1 (INTMUX source IRQ7)
DCD TSI0_IRQHandler ;Touch Sensing Input 0 (INTMUX source IRQ8)
DCD PMC_IRQHandler ;PMC controller low-voltage detect, low-voltage warning (INTMUX source IRQ9)
DCD FTFA_IRQHandler ;FTFA command complete/read collision (INTMUX source IRQ10)
DCD MCG_IRQHandler ;Multipurpose clock generator (INTMUX source IRQ11)
DCD WDOG_EWM_IRQHandler ;Single interrupt vector for WDOG and EWM (INTMUX source IRQ12)
DCD DAC0_IRQHandler ;Digital-to-analog converter 0 (INTMUX source IRQ13)
DCD TRNG0_IRQHandler ;True randon number generator (INTMUX source IRQ14)
DCD Reserved63_IRQHandler ;Reserved interrupt (INTMUX source IRQ15)
DCD CMP0_IRQHandler ;Comparator 0 (INTMUX source IRQ16)
DCD Reserved65_IRQHandler ;Reserved interrupt (INTMUX source IRQ17)
DCD RTC_Alarm_IRQHandler ;Real time clock (INTMUX source IRQ18)
DCD Reserved67_IRQHandler ;Reserved interrupt (INTMUX source IRQ19)
DCD Reserved68_IRQHandler ;Reserved interrupt (INTMUX source IRQ20)
DCD Reserved69_IRQHandler ;Reserved interrupt (INTMUX source IRQ21)
DCD Reserved70_IRQHandler ;Reserved interrupt (INTMUX source IRQ22)
DCD Reserved71_IRQHandler ;Reserved interrupt (INTMUX source IRQ23)
DCD DMA4_IRQHandler ;DMA channel 4 transfer complete (INTMUX source IRQ24)
DCD DMA5_IRQHandler ;DMA channel 5 transfer complete (INTMUX source IRQ25)
DCD DMA6_IRQHandler ;DMA channel 6 transfer complete (INTMUX source IRQ26)
DCD DMA7_IRQHandler ;DMA channel 7 transfer complete (INTMUX source IRQ27)
DCD Reserved76_IRQHandler ;Reserved interrupt (INTMUX source IRQ28)
DCD Reserved77_IRQHandler ;Reserved interrupt (INTMUX source IRQ29)
DCD Reserved78_IRQHandler ;Reserved interrupt (INTMUX source IRQ30)
DCD Reserved79_IRQHandler ;Reserved interrupt (INTMUX source IRQ31)
__Vectors_End
SECTION FlashConfig:CODE
__FlashConfig
DCD 0xFFFFFFFF
DCD 0xFFFFFFFF
DCD 0xFFFFFFFF
DCD 0xFFFFBDFE
__FlashConfig_End
__Vectors EQU __vector_table
__Vectors_Size EQU __Vectors_End - __Vectors
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
;; Default interrupt handlers.
;;
THUMB
PUBWEAK Reset_Handler
SECTION .text:CODE:REORDER:NOROOT(2)
Reset_Handler
CPSID I ; Mask interrupts
LDR R0, =SystemInit
BLX R0
LDR R0, =init_data_bss
BLX R0
CPSIE I ; Unmask interrupts
LDR R0, =__iar_program_start
BX R0
PUBWEAK NMI_Handler
SECTION .text:CODE:REORDER:NOROOT(1)
NMI_Handler
B .
PUBWEAK HardFault_Handler
SECTION .text:CODE:REORDER:NOROOT(1)
HardFault_Handler
B .
PUBWEAK SVC_Handler
SECTION .text:CODE:REORDER:NOROOT(1)
SVC_Handler
B .
PUBWEAK PendSV_Handler
SECTION .text:CODE:REORDER:NOROOT(1)
PendSV_Handler
B .
PUBWEAK SysTick_Handler
SECTION .text:CODE:REORDER:NOROOT(1)
SysTick_Handler
B .
PUBWEAK DMA0_DMA4_IRQHandler
PUBWEAK DMA1_DMA5_IRQHandler
PUBWEAK DMA2_DMA6_IRQHandler
PUBWEAK DMA3_DMA7_IRQHandler
PUBWEAK DMA_Error_IRQHandler
PUBWEAK FLEXIO0_IRQHandler
PUBWEAK TPM0_IRQHandler
PUBWEAK TPM1_IRQHandler
PUBWEAK TPM2_IRQHandler
PUBWEAK PIT0_IRQHandler
PUBWEAK SPI0_IRQHandler
PUBWEAK EMVSIM0_IRQHandler
PUBWEAK LPUART0_IRQHandler
PUBWEAK LPUART1_IRQHandler
PUBWEAK I2C0_IRQHandler
PUBWEAK QSPI0_IRQHandler
PUBWEAK Reserved32_IRQHandler
PUBWEAK PORTA_IRQHandler
PUBWEAK PORTB_IRQHandler
PUBWEAK PORTC_IRQHandler
PUBWEAK PORTD_IRQHandler
PUBWEAK PORTE_IRQHandler
PUBWEAK LLWU_IRQHandler
PUBWEAK LTC0_IRQHandler
PUBWEAK USB0_IRQHandler
PUBWEAK ADC0_IRQHandler
PUBWEAK LPTMR0_IRQHandler
PUBWEAK RTC_Seconds_IRQHandler
PUBWEAK INTMUX0_0_IRQHandler
PUBWEAK INTMUX0_1_IRQHandler
PUBWEAK INTMUX0_2_IRQHandler
PUBWEAK INTMUX0_3_IRQHandler
PUBWEAK LPTMR1_IRQHandler
PUBWEAK Reserved49_IRQHandler
PUBWEAK Reserved50_IRQHandler
PUBWEAK Reserved51_IRQHandler
PUBWEAK SPI1_IRQHandler
PUBWEAK LPUART2_IRQHandler
PUBWEAK EMVSIM1_IRQHandler
PUBWEAK I2C1_IRQHandler
PUBWEAK TSI0_IRQHandler
PUBWEAK PMC_IRQHandler
PUBWEAK FTFA_IRQHandler
PUBWEAK MCG_IRQHandler
PUBWEAK WDOG_EWM_IRQHandler
PUBWEAK DAC0_IRQHandler
PUBWEAK TRNG0_IRQHandler
PUBWEAK Reserved63_IRQHandler
PUBWEAK CMP0_IRQHandler
PUBWEAK Reserved65_IRQHandler
PUBWEAK RTC_Alarm_IRQHandler
PUBWEAK Reserved67_IRQHandler
PUBWEAK Reserved68_IRQHandler
PUBWEAK Reserved69_IRQHandler
PUBWEAK Reserved70_IRQHandler
PUBWEAK Reserved71_IRQHandler
PUBWEAK DMA4_IRQHandler
PUBWEAK DMA5_IRQHandler
PUBWEAK DMA6_IRQHandler
PUBWEAK DMA7_IRQHandler
PUBWEAK Reserved76_IRQHandler
PUBWEAK Reserved77_IRQHandler
PUBWEAK Reserved78_IRQHandler
PUBWEAK Reserved79_IRQHandler
PUBWEAK DefaultISR
SECTION .text:CODE:REORDER:NOROOT(2)
DMA0_DMA4_IRQHandler
DMA1_DMA5_IRQHandler
DMA2_DMA6_IRQHandler
DMA3_DMA7_IRQHandler
DMA_Error_IRQHandler
FLEXIO0_IRQHandler
TPM0_IRQHandler
TPM1_IRQHandler
TPM2_IRQHandler
PIT0_IRQHandler
SPI0_IRQHandler
EMVSIM0_IRQHandler
LPUART0_IRQHandler
LPUART1_IRQHandler
I2C0_IRQHandler
QSPI0_IRQHandler
Reserved32_IRQHandler
PORTA_IRQHandler
PORTB_IRQHandler
PORTC_IRQHandler
PORTD_IRQHandler
PORTE_IRQHandler
LLWU_IRQHandler
LTC0_IRQHandler
USB0_IRQHandler
ADC0_IRQHandler
LPTMR0_IRQHandler
RTC_Seconds_IRQHandler
INTMUX0_0_IRQHandler
INTMUX0_1_IRQHandler
INTMUX0_2_IRQHandler
INTMUX0_3_IRQHandler
LPTMR1_IRQHandler
Reserved49_IRQHandler
Reserved50_IRQHandler
Reserved51_IRQHandler
SPI1_IRQHandler
LPUART2_IRQHandler
EMVSIM1_IRQHandler
I2C1_IRQHandler
TSI0_IRQHandler
PMC_IRQHandler
FTFA_IRQHandler
MCG_IRQHandler
WDOG_EWM_IRQHandler
DAC0_IRQHandler
TRNG0_IRQHandler
Reserved63_IRQHandler
CMP0_IRQHandler
Reserved65_IRQHandler
RTC_Alarm_IRQHandler
Reserved67_IRQHandler
Reserved68_IRQHandler
Reserved69_IRQHandler
Reserved70_IRQHandler
Reserved71_IRQHandler
DMA4_IRQHandler
DMA5_IRQHandler
DMA6_IRQHandler
DMA7_IRQHandler
Reserved76_IRQHandler
Reserved77_IRQHandler
Reserved78_IRQHandler
Reserved79_IRQHandler
DefaultISR
LDR R0, =DefaultISR
BX R0
END
@@ -0,0 +1,350 @@
; ---------------------------------------------------------------------------------------
; @file: startup_MKL82Z7.s
; @purpose: CMSIS Cortex-M0P Core Device Startup File
; MKL82Z7
; @version: 1.4
; @date: 2015-8-28
; @build: b150910
; ---------------------------------------------------------------------------------------
;
; Copyright (c) 1997 - 2015 , Freescale Semiconductor, Inc.
; All rights reserved.
;
; Redistribution and use in source and binary forms, with or without modification,
; are permitted provided that the following conditions are met:
;
; o Redistributions of source code must retain the above copyright notice, this list
; of conditions and the following disclaimer.
;
; o 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.
;
; o Neither the name of Freescale Semiconductor, Inc. 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.
;
; The modules in this file are included in the libraries, and may be replaced
; by any user-defined modules that define the PUBLIC symbol _program_start or
; a user defined start symbol.
; To override the cstartup defined in the library, simply add your modified
; version to the workbench project.
;
; The vector table is normally located at address 0.
; When debugging in RAM, it can be located in RAM, aligned to at least 2^6.
; The name "__vector_table" has special meaning for C-SPY:
; it is where the SP start value is found, and the NVIC vector
; table register (VTOR) is initialized to this address if != 0.
;
; Cortex-M version
;
MODULE ?cstartup
;; Forward declaration of sections.
SECTION CSTACK:DATA:NOROOT(3)
SECTION .intvec:CODE:NOROOT(2)
EXTERN __iar_program_start
EXTERN SystemInit
EXTERN ROM_PatchHandler
EXTERN init_data_bss
PUBLIC __vector_table
PUBLIC __vector_table_0x1c
PUBLIC __Vectors
PUBLIC __Vectors_End
PUBLIC __Vectors_Size
DATA
__vector_table
DCD sfe(CSTACK)
DCD Reset_Handler
DCD NMI_Handler ;NMI Handler
DCD HardFault_Handler ;Hard Fault Handler
DCD 0 ;Reserved
DCD 0 ;Reserved
DCD 0 ;Reserved
__vector_table_0x1c
DCD 0 ;Reserved
DCD 0 ;Reserved
DCD 0 ;Reserved
DCD 0 ;Reserved
DCD SVC_Handler ;SVCall Handler
DCD 0 ;Reserved
DCD 0 ;Reserved
DCD PendSV_Handler ;PendSV Handler
DCD SysTick_Handler ;SysTick Handler
;External Interrupts
DCD DMA0_DMA4_IRQHandler ;DMA channel 0, 4 transfer complete
DCD DMA1_DMA5_IRQHandler ;DMA channel 1, 5 transfer complete
DCD DMA2_DMA6_IRQHandler ;DMA channel 2, 6 transfer complete
DCD DMA3_DMA7_IRQHandler ;DMA channel 3, 7 transfer complete
DCD DMA_Error_IRQHandler ;DMA channel 0 - 7 error
DCD FLEXIO0_IRQHandler ;Flexible IO
DCD TPM0_IRQHandler ;Timer/PWM module 0
DCD TPM1_IRQHandler ;Timer/PWM module 1
DCD TPM2_IRQHandler ;Timer/PWM module 2
DCD PIT0_IRQHandler ;Periodic Interrupt Timer 0
DCD SPI0_IRQHandler ;Serial Peripheral Interface 0
DCD EMVSIM0_IRQHandler ;EMVSIM0 common interrupt
DCD LPUART0_IRQHandler ;LPUART0 status and error
DCD LPUART1_IRQHandler ;LPUART1 status and error
DCD I2C0_IRQHandler ;Inter-Integrated Circuit 0
DCD QSPI0_IRQHandler ;QuadSPI0 interrupt
DCD Reserved32_IRQHandler ;DryIce tamper detect
DCD PORTA_IRQHandler ;Pin detect Port A
DCD PORTB_IRQHandler ;Pin detect Port B
DCD PORTC_IRQHandler ;Pin detect Port C
DCD PORTD_IRQHandler ;Pin detect Port D
DCD PORTE_IRQHandler ;Pin detect Port E
DCD LLWU_IRQHandler ;Low Leakage Wakeup
DCD LTC0_IRQHandler ;Low power trusted cryptographic
DCD USB0_IRQHandler ;USB OTG interrupt
DCD ADC0_IRQHandler ;Analog-to-Digital Converter 0
DCD LPTMR0_IRQHandler ;Low-Power Timer 0
DCD RTC_Seconds_IRQHandler ;RTC seconds
DCD INTMUX0_0_IRQHandler ;Selectable peripheral interrupt INTMUX0-0
DCD INTMUX0_1_IRQHandler ;Selectable peripheral interrupt INTMUX0-1
DCD INTMUX0_2_IRQHandler ;Selectable peripheral interrupt INTMUX0-2
DCD INTMUX0_3_IRQHandler ;Selectable peripheral interrupt INTMUX0-3
DCD LPTMR1_IRQHandler ;Low-Power Timer 1 (INTMUX source IRQ0)
DCD Reserved49_IRQHandler ;Reserved interrupt (INTMUX source IRQ1)
DCD Reserved50_IRQHandler ;Reserved interrupt (INTMUX source IRQ2)
DCD Reserved51_IRQHandler ;Reserved interrupt (INTMUX source IRQ3)
DCD SPI1_IRQHandler ;Serial Peripheral Interface 1 (INTMUX source IRQ4)
DCD LPUART2_IRQHandler ;LPUART2 status and error (INTMUX source IRQ5)
DCD EMVSIM1_IRQHandler ;EMVSIM1 common interrupt (INTMUX source IRQ6)
DCD I2C1_IRQHandler ;Inter-Integrated Circuit 1 (INTMUX source IRQ7)
DCD TSI0_IRQHandler ;Touch Sensing Input 0 (INTMUX source IRQ8)
DCD PMC_IRQHandler ;PMC controller low-voltage detect, low-voltage warning (INTMUX source IRQ9)
DCD FTFA_IRQHandler ;FTFA command complete/read collision (INTMUX source IRQ10)
DCD MCG_IRQHandler ;Multipurpose clock generator (INTMUX source IRQ11)
DCD WDOG_EWM_IRQHandler ;Single interrupt vector for WDOG and EWM (INTMUX source IRQ12)
DCD DAC0_IRQHandler ;Digital-to-analog converter 0 (INTMUX source IRQ13)
DCD TRNG0_IRQHandler ;True randon number generator (INTMUX source IRQ14)
DCD Reserved63_IRQHandler ;Reserved interrupt (INTMUX source IRQ15)
DCD CMP0_IRQHandler ;Comparator 0 (INTMUX source IRQ16)
DCD Reserved65_IRQHandler ;Reserved interrupt (INTMUX source IRQ17)
DCD RTC_Alarm_IRQHandler ;Real time clock (INTMUX source IRQ18)
DCD Reserved67_IRQHandler ;Reserved interrupt (INTMUX source IRQ19)
DCD Reserved68_IRQHandler ;Reserved interrupt (INTMUX source IRQ20)
DCD Reserved69_IRQHandler ;Reserved interrupt (INTMUX source IRQ21)
DCD Reserved70_IRQHandler ;Reserved interrupt (INTMUX source IRQ22)
DCD Reserved71_IRQHandler ;Reserved interrupt (INTMUX source IRQ23)
DCD DMA4_IRQHandler ;DMA channel 4 transfer complete (INTMUX source IRQ24)
DCD DMA5_IRQHandler ;DMA channel 5 transfer complete (INTMUX source IRQ25)
DCD DMA6_IRQHandler ;DMA channel 6 transfer complete (INTMUX source IRQ26)
DCD DMA7_IRQHandler ;DMA channel 7 transfer complete (INTMUX source IRQ27)
DCD Reserved76_IRQHandler ;Reserved interrupt (INTMUX source IRQ28)
DCD Reserved77_IRQHandler ;Reserved interrupt (INTMUX source IRQ29)
DCD Reserved78_IRQHandler ;Reserved interrupt (INTMUX source IRQ30)
DCD Reserved79_IRQHandler ;Reserved interrupt (INTMUX source IRQ31)
__Vectors_End
SECTION FlashConfig:CODE
__FlashConfig
DCD 0xFFFFFFFF
DCD 0xFFFFFFFF
DCD 0xFFFFFFFF
DCD 0xFFFFBDFE
__FlashConfig_End
__Vectors EQU __vector_table
__Vectors_Size EQU __Vectors_End - __Vectors
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
;; Default interrupt handlers.
;;
THUMB
PUBWEAK Reset_Handler
SECTION BootloaderPatchHandler:CODE:REORDER:NOROOT(2)
Reset_Handler
CPSID I ; Mask interrupts
LDR R0, =ROM_PatchHandler
BLX R0
LDR R0, =SystemInit
BLX R0
LDR R0, =init_data_bss
BLX R0
CPSIE I ; Unmask interrupts
LDR R0, =__iar_program_start
BX R0
PUBWEAK NMI_Handler
SECTION .text:CODE:REORDER:NOROOT(1)
NMI_Handler
B .
PUBWEAK HardFault_Handler
SECTION .text:CODE:REORDER:NOROOT(1)
HardFault_Handler
B .
PUBWEAK SVC_Handler
SECTION .text:CODE:REORDER:NOROOT(1)
SVC_Handler
B .
PUBWEAK PendSV_Handler
SECTION .text:CODE:REORDER:NOROOT(1)
PendSV_Handler
B .
PUBWEAK SysTick_Handler
SECTION .text:CODE:REORDER:NOROOT(1)
SysTick_Handler
B .
PUBWEAK DMA0_DMA4_IRQHandler
PUBWEAK DMA1_DMA5_IRQHandler
PUBWEAK DMA2_DMA6_IRQHandler
PUBWEAK DMA3_DMA7_IRQHandler
PUBWEAK DMA_Error_IRQHandler
PUBWEAK FLEXIO0_IRQHandler
PUBWEAK TPM0_IRQHandler
PUBWEAK TPM1_IRQHandler
PUBWEAK TPM2_IRQHandler
PUBWEAK PIT0_IRQHandler
PUBWEAK SPI0_IRQHandler
PUBWEAK EMVSIM0_IRQHandler
PUBWEAK LPUART0_IRQHandler
PUBWEAK LPUART1_IRQHandler
PUBWEAK I2C0_IRQHandler
PUBWEAK QSPI0_IRQHandler
PUBWEAK Reserved32_IRQHandler
PUBWEAK PORTA_IRQHandler
PUBWEAK PORTB_IRQHandler
PUBWEAK PORTC_IRQHandler
PUBWEAK PORTD_IRQHandler
PUBWEAK PORTE_IRQHandler
PUBWEAK LLWU_IRQHandler
PUBWEAK LTC0_IRQHandler
PUBWEAK USB0_IRQHandler
PUBWEAK ADC0_IRQHandler
PUBWEAK LPTMR0_IRQHandler
PUBWEAK RTC_Seconds_IRQHandler
PUBWEAK INTMUX0_0_IRQHandler
PUBWEAK INTMUX0_1_IRQHandler
PUBWEAK INTMUX0_2_IRQHandler
PUBWEAK INTMUX0_3_IRQHandler
PUBWEAK LPTMR1_IRQHandler
PUBWEAK Reserved49_IRQHandler
PUBWEAK Reserved50_IRQHandler
PUBWEAK Reserved51_IRQHandler
PUBWEAK SPI1_IRQHandler
PUBWEAK LPUART2_IRQHandler
PUBWEAK EMVSIM1_IRQHandler
PUBWEAK I2C1_IRQHandler
PUBWEAK TSI0_IRQHandler
PUBWEAK PMC_IRQHandler
PUBWEAK FTFA_IRQHandler
PUBWEAK MCG_IRQHandler
PUBWEAK WDOG_EWM_IRQHandler
PUBWEAK DAC0_IRQHandler
PUBWEAK TRNG0_IRQHandler
PUBWEAK Reserved63_IRQHandler
PUBWEAK CMP0_IRQHandler
PUBWEAK Reserved65_IRQHandler
PUBWEAK RTC_Alarm_IRQHandler
PUBWEAK Reserved67_IRQHandler
PUBWEAK Reserved68_IRQHandler
PUBWEAK Reserved69_IRQHandler
PUBWEAK Reserved70_IRQHandler
PUBWEAK Reserved71_IRQHandler
PUBWEAK DMA4_IRQHandler
PUBWEAK DMA5_IRQHandler
PUBWEAK DMA6_IRQHandler
PUBWEAK DMA7_IRQHandler
PUBWEAK Reserved76_IRQHandler
PUBWEAK Reserved77_IRQHandler
PUBWEAK Reserved78_IRQHandler
PUBWEAK Reserved79_IRQHandler
PUBWEAK DefaultISR
SECTION .text:CODE:REORDER:NOROOT(2)
DMA0_DMA4_IRQHandler
DMA1_DMA5_IRQHandler
DMA2_DMA6_IRQHandler
DMA3_DMA7_IRQHandler
DMA_Error_IRQHandler
FLEXIO0_IRQHandler
TPM0_IRQHandler
TPM1_IRQHandler
TPM2_IRQHandler
PIT0_IRQHandler
SPI0_IRQHandler
EMVSIM0_IRQHandler
LPUART0_IRQHandler
LPUART1_IRQHandler
I2C0_IRQHandler
QSPI0_IRQHandler
Reserved32_IRQHandler
PORTA_IRQHandler
PORTB_IRQHandler
PORTC_IRQHandler
PORTD_IRQHandler
PORTE_IRQHandler
LLWU_IRQHandler
LTC0_IRQHandler
USB0_IRQHandler
ADC0_IRQHandler
LPTMR0_IRQHandler
RTC_Seconds_IRQHandler
INTMUX0_0_IRQHandler
INTMUX0_1_IRQHandler
INTMUX0_2_IRQHandler
INTMUX0_3_IRQHandler
LPTMR1_IRQHandler
Reserved49_IRQHandler
Reserved50_IRQHandler
Reserved51_IRQHandler
SPI1_IRQHandler
LPUART2_IRQHandler
EMVSIM1_IRQHandler
I2C1_IRQHandler
TSI0_IRQHandler
PMC_IRQHandler
FTFA_IRQHandler
MCG_IRQHandler
WDOG_EWM_IRQHandler
DAC0_IRQHandler
TRNG0_IRQHandler
Reserved63_IRQHandler
CMP0_IRQHandler
Reserved65_IRQHandler
RTC_Alarm_IRQHandler
Reserved67_IRQHandler
Reserved68_IRQHandler
Reserved69_IRQHandler
Reserved70_IRQHandler
Reserved71_IRQHandler
DMA4_IRQHandler
DMA5_IRQHandler
DMA6_IRQHandler
DMA7_IRQHandler
Reserved76_IRQHandler
Reserved77_IRQHandler
Reserved78_IRQHandler
Reserved79_IRQHandler
DefaultISR
LDR R0, =DefaultISR
BX R0
END
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,390 @@
/*
** ###################################################################
** Processors: MKL82Z128VLH7
** MKL82Z128VLK7
** MKL82Z128VLL7
** MKL82Z128VMC7
** MKL82Z128VMP7
**
** Compilers: Keil ARM C/C++ Compiler
** Freescale C/C++ for Embedded ARM
** GNU C Compiler
** GNU C Compiler - CodeSourcery Sourcery G++
** IAR ANSI C/C++ Compiler for ARM
**
** Reference manual: KL82P121M72SF0RM, Rev.0.3 June 2015
** Version: rev. 1.4, 2015-08-28
** Build: b150910
**
** 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 (c) 2015 Freescale Semiconductor, Inc.
** All rights reserved.
**
** Redistribution and use in source and binary forms, with or without modification,
** are permitted provided that the following conditions are met:
**
** o Redistributions of source code must retain the above copyright notice, this list
** of conditions and the following disclaimer.
**
** o 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.
**
** o Neither the name of Freescale Semiconductor, Inc. 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.
**
** http: www.freescale.com
** mail: support@freescale.com
**
** Revisions:
** - rev. 1.0 (2015-04-18)
** Initial version.
** - rev. 1.1 (2015-05-04)
** Update SIM, EVMSIM, QuadSPI, and I2C based on Rev0 document.
** - rev. 1.2 (2015-08-11)
** Correct clock configuration.
** - rev. 1.3 (2015-08-20)
** Align with RM Rev.1.
** - rev. 1.4 (2015-08-28)
** Update LPUART to add FIFO.
**
** ###################################################################
*/
/*!
* @file MKL82Z7
* @version 1.4
* @date 2015-08-28
* @brief Device specific configuration file for MKL82Z7 (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_MKL82Z7_H_
#define SYSTEM_MKL82Z7_H_ /**< Symbol preventing repeated inclusion */
#ifdef __cplusplus
extern "C" {
#endif
#include <stdint.h>
#ifndef DISABLE_WDOG
#define DISABLE_WDOG 1
#endif
/* MCG mode constants */
#define MCG_MODE_FEI 0U
#define MCG_MODE_FBI 1U
#define MCG_MODE_BLPI 2U
#define MCG_MODE_FEE 3U
#define MCG_MODE_FBE 4U
#define MCG_MODE_BLPE 5U
#define MCG_MODE_PBE 6U
#define MCG_MODE_PEE 7U
/* Predefined clock setups
0 ... Default part configuration
Multipurpose Clock Generator (MCG) in FEI mode.
Reference clock source for MCG module: Slow internal reference clock
Core clock = 20.97152MHz
Bus clock = 20.97152MHz
1 ... Maximal speed configuration
Multipurpose Clock Generator (MCG) in PEE mode.
Reference clock source for MCG module: System oscillator 0 reference clock
Core clock = 96MHz
Bus clock = 24MHz
2 ... Chip internally clocked, ready for Very Low Power Run mode.
Multipurpose Clock Generator (MCG) in BLPI mode.
Reference clock source for MCG module: Fast internal reference clock
Core clock = 4MHz
Bus clock = 4MHz
3 ... Chip externally clocked, ready for Very Low Power Run mode.
Multipurpose Clock Generator (MCG) in BLPE mode.
Reference clock source for MCG module: System oscillator 0 reference clock
Core clock = 4MHz
Bus clock = 4MHz
4 ... USB clock setup
Multipurpose Clock Generator (MCG) in PEE mode.
Reference clock source for MCG module: System oscillator 0 reference clock
Core clock = 96MHz
Bus clock = 24MHz
5 ... Maximum achievable clock frequency configuration in RUN mode
Multipurpose Clock Generator (MCG) in PEE mode.
Reference clock source for MCG module: System oscillator 0 reference clock
Core clock = 72MHz
Bus clock = 24MHz
*/
/* Define clock source values */
#define CPU_XTAL_CLK_HZ \
12000000U /* Value of the external crystal or oscillator clock frequency of the system oscillator (OSC) in Hz */
#define CPU_XTAL32k_CLK_HZ \
32768U /* Value of the external 32k crystal or oscillator clock frequency of the RTC 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 CPU_INT_IRC_CLK_HZ 48000000U /* Value of the 48M internal oscillator clock frequency in Hz */
/* RTC oscillator setting */
/* RTC_CR: SC2P=0,SC4P=0,SC8P=0,SC16P=0,CLKO=1,OSCE=1,WPS=0,UM=0,SUP=0,WPE=0,SWR=0 */
#define SYSTEM_RTC_CR_VALUE 0x0300U /* RTC_CR */
/* Low power mode enable */
/* SMC_PMPROT: AHSRUN=1,AVLP=1,ALLS=1,AVLLS=1 */
#define SYSTEM_SMC_PMPROT_VALUE 0xAAU /* SMC_PMPROT */
/* Internal reference clock trim */
/* #undef SLOW_TRIM_ADDRESS */ /* Slow oscillator not trimmed. Commented out for MISRA compliance. */
/* #undef SLOW_FINE_TRIM_ADDRESS */ /* Slow oscillator not trimmed. Commented out for MISRA compliance. */
/* #undef FAST_TRIM_ADDRESS */ /* Fast oscillator not trimmed. Commented out for MISRA compliance. */
/* #undef FAST_FINE_TRIM_ADDRESS */ /* Fast oscillator not trimmed. Commented out for MISRA compliance. */
#ifdef CLOCK_SETUP
#if (CLOCK_SETUP == 0)
#define DEFAULT_SYSTEM_CLOCK 20971520U /* Default System clock value */
#define MCG_MODE MCG_MODE_FEI /* Clock generator mode */
/* MCG_C1: CLKS=0,FRDIV=0,IREFS=1,IRCLKEN=1,IREFSTEN=0 */
#define SYSTEM_MCG_C1_VALUE 0x06U /* MCG_C1 */
/* MCG_C2: LOCRE0=0,FCFTRIM=0,RANGE=2,HGO=0,EREFS=1,LP=0,IRCS=0 */
#define SYSTEM_MCG_C2_VALUE 0x24U /* MCG_C2 */
/* MCG_C4: DMX32=0,DRST_DRS=0,FCTRIM=0,SCFTRIM=0 */
#define SYSTEM_MCG_C4_VALUE 0x00U /* MCG_C4 */
/* MCG_SC: ATME=0,ATMS=0,ATMF=0,FLTPRSRV=0,FCRDIV=0,LOCS0=0 */
#define SYSTEM_MCG_SC_VALUE 0x00U /* MCG_SC */
/* MCG_C5: PLLCLKEN=0,PLLSTEN=0,PRDIV=0 */
#define SYSTEM_MCG_C5_VALUE 0x00U /* MCG_C5 */
/* MCG_C6: LOLIE0=0,PLLS=0,CME0=0,VDIV=0 */
#define SYSTEM_MCG_C6_VALUE 0x00U /* MCG_C6 */
/* MCG_C7: OSCSEL=0 */
#define SYSTEM_MCG_C7_VALUE 0x00U /* MCG_C7 */
/* OSC_CR: ERCLKEN=1,EREFSTEN=0,SC2P=0,SC4P=0,SC8P=0,SC16P=0 */
#define SYSTEM_OSC_CR_VALUE 0x80U /* OSC_CR */
/* SMC_PMCTRL: RUNM=0,STOPA=0,STOPM=0 */
#define SYSTEM_SMC_PMCTRL_VALUE 0x00U /* SMC_PMCTRL */
/* SIM_CLKDIV1: OUTDIV1=0,OUTDIV2=0,OUTDIV4=1,OUTDIV5=1 */
#define SYSTEM_SIM_CLKDIV1_VALUE 0x00011000U /* SIM_CLKDIV1 */
/* SIM_CLKDIV3: PLLFLLDIV=0,PLLFLLFRAC=0 */
#define SYSTEM_SIM_CLKDIV3_VALUE 0x00U /* SIM_CLKDIV3 */
/* SIM_SOPT1: USBREGEN=0,USBSSTBY=0,USBVSTBY=0,OSC32KSEL=2,RAMSIZE=0 */
#define SYSTEM_SIM_SOPT1_VALUE 0x00080000U /* SIM_SOPT1 */
/* SIM_SOPT2:
* EMVSIMSRC=0,SDHCSRC=0,LPUARTSRC=0,TPMSRC=1,FLEXIOSRC=0,USBSRC=0,PLLFLLSEL=0,TRACECLKSEL=0,FBSL=0,CLKOUTSEL=0,RTCCLKOUTSEL=0
*/
#define SYSTEM_SIM_SOPT2_VALUE 0x01000000U /* SIM_SOPT2 */
#elif(CLOCK_SETUP == 1)
#define DEFAULT_SYSTEM_CLOCK 96000000U /* Default System clock value */
#define MCG_MODE MCG_MODE_PEE /* Clock generator mode */
/* MCG_C1: CLKS=0,FRDIV=4,IREFS=0,IRCLKEN=1,IREFSTEN=0 */
#define SYSTEM_MCG_C1_VALUE 0x22U /* MCG_C1 */
/* MCG_C2: LOCRE0=0,FCFTRIM=0,RANGE=2,HGO=0,EREFS=1,LP=0,IRCS=0 */
#define SYSTEM_MCG_C2_VALUE 0x24U /* MCG_C2 */
/* MCG_C4: DMX32=0,DRST_DRS=0,FCTRIM=0,SCFTRIM=0 */
#define SYSTEM_MCG_C4_VALUE 0x00U /* MCG_C4 */
/* MCG_SC: ATME=0,ATMS=0,ATMF=0,FLTPRSRV=0,FCRDIV=0,LOCS0=0 */
#define SYSTEM_MCG_SC_VALUE 0x00U /* MCG_SC */
/* MCG_C5: PLLCLKEN=0,PLLSTEN=0,PRDIV=0 */
#define SYSTEM_MCG_C5_VALUE 0x00U /* MCG_C5 */
/* MCG_C6: LOLIE0=0,PLLS=1,CME0=0,VDIV=0 */
#define SYSTEM_MCG_C6_VALUE 0x40U /* MCG_C6 */
/* MCG_C7: OSCSEL=0 */
#define SYSTEM_MCG_C7_VALUE 0x00U /* MCG_C7 */
/* OSC_CR: ERCLKEN=1,EREFSTEN=0,SC2P=0,SC4P=0,SC8P=0,SC16P=0 */
#define SYSTEM_OSC_CR_VALUE 0x80U /* OSC_CR */
/* SMC_PMCTRL: RUNM=3,STOPA=0,STOPM=0 */
#define SYSTEM_SMC_PMCTRL_VALUE 0x60U /* SMC_PMCTRL */
/* SIM_CLKDIV1: OUTDIV1=0,OUTDIV2=3,OUTDIV4=3,OUTDIV5=0 */
#define SYSTEM_SIM_CLKDIV1_VALUE 0x03030000U /* SIM_CLKDIV1 */
/* SIM_CLKDIV3: PLLFLLDIV=0,PLLFLLFRAC=0 */
#define SYSTEM_SIM_CLKDIV3_VALUE 0x00U /* SIM_CLKDIV3 */
/* SIM_SOPT1: USBREGEN=0,USBSSTBY=0,USBVSTBY=0,OSC32KSEL=2,RAMSIZE=0 */
#define SYSTEM_SIM_SOPT1_VALUE 0x00080000U /* SIM_SOPT1 */
/* SIM_SOPT2:
* EMVSIMSRC=0,SDHCSRC=0,LPUARTSRC=0,TPMSRC=1,FLEXIOSRC=0,USBSRC=0,PLLFLLSEL=1,TRACECLKSEL=0,FBSL=0,CLKOUTSEL=0,RTCCLKOUTSEL=0
*/
#define SYSTEM_SIM_SOPT2_VALUE 0x01010000U /* SIM_SOPT2 */
#elif(CLOCK_SETUP == 2)
#define DEFAULT_SYSTEM_CLOCK 4000000U /* Default System clock value */
#define MCG_MODE MCG_MODE_BLPI /* Clock generator mode */
/* MCG_C1: CLKS=1,FRDIV=0,IREFS=1,IRCLKEN=1,IREFSTEN=0 */
#define SYSTEM_MCG_C1_VALUE 0x46U /* MCG_C1 */
/* MCG_C2: LOCRE0=0,FCFTRIM=0,RANGE=2,HGO=0,EREFS=1,LP=1,IRCS=1 */
#define SYSTEM_MCG_C2_VALUE 0x27U /* MCG_C2 */
/* MCG_C4: DMX32=0,DRST_DRS=0,FCTRIM=0,SCFTRIM=0 */
#define SYSTEM_MCG_C4_VALUE 0x00U /* MCG_C4 */
/* MCG_SC: ATME=0,ATMS=0,ATMF=0,FLTPRSRV=0,FCRDIV=0,LOCS0=0 */
#define SYSTEM_MCG_SC_VALUE 0x00U /* MCG_SC */
/* MCG_C5: PLLCLKEN=0,PLLSTEN=0,PRDIV=0 */
#define SYSTEM_MCG_C5_VALUE 0x00U /* MCG_C5 */
/* MCG_C6: LOLIE0=0,PLLS=0,CME0=0,VDIV=0 */
#define SYSTEM_MCG_C6_VALUE 0x00U /* MCG_C6 */
/* MCG_C7: OSCSEL=0 */
#define SYSTEM_MCG_C7_VALUE 0x00U /* MCG_C7 */
/* OSC_CR: ERCLKEN=1,EREFSTEN=0,SC2P=0,SC4P=0,SC8P=0,SC16P=0 */
#define SYSTEM_OSC_CR_VALUE 0x80U /* OSC_CR */
/* SMC_PMCTRL: RUNM=0,STOPA=0,STOPM=0 */
#define SYSTEM_SMC_PMCTRL_VALUE 0x00U /* SMC_PMCTRL */
/* SIM_CLKDIV1: OUTDIV1=0,OUTDIV2=3,OUTDIV4=4,OUTDIV5=0 */
#define SYSTEM_SIM_CLKDIV1_VALUE 0x03040000U /* SIM_CLKDIV1 */
/* SIM_CLKDIV3: PLLFLLDIV=0,PLLFLLFRAC=0 */
#define SYSTEM_SIM_CLKDIV3_VALUE 0x00U /* SIM_CLKDIV3 */
/* SIM_SOPT1: USBREGEN=0,USBSSTBY=0,USBVSTBY=0,OSC32KSEL=2,RAMSIZE=0 */
#define SYSTEM_SIM_SOPT1_VALUE 0x00080000U /* SIM_SOPT1 */
/* SIM_SOPT2:
* EMVSIMSRC=0,SDHCSRC=0,LPUARTSRC=0,TPMSRC=1,FLEXIOSRC=0,USBSRC=0,PLLFLLSEL=3,TRACECLKSEL=0,FBSL=0,CLKOUTSEL=0,RTCCLKOUTSEL=0
*/
#define SYSTEM_SIM_SOPT2_VALUE 0x01030000U /* SIM_SOPT2 */
#elif(CLOCK_SETUP == 3)
#define DEFAULT_SYSTEM_CLOCK 4000000U /* Default System clock value */
#define MCG_MODE MCG_MODE_BLPE /* Clock generator mode */
/* MCG_C1: CLKS=2,FRDIV=4,IREFS=0,IRCLKEN=1,IREFSTEN=0 */
#define SYSTEM_MCG_C1_VALUE 0xA2U /* MCG_C1 */
/* MCG_C2: LOCRE0=0,FCFTRIM=0,RANGE=2,HGO=0,EREFS=1,LP=1,IRCS=1 */
#define SYSTEM_MCG_C2_VALUE 0x27U /* MCG_C2 */
/* MCG_C4: DMX32=0,DRST_DRS=0,FCTRIM=0,SCFTRIM=0 */
#define SYSTEM_MCG_C4_VALUE 0x00U /* MCG_C4 */
/* MCG_SC: ATME=0,ATMS=0,ATMF=0,FLTPRSRV=0,FCRDIV=1,LOCS0=0 */
#define SYSTEM_MCG_SC_VALUE 0x02U /* MCG_SC */
/* MCG_C5: PLLCLKEN=0,PLLSTEN=0,PRDIV=0 */
#define SYSTEM_MCG_C5_VALUE 0x00U /* MCG_C5 */
/* MCG_C6: LOLIE0=0,PLLS=0,CME0=0,VDIV=0 */
#define SYSTEM_MCG_C6_VALUE 0x00U /* MCG_C6 */
/* MCG_C7: OSCSEL=0 */
#define SYSTEM_MCG_C7_VALUE 0x00U /* MCG_C7 */
/* OSC_CR: ERCLKEN=1,EREFSTEN=0,SC2P=0,SC4P=0,SC8P=0,SC16P=0 */
#define SYSTEM_OSC_CR_VALUE 0x80U /* OSC_CR */
/* SMC_PMCTRL: RUNM=0,STOPA=0,STOPM=0 */
#define SYSTEM_SMC_PMCTRL_VALUE 0x00U /* SMC_PMCTRL */
/* SIM_CLKDIV1: OUTDIV1=0,OUTDIV2=3,OUTDIV4=3,OUTDIV5=0x0B */
#define SYSTEM_SIM_CLKDIV1_VALUE 0x03030000U /* SIM_CLKDIV1 */
/* SIM_CLKDIV3: PLLFLLDIV=0,PLLFLLFRAC=0 */
#define SYSTEM_SIM_CLKDIV3_VALUE 0x00U /* SIM_CLKDIV3 */
/* SIM_SOPT1: USBREGEN=0,USBSSTBY=0,USBVSTBY=0,OSC32KSEL=2,RAMSIZE=0 */
#define SYSTEM_SIM_SOPT1_VALUE 0x00080000U /* SIM_SOPT1 */
/* SIM_SOPT2:
* EMVSIMSRC=0,SDHCSRC=0,LPUARTSRC=0,TPMSRC=1,FLEXIOSRC=0,USBSRC=0,PLLFLLSEL=3,TRACECLKSEL=0,FBSL=0,CLKOUTSEL=0,RTCCLKOUTSEL=0
*/
#define SYSTEM_SIM_SOPT2_VALUE 0x01030000U /* SIM_SOPT2 */
#elif(CLOCK_SETUP == 4)
#define DEFAULT_SYSTEM_CLOCK 96000000U /* Default System clock value */
#define MCG_MODE MCG_MODE_PEE /* Clock generator mode */
/* MCG_C1: CLKS=0,FRDIV=4,IREFS=0,IRCLKEN=1,IREFSTEN=0 */
#define SYSTEM_MCG_C1_VALUE 0x22U /* MCG_C1 */
/* MCG_C2: LOCRE0=0,FCFTRIM=0,RANGE=2,HGO=0,EREFS=1,LP=0,IRCS=0 */
#define SYSTEM_MCG_C2_VALUE 0x24U /* MCG_C2 */
/* MCG_C4: DMX32=0,DRST_DRS=0,FCTRIM=0,SCFTRIM=0 */
#define SYSTEM_MCG_C4_VALUE 0x00U /* MCG_C4 */
/* MCG_SC: ATME=0,ATMS=0,ATMF=0,FLTPRSRV=0,FCRDIV=0,LOCS0=0 */
#define SYSTEM_MCG_SC_VALUE 0x00U /* MCG_SC */
/* MCG_C5: PLLCLKEN=0,PLLSTEN=0,PRDIV=0 */
#define SYSTEM_MCG_C5_VALUE 0x00U /* MCG_C5 */
/* MCG_C6: LOLIE0=0,PLLS=1,CME0=0,VDIV=0 */
#define SYSTEM_MCG_C6_VALUE 0x40U /* MCG_C6 */
/* MCG_C7: OSCSEL=0 */
#define SYSTEM_MCG_C7_VALUE 0x00U /* MCG_C7 */
/* OSC_CR: ERCLKEN=1,EREFSTEN=0,SC2P=0,SC4P=0,SC8P=0,SC16P=0 */
#define SYSTEM_OSC_CR_VALUE 0x80U /* OSC_CR */
/* SMC_PMCTRL: RUNM=3,STOPA=0,STOPM=0 */
#define SYSTEM_SMC_PMCTRL_VALUE 0x60U /* SMC_PMCTRL */
/* SIM_CLKDIV1: OUTDIV1=0,OUTDIV2=3,OUTDIV4=3,OUTDIV5=0 */
#define SYSTEM_SIM_CLKDIV1_VALUE 0x03030000U /* SIM_CLKDIV1 */
/* SIM_CLKDIV2: USBDIV=3,USBFRAC=0 */
#define SYSTEM_SIM_CLKDIV2_VALUE 0x03U /* SIM_CLKDIV2 */
/* SIM_CLKDIV3: PLLFLLDIV=0,PLLFLLFRAC=0 */
#define SYSTEM_SIM_CLKDIV3_VALUE 0x00U /* SIM_CLKDIV3 */
/* SIM_SOPT1: USBREGEN=0,USBSSTBY=0,USBVSTBY=0,OSC32KSEL=2,RAMSIZE=0 */
#define SYSTEM_SIM_SOPT1_VALUE 0x00080000U /* SIM_SOPT1 */
/* SIM_SOPT2:
* EMVSIMSRC=0,SDHCSRC=0,LPUARTSRC=0,TPMSRC=1,FLEXIOSRC=0,USBSRC=0,PLLFLLSEL=1,TRACECLKSEL=0,FBSL=0,CLKOUTSEL=0,RTCCLKOUTSEL=0
*/
#define SYSTEM_SIM_SOPT2_VALUE 0x01010000U /* SIM_SOPT2 */
#elif(CLOCK_SETUP == 5)
#define DEFAULT_SYSTEM_CLOCK 72000000U /* Default System clock value */
#define MCG_MODE MCG_MODE_PEE /* Clock generator mode */
/* MCG_C1: CLKS=0,FRDIV=4,IREFS=0,IRCLKEN=1,IREFSTEN=0 */
#define SYSTEM_MCG_C1_VALUE 0x22U /* MCG_C1 */
/* MCG_C2: LOCRE0=0,FCFTRIM=0,RANGE=2,HGO=0,EREFS=1,LP=0,IRCS=0 */
#define SYSTEM_MCG_C2_VALUE 0x24U /* MCG_C2 */
/* MCG_C4: DMX32=0,DRST_DRS=0,FCTRIM=0,SCFTRIM=0 */
#define SYSTEM_MCG_C4_VALUE 0x00U /* MCG_C4 */
/* MCG_SC: ATME=0,ATMS=0,ATMF=0,FLTPRSRV=0,FCRDIV=0,LOCS0=0 */
#define SYSTEM_MCG_SC_VALUE 0x00U /* MCG_SC */
/* MCG_C5: PLLCLKEN=0,PLLSTEN=0,PRDIV=1 */
#define SYSTEM_MCG_C5_VALUE 0x01U /* MCG_C5 */
/* MCG_C6: LOLIE0=0,PLLS=1,CME0=0,VDIV=8 */
#define SYSTEM_MCG_C6_VALUE 0x48U /* MCG_C6 */
/* MCG_C7: OSCSEL=0 */
#define SYSTEM_MCG_C7_VALUE 0x00U /* MCG_C7 */
/* OSC_CR: ERCLKEN=1,EREFSTEN=0,SC2P=0,SC4P=0,SC8P=0,SC16P=0 */
#define SYSTEM_OSC_CR_VALUE 0x80U /* OSC_CR */
/* SMC_PMCTRL: RUNM=0,STOPA=0,STOPM=0 */
#define SYSTEM_SMC_PMCTRL_VALUE 0x00U /* SMC_PMCTRL */
/* SIM_CLKDIV1: OUTDIV1=0,OUTDIV2=2,OUTDIV4=2,OUTDIV5=0 */
#define SYSTEM_SIM_CLKDIV1_VALUE 0x02020000U /* SIM_CLKDIV1 */
/* SIM_CLKDIV3: PLLFLLDIV=0,PLLFLLFRAC=0 */
#define SYSTEM_SIM_CLKDIV3_VALUE 0x00U /* SIM_CLKDIV3 */
/* SIM_SOPT1: USBREGEN=0,USBSSTBY=0,USBVSTBY=0,OSC32KSEL=2,RAMSIZE=0 */
#define SYSTEM_SIM_SOPT1_VALUE 0x00080000U /* SIM_SOPT1 */
/* SIM_SOPT2:
* EMVSIMSRC=0,SDHCSRC=0,LPUARTSRC=0,TPMSRC=1,FLEXIOSRC=0,USBSRC=0,PLLFLLSEL=1,TRACECLKSEL=0,FBSL=0,CLKOUTSEL=0,RTCCLKOUTSEL=0
*/
#define SYSTEM_SIM_SOPT2_VALUE 0x01010000U /* SIM_SOPT2 */
#endif
#else
#define DEFAULT_SYSTEM_CLOCK 20971520u
#endif
/**
* @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_MKL82Z7_H_) */
@@ -0,0 +1,309 @@
/*
** ###################################################################
** Processors: MKL82Z128VLH7
** MKL82Z128VLK7
** MKL82Z128VLL7
** MKL82Z128VMC7
** MKL82Z128VMP7
**
** Compilers: Keil ARM C/C++ Compiler
** Freescale C/C++ for Embedded ARM
** GNU C Compiler
** GNU C Compiler - CodeSourcery Sourcery G++
** IAR ANSI C/C++ Compiler for ARM
**
** Reference manual: KL82P121M72SF0RM, Rev.0.3 June 2015
** Version: rev. 1.4, 2015-08-28
** Build: b150910
**
** 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 (c) 2015 Freescale Semiconductor, Inc.
** All rights reserved.
**
** Redistribution and use in source and binary forms, with or without modification,
** are permitted provided that the following conditions are met:
**
** o Redistributions of source code must retain the above copyright notice, this list
** of conditions and the following disclaimer.
**
** o 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.
**
** o Neither the name of Freescale Semiconductor, Inc. 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.
**
** http: www.freescale.com
** mail: support@freescale.com
**
** Revisions:
** - rev. 1.0 (2015-04-18)
** Initial version.
** - rev. 1.1 (2015-05-04)
** Update SIM, EVMSIM, QuadSPI, and I2C based on Rev0 document.
** - rev. 1.2 (2015-08-11)
** Correct clock configuration.
** - rev. 1.3 (2015-08-20)
** Align with RM Rev.1.
** - rev. 1.4 (2015-08-28)
** Update LPUART to add FIFO.
**
** ###################################################################
*/
/*!
* @file MKL82Z7
* @version 1.4
* @date 2015-08-28
* @brief Device specific configuration file for MKL82Z7 (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 "fsl_device_registers.h"
/*!
* @brief Defines the structure to set the Bootloader Configuration Area
*
* This type of variable is used to set the Bootloader Configuration Area
* of the chip.
*/
typedef struct SystemBootloaderConfig
{
uint32_t tag; /*!< Magic number to verify bootloader configuration is valid. Must be set to 'kcfg'. */
uint32_t crcStartAddress; /*!< Start address for application image CRC check. If the bits are all set then Kinetis
bootloader by default will not perform any CRC check. */
uint32_t crcByteCount; /*!< Byte count for application image CRC check. If the bits are all set then Kinetis
bootloader by default will not prform any CRC check. */
uint32_t crcExpectedValue; /*!< Expected CRC value for application CRC check. If the bits are all set then Kinetis
bootloader by default will not perform any CRC check.*/
uint8_t enabledPeripherals; /*!< Bitfield of peripherals to enable.
bit 0 - LPUART, bit 1 - I2C, bit 2 - SPI, bit 4 - USB
Kinetis bootloader will enable the peripheral if corresponding bit is set to 1. */
uint8_t i2cSlaveAddress; /*!< If not 0xFF, used as the 7-bit I2C slave address. If 0xFF, defaults to 0x10 for I2C
slave address */
uint16_t peripheralDetectionTimeoutMs; /*!< Timeout in milliseconds for active peripheral detection. If 0xFFFF,
defaults to 5 seconds. */
uint16_t usbVid; /*!< Sets the USB Vendor ID reported by the device during enumeration. If 0xFFFF, it defaults to
0x15A2. */
uint16_t usbPid; /*!< Sets the USB Product ID reported by the device during enumeration. */
uint32_t usbStringsPointer; /*!< Sets the USB Strings reported by the device during enumeration. */
uint8_t clockFlags; /*!< The flags in the clockFlags configuration field are enabled if the corresponding bit is
cleared (0).
bit 0 - HighSpeed Enable high speed mode (i.e., 48 MHz). */
uint8_t clockDivider; /*!< Inverted value of the divider to use for core and bus clocks when in high speed mode */
uint8_t bootFlags; /*!< If bit 0 is cleared, then Kinetis bootloader will jump to either Quad SPI Flash or internal
flash image depending on FOPT BOOTSRC_SEL bits.
If the bit is set, then Kinetis bootloader will prepare for host communication over serial
peripherals. */
uint8_t RESERVED1;
uint32_t RESERVED2[2];
uint8_t RESERVED3[8];
uint32_t qspiConfigBlockPtr; /*!< A pointer to the QSPI config block in internal flash array. */
uint8_t RESERVED4[12];
} system_bootloader_config_t;
#ifndef BOOTLOADER_CONFIG
#define BOOTLOADER_CONFIG 1 /* Enable BootloaderConfig Area by default */
#endif
#if (BOOTLOADER_CONFIG)
/* Bootlader configuration area */
#if defined(__IAR_SYSTEMS_ICC__)
/* Pragma to place the Bootloader Configuration Array on correct location defined in linker file. */
#pragma language = extended
#pragma location = "BootloaderConfig"
__root const system_bootloader_config_t BootloaderConfig @"BootloaderConfig" =
#elif defined(__GNUC__)
__attribute__((section(".BootloaderConfig"))) const system_bootloader_config_t BootloaderConfig =
#elif defined(__CC_ARM)
__attribute__((section("BootloaderConfig"))) const system_bootloader_config_t BootloaderConfig __attribute__((used)) =
#else
#error Unsupported compiler!
#endif
{
.tag = 0x6766636BU, /* Magic Number */
.crcStartAddress = 0xFFFFFFFFU, /* Disable CRC check */
.crcByteCount = 0xFFFFFFFFU, /* Disable CRC check */
.crcExpectedValue = 0xFFFFFFFFU, /* Disable CRC check */
.enabledPeripherals = 0x17, /* Enable all peripherals */
.i2cSlaveAddress = 0xFF, /* Use default I2C address */
.peripheralDetectionTimeoutMs = 0xFFFFU, /* Use default timeout */
.usbVid = 0xFFFFU, /* Use default USB Vendor ID */
.usbPid = 0xFFFFU, /* Use default USB Product ID */
.usbStringsPointer = 0xFFFFFFFFU, /* Use default USB Strings */
.clockFlags = 0x01, /* Enable High speed mode */
.clockDivider = 0xFF, /* Use clock divider 1 */
.bootFlags = 0x01, /* Enable communication with host */
.qspiConfigBlockPtr = 0xFFFFFFFFU /* No QSPI configuration */
};
#endif
/* ----------------------------------------------------------------------------
-- Core clock
---------------------------------------------------------------------------- */
uint32_t SystemCoreClock = 72000000ul;
/* ----------------------------------------------------------------------------
-- SystemInit()
---------------------------------------------------------------------------- */
void SystemInit(void)
{
}
/* ----------------------------------------------------------------------------
-- SystemCoreClockUpdate()
---------------------------------------------------------------------------- */
void SystemCoreClockUpdate(void)
{
uint32_t MCGOUTClock; /* Variable to store output clock frequency of the MCG module */
uint16_t Divider;
if ((MCG->C1 & MCG_C1_CLKS_MASK) == 0x00U)
{
/* Output of FLL or PLL is selected */
if ((MCG->C6 & MCG_C6_PLLS_MASK) == 0x00U)
{
/* FLL is selected */
if ((MCG->C1 & MCG_C1_IREFS_MASK) == 0x00U)
{
/* External reference clock is selected */
switch (MCG->C7 & MCG_C7_OSCSEL_MASK)
{
case 0x00U:
MCGOUTClock = CPU_XTAL_CLK_HZ; /* System oscillator drives MCG clock */
break;
case 0x01U:
MCGOUTClock = CPU_XTAL32k_CLK_HZ; /* RTC 32 kHz oscillator drives MCG clock */
break;
case 0x02U:
default:
MCGOUTClock = CPU_INT_IRC_CLK_HZ; /* IRC 48MHz oscillator drives MCG clock */
break;
}
if (((MCG->C2 & MCG_C2_RANGE_MASK) != 0x00U) && ((MCG->C7 & MCG_C7_OSCSEL_MASK) != 0x01U))
{
switch (MCG->C1 & MCG_C1_FRDIV_MASK)
{
case 0x38U:
Divider = 1536U;
break;
case 0x30U:
Divider = 1280U;
break;
default:
Divider = (uint16_t)(32LU << ((MCG->C1 & MCG_C1_FRDIV_MASK) >> MCG_C1_FRDIV_SHIFT));
break;
}
}
else
{ /* ((MCG->C2 & MCG_C2_RANGE_MASK) != 0x00U) */
Divider = (uint16_t)(1LU << ((MCG->C1 & MCG_C1_FRDIV_MASK) >> MCG_C1_FRDIV_SHIFT));
}
MCGOUTClock = (MCGOUTClock / Divider); /* Calculate the divided FLL reference clock */
}
else
{ /* (!((MCG->C1 & MCG_C1_IREFS_MASK) == 0x00U)) */
MCGOUTClock = CPU_INT_SLOW_CLK_HZ; /* The slow internal reference clock is selected */
} /* (!((MCG->C1 & MCG_C1_IREFS_MASK) == 0x00U)) */
/* Select correct multiplier to calculate the MCG output clock */
switch (MCG->C4 & (MCG_C4_DMX32_MASK | MCG_C4_DRST_DRS_MASK))
{
case 0x00U:
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) == 0x00U)) */
/* PLL is selected */
Divider = (((uint16_t)MCG->C5 & MCG_C5_PRDIV_MASK) + 0x01U);
MCGOUTClock = (uint32_t)(CPU_XTAL_CLK_HZ / Divider); /* Calculate the PLL reference clock */
Divider = (((uint16_t)MCG->C6 & MCG_C6_VDIV_MASK) + 16U);
MCGOUTClock *= Divider; /* Calculate the VCO output clock */
MCGOUTClock /= 2; /* Calculate the MCG output clock */
} /* (!((MCG->C6 & MCG_C6_PLLS_MASK) == 0x00U)) */
}
else if ((MCG->C1 & MCG_C1_CLKS_MASK) == 0x40U)
{
/* Internal reference clock is selected */
if ((MCG->C2 & MCG_C2_IRCS_MASK) == 0x00U)
{
MCGOUTClock = CPU_INT_SLOW_CLK_HZ; /* Slow internal reference clock selected */
}
else
{ /* (!((MCG->C2 & MCG_C2_IRCS_MASK) == 0x00U)) */
Divider = (uint16_t)(0x01LU << ((MCG->SC & MCG_SC_FCRDIV_MASK) >> MCG_SC_FCRDIV_SHIFT));
MCGOUTClock = (uint32_t)(CPU_INT_FAST_CLK_HZ / Divider); /* Fast internal reference clock selected */
} /* (!((MCG->C2 & MCG_C2_IRCS_MASK) == 0x00U)) */
}
else if ((MCG->C1 & MCG_C1_CLKS_MASK) == 0x80U)
{
/* External reference clock is selected */
switch (MCG->C7 & MCG_C7_OSCSEL_MASK)
{
case 0x00U:
MCGOUTClock = CPU_XTAL_CLK_HZ; /* System oscillator drives MCG clock */
break;
case 0x01U:
MCGOUTClock = CPU_XTAL32k_CLK_HZ; /* RTC 32 kHz oscillator drives MCG clock */
break;
case 0x02U:
default:
MCGOUTClock = CPU_INT_IRC_CLK_HZ; /* IRC 48MHz oscillator drives MCG clock */
break;
}
}
else
{ /* (!((MCG->C1 & MCG_C1_CLKS_MASK) == 0x80U)) */
/* Reserved value */
return;
} /* (!((MCG->C1 & MCG_C1_CLKS_MASK) == 0x80U)) */
SystemCoreClock =
(MCGOUTClock / (0x01U + ((SIM->CLKDIV1 & SIM_CLKDIV1_OUTDIV1_MASK) >> SIM_CLKDIV1_OUTDIV1_SHIFT)));
}
@@ -0,0 +1,230 @@
/*
** ###################################################################
** Processors: MKL82Z128VLH7
** MKL82Z128VLK7
** MKL82Z128VLL7
** MKL82Z128VMC7
** MKL82Z128VMP7
**
** Compilers: Keil ARM C/C++ Compiler
** Freescale C/C++ for Embedded ARM
** GNU C Compiler
** GNU C Compiler - CodeSourcery Sourcery G++
** IAR ANSI C/C++ Compiler for ARM
**
** Reference manual: KL82P121M72SF0RM, Rev.0.3 June 2015
** Version: rev. 1.4, 2015-08-28
** Build: b150910
**
** 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 (c) 2015 Freescale Semiconductor, Inc.
** All rights reserved.
**
** Redistribution and use in source and binary forms, with or without modification,
** are permitted provided that the following conditions are met:
**
** o Redistributions of source code must retain the above copyright notice, this list
** of conditions and the following disclaimer.
**
** o 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.
**
** o Neither the name of Freescale Semiconductor, Inc. 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.
**
** http: www.freescale.com
** mail: support@freescale.com
**
** Revisions:
** - rev. 1.0 (2015-04-18)
** Initial version.
** - rev. 1.1 (2015-05-04)
** Update SIM, EVMSIM, QuadSPI, and I2C based on Rev0 document.
** - rev. 1.2 (2015-08-11)
** Correct clock configuration.
** - rev. 1.3 (2015-08-20)
** Align with RM Rev.1.
** - rev. 1.4 (2015-08-28)
** Update LPUART to add FIFO.
**
** ###################################################################
*/
/*!
* @file MKL82Z7
* @version 1.4
* @date 2015-08-28
* @brief Device specific configuration file for MKL82Z7 (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 "fsl_device_registers.h"
/*!
* @brief Defines the structure to set the Bootloader Configuration Area
*
* This type of variable is used to set the Bootloader Configuration Area
* of the chip.
*/
typedef struct SystemBootloaderConfig
{
uint32_t tag; /*!< Magic number to verify bootloader configuration is valid. Must be set to 'kcfg'. */
uint32_t crcStartAddress; /*!< Start address for application image CRC check. If the bits are all set then Kinetis
bootloader by default will not perform any CRC check. */
uint32_t crcByteCount; /*!< Byte count for application image CRC check. If the bits are all set then Kinetis
bootloader by default will not prform any CRC check. */
uint32_t crcExpectedValue; /*!< Expected CRC value for application CRC check. If the bits are all set then Kinetis
bootloader by default will not perform any CRC check.*/
uint8_t enabledPeripherals; /*!< Bitfield of peripherals to enable.
bit 0 - LPUART, bit 1 - I2C, bit 2 - SPI, bit 4 - USB
Kinetis bootloader will enable the peripheral if corresponding bit is set to 1. */
uint8_t i2cSlaveAddress; /*!< If not 0xFF, used as the 7-bit I2C slave address. If 0xFF, defaults to 0x10 for I2C
slave address */
uint16_t peripheralDetectionTimeoutMs; /*!< Timeout in milliseconds for active peripheral detection. If 0xFFFF,
defaults to 5 seconds. */
uint16_t usbVid; /*!< Sets the USB Vendor ID reported by the device during enumeration. If 0xFFFF, it defaults to
0x15A2. */
uint16_t usbPid; /*!< Sets the USB Product ID reported by the device during enumeration. */
uint32_t usbStringsPointer; /*!< Sets the USB Strings reported by the device during enumeration. */
uint8_t clockFlags; /*!< The flags in the clockFlags configuration field are enabled if the corresponding bit is
cleared (0).
bit 0 - HighSpeed Enable high speed mode (i.e., 48 MHz). */
uint8_t clockDivider; /*!< Inverted value of the divider to use for core and bus clocks when in high speed mode */
uint8_t bootFlags; /*!< If bit 0 is cleared, then Kinetis bootloader will jump to either Quad SPI Flash or internal
flash image depending on FOPT BOOTSRC_SEL bits.
If the bit is set, then Kinetis bootloader will prepare for host communication over serial
peripherals. */
uint8_t RESERVED1;
uint32_t RESERVED2[2];
uint8_t RESERVED3[8];
uint32_t qspiConfigBlockPtr; /*!< A pointer to the QSPI config block in internal flash array. */
uint8_t RESERVED4[12];
} system_bootloader_config_t;
#ifndef BOOTLOADER_CONFIG
#define BOOTLOADER_CONFIG 1 /* Enable BootloaderConfig Area by default */
#endif
#if (BOOTLOADER_CONFIG)
/* Bootlader configuration area */
#if defined(__IAR_SYSTEMS_ICC__)
/* Pragma to place the Bootloader Configuration Array on correct location defined in linker file. */
#pragma language = extended
#pragma location = "BootloaderConfig"
__root const system_bootloader_config_t BootloaderConfig @"BootloaderConfig" =
#elif defined(__GNUC__)
__attribute__((section(".BootloaderConfig"))) const system_bootloader_config_t BootloaderConfig =
#elif defined(__CC_ARM)
__attribute__((section("BootloaderConfig"))) const system_bootloader_config_t BootloaderConfig __attribute__((used)) =
#else
#error Unsupported compiler!
#endif
{
.tag = 0x6766636BU, /* Magic Number */
.crcStartAddress = 0xFFFFFFFFU, /* Disable CRC check */
.crcByteCount = 0xFFFFFFFFU, /* Disable CRC check */
.crcExpectedValue = 0xFFFFFFFFU, /* Disable CRC check */
.enabledPeripherals = 0x17, /* Enable all peripherals */
.i2cSlaveAddress = 0xFF, /* Use default I2C address */
.peripheralDetectionTimeoutMs = 0xFFFFU, /* Use default timeout */
.usbVid = 0xFFFFU, /* Use default USB Vendor ID */
.usbPid = 0xFFFFU, /* Use default USB Product ID */
.usbStringsPointer = 0xFFFFFFFFU, /* Use default USB Strings */
.clockFlags = 0x01, /* Enable High speed mode */
.clockDivider = 0xFF, /* Use clock divider 1 */
.bootFlags = 0x01, /* Enable communication with host */
.qspiConfigBlockPtr = 0x2000, /* QCB is placed at 0x2000 */
};
#endif
/* ----------------------------------------------------------------------------
-- Core clock
---------------------------------------------------------------------------- */
uint32_t SystemCoreClock = 72000000ul;
/* ----------------------------------------------------------------------------
-- SystemInit()
---------------------------------------------------------------------------- */
#if defined(__IAR_SYSTEMS_ICC__)
/* Pragma to place the rom patch code on correct location defined in linker file. */
#pragma language = extended
#pragma section = "rom_patch_code"
const uint8_t s_rom_patch[124] @"rom_patch_code" =
#elif defined(__GNUC__)
__attribute__((section("rom_patch_code"))) const uint8_t s_rom_patch[124] __attribute__((used)) =
#elif defined(__CC_ARM)
__attribute__((section("rom_patch_code"))) const uint8_t s_rom_patch[124] __attribute__((used)) =
#else
#error Unsupported compiler!
#endif
{ 0x10, 0xB5, 0x01, 0x00, 0x17, 0x4A, 0x10, 0x00, 0x18, 0x30, 0x17, 0x4B, 0x1B, 0x68, 0xDB, 0x00, 0x02, 0xD5,
0x16, 0x4A, 0x10, 0x00, 0x18, 0x30, 0x13, 0x68, 0x15, 0x4C, 0x1C, 0x40, 0x14, 0x60, 0x13, 0x68, 0x0C, 0x69,
0x24, 0x04, 0x1C, 0x43, 0x14, 0x60, 0x02, 0x68, 0x11, 0x4B, 0x13, 0x40, 0x03, 0x60, 0xDA, 0x22, 0x52, 0x00,
0x89, 0x18, 0x02, 0x68, 0x0B, 0x68, 0x1B, 0x04, 0xFC, 0x24, 0xA4, 0x03, 0x1C, 0x40, 0x14, 0x43, 0x04, 0x60,
0x02, 0x68, 0x0B, 0x4B, 0x13, 0x40, 0x03, 0x60, 0x02, 0x68, 0x49, 0x68, 0x09, 0x06, 0xFC, 0x23, 0x9B, 0x05,
0x0B, 0x40, 0x13, 0x43, 0x03, 0x60, 0x00, 0x20, 0x10, 0xBD, 0x0C, 0xA0, 0x0D, 0x40, 0x24, 0x80, 0x04, 0x40,
0x0C, 0xA0, 0x05, 0x40, 0xFF, 0xFF, 0xFC, 0xFF, 0xFF, 0xFF, 0xC0, 0xFF, 0xFF, 0xFF, 0xFF, 0xC0 };
/*
* ROM patch handler for ROM patch code execution.
*/
#if defined(__IAR_SYSTEMS_ICC__)
/* Pragma to place the ROM_PatchHandler on correct location defined in linker file. */
#pragma language = extended
#pragma section = "BootloaderPatchHandler"
void ROM_PatchHandler(void) @"BootloaderPatchHandler"
#elif defined(__GNUC__)
__attribute__((section("BootloaderPatchHandler"))) void ROM_PatchHandler(void)
#elif defined(__CC_ARM)
__attribute__((section("BootloaderPatchHandler"))) void ROM_PatchHandler(void)
#else
#error Unsupported compiler!
#endif
{
typedef int (*patch_handler_t)(uint32_t);
#if defined(__IAR_SYSTEMS_ICC__)
uint32_t s_rom_patch_start = (uint32_t)__section_begin("rom_patch_code");
#elif defined(__CC_ARM)
extern uint32_t Load$$EXEC_m_rom_patch_code$$Base[];
uint32_t s_rom_patch_start = (uint32_t)&Load$$EXEC_m_rom_patch_code$$Base;
#elif defined(__GNUC__)
extern uint32_t rom_patch_code_start[];
uint32_t s_rom_patch_start = (uint32_t)&rom_patch_code_start;
#endif
uint32_t patch_start = s_rom_patch_start + 1;
patch_handler_t patch_run = (patch_handler_t)patch_start;
patch_run(BootloaderConfig.qspiConfigBlockPtr);
}
/* ----------------------------------------------------------------------------
-- SystemInit()
---------------------------------------------------------------------------- */
void SystemInit(void)
{
}
@@ -0,0 +1,60 @@
/*
* Copyright (c) 2015, Freescale Semiconductor, Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
*
* o Redistributions of source code must retain the above copyright notice, this list
* of conditions and the following disclaimer.
*
* o 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.
*
* o Neither the name of Freescale Semiconductor, Inc. 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.
*/
#include "fsl_device_registers.h"
typedef void (*application_handler_t)(void);
enum
{
QuadSPI_Image_Start = 0x04001000ul,
};
int main(void)
{
static uint32_t s_stackPointer = 0;
static application_handler_t runApplication;
// Set the VTOR to the application vector table address
SCB->VTOR = QuadSPI_Image_Start;
s_stackPointer = *(uint32_t *)QuadSPI_Image_Start;
runApplication = *(application_handler_t *)(QuadSPI_Image_Start + 4);
__set_MSP(s_stackPointer);
__set_PSP(s_stackPointer);
runApplication();
// Never run here
while (1)
{
}
}
+113
View File
@@ -0,0 +1,113 @@
/*
* Copyright (c) 2015, Freescale Semiconductor, Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
*
* o Redistributions of source code must retain the above copyright notice, this list
* of conditions and the following disclaimer.
*
* o 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.
*
* o Neither the name of Freescale Semiconductor, Inc. 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 __LED_BSP_H__
#define __LED_BSP_H__
#include "fsl_device_registers.h"
#define LED_ON_LOW_LEVEL 1
#define LED_ON_HIGH_LEVEL 2
#define LED0 (1)
#define LED1 (2)
#define LED2 (4)
#if defined(TWR_K80F150M)
#define MAX_LED_IDX (LED1)
#define LED0_OFFSET 14
#define LED1_OFFSET 15
#define LED0_PORT (PORTD)
#define LED0_GPIO (GPIOD)
#define LED1_PORT (PORTD)
#define LED1_GPIO (GPIOD)
#define LED_POLARITY LED_ON_HIGH_LEVEL
#elif defined(FRDM_K82F)
#define MAX_LED_IDX (LED2)
#define LED0_OFFSET 8
#define LED1_OFFSET 9
#define LED2_OFFSET 10
#define LED0_PORT (PORTC)
#define LED0_GPIO (GPIOC)
#define LED1_PORT (PORTC)
#define LED1_GPIO (GPIOC)
#define LED2_PORT (PORTC)
#define LED2_GPIO (GPIOC)
#define LED_POLARITY LED_ON_LOW_LEVEL
#elif defined(TWR_POS_K81)
#define MAX_LED_IDX (LED2)
#define LED0_OFFSET 7
#define LED1_OFFSET 8
#define LED2_OFFSET 13
#define LED0_PORT (PORTC)
#define LED0_GPIO (GPIOC)
#define LED1_PORT (PORTC)
#define LED1_GPIO (GPIOC)
#define LED2_PORT (PORTC)
#define LED2_GPIO (GPIOC)
#define LED_POLARITY LED_ON_LOW_LEVEL
#elif defined(TWR_KL8272M)
#define MAX_LED_IDX (LED1)
#define LED0_OFFSET 14
#define LED1_OFFSET 15
#define LED0_PORT (PORTD)
#define LED0_GPIO (GPIOD)
#define LED1_PORT (PORTD)
#define LED1_GPIO (GPIOD)
#define LED_POLARITY LED_ON_HIGH_LEVEL
#elif defined(FRDM_KL82Z)
#define MAX_LED_IDX (LED2)
#define LED0_OFFSET 0
#define LED1_OFFSET 1
#define LED2_OFFSET 2
#define LED0_PORT (PORTC)
#define LED0_GPIO (GPIOC)
#define LED1_PORT (PORTC)
#define LED1_GPIO (GPIOC)
#define LED2_PORT (PORTC)
#define LED2_GPIO (GPIOC)
#define LED_POLARITY LED_ON_LOW_LEVEL
#elif defined(TWR_POS_KL81)
#define MAX_LED_IDX (LED2)
#define LED0_OFFSET 7
#define LED1_OFFSET 8
#define LED2_OFFSET 13
#define LED0_PORT (PORTC)
#define LED0_GPIO (GPIOC)
#define LED1_PORT (PORTC)
#define LED1_GPIO (GPIOC)
#define LED2_PORT (PORTC)
#define LED2_GPIO (GPIOC)
#define LED_POLARITY LED_ON_LOW_LEVEL
#else
#error This board is not supported!
#endif
#endif
+110
View File
@@ -0,0 +1,110 @@
/*
* Copyright (c) 2015, Freescale Semiconductor, Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
*
* o Redistributions of source code must retain the above copyright notice, this list
* of conditions and the following disclaimer.
*
* o 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.
*
* o Neither the name of Freescale Semiconductor, Inc. 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.
*/
#include "fsl_device_registers.h"
#include "milliseconds_delay.h"
#include "led_bsp.h"
//! @brief Intialize necessary IPs.
void hardware_init(void);
//! @brief Toggle LEDs according to specified parameter leds.
void led_toggle(uint32_t leds);
int main(void)
{
hardware_init();
milliseconds_delay_init();
uint32_t led_idx = LED0;
while (1)
{
led_toggle(led_idx);
milliseconds_delay(500);
led_toggle(led_idx);
led_idx <<= 1;
if (led_idx > MAX_LED_IDX)
{
led_idx = LED0;
}
}
}
void hardware_init(void)
{
#if defined(SIM_SCGC5_PORTA_MASK)
SIM->SCGC5 |= (SIM_SCGC5_PORTA_MASK | SIM_SCGC5_PORTB_MASK | SIM_SCGC5_PORTC_MASK | SIM_SCGC5_PORTD_MASK |
SIM_SCGC5_PORTE_MASK);
#else
SIM->SCGC5 |=
(SIM_SCGC5_PTA_MASK | SIM_SCGC5_PTB_MASK | SIM_SCGC5_PTC_MASK | SIM_SCGC5_PTD_MASK | SIM_SCGC5_PTE_MASK);
#endif
// Enable the LED pins GPIO
LED0_PORT->PCR[LED0_OFFSET] = PORT_PCR_MUX(1);
LED1_PORT->PCR[LED1_OFFSET] = PORT_PCR_MUX(1);
#if MAX_LED_IDX == LED2
LED2_PORT->PCR[LED2_OFFSET] = PORT_PCR_MUX(1);
#endif // #if MAX_LED_IDX == LED2
// Configure port to output mode
LED0_GPIO->PDDR |= (1 << LED0_OFFSET);
LED1_GPIO->PDDR |= (1 << LED1_OFFSET);
#if MAX_LED_IDX == LED2
LED2_GPIO->PDDR |= (1 << LED2_OFFSET);
#endif // #if MAX_LED_IDX == LED2
// If led will be turned on with low level, need to turn all of them off at startup.
#if LED_POLARITY == LED_ON_LOW_LEVEL
LED0_GPIO->PTOR |= (1 << LED0_OFFSET);
LED1_GPIO->PTOR |= (1 << LED1_OFFSET);
#if MAX_LED_IDX == LED2
LED2_GPIO->PTOR |= (1 << LED2_OFFSET);
#endif // #if MAX_LED_IDX == LED2
#endif // #if LED_POLARITY == LED_ON_LOW_LEVEL
}
void led_toggle(uint32_t leds)
{
if (leds & LED0)
{
LED0_GPIO->PTOR |= (1 << LED0_OFFSET);
}
if (leds & LED1)
{
LED1_GPIO->PTOR |= (1 << LED1_OFFSET);
}
#if MAX_LED_IDX == LED2
if (leds & LED2)
{
LED2_GPIO->PTOR |= (1 << LED2_OFFSET);
}
#endif // #if MAX_LED_IDX == LED2
}
+359
View File
@@ -0,0 +1,359 @@
/*
* Copyright (c) 2015-2016, Freescale Semiconductor, Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
*
* o Redistributions of source code must retain the above copyright notice, this list
* of conditions and the following disclaimer.
*
* o 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.
*
* o Neither the name of Freescale Semiconductor, Inc. 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.
*/
/*
*
*
*
* This demo shows a simple led blinking example, to re-enter Kinetis Bootloader,
* hold SW2 about 2 seconds, then you can talk to Kinetis Bootloader via host tool again.
*
*
*
*/
#include "fsl_device_registers.h"
#include "milliseconds_delay.h"
#include "misc.h"
#include "led_bsp.h"
#include <stdbool.h>
//! @brief Intialize necessary IPs.
void hardware_init(void);
//! @brief Toggle LEDs according to specified parameter leds.
void led_toggle(uint32_t leds);
//! @brief switch to PEE mode from FEE mode.
//! In this function, the QuadSPI source clock is changed to MCGFLL,
//! The QuadSPI serial clock divider is set to 1.
//! The SystemCoreClock is updated to 120MHz, the MCG is swithced from FEE to PEE mode.
#if defined(__ICCARM__)
#pragma section = "ramfunc_section"
#pragma section = "ramfunc_section_init"
void clock_change(void) @"ramfunc_section";
#elif defined(__CC_ARM)
extern uint32_t Load$$EXEC_m_ramfunc$$Base[]; // Base address for loading ram function
extern uint32_t Load$$EXEC_m_ramfunc$$Length[]; // Size of ram function
extern uint32_t Image$$EXEC_m_ramfunc$$Base[];
void clock_change(void) __attribute__((section("ramfunc_section"))); // Execute address of ram function
#elif defined(__GNUC__)
extern uint32_t ramfunc_load_address[];
extern uint32_t ramfunc_length[];
extern uint32_t ramfunc_execution_address[];
void clock_change(void) __attribute__((section("ramfunc_section"))); // Execute address of ram function
#endif
// Copy ram functions from ROM to RAM.
void copy_to_ram(void);
int main(void)
{
copy_to_ram();
clock_change();
hardware_init();
milliseconds_delay_init();
uint32_t led_idx = LED0;
while (1)
{
led_toggle(led_idx);
milliseconds_delay(500);
led_toggle(led_idx);
led_idx <<= 1;
if (led_idx > MAX_LED_IDX)
{
led_idx = LED0;
}
// Re-enter bootloader if the bootloader pin is clicked.
if (is_bootloader_pin_clicked())
{
app_enter_bootloader();
}
}
}
void hardware_init(void)
{
#if defined(SIM_SCGC5_PORTA_MASK)
SIM->SCGC5 |= (SIM_SCGC5_PORTA_MASK | SIM_SCGC5_PORTB_MASK | SIM_SCGC5_PORTC_MASK | SIM_SCGC5_PORTD_MASK |
SIM_SCGC5_PORTE_MASK);
#else
SIM->SCGC5 |=
(SIM_SCGC5_PTA_MASK | SIM_SCGC5_PTB_MASK | SIM_SCGC5_PTC_MASK | SIM_SCGC5_PTD_MASK | SIM_SCGC5_PTE_MASK);
#endif
// Enable the LED pins GPIO
LED0_PORT->PCR[LED0_OFFSET] = PORT_PCR_MUX(1);
LED1_PORT->PCR[LED1_OFFSET] = PORT_PCR_MUX(1);
#if MAX_LED_IDX == LED2
LED2_PORT->PCR[LED2_OFFSET] = PORT_PCR_MUX(1);
#endif // #if MAX_LED_IDX == LED2
// Configure port to output mode
LED0_GPIO->PDDR |= (1 << LED0_OFFSET);
LED1_GPIO->PDDR |= (1 << LED1_OFFSET);
#if MAX_LED_IDX == LED2
LED2_GPIO->PDDR |= (1 << LED2_OFFSET);
#endif // #if MAX_LED_IDX == LED2
// If led will be turned on with low level, need to turn all of them off at startup.
#if LED_POLARITY == LED_ON_LOW_LEVEL
LED0_GPIO->PTOR |= (1 << LED0_OFFSET);
LED1_GPIO->PTOR |= (1 << LED1_OFFSET);
#if MAX_LED_IDX == LED2
LED2_GPIO->PTOR |= (1 << LED2_OFFSET);
#endif // #if MAX_LED_IDX == LED2
#endif // #if LED_POLARITY == LED_ON_LOW_LEVEL
bootloader_pin_init();
}
void led_toggle(uint32_t leds)
{
if (leds & LED0)
{
LED0_GPIO->PTOR |= (1 << LED0_OFFSET);
}
if (leds & LED1)
{
LED1_GPIO->PTOR |= (1 << LED1_OFFSET);
}
#if MAX_LED_IDX == LED2
if (leds & LED2)
{
LED2_GPIO->PTOR |= (1 << LED2_OFFSET);
}
#endif // #if MAX_LED_IDX == LED2
}
void clock_change(void)
{
__disable_irq(); // Disable global variable before changing the clock in case an interrupt is triggered during
// change clock source.
// Disable QuadSPI module, avoid glitch during clock switching.
QuadSPI0->MCR |= QuadSPI_MCR_MDIS_MASK;
/*
* Configure CLKDIV1 first, in case some clock exceeds the maximum clock during clock switch.
*/
#if CPU_IS_ARM_CORTEX_M4
/* SIM_CLKDIV1: OUTDIV1=1,OUTDIV2=1,OUTDIV3=1,OUTDIV4=4 */
SIM->CLKDIV1 = 0x01140000U;
#elif CPU_IS_ARM_CORTEX_M0P
/* SIM_CLKDIV1: OUTDIV1=1,OUTDIV2=5,OUTDIV4=5,OUTDIV5=1 */
SIM->CLKDIV1 = 0x15051000U;
#endif
// Restore to FEI mode before configuring external OSC.
MCG->C4 &= (uint8_t) ~(MCG_C4_DMX32_MASK | MCG_C4_DRST_DRS_MASK);
MCG->C1 |= MCG_C1_IREFS_MASK;
while ((MCG->S & MCG_S_IREFST_MASK) == 0x00U)
{
}
/*
* Switch to PEE mode, reuse almost the codes from SystemInit()
*/
/* SIM_SCGC5: PORTA=1 */
#if defined(SIM_SCGC5_PORTA_MASK)
SIM->SCGC5 |= SIM_SCGC5_PORTA_MASK;
#else
SIM->SCGC5 |= SIM_SCGC5_PTA_MASK;
#endif
/* Configure external OSC pinmux */
PORTA->PCR[18] &= (uint32_t) ~(uint32_t)((PORT_PCR_ISF_MASK | PORT_PCR_MUX(0x07)));
PORTA->PCR[19] &= (uint32_t) ~(uint32_t)((PORT_PCR_ISF_MASK | PORT_PCR_MUX(0x07)));
MCG->SC = 0; /* Set SC (fast clock internal reference divider) */
MCG->C2 = 0x24U; /* Set C2 (freq. range, ext. and int. reference selection etc) */
// Delay about 50us to ensure the C2[RANGE] is updated correctly.
for (volatile uint32_t delayCnt = 0; delayCnt < 4800; delayCnt++)
{
__ASM("nop");
}
OSC->CR = 0x80U; /* Set OSC_CR (OSCERCLK enable, oscillator capacitor load) */
MCG->C7 = 0; /* Set C7 (OSC Clock Select) */
MCG->C1 = 0x22 | MCG_C1_CLKS(0x02); /* Set C1 (clock source selection, FLL ext. reference divider, int. reference
enable etc.) - PBE mode*/
while ((MCG->S & MCG_S_OSCINIT0_MASK) == 0x00U)
{
}
/* Set C4 (FLL output; trim values not changed) */
MCG->C4 &= (uint8_t) ~(MCG_C4_DMX32_MASK | MCG_C4_DRST_DRS_MASK);
/* PLL clock can be used to generate clock for some devices regardless of clock generator (MCGOUTCLK) mode. */
MCG->C5 = 0x00U; /* Set C5 (PLL settings, PLL reference divider etc.) */
#if CPU_IS_ARM_CORTEX_M4
/* OSC is 12MHz, PLL clock = 12 * 20 / 2 = 120MHz */
MCG->C6 = 0x44U & (uint8_t) ~(MCG_C6_PLLS_MASK); /* Set C6 (PLL select, VCO divider etc.) */
#elif CPU_IS_ARM_CORTEX_M0P
/* OSC is 12MHz, PLL clock = 12 * 24 / 2 = 144MHz */
MCG->C6 = 0x48U & (uint8_t) ~(MCG_C6_PLLS_MASK); /* Set C6 (PLL select, VCO divider etc.) */
#endif
MCG->C6 |= MCG_C6_PLLS_MASK;
while ((MCG->S & MCG_S_LOCK0_MASK) == 0x00U)
{ /* Wait until PLL is locked*/
}
MCG->C1 &= (uint8_t) ~(MCG_C1_CLKS_MASK);
// Need to wait about 1ms until the MCGPLL is stable.
for (volatile uint32_t delayCnt = 0; delayCnt < 60000; delayCnt++)
{
__ASM("nop");
}
/*
*
* Now switch the QuadSPI Clock source and Configure the Clock divider
*
*/
// If the serial clock divider is 1, need to change it to 2 because the maximum
// supported clock under SDK mode is 100MHz while QuadSPI source clock is 120MHz.
// For DDR mode, it is OK, because the actual serial clock is QuadSPI source clock / 4.
uint32_t sclkcfg = (QuadSPI0->MCR & QuadSPI_MCR_SCLKCFG_MASK) >> QuadSPI_MCR_SCLKCFG_SHIFT;
if (sclkcfg == 0U)
{
uint32_t tmp = QuadSPI0->MCR;
tmp &= (uint32_t)~QuadSPI_MCR_SCLKCFG_MASK;
tmp |= QuadSPI_MCR_SCLKCFG(1);
QuadSPI0->MCR = tmp;
}
uint32_t tmp = QuadSPI0->SOCCR;
tmp &= (uint32_t)~QuadSPI_SOCCR_QSPISRC_MASK;
tmp |= QuadSPI_SOCCR_QSPISRC(2);
QuadSPI0->SOCCR = tmp; // Change QuadSPI source clock to MCGPLL
// Cleare AHB buffer after switching clock source.
QuadSPI0->MCR &= (uint32_t)~QuadSPI_MCR_MDIS_MASK; // Re-enable QuadSPI module
// Clear AHB buffer first here to avoid potential timing issue
QuadSPI0->MCR |= QuadSPI_MCR_SWRSTHD_MASK | QuadSPI_MCR_SWRSTSD_MASK;
// Wait ~10ms to ensure the AHB buffer is cleared.
for (volatile uint32_t delayCnt = 0; delayCnt < 960; delayCnt++)
{
__ASM("nop");
}
// Disable module during the reset procedure
QuadSPI0->MCR |= QuadSPI_MCR_MDIS_MASK;
// Clear the reset bits.
QuadSPI0->MCR &= (uint32_t) ~(QuadSPI_MCR_SWRSTHD_MASK | QuadSPI_MCR_SWRSTSD_MASK);
QuadSPI0->MCR &= (uint32_t)~QuadSPI_MCR_MDIS_MASK; // Re-enable QuadSPI module
__DSB();
__ISB();
// Enable global IRQ because the clock switch is complete.
__enable_irq();
#if CPU_IS_ARM_CORTEX_M4
SystemCoreClock = 120000000ul; // SystemCoreClock is 120MHz now.
#elif CPU_IS_ARM_CORTEX_M0P
SystemCoreClock = 72000000ul; // SystemCoreClock is 72MHz now.
#endif
}
void copy_to_ram(void)
{
uint8_t *codeRelocateRomStart;
uint32_t codeRelocateSize;
uint8_t *codeReloocateRamStart;
#if defined(__ICCARM__)
codeRelocateRomStart = (uint8_t *)__section_begin("ramfunc_section_init");
codeRelocateSize = (uint32_t)__section_size("ramfunc_section_init");
codeReloocateRamStart = (uint8_t *)__section_begin("ramfunc_section");
#elif defined(__CC_ARM)
codeRelocateRomStart = (uint8_t *)Load$$EXEC_m_ramfunc$$Base;
codeRelocateSize = (uint32_t)Load$$EXEC_m_ramfunc$$Length;
codeReloocateRamStart = (uint8_t *)Image$$EXEC_m_ramfunc$$Base;
#elif defined(__GNUC__)
codeRelocateRomStart = (uint8_t *)ramfunc_load_address;
codeRelocateSize = (uint32_t)ramfunc_length;
codeReloocateRamStart = (uint8_t *)ramfunc_execution_address;
#endif
while (codeRelocateSize)
{
*codeReloocateRamStart++ = *codeRelocateRomStart++;
codeRelocateSize--;
}
}
//! @brief Init bootloader pin
void bootloader_pin_init(void)
{
// Configure Enter Kinetis Bootloader pin (SW2-PTA4)
PORTA->PCR[4] = PORT_PCR_MUX(1); // Configure PTA21 to GPIO mode
GPIOA->PDDR &= (uint32_t) ~(1 << 4); // Configure SW1 to input mode
}
//! @brief determine whether boot pin is asserted
bool is_bootloader_pin_clicked(void)
{
static uint32_t count = 0;
static bool isPinAsserted = false;
static bool isPinReleased = false;
if (!isPinAsserted)
{
if (!(GPIOA->PDIR & (1 << 4)))
{
count++;
}
else
{
count = 0;
}
if (count == 2)
{
isPinAsserted = true;
count = 0;
}
}
else
{
if (GPIOA->PDIR & (1 << 4))
{
count++;
}
else
{
count = 0;
}
if (count == 2)
{
isPinReleased = true;
count = 0;
}
}
return (isPinAsserted && isPinReleased);
}
@@ -0,0 +1,78 @@
/*
* Copyright (c) 2013, Freescale Semiconductor, Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
*
* o Redistributions of source code must retain the above copyright notice, this list
* of conditions and the following disclaimer.
*
* o 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.
*
* o Neither the name of Freescale Semiconductor, Inc. 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.
*/
#include "fsl_device_registers.h"
#include "milliseconds_delay.h"
////////////////////////////////////////////////////////////////////////////////
// Code
////////////////////////////////////////////////////////////////////////////////
static volatile uint32_t s_milliseconds_left = 0;
static inline uint32_t milliseconds_left_get(void)
{
return s_milliseconds_left;
}
static inline void milliseconds_left_set(uint32_t ms)
{
s_milliseconds_left = ms;
}
static inline void milliseconds_left_decrement(void)
{
--s_milliseconds_left;
}
void milliseconds_delay_init(void)
{
SysTick_Config(SystemCoreClock / 1000);
}
void milliseconds_delay(uint32_t ms)
{
milliseconds_left_set(ms);
while (milliseconds_left_get())
{
}
}
void SysTick_Handler(void)
{
if (milliseconds_left_get())
{
milliseconds_left_decrement();
}
}
////////////////////////////////////////////////////////////////////////////////
// EOF
////////////////////////////////////////////////////////////////////////////////
@@ -0,0 +1,39 @@
/*
* Copyright (c) 2013, Freescale Semiconductor, Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
*
* o Redistributions of source code must retain the above copyright notice, this list
* of conditions and the following disclaimer.
*
* o 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.
*
* o Neither the name of Freescale Semiconductor, Inc. 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 __MILLISECONDS_DELAY_H__
#define __MILLISECONDS_DELAY_H__
#include <stdint.h>
extern void milliseconds_delay_init(void);
extern void milliseconds_delay(uint32_t ms);
#endif
+215
View File
@@ -0,0 +1,215 @@
/*
* Copyright (c) 2015, Freescale Semiconductor, Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
*
* o Redistributions of source code must retain the above copyright notice, this list
* of conditions and the following disclaimer.
*
* o 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.
*
* o Neither the name of Freescale Semiconductor, Inc. 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.
*/
#include "fsl_device_registers.h"
//! @brief Type used for all status and error return values.
typedef int32_t status_t;
//! @brief Enumeration for supported flash margin levels.
typedef enum _flash_margin_value
{
kFlashMargin_Normal,
kFlashMargin_User,
kFlashMargin_Factory,
// Not real margin level, Used to determine the range of valid margin level.
kFlashMargin_Invalid
} flash_margin_value_t;
//! @brief Enumeration for the three possible flash security states.
typedef enum _flash_security_state
{
kFlashNotSecure,
kFlashSecureBackdoorEnabled,
kFlashSecureBackdoorDisabled
} flash_security_state_t;
//! @brief Enumeration for the three possible flash protection levels.
typedef enum _flash_protection_state
{
kFlashProtection_Unprotected,
kFlashProtection_Protected,
kFlashProtection_Mixed
} flash_protection_state_t;
//! @brief Enumeration for the three possible flash execute access levels.
typedef enum _flash_execute_only_access_state
{
kFlashAccess_UnLimited,
kFlashAccess_ExecuteOnly,
kFlashAccess_Mixed
} flash_execute_only_access_state_t;
//! @brief Enumeration for various flash properties.
typedef enum _flash_property
{
kFlashProperty_SectorSize = 0,
kFlashProperty_TotalFlashSize = 1,
kFlashProperty_BlockCount = 3,
kFlashProperty_FlashBlockBaseAddr,
kFlashProperty_FlashFacSupport,
kFlashProperty_FlashAccessSegmentSize,
kFlashProperty_FlashAccessSegmentCount,
kFlashProperty_Version,
} flash_property_t;
//! @brief callback type used for pflash block
typedef void (*flash_callback_t)(void);
//! @brief Flash driver state information.
//!
//! An instance of this structure is allocated by the user of the flash driver and
//! passed into each of the driver APIs.
typedef struct _flash_driver
{
uint32_t PFlashBlockBase; //!< Base address of the first PFlash block
uint32_t PFlashTotalSize; //!< Size of all combined PFlash block.
uint32_t PFlashBlockCount; //!< Number of PFlash blocks.
uint32_t PFlashSectorSize; //!< Size in bytes of a sector of PFlash.
flash_callback_t PFlashCallback; //!< Callback function for flash API.
uint32_t PFlashAccessSegmentSize; //!< Size in bytes of a access segment of PFlash.
uint32_t PFlashAccessSegmentCount; //!< Number of PFlash access segments.
} flash_driver_t;
/*!
* @brief Enumeration for the two possible options of flash read resource command.
*/
typedef enum _flash_read_resource_option
{
kFlashResource_ProgramIFR = 0,
kFlashResource_VersionID = 1
} flash_read_resource_option_t;
//! @brief Interface for the flash driver.
typedef struct FlashDriverInterface
{
uint32_t version; //!< flash driver API version number.
status_t (*flash_init)(flash_driver_t *driver);
status_t (*flash_erase_all)(flash_driver_t *driver, uint32_t key);
status_t (*flash_erase_all_unsecure)(flash_driver_t *driver, uint32_t key);
status_t (*flash_erase)(flash_driver_t *driver, uint32_t start, uint32_t lengthInBytes, uint32_t key);
status_t (*flash_program)(flash_driver_t *driver, uint32_t start, uint32_t *src, uint32_t lengthInBytes);
status_t (*flash_get_security_state)(flash_driver_t *driver, flash_security_state_t *state);
status_t (*flash_security_bypass)(flash_driver_t *driver, const uint8_t *backdoorKey);
status_t (*flash_verify_erase_all)(flash_driver_t *driver, flash_margin_value_t margin);
status_t (*flash_verify_erase)(flash_driver_t *driver,
uint32_t start,
uint32_t lengthInBytes,
flash_margin_value_t margin);
status_t (*flash_verify_program)(flash_driver_t *driver,
uint32_t start,
uint32_t lengthInBytes,
const uint8_t *expectedData,
flash_margin_value_t margin,
uint32_t *failedAddress,
uint32_t *failedData);
status_t (*flash_get_property)(flash_driver_t *driver, flash_property_t whichProperty, uint32_t *value);
status_t (*flash_register_callback)(flash_driver_t *driver, flash_callback_t callback);
status_t (*flash_program_once)(flash_driver_t *driver, uint32_t index, uint32_t *src, uint32_t lengthInBytes);
status_t (*flash_read_once)(flash_driver_t *driver, uint32_t index, uint32_t *dst, uint32_t lengthInBytes);
status_t (*flash_read_resource)(flash_driver_t *driver,
uint32_t start,
uint32_t *dst,
uint32_t lengthInBytes,
flash_read_resource_option_t option);
} flash_driver_interface_t;
//! @brief Interface for AES 128 functions
typedef struct AesDriverInterface
{
void (*aes_init)(uint32_t *key);
void (*aes_encrypt)(uint32_t *in, uint32_t *key, uint32_t *out);
void (*aes_decrypt)(uint32_t *in, uint32_t *key, uint32_t *out);
} aes_driver_interface_t;
typedef struct BootloaderTree
{
void (*runBootloader)(void *arg); //!< Function to start the bootloader executing.
uint32_t version; //!< Bootloader version number.
const char *copyright; //!< Copyright string.
const uint32_t *reserved;
const flash_driver_interface_t *flashDriver; //!< Flash driver API.
const aes_driver_interface_t *aesDriver; //!< AES driver API.
} bootloader_tree_t;
#define BOOTLOADER_TREE_ROOT (0x1c00001cul)
enum
{
kFlashEraseKey = 0x6B65666BUL,
#ifndef BL_TARGET_FLASH
kApplicationBase = 0x0000,
#else
kApplicationBase = 0xa000,
#endif
};
// See misc.h for more details.
void app_enter_bootloader(void)
{
// Disable IRQ first
__disable_irq();
// Get Kinetis Bootloader Tree pointer.
const bootloader_tree_t *bootloaderTree = *(const bootloader_tree_t **)BOOTLOADER_TREE_ROOT;
// Initialize Flash Driver
flash_driver_t flashInstance;
uint32_t status = bootloaderTree->flashDriver->flash_init(&flashInstance);
if (status != 0)
{
// Handle error code here
}
// Save the flash config field before erase
uint32_t flashConfigField[4];
const uint32_t *flashConfigFieldStart = (const uint32_t *)(kApplicationBase + 0x400);
for (uint32_t i = 0; i < sizeof(flashConfigField) / sizeof(flashConfigField[0]); i++)
{
flashConfigField[i] = *flashConfigFieldStart++;
}
// Erase the first sector.
status = bootloaderTree->flashDriver->flash_erase(&flashInstance, kApplicationBase, 0x800, kFlashEraseKey);
if (status != 0)
{
// Handle error code here
}
// Write the flash config field back.
status = bootloaderTree->flashDriver->flash_program(&flashInstance, kApplicationBase + 0x400, flashConfigField,
sizeof(flashConfigField));
if (status != 0)
{
// Handle error code here
}
// Enter Kinetis Bootloader
#ifndef BL_TARGET_FLASH
bootloaderTree->runBootloader(0);
#else
NVIC_SystemReset();
#endif
}
+39
View File
@@ -0,0 +1,39 @@
/*
* Copyright (c) 2015, Freescale Semiconductor, Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
*
* o Redistributions of source code must retain the above copyright notice, this list
* of conditions and the following disclaimer.
*
* o 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.
*
* o Neither the name of Freescale Semiconductor, Inc. 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.
*/
#include <stdbool.h>
//! @brief Enter bootloader from user application.
void app_enter_bootloader(void);
//! @brief Init bootloader pin
void bootloader_pin_init(void);
//! @brief determine whether boot pin is asserted
bool is_bootloader_pin_clicked(void);
@@ -0,0 +1,107 @@
S0250000626F6F745F746F5F717370695F616C6961735F6D656D6F72795F726F6D2E73726563DF
S1130000F0FF0220F90500008704000087040000C7
S1130010870400008704000087040000000000003B
S11300200000000000000000000000008704000041
S11300308704000000000000870400006D06000033
S11300408D0600008D0600008D0600008D06000060
S11300508D0600008D0600008D0600008D06000050
S11300608D0600008D0600008D0600008D06000040
S11300708D0600008D0600008D0600008D06000030
S11300808D0600008D0600008D0600008D06000020
S11300908D0600008D0600008D0600008D06000010
S11300A08D0600008D0600008D0600008D06000000
S11300B08D0600008D0600008D0600008D060000F0
S11300C08D0600008D0600008D0600008D060000E0
S11300D08D0600008D0600008D0600008D060000D0
S11300E08D0600008D0600008D0600008D060000C0
S11300F08D0600008D0600008D0600008D060000B0
S11301008D0600008D0600008D0600008D0600009F
S11301108D0600008D0600008D0600008D0600008F
S11301208D0600008D0600008D0600008D0600007F
S11301308D0600008D0600008D0600008D0600006F
S11301408D0600008D0600008D0600008D0600005F
S11301508D0600008D0600008D0600008D0600004F
S11301608D0600008D0600008D0600008D0600003F
S11301708D0600008D0600008D0600008D0600002F
S11301808D0600008D0600008D0600008D0600001F
S11301908D0600008D0600008D0600008D0600000F
S11301A08D0600008D0600008D0600008D060000FF
S11301B08D0600008D0600008D0600008D060000EF
S11301C08D0600008D0600008D0600008D060000DF
S11301D08D0600008D0600008D0600008D060000CF
S11301E08D0600008D0600008D0600008D060000BF
S11301F08D0600008D0600008D0600008D060000AF
S11302008D0600008D0600008D0600008D0600009E
S11302108D0600008D0600008D0600008D0600008E
S11302208D0600008D0600008D0600008D0600007E
S11302308D0600008D0600008D0600008D0600006E
S11302408D0600008D0600008D0600008D0600005E
S11302508D0600008D0600008D0600008D0600004E
S11302608D0600008D0600008D0600008D0600003E
S11302708D0600008D0600008D0600008D0600002E
S11302808D0600008D0600008D0600008D0600001E
S11302908D0600008D0600008D0600008D0600000E
S11302A08D0600008D0600008D0600008D060000FE
S11302B08D0600008D0600008D0600008D060000EE
S11302C08D0600008D0600008D0600008D060000DE
S11302D08D0600008D0600008D0600008D060000CE
S11302E08D0600008D0600008D0600008D060000BE
S11302F08D0600008D0600008D0600008D060000AE
S11303008D0600008D0600008D0600008D0600009D
S11303108D0600008D0600008D0600008D0600008D
S11303208D0600008D0600008D0600008D0600007D
S11303308D0600008D0600008D0600008D0600006D
S11303408D0600008D0600008D0600008D0600005D
S11303508D0600008D0600008D0600008D0600004D
S11303608D0600008D0600008D0600008D0600003D
S11303708D0600008D0600008D0600008D0600002D
S11303808D0600008D0600008D0600008D0600001D
S11303908D0600008D0600008D0600008D0600000D
S11303A08D0600008D0600008D0600008D060000FD
S11303B08D0600008D0600008D0600008D060000ED
S11303C06B636667FFFFFFFFFFFFFFFFFFFFFFFF9A
S11303D017FFF401FFFFFFFFFFFFFFFF01FF010015
S11303E0FFFFFFFF001000000000000000000000FD
S11303F0FFFFFFFF000000000000000000000000FD
S1130400FFFFFFFFFFFFFFFFFFFFFFFFFEBDFFFF3B
S113041062B38B0708D0521E11F8013B00F8013B70
S113042000F024808B07F6D1830740F0208000BFC2
S1130430103A07D330B4B1E83810103AA0E83810B5
S1130440F9D230BC530724BFB1E80810A0E8081063
S113045044BF51F8043B40F8043BD20724BF31F8B1
S1130460022B20F8022B44BF0B7803707047083A24
S113047007D3B1E80810083A40F8043B40F804CB2D
S1130480F7D25307E4E7FEE780B50E490E4808604B
S11304900E490F48421A0F4888421CBF002AFFF732
S11304A0B7FF0D480D49091A18BF00F01FF80C4991
S11304B00C48421A04D0BDE808400B48FFF7A8BF17
S11304C001BD000008ED00E0000000000000000095
S11304D000000000000000000000FF1F0C00FF1FD0
S11304E0000000000000000000000000002200F0F6
S11304F001B80000401810F0030308D0C91A1FD334
S1130500DB0748BF00F8012D28BF20F8022D130097
S113051030B414461546103928BF20E93C00FAD8F7
S1130520490728BF20E90C0048BF40F8042D890082
S113053028BF20F8022D48BF00F8012D30BC7047B9
S1130540C91818BF00F8012DCB0728BF00F8012DEA
S1130550704719E050F8041BCB0744BFA9F101030D
S11305605918121F0023042A41F8043BF9D25FEA08
S1130570827C0B4604D54FF0000CA1F800C09B1CF4
S1130580D10744BF0021197050F8042B002AE1D18F
S11305907047000080B507490748084A08600168A9
S11305A011604068506081F3088881F309885068BD
S11305B08047FEE708ED00E0001000040000FF1F84
S11305C010B5074979441831064C7C44163404E0CC
S11305D00A68081D511888470146A142F8D110BD88
S11305E008000000140000006BFFFFFF0C00000077
S11305F00000FF1F0000000072B603488047034854
S1130600804762B6024800471506000089040000CE
S11306108106000005484CF22051C1814DF6281195
S1130620C1814FF4E971018070470000002005404A
S113063000F00BF8002801D0FFF7C2FF0020C046ED
S1130640C046FFF7A7FF00F002F80120704700F052
S113065001B800000746384600F002F8FBE7000046
S11306602021090326311820ABBEF9E703480168AD
S113067011B10168491E0160704700000800FF1FA6
S1130680C046C046C046C046FFF7D2FFFFF7FEBFD4
S90305F9FE
@@ -0,0 +1,123 @@
S01C00006C65645F64656D6F5F70666C6173685F303030302E73726563D3
S1130000F0FF0220090700008305000083050000BB
S11300108305000083050000830500000000000044
S11300200000000000000000000000008305000044
S1130030830500000000000083050000ED040000BB
S1130040890700008907000089070000890700006C
S1130050890700008907000089070000890700005C
S1130060890700008907000089070000890700004C
S1130070890700008907000089070000890700003C
S1130080890700008907000089070000890700002C
S1130090890700008907000089070000890700001C
S11300A0890700008907000089070000890700000C
S11300B089070000890700008907000089070000FC
S11300C089070000890700008907000089070000EC
S11300D089070000890700008907000089070000DC
S11300E089070000890700008907000089070000CC
S11300F089070000890700008907000089070000BC
S113010089070000890700008907000089070000AB
S1130110890700008907000089070000890700009B
S1130120890700008907000089070000890700008B
S1130130890700008907000089070000890700007B
S1130140890700008907000089070000890700006B
S1130150890700008907000089070000890700005B
S1130160890700008907000089070000890700004B
S1130170890700008907000089070000890700003B
S1130180890700008907000089070000890700002B
S1130190890700008907000089070000890700001B
S11301A0890700008907000089070000890700000B
S11301B089070000890700008907000089070000FB
S11301C089070000890700008907000089070000EB
S11301D089070000890700008907000089070000DB
S11301E089070000890700008907000089070000CB
S11301F089070000890700008907000089070000BB
S113020089070000890700008907000089070000AA
S1130210890700008907000089070000890700009A
S1130220890700008907000089070000890700008A
S1130230890700008907000089070000890700007A
S1130240890700008907000089070000890700006A
S1130250890700008907000089070000890700005A
S1130260890700008907000089070000890700004A
S1130270890700008907000089070000890700003A
S1130280890700008907000089070000890700002A
S1130290890700008907000089070000890700001A
S11302A0890700008907000089070000890700000A
S11302B089070000890700008907000089070000FA
S11302C089070000890700008907000089070000EA
S11302D089070000890700008907000089070000DA
S11302E089070000890700008907000089070000CA
S11302F089070000890700008907000089070000BA
S113030089070000890700008907000089070000A9
S11303108907000089070000890700008907000099
S11303208907000089070000890700008907000089
S11303308907000089070000890700008907000079
S11303408907000089070000890700008907000069
S11303508907000089070000890700008907000059
S11303608907000089070000890700008907000049
S11303708907000089070000890700008907000039
S11303808907000089070000890700008907000029
S11303908907000089070000890700008907000019
S11303A08907000089070000890700008907000009
S11303B089070000890700008907000089070000F9
S11303C06B636667FFFFFFFFFFFFFFFFFFFFFFFF9A
S11303D017FFF401FFFFFFFFFFFFFFFF01FF010015
S11303E0FFFFFFFF001000000000000000000000FD
S11303F0FFFFFFFF000000000000000000000000FD
S1130400FFFFFFFFFFFFFFFFFFFFFFFFFE3DFFFFBB
S113041010B500F011F800F04FF80124204600F068
S113042030F84FF4FA7000F05BF8204600F029F839
S11304306400052CF2D3F0E71C48016841F47851BC
S113044001604FF480711A4801604160816019486D
S1130450816841F480718160816841F40071816038
S1130460816841F480618160016841F480710160B8
S1130470016841F400710160016841F48061016028
S11304807047C2070B4903D50A6842F480720A60B8
S1130490820703D50A6842F400720A60400703D554
S11304A0086840F4806008607047000038800440A9
S11304B020B004408CF00F40104800684FF47A716B
S11304C0B0FBF1F0401EB0F1807F08D20C490D4A18
S11304D04860F02010700020886007200860704792
S11304E00949086008680028FCD17047064801687B
S11304F011B10168491E0160704700000000FF1F30
S113050010E000E023ED00E00400FF1F62B38B075E
S113051008D0521E11F8013B00F8013B00F0248082
S11305208B07F6D1830740F0208000BF103A07D331
S113053030B4B1E83810103AA0E83810F9D230BC21
S1130540530724BFB1E80810A0E8081044BF51F8CD
S1130550043B40F8043BD20724BF31F8022B20F8B7
S1130560022B44BF0B7803707047083A07D3B1E8F5
S11305700810083A40F8043B40F804CBF7D253077C
S1130580E4E7FEE780B50E490E4808600E490F48BF
S1130590421A0F4888421CBF002AFFF7B7FF0D48D4
S11305A00D49091A18BF00F01FF80C490C48421AEB
S11305B004D0BDE808400B48FFF7A8BF01BD000008
S11305C008ED00E0000000008C0700009007000028
S11305D00000FF1F0400FF1F0800FF1F00000000B1
S11305E00000000000000000002200F001B800003C
S11305F0401810F0030308D0C91A1FD3DB0748BF03
S113060000F8012D28BF20F8022D130030B4144641
S11306101546103928BF20E93C00FAD8490728BFFD
S113062020E90C0048BF40F8042D890028BF20F8B9
S1130630022D48BF00F8012D30BC7047C91818BFFF
S113064000F8012DCB0728BF00F8012D704719E0F1
S113065050F8041BCB0744BFA9F101035918121F1A
S11306600023042A41F8043BF9D25FEA827C0B465A
S113067004D54FF0000CA1F800C09B1CD10744BF67
S11306800021197050F8042B002AE1D1704710B4EE
S113069050F8041B79B10268436812180830DC076B
S11306A044BFA9F10104E31852F8044B43F8044B86
S11306B0091FF9D1ECE710BC7047000010B50749D9
S11306C079441831064C7C44163404E00A68081D49
S11306D0511888470146A142F8D110BD0800000016
S11306E0280000006BFFFFFF040000000400FF1F50
S11306F0000000009BFFFFFF0400000090000000CA
S11307000000FF1F0000000072B603488047034842
S1130710804762B6024800472507000085050000AF
S11307207D07000005484CF22051C1814DF6281187
S1130730C1814FF4E9710180704700000020054039
S113074000F00BF8002801D0FFF7B8FF0020C046E6
S1130750C046FFF75DFE00F002F80120704700F08C
S113076001B800000746384600F002F8FBE7000035
S11307702021090326311820ABBEF9E7C046C04644
S1130780C046C046FFF7DCFFFFF7FEBF0000400194
S9030709EC
@@ -0,0 +1,156 @@
S01A00006C65645F64656D6F5F717370695F303030302E7372656396
S1130000F0FF0220211500689B1300689B13006811
S11300109B1300689B1300689B130068000000009A
S11300200000000000000000000000009B130068B6
S11300309B130068000000009B130068AD12006869
S113004085150068851500688515006885150068A4
S11300508515006885150068851500688515006894
S11300608515006885150068851500688515006884
S11300708515006885150068851500688515006874
S11300808515006885150068851500688515006864
S11300908515006885150068851500688515006854
S11300A08515006885150068851500688515006844
S11300B08515006885150068851500688515006834
S11300C08515006885150068851500688515006824
S11300D08515006885150068851500688515006814
S11300E08515006885150068851500688515006804
S11300F085150068851500688515006885150068F4
S113010085150068851500688515006885150068E3
S113011085150068851500688515006885150068D3
S113012085150068851500688515006885150068C3
S113013085150068851500688515006885150068B3
S113014085150068851500688515006885150068A3
S11301508515006885150068851500688515006893
S11301608515006885150068851500688515006883
S11301708515006885150068851500688515006873
S11301808515006885150068851500688515006863
S11301908515006885150068851500688515006853
S11301A08515006885150068851500688515006843
S11301B08515006885150068851500688515006833
S11301C08515006885150068851500688515006823
S11301D08515006885150068851500688515006813
S11301E08515006885150068851500688515006803
S11301F085150068851500688515006885150068F3
S113020085150068851500688515006885150068E2
S113021085150068851500688515006885150068D2
S113022085150068851500688515006885150068C2
S113023085150068851500688515006885150068B2
S113024085150068851500688515006885150068A2
S11302508515006885150068851500688515006892
S11302608515006885150068851500688515006882
S11302708515006885150068851500688515006872
S11302808515006885150068851500688515006862
S11302908515006885150068851500688515006852
S11302A08515006885150068851500688515006842
S11302B08515006885150068851500688515006832
S11302C08515006885150068851500688515006822
S11302D08515006885150068851500688515006812
S11302E08515006885150068851500688515006802
S11302F085150068851500688515006885150068F2
S113030085150068851500688515006885150068E1
S113031085150068851500688515006885150068D1
S113032085150068851500688515006885150068C1
S113033085150068851500688515006885150068B1
S113034085150068851500688515006885150068A1
S11303508515006885150068851500688515006891
S11303608515006885150068851500688515006881
S11303708515006885150068851500688515006871
S11303808515006885150068851500688515006861
S11303908515006885150068851500688515006851
S11303A08515006885150068851500688515006841
S11303B08515006885150068851500688515006831
S11303C06B636667FFFFFFFFFFFFFFFFFFFFFFFF9A
S11303D017FFF401FFFFFFFFFFFFFFFF01FF010015
S11303E0FFFFFFFF001000000000000000000000FD
S11303F0FFFFFFFF000000000000000000000000FD
S1130400FFFFFFFFFFFFFFFFFFFFFFFFFEBDFFFF3B
S3156800100018B572B64648474A016841F4804101609E
S315680010104FF08A71D1604449CB7803F01F03CB70D7
S315680010200B7843F004030B708B79DB06FCD51368E9
S3156800103043F4007313603D4A3D4B1C6814401C60C2
S315680010405C6822405A6000220A7224224A70002292
S3156800105002E000BF009A521C0092009AB2F5965FB1
S31568001060F7D3344B80221A7000220A73A2220A70C0
S315680010708A799207FCD5CA7802F01F02CA700022E4
S315680010800A7104224A714A7942F040024A718A79A1
S315680010905206FCD50A7802F03F020A7000210091D8
S315680010A04EF6602203E000BF0099491C0091009942
S315680010B09142F8D30168090E05D101680902090A47
S315680010C041F080710160416AC908C90041F00201B6
S315680010D04162016821F480410160016841F00301C1
S315680010E00160002102E000BF0099491C0091009947
S315680010F0B1F5707FF7D3016841F4804101600168FA
S31568001100890889000160016821F480410160BFF3A4
S315680011104F8FBFF36F8F62B607490848086011BDE5
S3156800112000A00D403880044000400640FFF8FFFEEE
S3156800113048900440005006400000FF1F000E270735
S31568001140DFF800F001FCFF1F10B500F055F8FFF757
S31568001150F7FF00F018F800F08FF80124204600F039
S3156800116037F84FF4FA7000F09BF8204600F030F834
S315680011706400052C28BF012400F04FF80028EDD044
S3156800118000F0A4F8EAE73248016841F47851016052
S315680011904FF480712F480160416081602E488168F4
S315680011A041F480718160816841F400718160816871
S315680011B041F480618160016841F480710160016871
S315680011C041F400710160016841F4806101601AE0D0
S315680011D0C207214903D50A6842F480720A60820709
S315680011E003D50A6842F400720A60400703D50868A6
S315680011F040F4806008607047184A1AB1184919485F
S3156800120000F090B8704718494FF480700860174826
S31568001210016821F01001016070471548154A416858
S3156800122003781268491C002B06D1D2060AD4022913
S3156800123009D10121017005E0D20603D5022902D140
S31568001240012141700021416001784078084070476B
S315680012503880044020B004408CF00F404001000004
S315680012600010006800FCFF1F1090044014F00F4047
S315680012700400FF1F10F00F40104800684FF47A71A1
S31568001280B0FBF1F0401EB0F1807F08D20C490D4AE0
S315680012904860F0201070002088600720086070475A
S315680012A00949086008680028FCD170470648016843
S315680012B011B10168491E0160704700000000FF1FF8
S315680012C010E000E023ED00E00C00FF1F30B58BB0A6
S315680012D072B6124804682169496804A888474FF4B9
S315680012E08060002150F8042B4DF82120491C042900
S315680012F0F8D325690A4B2D694FF40062002104A8CA
S31568001300A84725696D6910236A464FF4806104A869
S31568001310A8472168002088470BB030BD1C00001C18
S315680013206B66656B62B38B0708D0521E11F8013B7A
S3156800133000F8013B00F024808B07F6D1830740F064
S31568001340208000BF103A07D330B4B1E83810103A9D
S31568001350A0E83810F9D230BC530724BFB1E80810AA
S31568001360A0E8081044BF51F8043B40F8043BD20794
S3156800137024BF31F8022B20F8022B44BF0B78037088
S315680013807047083A07D3B1E80810083A40F8043BB2
S3156800139040F804CBF7D25307E4E7FEE780B50E4979
S315680013A00E4808600E490F48421A0F4888421CBF0B
S315680013B0002AFFF7B7FF0D480D49091A18BF00F054
S315680013C01FF80C490C48421A04D0BDE808400B487F
S315680013D0FFF7A8BF01BD000008ED00E000000000AF
S315680013E0881500688C1500680000FF1F0400FF1F41
S315680013F01000FF1F00000000000000000000000051
S31568001400002200F001B80000401810F0030308D06D
S31568001410C91A1FD3DB0748BF00F8012D28BF20F87B
S31568001420022D130030B414461546103928BF20E93A
S315680014303C00FAD8490728BF20E90C0048BF40F8A5
S31568001440042D890028BF20F8022D48BF00F8012D19
S3156800145030BC7047C91818BF00F8012DCB0728BFE4
S3156800146000F8012D704719E050F8041BCB0744BFFC
S31568001470A9F101035918121F0023042A41F8043BF5
S31568001480F9D25FEA827C0B4604D54FF0000CA1F8CE
S3156800149000C09B1CD10744BF0021197050F8042B6B
S315680014A0002AE1D1704710B450F8041B79B102687C
S315680014B0436812180830DC0744BFA9F10104E31831
S315680014C052F8044B43F8044B091FF9D1ECE710BCFA
S315680014D07047000010B5074979441831064C7C44BA
S315680014E0163404E00A68081D511888470146A14267
S315680014F0F8D110BD08000000280000006BFFFFFF50
S315680015000C0000000400FF1F000000009BFFFFFFA7
S3156800151004000000740000000000FF1F00000000C7
S3156800152072B6034880470348804762B60248004758
S315680015308D1500689D1300687915006800F00BF832
S31568001540002801D0FFF7C6FF0020C046C046FFF757
S31568001550FBFD00F002F80120704700F001B80000BA
S315680015600746384600F002F8FBE700002021090329
S3156800157026311820ABBEF9E7C046C046C046C0460D
S31368001580FFF7DCFFFFF7FEBF00D8B80570471F
S705680015215C
@@ -0,0 +1,158 @@
S01A00006C65645F64656D6F5F717370695F613030302E7372656365
S113A000F0FF02203D150068B7130068B71300681D
S113A010B7130068B7130068B713006800000000A6
S113A020000000000000000000000000B7130068FA
S113A030B713006800000000B7130068AD12006891
S113A040A1150068A1150068A1150068A115006894
S113A050A1150068A1150068A1150068A115006884
S113A060A1150068A1150068A1150068A115006874
S113A070A1150068A1150068A1150068A115006864
S113A080A1150068A1150068A1150068A115006854
S113A090A1150068A1150068A1150068A115006844
S113A0A0A1150068A1150068A1150068A115006834
S113A0B0A1150068A1150068A1150068A115006824
S113A0C0A1150068A1150068A1150068A115006814
S113A0D0A1150068A1150068A1150068A115006804
S113A0E0A1150068A1150068A1150068A1150068F4
S113A0F0A1150068A1150068A1150068A1150068E4
S113A100A1150068A1150068A1150068A1150068D3
S113A110A1150068A1150068A1150068A1150068C3
S113A120A1150068A1150068A1150068A1150068B3
S113A130A1150068A1150068A1150068A1150068A3
S113A140A1150068A1150068A1150068A115006893
S113A150A1150068A1150068A1150068A115006883
S113A160A1150068A1150068A1150068A115006873
S113A170A1150068A1150068A1150068A115006863
S113A180A1150068A1150068A1150068A115006853
S113A190A1150068A1150068A1150068A115006843
S113A1A0A1150068A1150068A1150068A115006833
S113A1B0A1150068A1150068A1150068A115006823
S113A1C0A1150068A1150068A1150068A115006813
S113A1D0A1150068A1150068A1150068A115006803
S113A1E0A1150068A1150068A1150068A1150068F3
S113A1F0A1150068A1150068A1150068A1150068E3
S113A200A1150068A1150068A1150068A1150068D2
S113A210A1150068A1150068A1150068A1150068C2
S113A220A1150068A1150068A1150068A1150068B2
S113A230A1150068A1150068A1150068A1150068A2
S113A240A1150068A1150068A1150068A115006892
S113A250A1150068A1150068A1150068A115006882
S113A260A1150068A1150068A1150068A115006872
S113A270A1150068A1150068A1150068A115006862
S113A280A1150068A1150068A1150068A115006852
S113A290A1150068A1150068A1150068A115006842
S113A2A0A1150068A1150068A1150068A115006832
S113A2B0A1150068A1150068A1150068A115006822
S113A2C0A1150068A1150068A1150068A115006812
S113A2D0A1150068A1150068A1150068A115006802
S113A2E0A1150068A1150068A1150068A1150068F2
S113A2F0A1150068A1150068A1150068A1150068E2
S113A300A1150068A1150068A1150068A1150068D1
S113A310A1150068A1150068A1150068A1150068C1
S113A320A1150068A1150068A1150068A1150068B1
S113A330A1150068A1150068A1150068A1150068A1
S113A340A1150068A1150068A1150068A115006891
S113A350A1150068A1150068A1150068A115006881
S113A360A1150068A1150068A1150068A115006871
S113A370A1150068A1150068A1150068A115006861
S113A380A1150068A1150068A1150068A115006851
S113A390A1150068A1150068A1150068A115006841
S113A3A0A1150068A1150068A1150068A115006831
S113A3B0A1150068A1150068A1150068A115006821
S113A3C06B636667FFFFFFFFFFFFFFFFFFFFFFFFFA
S113A3D017FFF401FFFFFFFFFFFFFFFF01FF010075
S113A3E0FFFFFFFF00C000000000000000000000AD
S113A3F0FFFFFFFF0000000000000000000000005D
S113A400FFFFFFFFFFFFFFFFFFFFFFFFFEBDFFFF9B
S3156800100018B572B64648474A016841F4804101609E
S315680010104FF08A71D1604449CB7803F01F03CB70D7
S315680010200B7843F004030B708B79DB06FCD51368E9
S3156800103043F4007313603D4A3D4B1C6814401C60C2
S315680010405C6822405A6000220A7224224A70002292
S3156800105002E000BF009A521C0092009AB2F5965FB1
S31568001060F7D3344B80221A7000220A73A2220A70C0
S315680010708A799207FCD5CA7802F01F02CA700022E4
S315680010800A7104224A714A7942F040024A718A79A1
S315680010905206FCD50A7802F03F020A7000210091D8
S315680010A04EF6602203E000BF0099491C0091009942
S315680010B09142F8D30168090E05D101680902090A47
S315680010C041F080710160416AC908C90041F00201B6
S315680010D04162016821F480410160016841F00301C1
S315680010E00160002102E000BF0099491C0091009947
S315680010F0B1F5707FF7D3016841F4804101600168FA
S31568001100890889000160016821F480410160BFF3A4
S315680011104F8FBFF36F8F62B607490848086011BDE5
S3156800112000A00D403880044000400640FFF8FFFEEE
S3156800113048900440005006400000FF1F000E270735
S31568001140DFF800F001FCFF1F10B500F055F8FFF757
S31568001150F7FF00F018F800F08FF80124204600F039
S3156800116037F84FF4FA7000F09BF8204600F030F834
S315680011706400052C28BF012400F04FF80028EDD044
S3156800118000F0A4F8EAE73248016841F47851016052
S315680011904FF480712F480160416081602E488168F4
S315680011A041F480718160816841F400718160816871
S315680011B041F480618160016841F480710160016871
S315680011C041F400710160016841F4806101601AE0D0
S315680011D0C207214903D50A6842F480720A60820709
S315680011E003D50A6842F400720A60400703D50868A6
S315680011F040F4806008607047184A1AB1184919485F
S3156800120000F09EB8704718494FF480700860174818
S31568001210016821F01001016070471548154A416858
S3156800122003781268491C002B06D1D2060AD4022913
S3156800123009D10121017005E0D20603D5022902D140
S31568001240012141700021416001784078084070476B
S315680012503880044020B004408CF00F404001000004
S315680012600010006800FCFF1F1090044014F00F4047
S315680012700400FF1F10F00F40104800684FF47A71A1
S31568001280B0FBF1F0401EB0F1807F08D20C490D4AE0
S315680012904860F0201070002088600720086070475A
S315680012A00949086008680028FCD170470648016843
S315680012B011B10168491E0160704700000000FF1FF8
S315680012C010E000E023ED00E00C00FF1F30B58BB0A6
S315680012D072B6174804682169496804A888474FF4B4
S315680012E02440002150F8042B4DF82120491C04297C
S315680012F0F8D325690F4B2D694FF400624FF42041EE
S3156800130004A8A8472469646910236A464FF42441EF
S3156800131004A8A047BFF34F8F0748084A016801F43D
S31568001320E06111430160BFF34F8F00BFFDE700BF67
S315680013301C00001C6B66656B0CED00E00400FA058A
S3156800134062B38B0708D0521E11F8013B00F8013BC7
S3156800135000F024808B07F6D1830740F0208000BF19
S31568001360103A07D330B4B1E83810103AA0E838100C
S31568001370F9D230BC530724BFB1E80810A0E80810BA
S3156800138044BF51F8043B40F8043BD20724BF31F808
S31568001390022B20F8022B44BF0B7803707047083A7B
S315680013A007D3B1E80810083A40F8043B40F804CB84
S315680013B0F7D25307E4E7FEE780B50E490E480860A2
S315680013C00E490F48421A0F4888421CBF002AFFF789
S315680013D0B7FF0D480D49091A18BF00F01FF80C49E8
S315680013E00C48421A04D0BDE808400B48FFF7A8BF6E
S315680013F001BD000008ED00E000A00000A41500682B
S31568001400A81500680000FF1F0400FF1F1000FF1FDB
S31568001410000000000000000000000000002200F04C
S3156800142001B80000401810F0030308D0C91A1FD38A
S31568001430DB0748BF00F8012D28BF20F8022D1300EE
S3156800144030B414461546103928BF20E93C00FAD84E
S31568001450490728BF20E90C0048BF40F8042D8900D9
S3156800146028BF20F8022D48BF00F8012D30BC704710
S31568001470C91818BF00F8012DCB0728BF00F8012D41
S31568001480704719E050F8041BCB0744BFA9F1010364
S315680014905918121F0023042A41F8043BF9D25FEA5F
S315680014A0827C0B4604D54FF0000CA1F800C09B1C4B
S315680014B0D10744BF0021197050F8042B002AE1D1E6
S315680014C0704710B450F8041B79B102684368121863
S315680014D00830DC0744BFA9F10104E31852F8044B4D
S315680014E043F8044B091FF9D1ECE710BC70470000BC
S315680014F010B5074979441831064C7C44163404E023
S315680015000A68081D511888470146A142F8D110BDDE
S3156800151008000000280000006BFFFFFF0C000000B9
S315680015200400FF1F000000009BFFFFFF040000008F
S31568001530740000000000FF1F0000000072B6034838
S3156800154080470348804762B602480047A915006885
S31568001550B91300689515006800F00BF8002801D0EB
S31568001560FFF7C6FF0020C046C046FFF7EDFD00F056
S3156800157002F80120704700F001B8000007463846B7
S3156800158000F002F8FBE70000202109032631182045
S31568001590ABBEF9E7C046C046C046C046FFF7DCFFAB
S30F680015A0FFF7FEBF00D8B8057047D4
S7056800153D40
@@ -0,0 +1,158 @@
S02000006C65645F64656D6F5F717370695F616C6961735F613030302E73726563F6
S113A000000003203D150004B7130004B713000437
S113A010B7130004B7130004B713000400000000D2
S113A020000000000000000000000000B71300045E
S113A030B713000400000000B7130004AD120004BD
S113A040A1150004A1150004A1150004A115000424
S113A050A1150004A1150004A1150004A115000414
S113A060A1150004A1150004A1150004A115000404
S113A070A1150004A1150004A1150004A1150004F4
S113A080A1150004A1150004A1150004A1150004E4
S113A090A1150004A1150004A1150004A1150004D4
S113A0A0A1150004A1150004A1150004A1150004C4
S113A0B0A1150004A1150004A1150004A1150004B4
S113A0C0A1150004A1150004A1150004A1150004A4
S113A0D0A1150004A1150004A1150004A115000494
S113A0E0A1150004A1150004A1150004A115000484
S113A0F0A1150004A1150004A1150004A115000474
S113A100A1150004A1150004A1150004A115000463
S113A110A1150004A1150004A1150004A115000453
S113A120A1150004A1150004A1150004A115000443
S113A130A1150004A1150004A1150004A115000433
S113A140A1150004A1150004A1150004A115000423
S113A150A1150004A1150004A1150004A115000413
S113A160A1150004A1150004A1150004A115000403
S113A170A1150004A1150004A1150004A1150004F3
S113A180A1150004A1150004A1150004A1150004E3
S113A190A1150004A1150004A1150004A1150004D3
S113A1A0A1150004A1150004A1150004A1150004C3
S113A1B0A1150004A1150004A1150004A1150004B3
S113A1C0A1150004A1150004A1150004A1150004A3
S113A1D0A1150004A1150004A1150004A115000493
S113A1E0A1150004A1150004A1150004A115000483
S113A1F0A1150004A1150004A1150004A115000473
S113A200A1150004A1150004A1150004A115000462
S113A210A1150004A1150004A1150004A115000452
S113A220A1150004A1150004A1150004A115000442
S113A230A1150004A1150004A1150004A115000432
S113A240A1150004A1150004A1150004A115000422
S113A250A1150004A1150004A1150004A115000412
S113A260A1150004A1150004A1150004A115000402
S113A270A1150004A1150004A1150004A1150004F2
S113A280A1150004A1150004A1150004A1150004E2
S113A290A1150004A1150004A1150004A1150004D2
S113A2A0A1150004A1150004A1150004A1150004C2
S113A2B0A1150004A1150004A1150004A1150004B2
S113A2C0A1150004A1150004A1150004A1150004A2
S113A2D0A1150004A1150004A1150004A115000492
S113A2E0A1150004A1150004A1150004A115000482
S113A2F0A1150004A1150004A1150004A115000472
S113A300A1150004A1150004A1150004A115000461
S113A310A1150004A1150004A1150004A115000451
S113A320A1150004A1150004A1150004A115000441
S113A330A1150004A1150004A1150004A115000431
S113A340A1150004A1150004A1150004A115000421
S113A350A1150004A1150004A1150004A115000411
S113A360A1150004A1150004A1150004A115000401
S113A370A1150004A1150004A1150004A1150004F1
S113A380A1150004A1150004A1150004A1150004E1
S113A390A1150004A1150004A1150004A1150004D1
S113A3A0A1150004A1150004A1150004A1150004C1
S113A3B0A1150004A1150004A1150004A1150004B1
S113A3C06B636667FFFFFFFFFFFFFFFFFFFFFFFFFA
S113A3D017FFF401FFFFFFFFFFFFFFFF01FF010075
S113A3E0FFFFFFFF00C000000000000000000000AD
S113A3F0FFFFFFFF0000000000000000000000005D
S113A400FFFFFFFFFFFFFFFFFFFFFFFFFEBDFFFF9B
S3150400100018B572B64648474A016841F48041016002
S315040010104FF08A71D1604449CB7803F01F03CB703B
S315040010200B7843F004030B708B79DB06FCD513684D
S3150400103043F4007313603D4A3D4B1C6814401C6026
S315040010405C6822405A6000220A7224224A700022F6
S3150400105002E000BF009A521C0092009AB2F5965F15
S31504001060F7D3344B80221A7000220A73A2220A7024
S315040010708A799207FCD5CA7802F01F02CA70002248
S315040010800A7104224A714A7942F040024A718A7905
S315040010905206FCD50A7802F03F020A70002100913C
S315040010A04EF6602203E000BF0099491C00910099A6
S315040010B09142F8D30168090E05D101680902090AAB
S315040010C041F080710160416AC908C90041F002011A
S315040010D04162016821F480410160016841F0030125
S315040010E00160002102E000BF0099491C00910099AB
S315040010F0B1F5707FF7D3016841F48041016001685E
S31504001100890889000160016821F480410160BFF308
S315040011104F8FBFF36F8F62B607490848086011BD49
S3150400112000A00D403880044000400640FFF8FFFE52
S3150400113048900440005006400000FF1F000E270799
S31504001140DFF800F001FCFF1F10B500F055F8FFF7BB
S31504001150F7FF00F018F800F08FF80124204600F09D
S3150400116037F84FF4FA7000F09BF8204600F030F898
S315040011706400052C28BF012400F04FF80028EDD0A8
S3150400118000F0A4F8EAE73248016841F478510160B6
S315040011904FF480712F480160416081602E48816858
S315040011A041F480718160816841F4007181608168D5
S315040011B041F480618160016841F4807101600168D5
S315040011C041F400710160016841F4806101601AE034
S315040011D0C207214903D50A6842F480720A6082076D
S315040011E003D50A6842F400720A60400703D508680A
S315040011F040F4806008607047184A1AB118491948C3
S3150400120000F09EB8704718494FF48070086017487C
S31504001210016821F01001016070471548154A4168BC
S3150400122003781268491C002B06D1D2060AD4022977
S3150400123009D10121017005E0D20603D5022902D1A4
S3150400124001214170002141600178407808407047CF
S315040012503880044020B004408CF00F404001000068
S315040012600010000400FCFF1F1090044014F00F400F
S315040012700400FF1F10F00F40104800684FF47A7105
S31504001280B0FBF1F0401EB0F1807F08D20C490D4A44
S315040012904860F020107000208860072008607047BE
S315040012A00949086008680028FCD1704706480168A7
S315040012B011B10168491E0160704700000000FF1F5C
S315040012C010E000E023ED00E00C00FF1F30B58BB00A
S315040012D072B6174804682169496804A888474FF418
S315040012E02440002150F8042B4DF82120491C0429E0
S315040012F0F8D325690F4B2D694FF400624FF4204152
S3150400130004A8A8472469646910236A464FF4244153
S3150400131004A8A047BFF34F8F0748084A016801F4A1
S31504001320E06111430160BFF34F8F00BFFDE700BFCB
S315040013301C00001C6B66656B0CED00E00400FA05EE
S3150400134062B38B0708D0521E11F8013B00F8013B2B
S3150400135000F024808B07F6D1830740F0208000BF7D
S31504001360103A07D330B4B1E83810103AA0E8381070
S31504001370F9D230BC530724BFB1E80810A0E808101E
S3150400138044BF51F8043B40F8043BD20724BF31F86C
S31504001390022B20F8022B44BF0B7803707047083ADF
S315040013A007D3B1E80810083A40F8043B40F804CBE8
S315040013B0F7D25307E4E7FEE780B50E490E48086006
S315040013C00E490F48421A0F4888421CBF002AFFF7ED
S315040013D0B7FF0D480D49091A18BF00F01FF80C494C
S315040013E00C48421A04D0BDE808400B48FFF7A8BFD2
S315040013F001BD000008ED00E000A00000A4150004F3
S31504001400A81500040000FF1F0400FF1F1000FF1FA3
S31504001410000000000000000000000000002200F0B0
S3150400142001B80000401810F0030308D0C91A1FD3EE
S31504001430DB0748BF00F8012D28BF20F8022D130052
S3150400144030B414461546103928BF20E93C00FAD8B2
S31504001450490728BF20E90C0048BF40F8042D89003D
S3150400146028BF20F8022D48BF00F8012D30BC704774
S31504001470C91818BF00F8012DCB0728BF00F8012DA5
S31504001480704719E050F8041BCB0744BFA9F10103C8
S315040014905918121F0023042A41F8043BF9D25FEAC3
S315040014A0827C0B4604D54FF0000CA1F800C09B1CAF
S315040014B0D10744BF0021197050F8042B002AE1D14A
S315040014C0704710B450F8041B79B1026843681218C7
S315040014D00830DC0744BFA9F10104E31852F8044BB1
S315040014E043F8044B091FF9D1ECE710BC7047000020
S315040014F010B5074979441831064C7C44163404E087
S315040015000A68081D511888470146A142F8D110BD42
S3150400151008000000280000006BFFFFFF0C0000001D
S315040015200400FF1F000000009BFFFFFF04000000F3
S31504001530740000000000FF1F0000000072B603489C
S3150400154080470348804762B602480047A91500044D
S31504001550B91300049515000400F00BF8002801D017
S31504001560FFF7C6FF0020C046C046FFF7EDFD00F0BA
S3150400157002F80120704700F001B80000074638461B
S3150400158000F002F8FBE700002021090326311820A9
S31504001590ABBEF9E7C046C046C046C046FFF7DCFF0F
S30F040015A0FFF7FEBF00D8B805704738
S7050400153DA4
@@ -0,0 +1,156 @@
S01F00006C65645F64656D6F5F717370695F616C6961735F726F6D2E737265639A
S315040010000000032031190004AB170004AB170004D9
S31504001010AB170004AB170004AB1700040000000074
S31504001020000000000000000000000000AB170004F0
S31504001030AB17000400000000AB170004BD16000443
S3150400104095190004951900049519000495190004CE
S3150400105095190004951900049519000495190004BE
S3150400106095190004951900049519000495190004AE
S31504001070951900049519000495190004951900049E
S31504001080951900049519000495190004951900048E
S31504001090951900049519000495190004951900047E
S315040010A0951900049519000495190004951900046E
S315040010B0951900049519000495190004951900045E
S315040010C0951900049519000495190004951900044E
S315040010D0951900049519000495190004951900043E
S315040010E0951900049519000495190004951900042E
S315040010F0951900049519000495190004951900041E
S31504001100951900049519000495190004951900040D
S3150400111095190004951900049519000495190004FD
S3150400112095190004951900049519000495190004ED
S3150400113095190004951900049519000495190004DD
S3150400114095190004951900049519000495190004CD
S3150400115095190004951900049519000495190004BD
S3150400116095190004951900049519000495190004AD
S31504001170951900049519000495190004951900049D
S31504001180951900049519000495190004951900048D
S31504001190951900049519000495190004951900047D
S315040011A0951900049519000495190004951900046D
S315040011B0951900049519000495190004951900045D
S315040011C0951900049519000495190004951900044D
S315040011D0951900049519000495190004951900043D
S315040011E0951900049519000495190004951900042D
S315040011F0951900049519000495190004951900041D
S31504001200951900049519000495190004951900040C
S3150400121095190004951900049519000495190004FC
S3150400122095190004951900049519000495190004EC
S3150400123095190004951900049519000495190004DC
S3150400124095190004951900049519000495190004CC
S3150400125095190004951900049519000495190004BC
S3150400126095190004951900049519000495190004AC
S31504001270951900049519000495190004951900049C
S31504001280951900049519000495190004951900048C
S31504001290951900049519000495190004951900047C
S315040012A0951900049519000495190004951900046C
S315040012B0951900049519000495190004951900045C
S315040012C0951900049519000495190004951900044C
S315040012D0951900049519000495190004951900043C
S315040012E0951900049519000495190004951900042C
S315040012F0951900049519000495190004951900041C
S31504001300951900049519000495190004951900040B
S3150400131095190004951900049519000495190004FB
S3150400132095190004951900049519000495190004EB
S3150400133095190004951900049519000495190004DB
S3150400134095190004951900049519000495190004CB
S3150400135095190004951900049519000495190004BB
S3150400136095190004951900049519000495190004AB
S31504001370951900049519000495190004951900049B
S31504001380951900049519000495190004951900048B
S31504001390951900049519000495190004951900047B
S315040013A0951900049519000495190004951900046B
S315040013B0951900049519000495190004951900045B
S315040013C06B636667FFFFFFFFFFFFFFFFFFFFFFFF84
S315040013D017FFF401FFFFFFFFFFFFFFFF01FF0100FF
S315040013E0FFFFFFFF001000000000000000000000E7
S315040013F0FFFFFFFF000000000000000000000000E7
S31504001400FFFFFFFFFFFFFFFFFFFFFFFFFEBDFFFF25
S3150400141018B572B64648474A016841F480410160EE
S315040014204FF08A71D1604449CB7803F01F03CB7027
S315040014300B7843F004030B708B79DB06FCD5136839
S3150400144043F4007313603D4A3D4B1C6814401C6012
S315040014505C6822405A6000220A7224224A700022E2
S3150400146002E000BF009A521C0092009AB2F5965F01
S31504001470F7D3344B80221A7000220A73A2220A7010
S315040014808A799207FCD5CA7802F01F02CA70002234
S315040014900A7104224A714A7942F040024A718A79F1
S315040014A05206FCD50A7802F03F020A700021009128
S315040014B04EF6602203E000BF0099491C0091009992
S315040014C09142F8D30168090E05D101680902090A97
S315040014D041F080710160416AC908C90041F0020106
S315040014E04162016821F480410160016841F0030111
S315040014F00160002102E000BF0099491C0091009997
S31504001500B1F5707FF7D3016841F480410160016849
S31504001510890889000160016821F480410160BFF3F4
S315040015204F8FBFF36F8F62B607490848086011BD35
S3150400153000A00D403880044000400640FFF8FFFE3E
S3150400154048900440005006400000FF1F000E270785
S31504001550DFF800F001FCFF1F10B500F055F8FFF7A7
S31504001560F7FF00F018F800F08FF80124204600F089
S3150400157037F84FF4FA7000F09BF8204600F030F884
S315040015806400052C28BF012400F04FF80028EDD094
S3150400159000F0A4F8EAE73248016841F478510160A2
S315040015A04FF480712F480160416081602E48816844
S315040015B041F480718160816841F4007181608168C1
S315040015C041F480618160016841F4807101600168C1
S315040015D041F400710160016841F4806101601AE020
S315040015E0C207214903D50A6842F480720A60820759
S315040015F003D50A6842F400720A60400703D50868F6
S3150400160040F4806008607047184A1AB118491948AE
S3150400161000F090B8704718494FF480700860174876
S31504001620016821F01001016070471548154A4168A8
S3150400163003781268491C002B06D1D2060AD4022963
S3150400164009D10121017005E0D20603D5022902D190
S3150400165001214170002141600178407808407047BB
S315040016603880044020B004408CF00F404001000054
S315040016701014000400FCFF1F1090044014F00F40E7
S315040016800400FF1F10F00F40104800684FF47A71F1
S31504001690B0FBF1F0401EB0F1807F08D20C490D4A30
S315040016A04860F020107000208860072008607047AA
S315040016B00949086008680028FCD170470648016893
S315040016C011B10168491E0160704700000000FF1F48
S315040016D010E000E023ED00E00C00FF1F30B58BB0F6
S315040016E072B6124804682169496804A888474FF409
S315040016F08060002150F8042B4DF82120491C042950
S31504001700F8D325690A4B2D694FF40062002104A819
S31504001710A84725696D6910236A464FF4806104A8B9
S31504001720A8472168002088470BB030BD1C00001C68
S315040017306B66656B62B38B0708D0521E11F8013BCA
S3150400174000F8013B00F024808B07F6D1830740F0B4
S31504001750208000BF103A07D330B4B1E83810103AED
S31504001760A0E83810F9D230BC530724BFB1E80810FA
S31504001770A0E8081044BF51F8043B40F8043BD207E4
S3150400178024BF31F8022B20F8022B44BF0B780370D8
S315040017907047083A07D3B1E80810083A40F8043B02
S315040017A040F804CBF7D25307E4E7FEE780B50E49C9
S315040017B00E4808600E490F48421A0F4888421CBF5B
S315040017C0002AFFF7B7FF0D480D49091A18BF00F0A4
S315040017D01FF80C490C48421A04D0BDE808400B48CF
S315040017E0FFF7A8BF01BD000008ED00E000100004EB
S315040017F0981900049C1900040000FF1F0400FF1F31
S315040018001000FF1F000000000000000000000000A0
S31504001810002200F001B80000401810F0030308D0BD
S31504001820C91A1FD3DB0748BF00F8012D28BF20F8CB
S31504001830022D130030B414461546103928BF20E98A
S315040018403C00FAD8490728BF20E90C0048BF40F8F5
S31504001850042D890028BF20F8022D48BF00F8012D69
S3150400186030BC7047C91818BF00F8012DCB0728BF34
S3150400187000F8012D704719E050F8041BCB0744BF4C
S31504001880A9F101035918121F0023042A41F8043B45
S31504001890F9D25FEA827C0B4604D54FF0000CA1F81E
S315040018A000C09B1CD10744BF0021197050F8042BBB
S315040018B0002AE1D1704710B450F8041B79B10268CC
S315040018C0436812180830DC0744BFA9F10104E31881
S315040018D052F8044B43F8044B091FF9D1ECE710BC4A
S315040018E07047000010B5074979441831064C7C440A
S315040018F0163404E00A68081D511888470146A142B7
S31504001900F8D110BD08000000280000006BFFFFFF9F
S315040019100C0000000400FF1F000000009BFFFFFFF7
S3150400192004000000740000000000FF1F0000000017
S3150400193072B6034880470348804762B602480047A8
S315040019409D190004AD1700048919000400F00BF872
S31504001950002801D0FFF7C6FF0020C046C046FFF7A7
S31504001960FBFD00F002F80120704700F001B800000A
S315040019700746384600F002F8FBE700002021090379
S3150400198026311820ABBEF9E7C046C046C046C0465D
S31304001990FFF7DCFFFFF7FEBF00D8B80570476F
S70504001931AC
@@ -0,0 +1,157 @@
S01F00006C65645F64656D6F5F717370695F70617463685F726F6D2E7372656394
S1130000F0FF0220110500009B1300689B13006899
S11300109B1300689B1300689B130068000000009A
S11300200000000000000000000000009B130068B6
S11300309B130068000000009B130068AD12006869
S11300406915006869150068691500686915006814
S11300506915006869150068691500686915006804
S113006069150068691500686915006869150068F4
S113007069150068691500686915006869150068E4
S113008069150068691500686915006869150068D4
S113009069150068691500686915006869150068C4
S11300A069150068691500686915006869150068B4
S11300B069150068691500686915006869150068A4
S11300C06915006869150068691500686915006894
S11300D06915006869150068691500686915006884
S11300E06915006869150068691500686915006874
S11300F06915006869150068691500686915006864
S11301006915006869150068691500686915006853
S11301106915006869150068691500686915006843
S11301206915006869150068691500686915006833
S11301306915006869150068691500686915006823
S11301406915006869150068691500686915006813
S11301506915006869150068691500686915006803
S113016069150068691500686915006869150068F3
S113017069150068691500686915006869150068E3
S113018069150068691500686915006869150068D3
S113019069150068691500686915006869150068C3
S11301A069150068691500686915006869150068B3
S11301B069150068691500686915006869150068A3
S11301C06915006869150068691500686915006893
S11301D06915006869150068691500686915006883
S11301E06915006869150068691500686915006873
S11301F06915006869150068691500686915006863
S11302006915006869150068691500686915006852
S11302106915006869150068691500686915006842
S11302206915006869150068691500686915006832
S11302306915006869150068691500686915006822
S11302406915006869150068691500686915006812
S11302506915006869150068691500686915006802
S113026069150068691500686915006869150068F2
S113027069150068691500686915006869150068E2
S113028069150068691500686915006869150068D2
S113029069150068691500686915006869150068C2
S11302A069150068691500686915006869150068B2
S11302B069150068691500686915006869150068A2
S11302C06915006869150068691500686915006892
S11302D06915006869150068691500686915006882
S11302E06915006869150068691500686915006872
S11302F06915006869150068691500686915006862
S11303006915006869150068691500686915006851
S11303106915006869150068691500686915006841
S11303206915006869150068691500686915006831
S11303306915006869150068691500686915006821
S11303406915006869150068691500686915006811
S11303506915006869150068691500686915006801
S113036069150068691500686915006869150068F1
S113037069150068691500686915006869150068E1
S113038069150068691500686915006869150068D1
S113039069150068691500686915006869150068C1
S11303A069150068691500686915006869150068B1
S11303B069150068691500686915006869150068A1
S11303C06B636667FFFFFFFFFFFFFFFFFFFFFFFF9A
S11303D017FFB80BFFFFFFFFFFFFFFFF01FF010047
S11303E0FFFFFFFF001000000000000000000000FD
S11303F000200000000000000000000000000000D9
S1130400FFFFFFFFFFFFFFFFFFFFFFFFFEBDFFFF3B
S113051072B604488047044880470448804762B65E
S11305200348004735050000071400689D13006860
S11305305D1500684FF400500049084701000000B1
S3156800100018B572B64648474A016841F4804101609E
S315680010104FF08A71D1604449CB7803F01F03CB70D7
S315680010200B7843F004030B708B79DB06FCD51368E9
S3156800103043F4007313603D4A3D4B1C6814401C60C2
S315680010405C6822405A6000220A7224224A70002292
S3156800105002E000BF009A521C0092009AB2F5965FB1
S31568001060F7D3344B80221A7000220A73A2220A70C0
S315680010708A799207FCD5CA7802F01F02CA700022E4
S315680010800A7104224A714A7942F040024A718A79A1
S315680010905206FCD50A7802F03F020A7000210091D8
S315680010A04EF6602203E000BF0099491C0091009942
S315680010B09142F8D30168090E05D101680902090A47
S315680010C041F080710160416AC908C90041F00201B6
S315680010D04162016821F480410160016841F00301C1
S315680010E00160002102E000BF0099491C0091009947
S315680010F0B1F5707FF7D3016841F4804101600168FA
S31568001100890889000160016821F480410160BFF3A4
S315680011104F8FBFF36F8F62B607490848086011BDE5
S3156800112000A00D403880044000400640FFF8FFFEEE
S3156800113048900440005006400000FF1F000E270735
S31568001140DFF800F001FCFF1F10B500F055F8FFF757
S31568001150F7FF00F018F800F08FF80124204600F039
S3156800116037F84FF4FA7000F09BF8204600F030F834
S315680011706400052C28BF012400F04FF80028EDD044
S3156800118000F0A4F8EAE73248016841F47851016052
S315680011904FF480712F480160416081602E488168F4
S315680011A041F480718160816841F400718160816871
S315680011B041F480618160016841F480710160016871
S315680011C041F400710160016841F4806101601AE0D0
S315680011D0C207214903D50A6842F480720A60820709
S315680011E003D50A6842F400720A60400703D50868A6
S315680011F040F4806008607047184A1AB1184919485F
S3156800120000F090B8704718494FF480700860174826
S31568001210016821F01001016070471548154A416858
S3156800122003781268491C002B06D1D2060AD4022913
S3156800123009D10121017005E0D20603D5022902D140
S31568001240012141700021416001784078084070476B
S315680012503880044020B004408CF00F404001000004
S315680012600010006800FCFF1F1090044014F00F4047
S315680012700400FF1F10F00F40104800684FF47A71A1
S31568001280B0FBF1F0401EB0F1807F08D20C490D4AE0
S315680012904860F0201070002088600720086070475A
S315680012A00949086008680028FCD170470648016843
S315680012B011B10168491E0160704700000000FF1FF8
S315680012C010E000E023ED00E00C00FF1F30B58BB0A6
S315680012D072B6124804682169496804A888474FF4B9
S315680012E08060002150F8042B4DF82120491C042900
S315680012F0F8D325690A4B2D694FF40062002104A8CA
S31568001300A84725696D6910236A464FF4806104A869
S31568001310A8472168002088470BB030BD1C00001C18
S315680013206B66656B62B38B0708D0521E11F8013B7A
S3156800133000F8013B00F024808B07F6D1830740F064
S31568001340208000BF103A07D330B4B1E83810103A9D
S31568001350A0E83810F9D230BC530724BFB1E80810AA
S31568001360A0E8081044BF51F8043B40F8043BD20794
S3156800137024BF31F8022B20F8022B44BF0B78037088
S315680013807047083A07D3B1E80810083A40F8043BB2
S3156800139040F804CBF7D25307E4E7FEE780B50E4979
S315680013A00E4808600E490F48421A0F4888421CBF0B
S315680013B0002AFFF7B7FF0D480D49091A18BF00F054
S315680013C01FF80C490C48421A04D0BDE808400B487F
S315680013D0FFF7A8BF01BD000008ED00E000000000AF
S315680013E06C150068701500680000FF1F0400FF1F79
S315680013F01000FF1F00000000000000000000000051
S31568001400002200F001B87047401810F0030308D0B6
S31568001410C91A1FD3DB0748BF00F8012D28BF20F87B
S31568001420022D130030B414461546103928BF20E93A
S315680014303C00FAD8490728BF20E90C0048BF40F8A5
S31568001440042D890028BF20F8022D48BF00F8012D19
S3156800145030BC7047C91818BF00F8012DCB0728BFE4
S3156800146000F8012D704719E050F8041BCB0744BFFC
S31568001470A9F101035918121F0023042A41F8043BF5
S31568001480F9D25FEA827C0B4604D54FF0000CA1F8CE
S3156800149000C09B1CD10744BF0021197050F8042B6B
S315680014A0002AE1D1704710B450F8041B79B102687C
S315680014B0436812180830DC0744BFA9F10104E31831
S315680014C052F8044B43F8044B091FF9D1ECE710BCFA
S315680014D07047000010B5074979441831064C7C44BA
S315680014E0163404E00A68081D511888470146A14267
S315680014F0F8D110BD08000000280000006BFFFFFF50
S315680015000C0000000400FF1F000000009BFFFFFFA7
S3156800151004000000580000000000FF1F00000000E3
S3156800152000F00BF8002801D0FFF7D4FF0020C04672
S31568001530C046FFF709FE00F002F80120704700F088
S3156800154001B800000746384600F002F8FBE70000DD
S315680015502021090326311820ABBEF9E7C046C046EC
S31568001560C046C046FFF7DCFFFFF7FEBF00D8B805E8
S9030511E6

Some files were not shown because too many files have changed in this diff Show More