Import Mbed OS hard-float snapshot
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,255 @@
|
||||
/*
|
||||
** ###################################################################
|
||||
** Version: rev. 1.0, 2016-05-09
|
||||
** Build: b190225
|
||||
**
|
||||
** Abstract:
|
||||
** Chip specific module features.
|
||||
**
|
||||
** Copyright 2016 Freescale Semiconductor, Inc.
|
||||
** Copyright 2016-2019 NXP
|
||||
** All rights reserved.
|
||||
**
|
||||
** SPDX-License-Identifier: BSD-3-Clause
|
||||
**
|
||||
** http: www.nxp.com
|
||||
** mail: support@nxp.com
|
||||
**
|
||||
** Revisions:
|
||||
** - rev. 1.0 (2016-05-09)
|
||||
** Initial version.
|
||||
**
|
||||
** ###################################################################
|
||||
*/
|
||||
|
||||
#ifndef _LPC54114_cm4_FEATURES_H_
|
||||
#define _LPC54114_cm4_FEATURES_H_
|
||||
|
||||
/* SOC module features */
|
||||
|
||||
/* @brief ADC availability on the SoC. */
|
||||
#define FSL_FEATURE_SOC_ADC_COUNT (1)
|
||||
/* @brief ASYNC_SYSCON availability on the SoC. */
|
||||
#define FSL_FEATURE_SOC_ASYNC_SYSCON_COUNT (1)
|
||||
/* @brief CRC availability on the SoC. */
|
||||
#define FSL_FEATURE_SOC_CRC_COUNT (1)
|
||||
/* @brief CTIMER availability on the SoC. */
|
||||
#define FSL_FEATURE_SOC_CTIMER_COUNT (5)
|
||||
/* @brief DMA availability on the SoC. */
|
||||
#define FSL_FEATURE_SOC_DMA_COUNT (1)
|
||||
/* @brief DMIC availability on the SoC. */
|
||||
#define FSL_FEATURE_SOC_DMIC_COUNT (1)
|
||||
/* @brief FLEXCOMM availability on the SoC. */
|
||||
#define FSL_FEATURE_SOC_FLEXCOMM_COUNT (8)
|
||||
/* @brief GINT availability on the SoC. */
|
||||
#define FSL_FEATURE_SOC_GINT_COUNT (2)
|
||||
/* @brief GPIO availability on the SoC. */
|
||||
#define FSL_FEATURE_SOC_GPIO_COUNT (1)
|
||||
/* @brief I2C availability on the SoC. */
|
||||
#define FSL_FEATURE_SOC_I2C_COUNT (8)
|
||||
/* @brief I2S availability on the SoC. */
|
||||
#define FSL_FEATURE_SOC_I2S_COUNT (2)
|
||||
/* @brief INPUTMUX availability on the SoC. */
|
||||
#define FSL_FEATURE_SOC_INPUTMUX_COUNT (1)
|
||||
/* @brief IOCON availability on the SoC. */
|
||||
#define FSL_FEATURE_SOC_IOCON_COUNT (1)
|
||||
/* @brief MAILBOX availability on the SoC. */
|
||||
#define FSL_FEATURE_SOC_MAILBOX_COUNT (1)
|
||||
/* @brief MRT availability on the SoC. */
|
||||
#define FSL_FEATURE_SOC_MRT_COUNT (1)
|
||||
/* @brief PINT availability on the SoC. */
|
||||
#define FSL_FEATURE_SOC_PINT_COUNT (1)
|
||||
/* @brief RTC availability on the SoC. */
|
||||
#define FSL_FEATURE_SOC_RTC_COUNT (1)
|
||||
/* @brief SCT availability on the SoC. */
|
||||
#define FSL_FEATURE_SOC_SCT_COUNT (1)
|
||||
/* @brief SPI availability on the SoC. */
|
||||
#define FSL_FEATURE_SOC_SPI_COUNT (8)
|
||||
/* @brief SPIFI availability on the SoC. */
|
||||
#define FSL_FEATURE_SOC_SPIFI_COUNT (1)
|
||||
/* @brief SYSCON availability on the SoC. */
|
||||
#define FSL_FEATURE_SOC_SYSCON_COUNT (1)
|
||||
/* @brief USART availability on the SoC. */
|
||||
#define FSL_FEATURE_SOC_USART_COUNT (8)
|
||||
/* @brief USB availability on the SoC. */
|
||||
#define FSL_FEATURE_SOC_USB_COUNT (1)
|
||||
/* @brief UTICK availability on the SoC. */
|
||||
#define FSL_FEATURE_SOC_UTICK_COUNT (1)
|
||||
/* @brief WWDT availability on the SoC. */
|
||||
#define FSL_FEATURE_SOC_WWDT_COUNT (1)
|
||||
|
||||
/* ADC module features */
|
||||
|
||||
/* @brief Do not has input select (register INSEL). */
|
||||
#define FSL_FEATURE_ADC_HAS_NO_INSEL (0)
|
||||
/* @brief Has ASYNMODE bitfile in CTRL reigster. */
|
||||
#define FSL_FEATURE_ADC_HAS_CTRL_ASYNMODE (1)
|
||||
/* @brief Has ASYNMODE bitfile in CTRL reigster. */
|
||||
#define FSL_FEATURE_ADC_HAS_CTRL_RESOL (1)
|
||||
/* @brief Has ASYNMODE bitfile in CTRL reigster. */
|
||||
#define FSL_FEATURE_ADC_HAS_CTRL_BYPASSCAL (1)
|
||||
/* @brief Has ASYNMODE bitfile in CTRL reigster. */
|
||||
#define FSL_FEATURE_ADC_HAS_CTRL_TSAMP (1)
|
||||
/* @brief Has ASYNMODE bitfile in CTRL reigster. */
|
||||
#define FSL_FEATURE_ADC_HAS_CTRL_LPWRMODE (0)
|
||||
/* @brief Has ASYNMODE bitfile in CTRL reigster. */
|
||||
#define FSL_FEATURE_ADC_HAS_CTRL_CALMODE (0)
|
||||
/* @brief Has startup register. */
|
||||
#define FSL_FEATURE_ADC_HAS_STARTUP_REG (1)
|
||||
/* @brief Has ADTrim register */
|
||||
#define FSL_FEATURE_ADC_HAS_TRIM_REG (0)
|
||||
/* @brief Has Calibration register. */
|
||||
#define FSL_FEATURE_ADC_HAS_CALIB_REG (1)
|
||||
|
||||
/* DMA module features */
|
||||
|
||||
/* @brief Number of channels */
|
||||
#define FSL_FEATURE_DMA_NUMBER_OF_CHANNELS (20)
|
||||
/* @brief Align size of DMA descriptor */
|
||||
#define FSL_FEATURE_DMA_DESCRIPTOR_ALIGN_SIZE (512)
|
||||
/* @brief DMA head link descriptor table align size */
|
||||
#define FSL_FEATURE_DMA_LINK_DESCRIPTOR_ALIGN_SIZE (16U)
|
||||
|
||||
/* FLEXCOMM module features */
|
||||
|
||||
/* @brief FLEXCOMM0 USART INDEX 0 */
|
||||
#define FSL_FEATURE_FLEXCOMM0_USART_INDEX (0)
|
||||
/* @brief FLEXCOMM0 SPI INDEX 0 */
|
||||
#define FSL_FEATURE_FLEXCOMM0_SPI_INDEX (0)
|
||||
/* @brief FLEXCOMM0 I2C INDEX 0 */
|
||||
#define FSL_FEATURE_FLEXCOMM0_I2C_INDEX (0)
|
||||
/* @brief FLEXCOMM1 USART INDEX 1 */
|
||||
#define FSL_FEATURE_FLEXCOMM1_USART_INDEX (1)
|
||||
/* @brief FLEXCOMM1 SPI INDEX 1 */
|
||||
#define FSL_FEATURE_FLEXCOMM1_SPI_INDEX (1)
|
||||
/* @brief FLEXCOMM1 I2C INDEX 1 */
|
||||
#define FSL_FEATURE_FLEXCOMM1_I2C_INDEX (1)
|
||||
/* @brief FLEXCOMM2 USART INDEX 2 */
|
||||
#define FSL_FEATURE_FLEXCOMM2_USART_INDEX (2)
|
||||
/* @brief FLEXCOMM2 SPI INDEX 2 */
|
||||
#define FSL_FEATURE_FLEXCOMM2_SPI_INDEX (2)
|
||||
/* @brief FLEXCOMM2 I2C INDEX 2 */
|
||||
#define FSL_FEATURE_FLEXCOMM2_I2C_INDEX (2)
|
||||
/* @brief FLEXCOMM3 USART INDEX 3 */
|
||||
#define FSL_FEATURE_FLEXCOMM3_USART_INDEX (3)
|
||||
/* @brief FLEXCOMM3 SPI INDEX 3 */
|
||||
#define FSL_FEATURE_FLEXCOMM3_SPI_INDEX (3)
|
||||
/* @brief FLEXCOMM3 I2C INDEX 3 */
|
||||
#define FSL_FEATURE_FLEXCOMM3_I2C_INDEX (3)
|
||||
/* @brief FLEXCOMM4 USART INDEX 4 */
|
||||
#define FSL_FEATURE_FLEXCOMM4_USART_INDEX (4)
|
||||
/* @brief FLEXCOMM4 SPI INDEX 4 */
|
||||
#define FSL_FEATURE_FLEXCOMM4_SPI_INDEX (4)
|
||||
/* @brief FLEXCOMM4 I2C INDEX 4 */
|
||||
#define FSL_FEATURE_FLEXCOMM4_I2C_INDEX (4)
|
||||
/* @brief FLEXCOMM5 USART INDEX 5 */
|
||||
#define FSL_FEATURE_FLEXCOMM5_USART_INDEX (5)
|
||||
/* @brief FLEXCOMM5 SPI INDEX 5 */
|
||||
#define FSL_FEATURE_FLEXCOMM5_SPI_INDEX (5)
|
||||
/* @brief FLEXCOMM5 I2C INDEX 5 */
|
||||
#define FSL_FEATURE_FLEXCOMM5_I2C_INDEX (5)
|
||||
/* @brief FLEXCOMM6 USART INDEX 6 */
|
||||
#define FSL_FEATURE_FLEXCOMM6_USART_INDEX (6)
|
||||
/* @brief FLEXCOMM6 SPI INDEX 6 */
|
||||
#define FSL_FEATURE_FLEXCOMM6_SPI_INDEX (6)
|
||||
/* @brief FLEXCOMM6 I2C INDEX 6 */
|
||||
#define FSL_FEATURE_FLEXCOMM6_I2C_INDEX (6)
|
||||
/* @brief FLEXCOMM7 I2S INDEX 0 */
|
||||
#define FSL_FEATURE_FLEXCOMM6_I2S_INDEX (0)
|
||||
/* @brief FLEXCOMM7 USART INDEX 7 */
|
||||
#define FSL_FEATURE_FLEXCOMM7_USART_INDEX (7)
|
||||
/* @brief FLEXCOMM7 SPI INDEX 7 */
|
||||
#define FSL_FEATURE_FLEXCOMM7_SPI_INDEX (7)
|
||||
/* @brief FLEXCOMM7 I2C INDEX 7 */
|
||||
#define FSL_FEATURE_FLEXCOMM7_I2C_INDEX (7)
|
||||
/* @brief FLEXCOMM7 I2S INDEX 1 */
|
||||
#define FSL_FEATURE_FLEXCOMM7_I2S_INDEX (1)
|
||||
/* @brief I2S has DMIC interconnection */
|
||||
#define FSL_FEATURE_FLEXCOMM_INSTANCE_I2S_HAS_DMIC_INTERCONNECTIONn(x) \
|
||||
(((x) == FLEXCOMM0) ? (0) : \
|
||||
(((x) == FLEXCOMM1) ? (0) : \
|
||||
(((x) == FLEXCOMM2) ? (0) : \
|
||||
(((x) == FLEXCOMM3) ? (0) : \
|
||||
(((x) == FLEXCOMM4) ? (0) : \
|
||||
(((x) == FLEXCOMM5) ? (0) : \
|
||||
(((x) == FLEXCOMM6) ? (0) : \
|
||||
(((x) == FLEXCOMM7) ? (1) : (-1)))))))))
|
||||
|
||||
/* I2S module features */
|
||||
|
||||
/* @brief I2S support dual channel transfer */
|
||||
#define FSL_FEATURE_I2S_SUPPORT_SECONDARY_CHANNEL (0)
|
||||
/* @brief I2S has DMIC interconnection */
|
||||
#define FSL_FEATURE_FLEXCOMM_I2S_HAS_DMIC_INTERCONNECTION (1)
|
||||
|
||||
/* MAILBOX module features */
|
||||
|
||||
/* @brief Mailbox side for current core */
|
||||
#define FSL_FEATURE_MAILBOX_SIDE_A (1)
|
||||
/* @brief Mailbox has no reset control */
|
||||
#define FSL_FEATURE_MAILBOX_HAS_NO_RESET (1)
|
||||
|
||||
/* MRT module features */
|
||||
|
||||
/* @brief number of channels. */
|
||||
#define FSL_FEATURE_MRT_NUMBER_OF_CHANNELS (4)
|
||||
|
||||
/* interrupt module features */
|
||||
|
||||
/* @brief Lowest interrupt request number. */
|
||||
#define FSL_FEATURE_INTERRUPT_IRQ_MIN (-14)
|
||||
/* @brief Highest interrupt request number. */
|
||||
#define FSL_FEATURE_INTERRUPT_IRQ_MAX (105)
|
||||
|
||||
/* PINT module features */
|
||||
|
||||
/* @brief Number of connected outputs */
|
||||
#define FSL_FEATURE_PINT_NUMBER_OF_CONNECTED_OUTPUTS (8)
|
||||
|
||||
/* RTC module features */
|
||||
|
||||
/* @brief RTC has no reset control */
|
||||
#define FSL_FEATURE_RTC_HAS_NO_RESET (1)
|
||||
|
||||
/* SCT module features */
|
||||
|
||||
/* @brief Number of events */
|
||||
#define FSL_FEATURE_SCT_NUMBER_OF_EVENTS (10)
|
||||
/* @brief Number of states */
|
||||
#define FSL_FEATURE_SCT_NUMBER_OF_STATES (10)
|
||||
/* @brief Number of match capture */
|
||||
#define FSL_FEATURE_SCT_NUMBER_OF_MATCH_CAPTURE (10)
|
||||
/* @brief Number of outputs */
|
||||
#define FSL_FEATURE_SCT_NUMBER_OF_OUTPUTS (8)
|
||||
|
||||
/* SYSCON module features */
|
||||
|
||||
/* @brief Pointer to ROM IAP entry functions */
|
||||
#define FSL_FEATURE_SYSCON_IAP_ENTRY_LOCATION (0x03000205)
|
||||
/* @brief Flash page size in bytes */
|
||||
#define FSL_FEATURE_SYSCON_FLASH_PAGE_SIZE_BYTES (256)
|
||||
/* @brief Flash sector size in bytes */
|
||||
#define FSL_FEATURE_SYSCON_FLASH_SECTOR_SIZE_BYTES (32768)
|
||||
/* @brief Flash size in bytes */
|
||||
#define FSL_FEATURE_SYSCON_FLASH_SIZE_BYTES (262144)
|
||||
/* @brief IAP has Flash read & write function */
|
||||
#define FSL_FEATURE_IAP_HAS_FLASH_FUNCTION (1)
|
||||
/* @brief IAP has read Flash signature function */
|
||||
#define FSL_FEATURE_IAP_HAS_FLASH_SIGNATURE_READ (1)
|
||||
/* @brief IAP has read extended Flash signature function */
|
||||
#define FSL_FEATURE_IAP_HAS_FLASH_EXTENDED_SIGNATURE_READ (0)
|
||||
|
||||
/* SysTick module features */
|
||||
|
||||
/* @brief Systick has external reference clock. */
|
||||
#define FSL_FEATURE_SYSTICK_HAS_EXT_REF (0)
|
||||
/* @brief Systick external reference clock is core clock divided by this value. */
|
||||
#define FSL_FEATURE_SYSTICK_EXT_REF_CORE_DIV (0)
|
||||
|
||||
/* USB module features */
|
||||
|
||||
/* @brief Number of the endpoint in USB FS */
|
||||
#define FSL_FEATURE_USB_EP_NUM (5)
|
||||
|
||||
#endif /* _LPC54114_cm4_FEATURES_H_ */
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
Copyright 2016-2018 NXP
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted (subject to the limitations in the
|
||||
disclaimer below) provided that the following conditions are met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
|
||||
* Neither the name of the copyright holder nor the names of its
|
||||
contributors may be used to endorse or promote products derived from
|
||||
this software without specific prior written permission.
|
||||
|
||||
NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE
|
||||
GRANTED BY THIS LICENSE. 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.
|
||||
@@ -0,0 +1,133 @@
|
||||
#! armcc -E
|
||||
/*
|
||||
** ###################################################################
|
||||
** Processors: LPC54114J256BD64_cm4
|
||||
** LPC54114J256UK49_cm4
|
||||
**
|
||||
** Compiler: Keil ARM C/C++ Compiler
|
||||
** Reference manual: LPC5411x User manual Rev. 1.0 16 February 2016
|
||||
** Version: rev. 1.0, 2016-04-29
|
||||
** Build: b160526
|
||||
**
|
||||
** Abstract:
|
||||
** Linker file for the Keil ARM C/C++ Compiler
|
||||
**
|
||||
** Copyright (c) 2016 Freescale Semiconductor, Inc.
|
||||
** Copyright (c) 2016 NXP
|
||||
** 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 copyright holder 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.nxp.com
|
||||
** mail: support@nxp.com
|
||||
**
|
||||
** ###################################################################
|
||||
*/
|
||||
#define __ram_vector_table__ 1
|
||||
|
||||
#if (defined(__ram_vector_table__))
|
||||
#define __ram_vector_table_size__ 0x000000E0
|
||||
#else
|
||||
#define __ram_vector_table_size__ 0x00000000
|
||||
#endif
|
||||
|
||||
#define m_interrupts_start 0x00000000
|
||||
#define m_interrupts_size 0x000000E0
|
||||
|
||||
#define m_text_start 0x000000E0
|
||||
#define m_text_size 0x0002FF20
|
||||
|
||||
#define m_core1_image_start 0x00030000
|
||||
#define m_core1_image_size 0x00010000
|
||||
|
||||
#define m_interrupts_ram_start 0x20000000
|
||||
#define m_interrupts_ram_size __ram_vector_table_size__
|
||||
|
||||
#define m_rpmsg_sh_mem_start 0x20026800
|
||||
#define m_rpmsg_sh_mem_size 0x00001800
|
||||
|
||||
#define m_data_start (m_interrupts_ram_start + m_interrupts_ram_size)
|
||||
#define m_data_size (0x00010000 - m_interrupts_ram_size)
|
||||
|
||||
#define m_sramx_start 0x04000000
|
||||
#define m_sramx_size 0x00008000
|
||||
|
||||
/* Sizes */
|
||||
#if !defined(MBED_BOOT_STACK_SIZE)
|
||||
#define MBED_BOOT_STACK_SIZE 0x400
|
||||
#endif
|
||||
|
||||
#if (defined(__stack_size__))
|
||||
#define Stack_Size __stack_size__
|
||||
#else
|
||||
#define Stack_Size MBED_BOOT_STACK_SIZE
|
||||
#endif
|
||||
|
||||
#if (defined(__heap_size__))
|
||||
#define Heap_Size __heap_size__
|
||||
#else
|
||||
#define Heap_Size 0x0400
|
||||
#endif
|
||||
|
||||
LR_IROM1 m_interrupts_start m_text_start+m_text_size-m_interrupts_start { ; load region size_region
|
||||
VECTOR_ROM m_interrupts_start m_interrupts_size { ; load address = execution address
|
||||
* (RESET,+FIRST)
|
||||
}
|
||||
ER_IROM1 m_text_start m_text_size { ; load address = execution address
|
||||
* (InRoot$$Sections)
|
||||
.ANY (+RO)
|
||||
}
|
||||
ER_m_sramx m_sramx_start m_sramx_size { ; SRAMX memory
|
||||
* (sramx)
|
||||
}
|
||||
|
||||
#if (defined(__ram_vector_table__))
|
||||
VECTOR_RAM m_interrupts_ram_start EMPTY m_interrupts_ram_size {
|
||||
}
|
||||
#else
|
||||
VECTOR_RAM m_interrupts_start EMPTY 0 {
|
||||
}
|
||||
#endif
|
||||
|
||||
RW_m_data m_data_start m_data_size { ; RW data
|
||||
.ANY (+RW +ZI)
|
||||
}
|
||||
RW_IRAM1 ((ImageLimit(RW_m_data) == m_data_start) ? ImageLimit(RW_m_data) : +0) EMPTY Heap_Size { ; Heap region growing up
|
||||
}
|
||||
ARM_LIB_STACK m_data_start+m_data_size EMPTY -Stack_Size { ; Stack region growing down
|
||||
}
|
||||
|
||||
RPMSG_SH_MEM m_rpmsg_sh_mem_start UNINIT m_rpmsg_sh_mem_size { ; Shared memory used by RPMSG
|
||||
* (rpmsg_sh_mem_section)
|
||||
}
|
||||
}
|
||||
|
||||
LR_CORE1_IMAGE m_core1_image_start {
|
||||
CORE1_REGION m_core1_image_start m_core1_image_size {
|
||||
*(M0CODE)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
LPC54114 libpower.ar README
|
||||
|
||||
The libpower.ar library provides the following functions for optimized power management on LPC54114 devices. Features include:
|
||||
1. Simple APIs to control power consumption and wake-up in all power modes.
|
||||
2. Manage power consumption for sleep and active modes
|
||||
3. Prepare the part to enter low power modes (sleep, deep-sleep, and deep power-down).
|
||||
4. Configure wake-up from deep-sleep via functions enabled by bits in the PDRUNCFG registers.
|
||||
|
||||
The APIs provided by the library are fully described in the LPC54114 User Manual (document UM10914) which is available from https://www.nxp.com
|
||||
Binary file not shown.
@@ -0,0 +1,625 @@
|
||||
;/*****************************************************************************
|
||||
; * @file: startup_LPC54114_cm4.s
|
||||
; * @purpose: CMSIS Cortex-M4 Core Device Startup File for the
|
||||
; * LPC54114_cm4
|
||||
; * @version: 1.0
|
||||
; * @date: 2016-4-29
|
||||
; *
|
||||
; * Copyright: 1997 - 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.
|
||||
; *
|
||||
; *------- <<< Use Configuration Wizard in Context Menu >>> ------------------
|
||||
; *
|
||||
; *****************************************************************************/
|
||||
|
||||
PRESERVE8
|
||||
THUMB
|
||||
|
||||
; Vector Table Mapped to Address 0 at Reset
|
||||
AREA RESET, DATA, READONLY
|
||||
EXPORT __Vectors
|
||||
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
|
||||
DCD HardFault_Handler
|
||||
DCD MemManage_Handler
|
||||
DCD BusFault_Handler
|
||||
DCD UsageFault_Handler
|
||||
__vector_table_0x1c
|
||||
DCD 0 ; Checksum of the first 7 words
|
||||
DCD 0
|
||||
DCD 0 ; Enhanced image marker, set to 0x0 for legacy boot
|
||||
DCD 0 ; Pointer to enhanced boot block, set to 0x0 for legacy boot
|
||||
DCD SVC_Handler
|
||||
DCD DebugMon_Handler
|
||||
DCD 0
|
||||
DCD PendSV_Handler
|
||||
DCD SysTick_Handler
|
||||
|
||||
; External Interrupts
|
||||
DCD WDT_BOD_IRQHandler ; Windowed watchdog timer, Brownout detect
|
||||
DCD DMA0_IRQHandler ; DMA controller
|
||||
DCD GINT0_IRQHandler ; GPIO group 0
|
||||
DCD GINT1_IRQHandler ; GPIO group 1
|
||||
DCD PIN_INT0_IRQHandler ; Pin interrupt 0 or pattern match engine slice 0
|
||||
DCD PIN_INT1_IRQHandler ; Pin interrupt 1or pattern match engine slice 1
|
||||
DCD PIN_INT2_IRQHandler ; Pin interrupt 2 or pattern match engine slice 2
|
||||
DCD PIN_INT3_IRQHandler ; Pin interrupt 3 or pattern match engine slice 3
|
||||
DCD UTICK0_IRQHandler ; Micro-tick Timer
|
||||
DCD MRT0_IRQHandler ; Multi-rate timer
|
||||
DCD CTIMER0_IRQHandler ; Standard counter/timer CTIMER0
|
||||
DCD CTIMER1_IRQHandler ; Standard counter/timer CTIMER1
|
||||
DCD SCT0_IRQHandler ; SCTimer/PWM
|
||||
DCD CTIMER3_IRQHandler ; Standard counter/timer CTIMER3
|
||||
DCD FLEXCOMM0_IRQHandler ; Flexcomm Interface 0 (USART, SPI, I2C)
|
||||
DCD FLEXCOMM1_IRQHandler ; Flexcomm Interface 1 (USART, SPI, I2C)
|
||||
DCD FLEXCOMM2_IRQHandler ; Flexcomm Interface 2 (USART, SPI, I2C)
|
||||
DCD FLEXCOMM3_IRQHandler ; Flexcomm Interface 3 (USART, SPI, I2C)
|
||||
DCD FLEXCOMM4_IRQHandler ; Flexcomm Interface 4 (USART, SPI, I2C)
|
||||
DCD FLEXCOMM5_IRQHandler ; Flexcomm Interface 5 (USART, SPI, I2C)
|
||||
DCD FLEXCOMM6_IRQHandler ; Flexcomm Interface 6 (USART, SPI, I2C, I2S)
|
||||
DCD FLEXCOMM7_IRQHandler ; Flexcomm Interface 7 (USART, SPI, I2C, I2S)
|
||||
DCD ADC0_SEQA_IRQHandler ; ADC0 sequence A completion.
|
||||
DCD ADC0_SEQB_IRQHandler ; ADC0 sequence B completion.
|
||||
DCD ADC0_THCMP_IRQHandler ; ADC0 threshold compare and error.
|
||||
DCD DMIC0_IRQHandler ; Digital microphone and DMIC subsystem
|
||||
DCD HWVAD0_IRQHandler ; Hardware Voice Activity Detector
|
||||
DCD USB0_NEEDCLK_IRQHandler ; USB Activity Wake-up Interrupt
|
||||
DCD USB0_IRQHandler ; USB device
|
||||
DCD RTC_IRQHandler ; RTC alarm and wake-up interrupts
|
||||
DCD IOH_IRQHandler ; IOH
|
||||
DCD MAILBOX_IRQHandler ; Mailbox interrupt (present on selected devices)
|
||||
DCD PIN_INT4_IRQHandler ; Pin interrupt 4 or pattern match engine slice 4 int
|
||||
DCD PIN_INT5_IRQHandler ; Pin interrupt 5 or pattern match engine slice 5 int
|
||||
DCD PIN_INT6_IRQHandler ; Pin interrupt 6 or pattern match engine slice 6 int
|
||||
DCD PIN_INT7_IRQHandler ; Pin interrupt 7 or pattern match engine slice 7 int
|
||||
DCD CTIMER2_IRQHandler ; Standard counter/timer CTIMER2
|
||||
DCD CTIMER4_IRQHandler ; Standard counter/timer CTIMER4
|
||||
DCD Reserved54_IRQHandler ; Reserved interrupt
|
||||
DCD SPIFI0_IRQHandler ; SPI flash interface
|
||||
|
||||
; <h> Code Read Protection level (CRP)
|
||||
; <o> CRP_Level:
|
||||
; <0xFFFFFFFF=> Disabled
|
||||
; <0x4E697370=> NO_ISP
|
||||
; <0x12345678=> CRP1
|
||||
; <0x87654321=> CRP2
|
||||
; <0x43218765=> CRP3 (Are you sure?)
|
||||
; </h>
|
||||
CRP_Level EQU 0xFFFFFFFF
|
||||
|
||||
IF :LNOT::DEF:NO_CRP
|
||||
AREA |.ARM.__at_0x02FC|, CODE, READONLY
|
||||
CRP_Key DCD 0xFFFFFFFF
|
||||
ENDIF
|
||||
|
||||
AREA |.text|, CODE, READONLY
|
||||
|
||||
cpu_id EQU 0xE000ED00
|
||||
cpu_ctrl EQU 0x40000800
|
||||
coproc_boot EQU 0x40000804
|
||||
coproc_stack EQU 0x40000808
|
||||
|
||||
rel_vals
|
||||
DCD cpu_id, cpu_ctrl, coproc_boot, coproc_stack
|
||||
DCW 0xFFF, 0xC24
|
||||
|
||||
; Reset Handler - shared for both cores
|
||||
Reset_Handler PROC
|
||||
EXPORT Reset_Handler [WEAK]
|
||||
IMPORT SystemInit
|
||||
IMPORT __main
|
||||
|
||||
IF :LNOT::DEF:SLAVEBOOT
|
||||
; Both the M0+ and M4 core come via this shared startup code,
|
||||
; but the M0+ and M4 core have different vector tables.
|
||||
; Determine if the core executing this code is the master or
|
||||
; the slave and handle each core state individually.
|
||||
shared_boot_entry
|
||||
LDR r6, =rel_vals
|
||||
MOVS r4, #0 ; Flag for slave core (0)
|
||||
MOVS r5, #1
|
||||
|
||||
; Determine which core (M0+ or M4) this code is running on
|
||||
; r2 = (((*cpu_id) >> 4) & 0xFFF); (M4 core == 0xC24)
|
||||
get_current_core_id
|
||||
LDR r0, [r6, #0]
|
||||
LDR r1, [r0] ; r1 = CPU ID status
|
||||
LSRS r1, r1, #4 ; Right justify 12 CPU ID bits
|
||||
LDRH r2, [r6, #16] ; Mask for CPU ID bits
|
||||
ANDS r2, r1, r2 ; r2 = ARM COrtex CPU ID
|
||||
LDRH r3, [r6, #18] ; Mask for CPU ID bits
|
||||
CMP r3, r2 ; Core ID matches M4 identifier
|
||||
BNE get_master_status
|
||||
MOV r4, r5 ; Set flag for master core (1)
|
||||
|
||||
; Determine if M4 core is the master or slave
|
||||
; r3 = ((*cpu_ctrl) & 1); (0 == m0+, 1 == M4)
|
||||
get_master_status
|
||||
LDR r0, [r6, #4]
|
||||
LDR r3, [r0] ; r3 = SYSCON co-processor CPU control status
|
||||
ANDS r3, r3, r5 ; r3 = (Bit 0: 1 = M4 is master, 0 = M4 is slave)
|
||||
|
||||
; Select boot based on selected master core and core ID
|
||||
select_boot
|
||||
EORS r3, r3, r4 ; r4 = (Bit 0: 0 = master, 1 = slave)
|
||||
BNE slave_boot
|
||||
B normal_boot
|
||||
|
||||
; Slave boot
|
||||
slave_boot
|
||||
LDR r0, [r6, #8]
|
||||
LDR r2, [r0] ; r1 = SYSCON co-processor boot address
|
||||
CMP r2, #0 ; Slave boot address = 0 (not set up)?
|
||||
BEQ cpu_sleep
|
||||
LDR r0, [r6, #12]
|
||||
LDR r1, [r0] ; r5 = SYSCON co-processor stack address
|
||||
MOV sp, r1 ; Update slave CPU stack pointer
|
||||
; Be sure to update VTOR for the slave MCU to point to the
|
||||
; slave vector table in boot memory
|
||||
BX r2 ; Jump to slave boot address
|
||||
|
||||
; Slave isn't yet setup for system boot from the master
|
||||
; so sleep until the master sets it up and then reboots it
|
||||
cpu_sleep
|
||||
MOV sp, r5 ; Will force exception if something happens
|
||||
cpu_sleep_wfi
|
||||
WFI ; Sleep forever until master reboots
|
||||
B cpu_sleep_wfi
|
||||
ENDIF
|
||||
|
||||
; Normal boot for master/slave
|
||||
normal_boot
|
||||
LDR r0, =SystemInit
|
||||
BLX r0
|
||||
LDR r0, =__main
|
||||
BX r0
|
||||
ENDP
|
||||
|
||||
; Dummy Exception Handlers (infinite loops which can be modified)
|
||||
NMI_Handler PROC
|
||||
EXPORT NMI_Handler [WEAK]
|
||||
B .
|
||||
ENDP
|
||||
|
||||
HardFault_Handler \
|
||||
PROC
|
||||
EXPORT HardFault_Handler [WEAK]
|
||||
B .
|
||||
ENDP
|
||||
|
||||
MemManage_Handler PROC
|
||||
EXPORT MemManage_Handler [WEAK]
|
||||
B .
|
||||
ENDP
|
||||
|
||||
BusFault_Handler PROC
|
||||
EXPORT BusFault_Handler [WEAK]
|
||||
B .
|
||||
ENDP
|
||||
|
||||
UsageFault_Handler PROC
|
||||
EXPORT UsageFault_Handler [WEAK]
|
||||
B .
|
||||
ENDP
|
||||
|
||||
SVC_Handler PROC
|
||||
EXPORT SVC_Handler [WEAK]
|
||||
B .
|
||||
ENDP
|
||||
|
||||
DebugMon_Handler PROC
|
||||
EXPORT DebugMon_Handler [WEAK]
|
||||
B .
|
||||
ENDP
|
||||
|
||||
PendSV_Handler PROC
|
||||
EXPORT PendSV_Handler [WEAK]
|
||||
B .
|
||||
ENDP
|
||||
|
||||
SysTick_Handler PROC
|
||||
EXPORT SysTick_Handler [WEAK]
|
||||
B .
|
||||
ENDP
|
||||
|
||||
WDT_BOD_IRQHandler\
|
||||
PROC
|
||||
EXPORT WDT_BOD_IRQHandler [WEAK]
|
||||
LDR R0, =WDT_BOD_DriverIRQHandler
|
||||
BX R0
|
||||
ENDP
|
||||
|
||||
DMA0_IRQHandler\
|
||||
PROC
|
||||
EXPORT DMA0_IRQHandler [WEAK]
|
||||
LDR R0, =DMA0_DriverIRQHandler
|
||||
BX R0
|
||||
ENDP
|
||||
|
||||
GINT0_IRQHandler\
|
||||
PROC
|
||||
EXPORT GINT0_IRQHandler [WEAK]
|
||||
LDR R0, =GINT0_DriverIRQHandler
|
||||
BX R0
|
||||
ENDP
|
||||
|
||||
GINT1_IRQHandler\
|
||||
PROC
|
||||
EXPORT GINT1_IRQHandler [WEAK]
|
||||
LDR R0, =GINT1_DriverIRQHandler
|
||||
BX R0
|
||||
ENDP
|
||||
|
||||
PIN_INT0_IRQHandler\
|
||||
PROC
|
||||
EXPORT PIN_INT0_IRQHandler [WEAK]
|
||||
LDR R0, =PIN_INT0_DriverIRQHandler
|
||||
BX R0
|
||||
ENDP
|
||||
|
||||
PIN_INT1_IRQHandler\
|
||||
PROC
|
||||
EXPORT PIN_INT1_IRQHandler [WEAK]
|
||||
LDR R0, =PIN_INT1_DriverIRQHandler
|
||||
BX R0
|
||||
ENDP
|
||||
|
||||
PIN_INT2_IRQHandler\
|
||||
PROC
|
||||
EXPORT PIN_INT2_IRQHandler [WEAK]
|
||||
LDR R0, =PIN_INT2_DriverIRQHandler
|
||||
BX R0
|
||||
ENDP
|
||||
|
||||
PIN_INT3_IRQHandler\
|
||||
PROC
|
||||
EXPORT PIN_INT3_IRQHandler [WEAK]
|
||||
LDR R0, =PIN_INT3_DriverIRQHandler
|
||||
BX R0
|
||||
ENDP
|
||||
|
||||
UTICK0_IRQHandler\
|
||||
PROC
|
||||
EXPORT UTICK0_IRQHandler [WEAK]
|
||||
LDR R0, =UTICK0_DriverIRQHandler
|
||||
BX R0
|
||||
ENDP
|
||||
|
||||
MRT0_IRQHandler\
|
||||
PROC
|
||||
EXPORT MRT0_IRQHandler [WEAK]
|
||||
LDR R0, =MRT0_DriverIRQHandler
|
||||
BX R0
|
||||
ENDP
|
||||
|
||||
CTIMER0_IRQHandler\
|
||||
PROC
|
||||
EXPORT CTIMER0_IRQHandler [WEAK]
|
||||
LDR R0, =CTIMER0_DriverIRQHandler
|
||||
BX R0
|
||||
ENDP
|
||||
|
||||
CTIMER1_IRQHandler\
|
||||
PROC
|
||||
EXPORT CTIMER1_IRQHandler [WEAK]
|
||||
LDR R0, =CTIMER1_DriverIRQHandler
|
||||
BX R0
|
||||
ENDP
|
||||
|
||||
SCT0_IRQHandler\
|
||||
PROC
|
||||
EXPORT SCT0_IRQHandler [WEAK]
|
||||
LDR R0, =SCT0_DriverIRQHandler
|
||||
BX R0
|
||||
ENDP
|
||||
|
||||
CTIMER3_IRQHandler\
|
||||
PROC
|
||||
EXPORT CTIMER3_IRQHandler [WEAK]
|
||||
LDR R0, =CTIMER3_DriverIRQHandler
|
||||
BX R0
|
||||
ENDP
|
||||
|
||||
FLEXCOMM0_IRQHandler\
|
||||
PROC
|
||||
EXPORT FLEXCOMM0_IRQHandler [WEAK]
|
||||
LDR R0, =FLEXCOMM0_DriverIRQHandler
|
||||
BX R0
|
||||
ENDP
|
||||
|
||||
FLEXCOMM1_IRQHandler\
|
||||
PROC
|
||||
EXPORT FLEXCOMM1_IRQHandler [WEAK]
|
||||
LDR R0, =FLEXCOMM1_DriverIRQHandler
|
||||
BX R0
|
||||
ENDP
|
||||
|
||||
FLEXCOMM2_IRQHandler\
|
||||
PROC
|
||||
EXPORT FLEXCOMM2_IRQHandler [WEAK]
|
||||
LDR R0, =FLEXCOMM2_DriverIRQHandler
|
||||
BX R0
|
||||
ENDP
|
||||
|
||||
FLEXCOMM3_IRQHandler\
|
||||
PROC
|
||||
EXPORT FLEXCOMM3_IRQHandler [WEAK]
|
||||
LDR R0, =FLEXCOMM3_DriverIRQHandler
|
||||
BX R0
|
||||
ENDP
|
||||
|
||||
FLEXCOMM4_IRQHandler\
|
||||
PROC
|
||||
EXPORT FLEXCOMM4_IRQHandler [WEAK]
|
||||
LDR R0, =FLEXCOMM4_DriverIRQHandler
|
||||
BX R0
|
||||
ENDP
|
||||
|
||||
FLEXCOMM5_IRQHandler\
|
||||
PROC
|
||||
EXPORT FLEXCOMM5_IRQHandler [WEAK]
|
||||
LDR R0, =FLEXCOMM5_DriverIRQHandler
|
||||
BX R0
|
||||
ENDP
|
||||
|
||||
FLEXCOMM6_IRQHandler\
|
||||
PROC
|
||||
EXPORT FLEXCOMM6_IRQHandler [WEAK]
|
||||
LDR R0, =FLEXCOMM6_DriverIRQHandler
|
||||
BX R0
|
||||
ENDP
|
||||
|
||||
FLEXCOMM7_IRQHandler\
|
||||
PROC
|
||||
EXPORT FLEXCOMM7_IRQHandler [WEAK]
|
||||
LDR R0, =FLEXCOMM7_DriverIRQHandler
|
||||
BX R0
|
||||
ENDP
|
||||
|
||||
ADC0_SEQA_IRQHandler\
|
||||
PROC
|
||||
EXPORT ADC0_SEQA_IRQHandler [WEAK]
|
||||
LDR R0, =ADC0_SEQA_DriverIRQHandler
|
||||
BX R0
|
||||
ENDP
|
||||
|
||||
ADC0_SEQB_IRQHandler\
|
||||
PROC
|
||||
EXPORT ADC0_SEQB_IRQHandler [WEAK]
|
||||
LDR R0, =ADC0_SEQB_DriverIRQHandler
|
||||
BX R0
|
||||
ENDP
|
||||
|
||||
ADC0_THCMP_IRQHandler\
|
||||
PROC
|
||||
EXPORT ADC0_THCMP_IRQHandler [WEAK]
|
||||
LDR R0, =ADC0_THCMP_DriverIRQHandler
|
||||
BX R0
|
||||
ENDP
|
||||
|
||||
DMIC0_IRQHandler\
|
||||
PROC
|
||||
EXPORT DMIC0_IRQHandler [WEAK]
|
||||
LDR R0, =DMIC0_DriverIRQHandler
|
||||
BX R0
|
||||
ENDP
|
||||
|
||||
HWVAD0_IRQHandler\
|
||||
PROC
|
||||
EXPORT HWVAD0_IRQHandler [WEAK]
|
||||
LDR R0, =HWVAD0_DriverIRQHandler
|
||||
BX R0
|
||||
ENDP
|
||||
|
||||
USB0_NEEDCLK_IRQHandler\
|
||||
PROC
|
||||
EXPORT USB0_NEEDCLK_IRQHandler [WEAK]
|
||||
LDR R0, =USB0_NEEDCLK_DriverIRQHandler
|
||||
BX R0
|
||||
ENDP
|
||||
|
||||
USB0_IRQHandler\
|
||||
PROC
|
||||
EXPORT USB0_IRQHandler [WEAK]
|
||||
LDR R0, =USB0_DriverIRQHandler
|
||||
BX R0
|
||||
ENDP
|
||||
|
||||
RTC_IRQHandler\
|
||||
PROC
|
||||
EXPORT RTC_IRQHandler [WEAK]
|
||||
LDR R0, =RTC_DriverIRQHandler
|
||||
BX R0
|
||||
ENDP
|
||||
|
||||
IOH_IRQHandler\
|
||||
PROC
|
||||
EXPORT IOH_IRQHandler [WEAK]
|
||||
LDR R0, =IOH_DriverIRQHandler
|
||||
BX R0
|
||||
ENDP
|
||||
|
||||
MAILBOX_IRQHandler\
|
||||
PROC
|
||||
EXPORT MAILBOX_IRQHandler [WEAK]
|
||||
LDR R0, =MAILBOX_DriverIRQHandler
|
||||
BX R0
|
||||
ENDP
|
||||
|
||||
PIN_INT4_IRQHandler\
|
||||
PROC
|
||||
EXPORT PIN_INT4_IRQHandler [WEAK]
|
||||
LDR R0, =PIN_INT4_DriverIRQHandler
|
||||
BX R0
|
||||
ENDP
|
||||
|
||||
PIN_INT5_IRQHandler\
|
||||
PROC
|
||||
EXPORT PIN_INT5_IRQHandler [WEAK]
|
||||
LDR R0, =PIN_INT5_DriverIRQHandler
|
||||
BX R0
|
||||
ENDP
|
||||
|
||||
PIN_INT6_IRQHandler\
|
||||
PROC
|
||||
EXPORT PIN_INT6_IRQHandler [WEAK]
|
||||
LDR R0, =PIN_INT6_DriverIRQHandler
|
||||
BX R0
|
||||
ENDP
|
||||
|
||||
PIN_INT7_IRQHandler\
|
||||
PROC
|
||||
EXPORT PIN_INT7_IRQHandler [WEAK]
|
||||
LDR R0, =PIN_INT7_DriverIRQHandler
|
||||
BX R0
|
||||
ENDP
|
||||
|
||||
CTIMER2_IRQHandler\
|
||||
PROC
|
||||
EXPORT CTIMER2_IRQHandler [WEAK]
|
||||
LDR R0, =CTIMER2_DriverIRQHandler
|
||||
BX R0
|
||||
ENDP
|
||||
|
||||
CTIMER4_IRQHandler\
|
||||
PROC
|
||||
EXPORT CTIMER4_IRQHandler [WEAK]
|
||||
LDR R0, =CTIMER4_DriverIRQHandler
|
||||
BX R0
|
||||
ENDP
|
||||
|
||||
Reserved54_IRQHandler\
|
||||
PROC
|
||||
EXPORT Reserved54_IRQHandler [WEAK]
|
||||
LDR R0, =Reserved54_DriverIRQHandler
|
||||
BX R0
|
||||
ENDP
|
||||
|
||||
SPIFI0_IRQHandler\
|
||||
PROC
|
||||
EXPORT SPIFI0_IRQHandler [WEAK]
|
||||
LDR R0, =SPIFI0_DriverIRQHandler
|
||||
BX R0
|
||||
ENDP
|
||||
|
||||
Default_Handler PROC
|
||||
EXPORT WDT_BOD_DriverIRQHandler [WEAK]
|
||||
EXPORT DMA0_DriverIRQHandler [WEAK]
|
||||
EXPORT GINT0_DriverIRQHandler [WEAK]
|
||||
EXPORT GINT1_DriverIRQHandler [WEAK]
|
||||
EXPORT PIN_INT0_DriverIRQHandler [WEAK]
|
||||
EXPORT PIN_INT1_DriverIRQHandler [WEAK]
|
||||
EXPORT PIN_INT2_DriverIRQHandler [WEAK]
|
||||
EXPORT PIN_INT3_DriverIRQHandler [WEAK]
|
||||
EXPORT UTICK0_DriverIRQHandler [WEAK]
|
||||
EXPORT MRT0_DriverIRQHandler [WEAK]
|
||||
EXPORT CTIMER0_DriverIRQHandler [WEAK]
|
||||
EXPORT CTIMER1_DriverIRQHandler [WEAK]
|
||||
EXPORT SCT0_DriverIRQHandler [WEAK]
|
||||
EXPORT CTIMER3_DriverIRQHandler [WEAK]
|
||||
EXPORT FLEXCOMM0_DriverIRQHandler [WEAK]
|
||||
EXPORT FLEXCOMM1_DriverIRQHandler [WEAK]
|
||||
EXPORT FLEXCOMM2_DriverIRQHandler [WEAK]
|
||||
EXPORT FLEXCOMM3_DriverIRQHandler [WEAK]
|
||||
EXPORT FLEXCOMM4_DriverIRQHandler [WEAK]
|
||||
EXPORT FLEXCOMM5_DriverIRQHandler [WEAK]
|
||||
EXPORT FLEXCOMM6_DriverIRQHandler [WEAK]
|
||||
EXPORT FLEXCOMM7_DriverIRQHandler [WEAK]
|
||||
EXPORT ADC0_SEQA_DriverIRQHandler [WEAK]
|
||||
EXPORT ADC0_SEQB_DriverIRQHandler [WEAK]
|
||||
EXPORT ADC0_THCMP_DriverIRQHandler [WEAK]
|
||||
EXPORT DMIC0_DriverIRQHandler [WEAK]
|
||||
EXPORT HWVAD0_DriverIRQHandler [WEAK]
|
||||
EXPORT USB0_NEEDCLK_DriverIRQHandler [WEAK]
|
||||
EXPORT USB0_DriverIRQHandler [WEAK]
|
||||
EXPORT RTC_DriverIRQHandler [WEAK]
|
||||
EXPORT IOH_DriverIRQHandler [WEAK]
|
||||
EXPORT MAILBOX_DriverIRQHandler [WEAK]
|
||||
EXPORT PIN_INT4_DriverIRQHandler [WEAK]
|
||||
EXPORT PIN_INT5_DriverIRQHandler [WEAK]
|
||||
EXPORT PIN_INT6_DriverIRQHandler [WEAK]
|
||||
EXPORT PIN_INT7_DriverIRQHandler [WEAK]
|
||||
EXPORT CTIMER2_DriverIRQHandler [WEAK]
|
||||
EXPORT CTIMER4_DriverIRQHandler [WEAK]
|
||||
EXPORT Reserved54_DriverIRQHandler [WEAK]
|
||||
EXPORT SPIFI0_DriverIRQHandler [WEAK]
|
||||
|
||||
WDT_BOD_DriverIRQHandler
|
||||
DMA0_DriverIRQHandler
|
||||
GINT0_DriverIRQHandler
|
||||
GINT1_DriverIRQHandler
|
||||
PIN_INT0_DriverIRQHandler
|
||||
PIN_INT1_DriverIRQHandler
|
||||
PIN_INT2_DriverIRQHandler
|
||||
PIN_INT3_DriverIRQHandler
|
||||
UTICK0_DriverIRQHandler
|
||||
MRT0_DriverIRQHandler
|
||||
CTIMER0_DriverIRQHandler
|
||||
CTIMER1_DriverIRQHandler
|
||||
SCT0_DriverIRQHandler
|
||||
CTIMER3_DriverIRQHandler
|
||||
FLEXCOMM0_DriverIRQHandler
|
||||
FLEXCOMM1_DriverIRQHandler
|
||||
FLEXCOMM2_DriverIRQHandler
|
||||
FLEXCOMM3_DriverIRQHandler
|
||||
FLEXCOMM4_DriverIRQHandler
|
||||
FLEXCOMM5_DriverIRQHandler
|
||||
FLEXCOMM6_DriverIRQHandler
|
||||
FLEXCOMM7_DriverIRQHandler
|
||||
ADC0_SEQA_DriverIRQHandler
|
||||
ADC0_SEQB_DriverIRQHandler
|
||||
ADC0_THCMP_DriverIRQHandler
|
||||
DMIC0_DriverIRQHandler
|
||||
HWVAD0_DriverIRQHandler
|
||||
USB0_NEEDCLK_DriverIRQHandler
|
||||
USB0_DriverIRQHandler
|
||||
RTC_DriverIRQHandler
|
||||
IOH_DriverIRQHandler
|
||||
MAILBOX_DriverIRQHandler
|
||||
PIN_INT4_DriverIRQHandler
|
||||
PIN_INT5_DriverIRQHandler
|
||||
PIN_INT6_DriverIRQHandler
|
||||
PIN_INT7_DriverIRQHandler
|
||||
CTIMER2_DriverIRQHandler
|
||||
CTIMER4_DriverIRQHandler
|
||||
Reserved54_DriverIRQHandler
|
||||
SPIFI0_DriverIRQHandler
|
||||
|
||||
B .
|
||||
|
||||
ENDP
|
||||
|
||||
|
||||
ALIGN
|
||||
|
||||
|
||||
END
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
Copyright 2016-2018 NXP
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted (subject to the limitations in the
|
||||
disclaimer below) provided that the following conditions are met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
|
||||
* Neither the name of the copyright holder nor the names of its
|
||||
contributors may be used to endorse or promote products derived from
|
||||
this software without specific prior written permission.
|
||||
|
||||
NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE
|
||||
GRANTED BY THIS LICENSE. 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.
|
||||
@@ -0,0 +1,293 @@
|
||||
/*
|
||||
** ###################################################################
|
||||
** Processors: LPC54114J256_cm4
|
||||
**
|
||||
** Compiler: GNU C Compiler
|
||||
** Reference manual: LPC54114 Series Reference Manual, Rev. 0 , 11/2016
|
||||
** Version: rev. 1.0, 2016-11-02
|
||||
** Build: b161214
|
||||
**
|
||||
** Abstract:
|
||||
** Linker file for the GNU C Compiler
|
||||
**
|
||||
** Copyright (c) 2016 Freescale Semiconductor, Inc.
|
||||
** Copyright (c) 2016 - 2017 , NXP
|
||||
** 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 copyright holder 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
|
||||
**
|
||||
** Copyright (c) 2016 NXP Semiconductors, 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 NXP Semiconductors, 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.nxp.com
|
||||
** mail: support@nxp.com
|
||||
**
|
||||
** ###################################################################
|
||||
*/
|
||||
/* Entry Point */
|
||||
ENTRY(Reset_Handler)
|
||||
|
||||
__ram_vector_table__ = 1;
|
||||
|
||||
#if !defined(MBED_BOOT_STACK_SIZE)
|
||||
#define MBED_BOOT_STACK_SIZE 0x400
|
||||
#endif
|
||||
|
||||
__stack_size__ = MBED_BOOT_STACK_SIZE;
|
||||
STACK_SIZE = DEFINED(__stack_size__) ? __stack_size__ : 0x0800;
|
||||
M_VECTOR_RAM_SIZE = DEFINED(__ram_vector_table__) ? 0xE4 : 0x0;
|
||||
RPMSG_SHMEM_SIZE = DEFINED(__use_shmem__) ? 0x1800 : 0;
|
||||
|
||||
|
||||
/* Specify the memory areas */
|
||||
MEMORY
|
||||
{
|
||||
m_interrupts (RX) : ORIGIN = 0x00000000, LENGTH = 0x000000E4
|
||||
m_text (RX) : ORIGIN = 0x000000E4, LENGTH = 0x0002FF1C
|
||||
m_core1_image (RX) : ORIGIN = 0x00030000, LENGTH = 0x00010000
|
||||
m_data (RW) : ORIGIN = 0x20000000, LENGTH = 0x00010000
|
||||
rpmsg_sh_mem (RW) : ORIGIN = 0x20026800, LENGTH = RPMSG_SHMEM_SIZE
|
||||
|
||||
}
|
||||
|
||||
/* Define output sections */
|
||||
SECTIONS
|
||||
{
|
||||
/* section for storing the secondary core image */
|
||||
.m0code :
|
||||
{
|
||||
. = ALIGN(8) ;
|
||||
KEEP (*(.m0code))
|
||||
*(.m0code*)
|
||||
. = ALIGN(8) ;
|
||||
} > m_core1_image
|
||||
|
||||
/* NOINIT section for rpmsg_sh_mem */
|
||||
.noinit_rpmsg_sh_mem (NOLOAD) : ALIGN(8)
|
||||
{
|
||||
*(.noinit.$rpmsg_sh_mem*)
|
||||
. = ALIGN(8) ;
|
||||
} > rpmsg_sh_mem
|
||||
|
||||
/* The startup code goes first into internal flash */
|
||||
.interrupts :
|
||||
{
|
||||
__VECTOR_TABLE = .;
|
||||
. = ALIGN(8);
|
||||
KEEP(*(.isr_vector)) /* Startup code */
|
||||
. = ALIGN(8);
|
||||
} > m_interrupts
|
||||
|
||||
/* The program code and other data goes into internal flash */
|
||||
.text :
|
||||
{
|
||||
. = ALIGN(8);
|
||||
*(.text) /* .text sections (code) */
|
||||
*(.text*) /* .text* sections (code) */
|
||||
*(.rodata) /* .rodata sections (constants, strings, etc.) */
|
||||
*(.rodata*) /* .rodata* sections (constants, strings, etc.) */
|
||||
*(.glue_7) /* glue arm to thumb code */
|
||||
*(.glue_7t) /* glue thumb to arm code */
|
||||
*(.eh_frame)
|
||||
KEEP (*(.init))
|
||||
KEEP (*(.fini))
|
||||
. = ALIGN(8);
|
||||
} > m_text
|
||||
|
||||
.ARM.extab :
|
||||
{
|
||||
*(.ARM.extab* .gnu.linkonce.armextab.*)
|
||||
} > m_text
|
||||
|
||||
.ARM :
|
||||
{
|
||||
__exidx_start = .;
|
||||
*(.ARM.exidx*)
|
||||
__exidx_end = .;
|
||||
} > m_text
|
||||
|
||||
.ctors :
|
||||
{
|
||||
__CTOR_LIST__ = .;
|
||||
/* gcc uses crtbegin.o to find the start of
|
||||
the constructors, so we make sure it is
|
||||
first. Because this is a wildcard, it
|
||||
doesn't matter if the user does not
|
||||
actually link against crtbegin.o; the
|
||||
linker won't look for a file to match a
|
||||
wildcard. The wildcard also means that it
|
||||
doesn't matter which directory crtbegin.o
|
||||
is in. */
|
||||
KEEP (*crtbegin.o(.ctors))
|
||||
KEEP (*crtbegin?.o(.ctors))
|
||||
/* We don't want to include the .ctor section from
|
||||
from the crtend.o file until after the sorted ctors.
|
||||
The .ctor section from the crtend file contains the
|
||||
end of ctors marker and it must be last */
|
||||
KEEP (*(EXCLUDE_FILE(*crtend?.o *crtend.o) .ctors))
|
||||
KEEP (*(SORT(.ctors.*)))
|
||||
KEEP (*(.ctors))
|
||||
__CTOR_END__ = .;
|
||||
} > m_text
|
||||
|
||||
.dtors :
|
||||
{
|
||||
__DTOR_LIST__ = .;
|
||||
KEEP (*crtbegin.o(.dtors))
|
||||
KEEP (*crtbegin?.o(.dtors))
|
||||
KEEP (*(EXCLUDE_FILE(*crtend?.o *crtend.o) .dtors))
|
||||
KEEP (*(SORT(.dtors.*)))
|
||||
KEEP (*(.dtors))
|
||||
__DTOR_END__ = .;
|
||||
} > m_text
|
||||
|
||||
.preinit_array :
|
||||
{
|
||||
PROVIDE_HIDDEN (__preinit_array_start = .);
|
||||
KEEP (*(.preinit_array*))
|
||||
PROVIDE_HIDDEN (__preinit_array_end = .);
|
||||
} > m_text
|
||||
|
||||
.init_array :
|
||||
{
|
||||
PROVIDE_HIDDEN (__init_array_start = .);
|
||||
KEEP (*(SORT(.init_array.*)))
|
||||
KEEP (*(.init_array*))
|
||||
PROVIDE_HIDDEN (__init_array_end = .);
|
||||
} > m_text
|
||||
|
||||
.fini_array :
|
||||
{
|
||||
PROVIDE_HIDDEN (__fini_array_start = .);
|
||||
KEEP (*(SORT(.fini_array.*)))
|
||||
KEEP (*(.fini_array*))
|
||||
PROVIDE_HIDDEN (__fini_array_end = .);
|
||||
} > m_text
|
||||
|
||||
__etext = .; /* define a global symbol at end of code */
|
||||
__DATA_ROM = .; /* Symbol is used by startup for data initialization */
|
||||
|
||||
.interrupts_ram :
|
||||
{
|
||||
. = ALIGN(8);
|
||||
__VECTOR_RAM__ = .;
|
||||
__interrupts_ram_start__ = .; /* Create a global symbol at data start */
|
||||
*(.m_interrupts_ram) /* This is a user defined section */
|
||||
. += M_VECTOR_RAM_SIZE;
|
||||
. = ALIGN(8);
|
||||
__interrupts_ram_end__ = .; /* Define a global symbol at data end */
|
||||
} > m_data
|
||||
|
||||
__VECTOR_RAM = DEFINED(__ram_vector_table__) ? __VECTOR_RAM__ : ORIGIN(m_interrupts);
|
||||
__RAM_VECTOR_TABLE_SIZE_BYTES = DEFINED(__ram_vector_table__) ? (__interrupts_ram_end__ - __interrupts_ram_start__) : 0x0;
|
||||
|
||||
.data : AT(__DATA_ROM)
|
||||
{
|
||||
. = ALIGN(8);
|
||||
__DATA_RAM = .;
|
||||
__data_start__ = .; /* create a global symbol at data start */
|
||||
*(.ramfunc*) /* for functions in ram */
|
||||
*(.data) /* .data sections */
|
||||
*(.data*) /* .data* sections */
|
||||
KEEP(*(.jcr*))
|
||||
. = ALIGN(8);
|
||||
__data_end__ = .; /* define a global symbol at data end */
|
||||
} > m_data
|
||||
|
||||
__DATA_END = __DATA_ROM + (__data_end__ - __data_start__);
|
||||
text_end = ORIGIN(m_text) + LENGTH(m_text);
|
||||
ASSERT(__DATA_END <= text_end, "region m_text overflowed with text and data")
|
||||
|
||||
/* Uninitialized data section */
|
||||
.bss :
|
||||
{
|
||||
/* This is used by the startup in order to initialize the .bss section */
|
||||
. = ALIGN(8);
|
||||
__START_BSS = .;
|
||||
__bss_start__ = .;
|
||||
*(.bss)
|
||||
*(.bss*)
|
||||
*(COMMON)
|
||||
. = ALIGN(8);
|
||||
__bss_end__ = .;
|
||||
__END_BSS = .;
|
||||
} > m_data
|
||||
|
||||
.heap :
|
||||
{
|
||||
. = ALIGN(8);
|
||||
__end__ = .;
|
||||
PROVIDE(end = .);
|
||||
__HeapBase = .;
|
||||
. = ORIGIN(m_data) + LENGTH(m_data) - STACK_SIZE;
|
||||
__HeapLimit = .;
|
||||
__heap_limit = .; /* Add for _sbrk */
|
||||
} > m_data
|
||||
|
||||
.stack :
|
||||
{
|
||||
. = ALIGN(8);
|
||||
. += STACK_SIZE;
|
||||
} > m_data
|
||||
|
||||
/* Initializes stack on the end of block */
|
||||
__StackTop = ORIGIN(m_data) + LENGTH(m_data);
|
||||
__StackLimit = __StackTop - STACK_SIZE;
|
||||
PROVIDE(__stack = __StackTop);
|
||||
|
||||
.ARM.attributes 0 : { *(.ARM.attributes) }
|
||||
|
||||
ASSERT(__StackLimit >= __HeapLimit, "region m_data overflowed with stack and heap")
|
||||
}
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
LPC54114 libpower.a README
|
||||
|
||||
The libpower.a library provides the following functions for optimized power management on LPC54114 devices. Features include:
|
||||
1. Simple APIs to control power consumption and wake-up in all power modes.
|
||||
2. Manage power consumption for sleep and active modes
|
||||
3. Prepare the part to enter low power modes (sleep, deep-sleep, and deep power-down).
|
||||
4. Configure wake-up from deep-sleep via functions enabled by bits in the PDRUNCFG registers.
|
||||
|
||||
The APIs provided by the library are fully described in the LPC54114 User Manual (document UM10914) which is available from https://www.nxp.com
|
||||
Binary file not shown.
@@ -0,0 +1,791 @@
|
||||
/* ---------------------------------------------------------------------------------------*/
|
||||
/* @file: startup_LPC54114_cm4.S */
|
||||
/* @purpose: CMSIS Cortex-M4 Core Device Startup File */
|
||||
/* LPC54114_cm4 */
|
||||
/* @version: 1.0 */
|
||||
/* @date: 2016-11-2 */
|
||||
/* @build: b161214 */
|
||||
/* ---------------------------------------------------------------------------------------*/
|
||||
/* */
|
||||
/* Copyright (c) 1997 - 2016 , Freescale Semiconductor, Inc. */
|
||||
/* Copyright (c) 2016 - 2017 , NXP */
|
||||
/* */
|
||||
/* 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 copyright holder 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. */
|
||||
/* */
|
||||
/* Copyright (c) 2016 , NXP Semiconductors, 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 NXP Semiconductors, 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 __Vectors
|
||||
__Vectors:
|
||||
.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 WDT_BOD_IRQHandler /* Watchdog Timer, Brownout detect */
|
||||
.long DMA0_IRQHandler /* DMA controller interrupt */
|
||||
.long GINT0_IRQHandler /* GPIO group 0 */
|
||||
.long GINT1_IRQHandler /* GPIO group 1 */
|
||||
.long PIN_INT0_IRQHandler /* Pin interrupt 0 or pattern match engine slice 0 */
|
||||
.long PIN_INT1_IRQHandler /* Pin interrupt 1 or pattern match engine slice 1 */
|
||||
.long PIN_INT2_IRQHandler /* Pin interrupt 2 or pattern match engine slice 2 */
|
||||
.long PIN_INT3_IRQHandler /* Pin interrupt 3 or pattern match engine slice 3 */
|
||||
.long UTICK0_IRQHandler /* Micro-tick Timer */
|
||||
.long MRT0_IRQHandler /* Multi-rate timer */
|
||||
.long CTIMER0_IRQHandler /* Standard counter/timer CTIMER0 */
|
||||
.long CTIMER1_IRQHandler /* Standard counter/timer CTIMER1 */
|
||||
.long SCT0_IRQHandler /* SCTimer/PWM */
|
||||
.long CTIMER3_IRQHandler /* Standard counter/timer CTIMER3 */
|
||||
.long FLEXCOMM0_IRQHandler /* Flexcomm Interface 0 (USART, SPI, I2C, FLEXCOMM) */
|
||||
.long FLEXCOMM1_IRQHandler /* Flexcomm Interface 1 (USART, SPI, I2C, FLEXCOMM) */
|
||||
.long FLEXCOMM2_IRQHandler /* Flexcomm Interface 2 (USART, SPI, I2C, FLEXCOMM) */
|
||||
.long FLEXCOMM3_IRQHandler /* Flexcomm Interface 3 (USART, SPI, I2C, FLEXCOMM) */
|
||||
.long FLEXCOMM4_IRQHandler /* Flexcomm Interface 4 (USART, SPI, I2C, FLEXCOMM) */
|
||||
.long FLEXCOMM5_IRQHandler /* Flexcomm Interface 5 (USART, SPI, I2C, FLEXCOMM) */
|
||||
.long FLEXCOMM6_IRQHandler /* Flexcomm Interface 6 (USART, SPI, I2C, FLEXCOMM) */
|
||||
.long FLEXCOMM7_IRQHandler /* Flexcomm Interface 7 (USART, SPI, I2C, FLEXCOMM) */
|
||||
.long ADC0_SEQA_IRQHandler /* ADC0 sequence A completion */
|
||||
.long ADC0_SEQB_IRQHandler /* ADC0 sequence B completion */
|
||||
.long ADC0_THCMP_IRQHandler /* ADC0 threshold compare and error. */
|
||||
.long DMIC0_IRQHandler /* RTC alarm and wake-up interrupts */
|
||||
.long HWVAD0_IRQHandler /* Hardware Voice Activity Detector */
|
||||
.long USB0_NEEDCLK_IRQHandler /* USB Activity Wake-up Interrupt */
|
||||
.long USB0_IRQHandler /* USB device */
|
||||
.long RTC_IRQHandler /* RTC alarm and wake-up interrupts */
|
||||
.long IOH_IRQHandler /* IOH interrupt */
|
||||
.long MAILBOX_IRQHandler /* Mailbox interrupt */
|
||||
.long PIN_INT4_IRQHandler /* Pin interrupt 4 or pattern match engine slice 4 int */
|
||||
.long PIN_INT5_IRQHandler /* Pin interrupt 5 or pattern match engine slice 5 int */
|
||||
.long PIN_INT6_IRQHandler /* Pin interrupt 6 or pattern match engine slice 6 int */
|
||||
.long PIN_INT7_IRQHandler /* Pin interrupt 7 or pattern match engine slice 7 int */
|
||||
.long CTIMER2_IRQHandler /* Standard counter/timer CTIMER2 */
|
||||
.long CTIMER4_IRQHandler /* Standard counter/timer CTIMER4 */
|
||||
.long 0 /* Reserved interrupt */
|
||||
.long SPIFI0_IRQHandler /* SPI flash interface */
|
||||
.size __Vectors, . - __Vectors
|
||||
|
||||
|
||||
|
||||
.text
|
||||
.thumb
|
||||
#ifndef SLAVEBOOT
|
||||
rel_vals:
|
||||
.long 0xE000ED00 /* cpu_id */
|
||||
.long 0x40000800 /* cpu_ctrl */
|
||||
.long 0x40000804 /* coproc_boot */
|
||||
.long 0x40000808 /* coproc_stack */
|
||||
.short 0x0FFF
|
||||
.short 0x0C24
|
||||
#endif
|
||||
/* Reset Handler */
|
||||
|
||||
.thumb_func
|
||||
.align 2
|
||||
.globl Reset_Handler
|
||||
.weak Reset_Handler
|
||||
.type Reset_Handler, %function
|
||||
|
||||
Reset_Handler:
|
||||
#ifndef SLAVEBOOT
|
||||
/* Both the M0+ and M4 core come via this shared startup code,
|
||||
* but the M0+ and M4 core have different vector tables.
|
||||
* Determine if the core executing this code is the master or
|
||||
* the slave and handle each core state individually. */
|
||||
|
||||
shared_boot_entry:
|
||||
ldr r6, =rel_vals
|
||||
|
||||
/* Flag for slave core (0) */
|
||||
movs r4, 0
|
||||
movs r5, 1
|
||||
|
||||
/* Determine which core (M0+ or M4) this code is running on */
|
||||
/* r2 = (((*cpu_id) >> 4) & 0xFFF); (M4 core == 0xC24) */
|
||||
get_current_core_id:
|
||||
ldr r0, [r6, #0]
|
||||
ldr r1, [r0] /* r1 = CPU ID status */
|
||||
lsrs r1, r1, #4 /* Right justify 12 CPU ID bits */
|
||||
ldrh r2, [r6, #16] /* Mask for CPU ID bits */
|
||||
ands r2, r1, r2 /* r2 = ARM COrtex CPU ID */
|
||||
ldrh r3, [r6, #18] /* Mask for CPU ID bits */
|
||||
cmp r3, r2 /* Core ID matches M4 identifier */
|
||||
bne get_master_status
|
||||
mov r4, r5 /* Set flag for master core (1) */
|
||||
|
||||
/* Determine if M4 core is the master or slave */
|
||||
/* r3 = ((*cpu_ctrl) & 1); (0 == m0+, 1 == M4) */
|
||||
get_master_status:
|
||||
ldr r0, [r6, #4]
|
||||
ldr r3, [r0] /* r3 = SYSCON co-processor CPU control status */
|
||||
|
||||
ands r3, r3, r5 /* r3 = (Bit 0: 1 = M4 is master, 0 = M4 is slave) */
|
||||
|
||||
/* Select boot based on selected master core and core ID */
|
||||
|
||||
select_boot:
|
||||
eors r3, r3, r4 /* r4 = (Bit 0: 0 = master, 1 = slave) */
|
||||
|
||||
bne slave_boot
|
||||
b normal_boot
|
||||
|
||||
/* Slave boot */
|
||||
slave_boot:
|
||||
ldr r0, [r6, #8]
|
||||
ldr r2, [r0] /* r1 = SYSCON co-processor boot address */
|
||||
|
||||
cmp r2, #0 /* Slave boot address = 0 (not set up)? */
|
||||
|
||||
beq cpu_sleep
|
||||
ldr r0, [r6, #12]
|
||||
ldr r1, [r0] /* r5 = SYSCON co-processor stack address */
|
||||
|
||||
mov sp, r1 /* Update slave CPU stack pointer */
|
||||
|
||||
/* Be sure to update VTOR for the slave MCU to point to the */
|
||||
/* slave vector table in boot memory */
|
||||
bx r2 /* Jump to slave boot address */
|
||||
|
||||
/* Slave isn't yet setup for system boot from the master */
|
||||
/* so sleep until the master sets it up and then reboots it */
|
||||
cpu_sleep:
|
||||
mov sp, r5 /* Will force exception if something happens */
|
||||
cpu_sleep_wfi:
|
||||
wfi /* Sleep forever until master reboots */
|
||||
b cpu_sleep_wfi
|
||||
#endif /* defined(SLAVEBOOT) */
|
||||
|
||||
#ifndef __START
|
||||
#define __START _start
|
||||
#endif
|
||||
#ifndef __ATOLLIC__
|
||||
normal_boot:
|
||||
#ifndef __NO_SYSTEM_INIT
|
||||
ldr r0,=SystemInit
|
||||
blx r0
|
||||
#endif
|
||||
/* Loop to copy data from read only memory to RAM. The ranges
|
||||
* of copy from/to are specified by following symbols evaluated in
|
||||
* linker script.
|
||||
* __etext: End of code section, i.e., begin of data sections to copy from.
|
||||
* __data_start__/__data_end__: RAM address range that data should be
|
||||
* copied to. Both must be aligned to 4 bytes boundary. */
|
||||
|
||||
ldr r1, =__etext
|
||||
ldr r2, =__data_start__
|
||||
ldr r3, =__data_end__
|
||||
|
||||
#if 1
|
||||
/* Here are two copies of loop implemenations. First one favors code size
|
||||
* and the second one favors performance. Default uses the first one.
|
||||
* Change to "#if 0" to use the second one */
|
||||
.LC0:
|
||||
cmp r2, r3
|
||||
ittt lt
|
||||
ldrlt r0, [r1], #4
|
||||
strlt r0, [r2], #4
|
||||
blt .LC0
|
||||
#else
|
||||
subs r3, r2
|
||||
ble .LC1
|
||||
.LC0:
|
||||
subs r3, #4
|
||||
ldr r0, [r1, r3]
|
||||
str r0, [r2, r3]
|
||||
bgt .LC0
|
||||
.LC1:
|
||||
#endif
|
||||
|
||||
#ifdef __STARTUP_CLEAR_BSS
|
||||
/* This part of work usually is done in C library startup code. Otherwise,
|
||||
* define this macro to enable it in this startup.
|
||||
*
|
||||
* Loop to zero out BSS section, which uses following symbols
|
||||
* in linker script:
|
||||
* __bss_start__: start of BSS section. Must align to 4
|
||||
* __bss_end__: end of BSS section. Must align to 4
|
||||
*/
|
||||
ldr r1, =__bss_start__
|
||||
ldr r2, =__bss_end__
|
||||
|
||||
movs r0, 0
|
||||
.LC2:
|
||||
cmp r1, r2
|
||||
itt lt
|
||||
strlt r0, [r1], #4
|
||||
blt .LC2
|
||||
#endif /* __STARTUP_CLEAR_BSS */
|
||||
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
|
||||
|
||||
.align 1
|
||||
.thumb_func
|
||||
.weak DefaultISR
|
||||
.type DefaultISR, %function
|
||||
DefaultISR:
|
||||
b DefaultISR
|
||||
.size DefaultISR, . - DefaultISR
|
||||
|
||||
.align 1
|
||||
.thumb_func
|
||||
.weak NMI_Handler
|
||||
.type NMI_Handler, %function
|
||||
NMI_Handler:
|
||||
ldr r0,=NMI_Handler
|
||||
bx r0
|
||||
.size NMI_Handler, . - NMI_Handler
|
||||
|
||||
.align 1
|
||||
.thumb_func
|
||||
.weak HardFault_Handler
|
||||
.type HardFault_Handler, %function
|
||||
HardFault_Handler:
|
||||
ldr r0,=HardFault_Handler
|
||||
bx r0
|
||||
.size HardFault_Handler, . - HardFault_Handler
|
||||
|
||||
.align 1
|
||||
.thumb_func
|
||||
.weak MemManage_Handler
|
||||
.type MemManage_Handler, %function
|
||||
MemManage_Handler:
|
||||
ldr r0,=MemManage_Handler
|
||||
bx r0
|
||||
.size MemManage_Handler, . - MemManage_Handler
|
||||
|
||||
.align 1
|
||||
.thumb_func
|
||||
.weak BusFault_Handler
|
||||
.type BusFault_Handler, %function
|
||||
BusFault_Handler:
|
||||
ldr r0,=BusFault_Handler
|
||||
bx r0
|
||||
.size BusFault_Handler, . - BusFault_Handler
|
||||
|
||||
.align 1
|
||||
.thumb_func
|
||||
.weak UsageFault_Handler
|
||||
.type UsageFault_Handler, %function
|
||||
UsageFault_Handler:
|
||||
ldr r0,=UsageFault_Handler
|
||||
bx r0
|
||||
.size UsageFault_Handler, . - UsageFault_Handler
|
||||
|
||||
.align 1
|
||||
.thumb_func
|
||||
.weak SVC_Handler
|
||||
.type SVC_Handler, %function
|
||||
SVC_Handler:
|
||||
ldr r0,=SVC_Handler
|
||||
bx r0
|
||||
.size SVC_Handler, . - SVC_Handler
|
||||
|
||||
.align 1
|
||||
.thumb_func
|
||||
.weak DebugMon_Handler
|
||||
.type DebugMon_Handler, %function
|
||||
DebugMon_Handler:
|
||||
ldr r0,=DebugMon_Handler
|
||||
bx r0
|
||||
.size DebugMon_Handler, . - DebugMon_Handler
|
||||
|
||||
.align 1
|
||||
.thumb_func
|
||||
.weak PendSV_Handler
|
||||
.type PendSV_Handler, %function
|
||||
PendSV_Handler:
|
||||
ldr r0,=PendSV_Handler
|
||||
bx r0
|
||||
.size PendSV_Handler, . - PendSV_Handler
|
||||
|
||||
.align 1
|
||||
.thumb_func
|
||||
.weak SysTick_Handler
|
||||
.type SysTick_Handler, %function
|
||||
SysTick_Handler:
|
||||
ldr r0,=SysTick_Handler
|
||||
bx r0
|
||||
.size SysTick_Handler, . - SysTick_Handler
|
||||
|
||||
.align 1
|
||||
.thumb_func
|
||||
.weak WDT_BOD_IRQHandler
|
||||
.type WDT_BOD_IRQHandler, %function
|
||||
WDT_BOD_IRQHandler:
|
||||
ldr r0,=WDT_BOD_DriverIRQHandler
|
||||
bx r0
|
||||
.size WDT_BOD_IRQHandler, . - WDT_BOD_IRQHandler
|
||||
|
||||
|
||||
.align 1
|
||||
.thumb_func
|
||||
.weak DMA0_IRQHandler
|
||||
.type DMA0_IRQHandler, %function
|
||||
DMA0_IRQHandler:
|
||||
ldr r0,=DMA0_DriverIRQHandler
|
||||
bx r0
|
||||
.size DMA0_IRQHandler, . - DMA0_IRQHandler
|
||||
|
||||
.align 1
|
||||
.thumb_func
|
||||
.weak GINT0_IRQHandler
|
||||
.type GINT0_IRQHandler, %function
|
||||
GINT0_IRQHandler:
|
||||
ldr r0,=GINT0_DriverIRQHandler
|
||||
bx r0
|
||||
.size GINT0_IRQHandler, . - GINT0_IRQHandler
|
||||
|
||||
.align 1
|
||||
.thumb_func
|
||||
.weak GINT1_IRQHandler
|
||||
.type GINT1_IRQHandler, %function
|
||||
GINT1_IRQHandler:
|
||||
ldr r0,=GINT1_DriverIRQHandler
|
||||
bx r0
|
||||
.size GINT1_IRQHandler, . - GINT1_IRQHandler
|
||||
|
||||
.align 1
|
||||
.thumb_func
|
||||
.weak PIN_INT0_IRQHandler
|
||||
.type PIN_INT0_IRQHandler, %function
|
||||
PIN_INT0_IRQHandler:
|
||||
ldr r0,=PIN_INT0_DriverIRQHandler
|
||||
bx r0
|
||||
.size PIN_INT0_IRQHandler, . - PIN_INT0_IRQHandler
|
||||
|
||||
.align 1
|
||||
.thumb_func
|
||||
.weak PIN_INT1_IRQHandler
|
||||
.type PIN_INT1_IRQHandler, %function
|
||||
PIN_INT1_IRQHandler:
|
||||
ldr r0,=PIN_INT1_DriverIRQHandler
|
||||
bx r0
|
||||
.size PIN_INT1_IRQHandler, . - PIN_INT1_IRQHandler
|
||||
|
||||
.align 1
|
||||
.thumb_func
|
||||
.weak PIN_INT2_IRQHandler
|
||||
.type PIN_INT2_IRQHandler, %function
|
||||
PIN_INT2_IRQHandler:
|
||||
ldr r0,=PIN_INT2_DriverIRQHandler
|
||||
bx r0
|
||||
.size PIN_INT2_IRQHandler, . - PIN_INT2_IRQHandler
|
||||
|
||||
.align 1
|
||||
.thumb_func
|
||||
.weak PIN_INT3_IRQHandler
|
||||
.type PIN_INT3_IRQHandler, %function
|
||||
PIN_INT3_IRQHandler:
|
||||
ldr r0,=PIN_INT3_DriverIRQHandler
|
||||
bx r0
|
||||
.size PIN_INT3_IRQHandler, . - PIN_INT3_IRQHandler
|
||||
|
||||
.align 1
|
||||
.thumb_func
|
||||
.weak UTICK0_IRQHandler
|
||||
.type UTICK0_IRQHandler, %function
|
||||
UTICK0_IRQHandler:
|
||||
ldr r0,=UTICK0_DriverIRQHandler
|
||||
bx r0
|
||||
.size UTICK0_IRQHandler, . - UTICK0_IRQHandler
|
||||
|
||||
.align 1
|
||||
.thumb_func
|
||||
.weak MRT0_IRQHandler
|
||||
.type MRT0_IRQHandler, %function
|
||||
MRT0_IRQHandler:
|
||||
ldr r0,=MRT0_DriverIRQHandler
|
||||
bx r0
|
||||
.size MRT0_IRQHandler, . - MRT0_IRQHandler
|
||||
|
||||
.align 1
|
||||
.thumb_func
|
||||
.weak CTIMER0_IRQHandler
|
||||
.type CTIMER0_IRQHandler, %function
|
||||
CTIMER0_IRQHandler:
|
||||
ldr r0,=CTIMER0_DriverIRQHandler
|
||||
bx r0
|
||||
.size CTIMER0_IRQHandler, . - CTIMER0_IRQHandler
|
||||
|
||||
.align 1
|
||||
.thumb_func
|
||||
.weak CTIMER1_IRQHandler
|
||||
.type CTIMER1_IRQHandler, %function
|
||||
CTIMER1_IRQHandler:
|
||||
ldr r0,=CTIMER1_DriverIRQHandler
|
||||
bx r0
|
||||
.size CTIMER1_IRQHandler, . - CTIMER1_IRQHandler
|
||||
|
||||
|
||||
.align 1
|
||||
.thumb_func
|
||||
.weak SCT0_IRQHandler
|
||||
.type SCT0_IRQHandler, %function
|
||||
SCT0_IRQHandler:
|
||||
ldr r0,=SCT0_DriverIRQHandler
|
||||
bx r0
|
||||
.size SCT0_IRQHandler, . - SCT0_IRQHandler
|
||||
|
||||
.align 1
|
||||
.thumb_func
|
||||
.weak CTIMER3_IRQHandler
|
||||
.type CTIMER3_IRQHandler, %function
|
||||
CTIMER3_IRQHandler:
|
||||
ldr r0,=CTIMER3_DriverIRQHandler
|
||||
bx r0
|
||||
.size CTIMER3_IRQHandler, . - CTIMER3_IRQHandler
|
||||
|
||||
.align 1
|
||||
.thumb_func
|
||||
.weak FLEXCOMM0_IRQHandler
|
||||
.type FLEXCOMM0_IRQHandler, %function
|
||||
FLEXCOMM0_IRQHandler:
|
||||
ldr r0,=FLEXCOMM0_DriverIRQHandler
|
||||
bx r0
|
||||
.size FLEXCOMM0_IRQHandler, . - FLEXCOMM0_IRQHandler
|
||||
|
||||
.align 1
|
||||
.thumb_func
|
||||
.weak FLEXCOMM1_IRQHandler
|
||||
.type FLEXCOMM1_IRQHandler, %function
|
||||
FLEXCOMM1_IRQHandler:
|
||||
ldr r0,=FLEXCOMM1_DriverIRQHandler
|
||||
bx r0
|
||||
.size FLEXCOMM1_IRQHandler, . - FLEXCOMM1_IRQHandler
|
||||
|
||||
.align 1
|
||||
.thumb_func
|
||||
.weak FLEXCOMM2_IRQHandler
|
||||
.type FLEXCOMM2_IRQHandler, %function
|
||||
FLEXCOMM2_IRQHandler:
|
||||
ldr r0,=FLEXCOMM2_DriverIRQHandler
|
||||
bx r0
|
||||
.size FLEXCOMM2_IRQHandler, . - FLEXCOMM2_IRQHandler
|
||||
|
||||
.align 1
|
||||
.thumb_func
|
||||
.weak FLEXCOMM3_IRQHandler
|
||||
.type FLEXCOMM3_IRQHandler, %function
|
||||
FLEXCOMM3_IRQHandler:
|
||||
ldr r0,=FLEXCOMM3_DriverIRQHandler
|
||||
bx r0
|
||||
.size FLEXCOMM3_IRQHandler, . - FLEXCOMM3_IRQHandler
|
||||
|
||||
.align 1
|
||||
.thumb_func
|
||||
.weak FLEXCOMM4_IRQHandler
|
||||
.type FLEXCOMM4_IRQHandler, %function
|
||||
FLEXCOMM4_IRQHandler:
|
||||
ldr r0,=FLEXCOMM4_DriverIRQHandler
|
||||
bx r0
|
||||
.size FLEXCOMM4_IRQHandler, . - FLEXCOMM4_IRQHandler
|
||||
|
||||
.align 1
|
||||
.thumb_func
|
||||
.weak FLEXCOMM5_IRQHandler
|
||||
.type FLEXCOMM5_IRQHandler, %function
|
||||
FLEXCOMM5_IRQHandler:
|
||||
ldr r0,=FLEXCOMM5_DriverIRQHandler
|
||||
bx r0
|
||||
.size FLEXCOMM5_IRQHandler, . - FLEXCOMM5_IRQHandler
|
||||
|
||||
.align 1
|
||||
.thumb_func
|
||||
.weak FLEXCOMM6_IRQHandler
|
||||
.type FLEXCOMM6_IRQHandler, %function
|
||||
FLEXCOMM6_IRQHandler:
|
||||
ldr r0,=FLEXCOMM6_DriverIRQHandler
|
||||
bx r0
|
||||
.size FLEXCOMM6_IRQHandler, . - FLEXCOMM6_IRQHandler
|
||||
|
||||
.align 1
|
||||
.thumb_func
|
||||
.weak FLEXCOMM7_IRQHandler
|
||||
.type FLEXCOMM7_IRQHandler, %function
|
||||
FLEXCOMM7_IRQHandler:
|
||||
ldr r0,=FLEXCOMM7_DriverIRQHandler
|
||||
bx r0
|
||||
.size FLEXCOMM7_IRQHandler, . - FLEXCOMM7_IRQHandler
|
||||
|
||||
|
||||
.align 1
|
||||
.thumb_func
|
||||
.weak ADC0_SEQA_IRQHandler
|
||||
.type ADC0_SEQA_IRQHandler, %function
|
||||
ADC0_SEQA_IRQHandler:
|
||||
ldr r0,=ADC0_SEQA_DriverIRQHandler
|
||||
bx r0
|
||||
.size ADC0_SEQA_IRQHandler, . - ADC0_SEQA_IRQHandler
|
||||
|
||||
.align 1
|
||||
.thumb_func
|
||||
.weak ADC0_SEQB_IRQHandler
|
||||
.type ADC0_SEQB_IRQHandler, %function
|
||||
ADC0_SEQB_IRQHandler:
|
||||
ldr r0,=ADC0_SEQB_DriverIRQHandler
|
||||
bx r0
|
||||
.size ADC0_SEQB_IRQHandler, . - ADC0_SEQB_IRQHandler
|
||||
|
||||
.align 1
|
||||
.thumb_func
|
||||
.weak ADC0_THCMP_IRQHandler
|
||||
.type ADC0_THCMP_IRQHandler, %function
|
||||
ADC0_THCMP_IRQHandler:
|
||||
ldr r0,=ADC0_THCMP_DriverIRQHandler
|
||||
bx r0
|
||||
.size ADC0_THCMP_IRQHandler, . - ADC0_THCMP_IRQHandler
|
||||
|
||||
.align 1
|
||||
.thumb_func
|
||||
.weak DMIC0_IRQHandler
|
||||
.type DMIC0_IRQHandler, %function
|
||||
DMIC0_IRQHandler:
|
||||
ldr r0,=DMIC0_DriverIRQHandler
|
||||
bx r0
|
||||
.size DMIC0_IRQHandler, . - DMIC0_IRQHandler
|
||||
|
||||
.align 1
|
||||
.thumb_func
|
||||
.weak HWVAD0_IRQHandler
|
||||
.type HWVAD0_IRQHandler, %function
|
||||
HWVAD0_IRQHandler:
|
||||
ldr r0,=HWVAD0_DriverIRQHandler
|
||||
bx r0
|
||||
.size HWVAD0_IRQHandler, . - HWVAD0_IRQHandler
|
||||
|
||||
.align 1
|
||||
.thumb_func
|
||||
.weak USB0_NEEDCLK_IRQHandler
|
||||
.type USB0_NEEDCLK_IRQHandler, %function
|
||||
USB0_NEEDCLK_IRQHandler:
|
||||
ldr r0,=USB0_NEEDCLK_DriverIRQHandler
|
||||
bx r0
|
||||
.size USB0_NEEDCLK_IRQHandler, . - USB0_NEEDCLK_IRQHandler
|
||||
|
||||
.align 1
|
||||
.thumb_func
|
||||
.weak USB0_IRQHandler
|
||||
.type USB0_IRQHandler, %function
|
||||
USB0_IRQHandler:
|
||||
ldr r0,=USB0_DriverIRQHandler
|
||||
bx r0
|
||||
.size USB0_IRQHandler, . - USB0_IRQHandler
|
||||
|
||||
.align 1
|
||||
.thumb_func
|
||||
.weak RTC_IRQHandler
|
||||
.type RTC_IRQHandler, %function
|
||||
RTC_IRQHandler:
|
||||
ldr r0,=RTC_DriverIRQHandler
|
||||
bx r0
|
||||
.size RTC_IRQHandler, . - RTC_IRQHandler
|
||||
|
||||
.align 1
|
||||
.thumb_func
|
||||
.weak IOH_IRQHandler
|
||||
.type IOH_IRQHandler, %function
|
||||
IOH_IRQHandler:
|
||||
ldr r0,=IOH_DriverIRQHandler
|
||||
bx r0
|
||||
.size IOH_IRQHandler, . - IOH_IRQHandler
|
||||
|
||||
.align 1
|
||||
.thumb_func
|
||||
.weak MAILBOX_IRQHandler
|
||||
.type MAILBOX_IRQHandler, %function
|
||||
MAILBOX_IRQHandler:
|
||||
ldr r0,=MAILBOX_DriverIRQHandler
|
||||
bx r0
|
||||
.size MAILBOX_IRQHandler, . - MAILBOX_IRQHandler
|
||||
|
||||
|
||||
.align 1
|
||||
.thumb_func
|
||||
.weak PIN_INT4_IRQHandler
|
||||
.type PIN_INT4_IRQHandler, %function
|
||||
PIN_INT4_IRQHandler:
|
||||
ldr r0,=PIN_INT4_DriverIRQHandler
|
||||
bx r0
|
||||
.size PIN_INT4_IRQHandler, . - PIN_INT4_IRQHandler
|
||||
|
||||
.align 1
|
||||
.thumb_func
|
||||
.weak PIN_INT5_IRQHandler
|
||||
.type PIN_INT5_IRQHandler, %function
|
||||
PIN_INT5_IRQHandler:
|
||||
ldr r0,=PIN_INT5_DriverIRQHandler
|
||||
bx r0
|
||||
.size PIN_INT5_IRQHandler, . - PIN_INT5_IRQHandler
|
||||
|
||||
.align 1
|
||||
.thumb_func
|
||||
.weak PIN_INT6_IRQHandler
|
||||
.type PIN_INT6_IRQHandler, %function
|
||||
PIN_INT6_IRQHandler:
|
||||
ldr r0,=PIN_INT6_DriverIRQHandler
|
||||
bx r0
|
||||
.size PIN_INT6_IRQHandler, . - PIN_INT6_IRQHandler
|
||||
|
||||
.align 1
|
||||
.thumb_func
|
||||
.weak PIN_INT7_IRQHandler
|
||||
.type PIN_INT7_IRQHandler, %function
|
||||
PIN_INT7_IRQHandler:
|
||||
ldr r0,=PIN_INT7_DriverIRQHandler
|
||||
bx r0
|
||||
.size PIN_INT7_IRQHandler, . - PIN_INT7_IRQHandler
|
||||
|
||||
|
||||
.align 1
|
||||
.thumb_func
|
||||
.weak CTIMER2_IRQHandler
|
||||
.type CTIMER2_IRQHandler, %function
|
||||
CTIMER2_IRQHandler:
|
||||
ldr r0,=CTIMER2_DriverIRQHandler
|
||||
bx r0
|
||||
.size CTIMER2_IRQHandler, . - CTIMER2_IRQHandler
|
||||
|
||||
.align 1
|
||||
.thumb_func
|
||||
.weak CTIMER4_IRQHandler
|
||||
.type CTIMER4_IRQHandler, %function
|
||||
CTIMER4_IRQHandler:
|
||||
ldr r0,=CTIMER4_DriverIRQHandler
|
||||
bx r0
|
||||
.size CTIMER4_IRQHandler, . - CTIMER4_IRQHandler
|
||||
|
||||
|
||||
.align 1
|
||||
.thumb_func
|
||||
.weak SPIFI0_IRQHandler
|
||||
.type SPIFI0_IRQHandler, %function
|
||||
SPIFI0_IRQHandler:
|
||||
ldr r0,=SPIFI0_DriverIRQHandler
|
||||
bx r0
|
||||
.size SPIFI0_IRQHandler, . - SPIFI0_IRQHandler
|
||||
/* 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 WDT_BOD_DriverIRQHandler /* Windowed watchdog timer, Brownout detect */
|
||||
def_irq_handler DMA0_DriverIRQHandler /* DMA controller */
|
||||
def_irq_handler GINT0_DriverIRQHandler /* GPIO group 0 */
|
||||
def_irq_handler GINT1_DriverIRQHandler /* GPIO group 1 */
|
||||
def_irq_handler PIN_INT0_DriverIRQHandler /* Pin interrupt 0 or pattern match engine slice 0 */
|
||||
def_irq_handler PIN_INT1_DriverIRQHandler /* Pin interrupt 1or pattern match engine slice 1 */
|
||||
def_irq_handler PIN_INT2_DriverIRQHandler /* Pin interrupt 2 or pattern match engine slice 2 */
|
||||
def_irq_handler PIN_INT3_DriverIRQHandler /* Pin interrupt 3 or pattern match engine slice 3 */
|
||||
def_irq_handler UTICK0_DriverIRQHandler /* Micro-tick Timer */
|
||||
def_irq_handler MRT0_DriverIRQHandler /* Multi-rate timer */
|
||||
def_irq_handler CTIMER0_DriverIRQHandler /* Standard counter/timer CTIMER0 */
|
||||
def_irq_handler CTIMER1_DriverIRQHandler /* Standard counter/timer CTIMER1 */
|
||||
def_irq_handler SCT0_DriverIRQHandler /* SCTimer/PWM */
|
||||
def_irq_handler CTIMER3_DriverIRQHandler /* Standard counter/timer CTIMER3 */
|
||||
def_irq_handler FLEXCOMM0_DriverIRQHandler /* Flexcomm Interface 0 (USART, SPI, I2C) */
|
||||
def_irq_handler FLEXCOMM1_DriverIRQHandler /* Flexcomm Interface 1 (USART, SPI, I2C) */
|
||||
def_irq_handler FLEXCOMM2_DriverIRQHandler /* Flexcomm Interface 2 (USART, SPI, I2C) */
|
||||
def_irq_handler FLEXCOMM3_DriverIRQHandler /* Flexcomm Interface 3 (USART, SPI, I2C) */
|
||||
def_irq_handler FLEXCOMM4_DriverIRQHandler /* Flexcomm Interface 4 (USART, SPI, I2C) */
|
||||
def_irq_handler FLEXCOMM5_DriverIRQHandler /* Flexcomm Interface 5 (USART, SPI, I2C) */
|
||||
def_irq_handler FLEXCOMM6_DriverIRQHandler /* Flexcomm Interface 6 (USART, SPI, I2C, I2S) */
|
||||
def_irq_handler FLEXCOMM7_DriverIRQHandler /* Flexcomm Interface 7 (USART, SPI, I2C, I2S) */
|
||||
def_irq_handler ADC0_SEQA_DriverIRQHandler /* ADC0 sequence A completion. */
|
||||
def_irq_handler ADC0_SEQB_DriverIRQHandler /* ADC0 sequence B completion. */
|
||||
def_irq_handler ADC0_THCMP_DriverIRQHandler /* ADC0 threshold compare and error. */
|
||||
def_irq_handler DMIC0_DriverIRQHandler /* Digital microphone and DMIC subsystem */
|
||||
def_irq_handler HWVAD0_DriverIRQHandler /* Hardware Voice Activity Detector */
|
||||
def_irq_handler USB0_NEEDCLK_DriverIRQHandler /* USB Activity Wake-up Interrupt */
|
||||
def_irq_handler USB0_DriverIRQHandler /* USB device */
|
||||
def_irq_handler RTC_DriverIRQHandler /* RTC alarm and wake-up interrupts */
|
||||
def_irq_handler IOH_DriverIRQHandler /* IOH */
|
||||
def_irq_handler MAILBOX_DriverIRQHandler /* Mailbox interrupt (present on selected devices) */
|
||||
def_irq_handler PIN_INT4_DriverIRQHandler /* Pin interrupt 4 or pattern match engine slice 4 int */
|
||||
def_irq_handler PIN_INT5_DriverIRQHandler /* Pin interrupt 5 or pattern match engine slice 5 int */
|
||||
def_irq_handler PIN_INT6_DriverIRQHandler /* Pin interrupt 6 or pattern match engine slice 6 int */
|
||||
def_irq_handler PIN_INT7_DriverIRQHandler /* Pin interrupt 7 or pattern match engine slice 7 int */
|
||||
def_irq_handler CTIMER2_DriverIRQHandler /* Standard counter/timer CTIMER2 */
|
||||
def_irq_handler CTIMER4_DriverIRQHandler /* Standard counter/timer CTIMER4 */
|
||||
def_irq_handler SPIFI0_DriverIRQHandler /* SPI flash interface */
|
||||
|
||||
.end
|
||||
@@ -0,0 +1,31 @@
|
||||
Copyright 2016-2018 NXP
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted (subject to the limitations in the
|
||||
disclaimer below) provided that the following conditions are met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
|
||||
* Neither the name of the copyright holder nor the names of its
|
||||
contributors may be used to endorse or promote products derived from
|
||||
this software without specific prior written permission.
|
||||
|
||||
NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE
|
||||
GRANTED BY THIS LICENSE. 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.
|
||||
@@ -0,0 +1,145 @@
|
||||
/*
|
||||
** ###################################################################
|
||||
** Processors: LPC54114J256BD64_M4
|
||||
** LPC54114J256UK49_M4
|
||||
**
|
||||
** Compiler: IAR ANSI C/C++ Compiler for ARM
|
||||
** Reference manual: LPC5411x User manual Rev. 1.1 25 May 2016
|
||||
** Version: rev. 1.0, 2016-04-29
|
||||
** Build: b161227
|
||||
**
|
||||
** Abstract:
|
||||
** Linker file for the IAR ANSI C/C++ Compiler for ARM
|
||||
**
|
||||
** Copyright (c) 2016 Freescale Semiconductor, Inc.
|
||||
** Copyright 2016 - 2017 NXP
|
||||
** 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 the copyright holder 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.nxp.com
|
||||
** mail: support@nxp.com
|
||||
**
|
||||
** ###################################################################
|
||||
*/
|
||||
define symbol __ram_vector_table__ = 1;
|
||||
|
||||
if (!isdefinedsymbol(MBED_BOOT_STACK_SIZE)) {
|
||||
define symbol MBED_BOOT_STACK_SIZE = 0x400;
|
||||
}
|
||||
|
||||
define symbol __stack_size__=MBED_BOOT_STACK_SIZE;
|
||||
define symbol __heap_size__=0x4000;
|
||||
|
||||
define symbol __ram_vector_table_size__ = isdefinedsymbol(__ram_vector_table__) ? 0x000000E0 : 0;
|
||||
define symbol __ram_vector_table_offset__ = isdefinedsymbol(__ram_vector_table__) ? 0x000000DF : 0;
|
||||
|
||||
define symbol m_interrupts_start = 0x00000000;
|
||||
define symbol m_interrupts_end = 0x000000DF;
|
||||
|
||||
define symbol m_text_start = 0x000000E0;
|
||||
define symbol m_text_end = 0x0002FFFF;
|
||||
|
||||
define symbol m_interrupts_ram_start = 0x20000000;
|
||||
define symbol m_interrupts_ram_end = 0x20000000 + __ram_vector_table_offset__;
|
||||
|
||||
define symbol m_data_start = m_interrupts_ram_start + __ram_vector_table_size__;
|
||||
define symbol m_data_end = 0x2000FFFF;
|
||||
|
||||
define exported symbol rpmsg_sh_mem_start = 0x20026800;
|
||||
define exported symbol rpmsg_sh_mem_end = 0x20027FFF;
|
||||
|
||||
define symbol m_sramx_start = 0x04000000;
|
||||
define symbol m_sramx_end = 0x04007FFF;
|
||||
|
||||
define exported symbol core1_image_start = 0x00030000;
|
||||
define exported symbol core1_image_end = 0x0003FFFF;
|
||||
|
||||
define symbol __crp_start__ = 0x000002FC;
|
||||
define symbol __crp_end__ = 0x000002FF;
|
||||
|
||||
define symbol __ram_iap_start__ = 0x2000FFE0;
|
||||
define symbol __ram_iap_end__ = 0x2000FFFF;
|
||||
|
||||
/* Sizes */
|
||||
if (isdefinedsymbol(__stack_size__)) {
|
||||
define symbol __size_cstack__ = __stack_size__;
|
||||
} else {
|
||||
define symbol __size_cstack__ = 0x0400;
|
||||
}
|
||||
|
||||
if (isdefinedsymbol(__heap_size__)) {
|
||||
define symbol __size_heap__ = __heap_size__;
|
||||
} else {
|
||||
define symbol __size_heap__ = 0x0800;
|
||||
}
|
||||
|
||||
define exported symbol __VECTOR_TABLE = m_interrupts_start;
|
||||
define exported symbol __VECTOR_RAM = isdefinedsymbol(__ram_vector_table__) ? m_interrupts_ram_start : m_interrupts_start;
|
||||
define exported symbol __RAM_VECTOR_TABLE_SIZE = __ram_vector_table_size__;
|
||||
|
||||
define memory mem with size = 4G;
|
||||
define region TEXT_region = mem:[from m_interrupts_start to m_interrupts_end]
|
||||
| mem:[from m_text_start to m_text_end]
|
||||
- mem:[from __crp_start__ to __crp_end__];
|
||||
define region DATA_region = mem:[from m_data_start to m_data_end]
|
||||
- mem:[from __ram_iap_start__-__size_cstack__ to __ram_iap_end__];
|
||||
define region CSTACK_region = mem:[from __ram_iap_start__-__size_cstack__ to __ram_iap_start__-1];
|
||||
define region SRAMX_region = mem:[from m_sramx_start to m_sramx_end];
|
||||
define region CRP_region = mem:[from __crp_start__ to __crp_end__];
|
||||
define region m_interrupts_ram_region = mem:[from m_interrupts_ram_start to m_interrupts_ram_end];
|
||||
|
||||
define region rpmsg_sh_mem_region = mem:[from rpmsg_sh_mem_start to rpmsg_sh_mem_end];
|
||||
|
||||
define block CSTACK with alignment = 8, size = __size_cstack__ { };
|
||||
define block HEAP with alignment = 8, size = __size_heap__ { };
|
||||
define block RW { readwrite };
|
||||
define block ZI { zi };
|
||||
|
||||
define region core1_region = mem:[from core1_image_start to core1_image_end];
|
||||
define block SEC_CORE_IMAGE_WBLOCK { section __sec_core };
|
||||
|
||||
initialize by copy { readwrite };
|
||||
|
||||
if (isdefinedsymbol(__USE_DLIB_PERTHREAD))
|
||||
{
|
||||
// Required in a multi-threaded application
|
||||
initialize by copy with packing = none { section __DLIB_PERTHREAD };
|
||||
}
|
||||
|
||||
do not initialize { section .noinit };
|
||||
do not initialize { section rpmsg_sh_mem_section };
|
||||
|
||||
place at address mem: m_interrupts_start { readonly section .intvec };
|
||||
place in TEXT_region { readonly };
|
||||
place in DATA_region { block RW };
|
||||
place in DATA_region { block ZI };
|
||||
place in DATA_region { last block HEAP };
|
||||
place in SRAMX_region { section sramx };
|
||||
place in CSTACK_region { block CSTACK };
|
||||
place in CRP_region { section .crp };
|
||||
place in m_interrupts_ram_region { section m_interrupts_ram };
|
||||
place in rpmsg_sh_mem_region { section rpmsg_sh_mem_section };
|
||||
|
||||
place in core1_region { block SEC_CORE_IMAGE_WBLOCK };
|
||||
@@ -0,0 +1,9 @@
|
||||
LPC54114 libpower.a README
|
||||
|
||||
The libpower.a library provides the following functions for optimized power management on LPC54114 devices. Features include:
|
||||
1. Simple APIs to control power consumption and wake-up in all power modes.
|
||||
2. Manage power consumption for sleep and active modes
|
||||
3. Prepare the part to enter low power modes (sleep, deep-sleep, and deep power-down).
|
||||
4. Configure wake-up from deep-sleep via functions enabled by bits in the PDRUNCFG registers.
|
||||
|
||||
The APIs provided by the library are fully described in the LPC54114 User Manual (document UM10914) which is available from https://www.nxp.com
|
||||
Binary file not shown.
@@ -0,0 +1,567 @@
|
||||
;/*****************************************************************************
|
||||
; * @file: startup_LPC54114_cm4.s
|
||||
; * @purpose: CMSIS Cortex-M4 Core Device Startup File
|
||||
; * LPC54114_cm4
|
||||
; * @version: 1.0
|
||||
; * @date: 2016-4-29
|
||||
; *----------------------------------------------------------------------------
|
||||
; *
|
||||
; * Copyright: 1997 - 2016 Freescale Semiconductor,
|
||||
; *
|
||||
; 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
|
||||
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
|
||||
DCD HardFault_Handler
|
||||
DCD MemManage_Handler
|
||||
DCD BusFault_Handler
|
||||
DCD UsageFault_Handler
|
||||
__vector_table_0x1c
|
||||
DCD 0
|
||||
DCD 0
|
||||
DCD 0
|
||||
DCD 0
|
||||
DCD SVC_Handler
|
||||
DCD DebugMon_Handler
|
||||
DCD 0
|
||||
DCD PendSV_Handler
|
||||
DCD SysTick_Handler
|
||||
|
||||
; External Interrupts
|
||||
DCD WDT_BOD_IRQHandler ; Windowed watchdog timer, Brownout detect
|
||||
DCD DMA0_IRQHandler ; DMA controller
|
||||
DCD GINT0_IRQHandler ; GPIO group 0
|
||||
DCD GINT1_IRQHandler ; GPIO group 1
|
||||
DCD PIN_INT0_IRQHandler ; Pin interrupt 0 or pattern match engine slice 0
|
||||
DCD PIN_INT1_IRQHandler ; Pin interrupt 1or pattern match engine slice 1
|
||||
DCD PIN_INT2_IRQHandler ; Pin interrupt 2 or pattern match engine slice 2
|
||||
DCD PIN_INT3_IRQHandler ; Pin interrupt 3 or pattern match engine slice 3
|
||||
DCD UTICK0_IRQHandler ; Micro-tick Timer
|
||||
DCD MRT0_IRQHandler ; Multi-rate timer
|
||||
DCD CTIMER0_IRQHandler ; Standard counter/timer CTIMER0
|
||||
DCD CTIMER1_IRQHandler ; Standard counter/timer CTIMER1
|
||||
DCD SCT0_IRQHandler ; SCTimer/PWM
|
||||
DCD CTIMER3_IRQHandler ; Standard counter/timer CTIMER3
|
||||
DCD FLEXCOMM0_IRQHandler ; Flexcomm Interface 0 (USART, SPI, I2C)
|
||||
DCD FLEXCOMM1_IRQHandler ; Flexcomm Interface 1 (USART, SPI, I2C)
|
||||
DCD FLEXCOMM2_IRQHandler ; Flexcomm Interface 2 (USART, SPI, I2C)
|
||||
DCD FLEXCOMM3_IRQHandler ; Flexcomm Interface 3 (USART, SPI, I2C)
|
||||
DCD FLEXCOMM4_IRQHandler ; Flexcomm Interface 4 (USART, SPI, I2C)
|
||||
DCD FLEXCOMM5_IRQHandler ; Flexcomm Interface 5 (USART, SPI, I2C)
|
||||
DCD FLEXCOMM6_IRQHandler ; Flexcomm Interface 6 (USART, SPI, I2C, I2S)
|
||||
DCD FLEXCOMM7_IRQHandler ; Flexcomm Interface 7 (USART, SPI, I2C, I2S)
|
||||
DCD ADC0_SEQA_IRQHandler ; ADC0 sequence A completion.
|
||||
DCD ADC0_SEQB_IRQHandler ; ADC0 sequence B completion.
|
||||
DCD ADC0_THCMP_IRQHandler ; ADC0 threshold compare and error.
|
||||
DCD DMIC0_IRQHandler ; Digital microphone and DMIC subsystem
|
||||
DCD HWVAD0_IRQHandler ; Hardware Voice Activity Detector
|
||||
DCD USB0_NEEDCLK_IRQHandler ; USB Activity Wake-up Interrupt
|
||||
DCD USB0_IRQHandler ; USB device
|
||||
DCD RTC_IRQHandler ; RTC alarm and wake-up interrupts
|
||||
DCD IOH_IRQHandler ; IOH
|
||||
DCD MAILBOX_IRQHandler ; Mailbox interrupt (present on selected devices)
|
||||
DCD PIN_INT4_IRQHandler ; Pin interrupt 4 or pattern match engine slice 4 int
|
||||
DCD PIN_INT5_IRQHandler ; Pin interrupt 5 or pattern match engine slice 5 int
|
||||
DCD PIN_INT6_IRQHandler ; Pin interrupt 6 or pattern match engine slice 6 int
|
||||
DCD PIN_INT7_IRQHandler ; Pin interrupt 7 or pattern match engine slice 7 int
|
||||
DCD CTIMER2_IRQHandler ; Standard counter/timer CTIMER2
|
||||
DCD CTIMER4_IRQHandler ; Standard counter/timer CTIMER4
|
||||
DCD Reserved54_IRQHandler ; Reserved interrupt
|
||||
DCD SPIFI0_IRQHandler ; SPI flash interface
|
||||
__Vectors_End
|
||||
|
||||
; Code Read Protection Level (CRP)
|
||||
; <0xFFFFFFFF=> Disabled
|
||||
; <0x4E697370=> NO_ISP
|
||||
; <0x12345678=> CRP1
|
||||
; <0x87654321=> CRP2
|
||||
; <0x43218765=> CRP3
|
||||
|
||||
#if !defined NO_CRP
|
||||
SECTION .crp:CODE
|
||||
__CRP
|
||||
DCD 0xFFFFFFFF
|
||||
__CRP_End
|
||||
#endif
|
||||
|
||||
__Vectors EQU __vector_table
|
||||
__Vectors_Size EQU __Vectors_End - __Vectors
|
||||
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;;
|
||||
;; Default interrupt handlers.
|
||||
;;
|
||||
SECTION .intvec:CODE:NOROOT(2)
|
||||
#if !defined(SLAVEBOOT)
|
||||
DATA
|
||||
cpu_id EQU 0xE000ED00 ; CPUID Base Register (System control block register)
|
||||
cpu_ctrl EQU 0x40000800
|
||||
coproc_boot EQU 0x40000804
|
||||
coproc_stack EQU 0x40000808
|
||||
rel_vals
|
||||
DC32 cpu_id, cpu_ctrl, coproc_boot, coproc_stack
|
||||
DC16 0xFFF, 0xC24
|
||||
#endif
|
||||
|
||||
THUMB
|
||||
|
||||
PUBWEAK Reset_Handler
|
||||
SECTION .text:CODE:REORDER:NOROOT(2)
|
||||
; Reset Handler - shared for both cores
|
||||
Reset_Handler
|
||||
|
||||
#if !defined(SLAVEBOOT)
|
||||
; Both the M0+ and M4 core come via this shared startup code,
|
||||
; but the M0+ and M4 core have different vector tables.
|
||||
; Determine if the core executing this code is the master or
|
||||
; the slave and handle each core state individually.
|
||||
shared_boot_entry
|
||||
LDR r6, =rel_vals
|
||||
MOVS r4, #0 ; Flag for slave core (0)
|
||||
MOVS r5, #1
|
||||
|
||||
; Determine which core (M0+ or M4) this code is running on
|
||||
; r2 = (((*cpu_id) >> 4) & 0xFFF); (M4 core == 0xC24)
|
||||
get_current_core_id
|
||||
LDR r0, [r6, #0]
|
||||
LDR r1, [r0] ; r1 = CPU ID status
|
||||
LSRS r1, r1, #4 ; Right justify 12 CPU ID bits
|
||||
LDRH r2, [r6, #16] ; Mask for CPU ID bits
|
||||
ANDS r2, r1, r2 ; r2 = ARM COrtex CPU ID
|
||||
LDRH r3, [r6, #18] ; Mask for CPU ID bits
|
||||
CMP r3, r2 ; Core ID matches M4 identifier
|
||||
BNE get_master_status
|
||||
MOV r4, r5 ; Set flag for master core (1)
|
||||
|
||||
; Determine if M4 core is the master or slave
|
||||
; r3 = ((*cpu_ctrl) & 1); (0 == m0+, 1 == M4)
|
||||
get_master_status
|
||||
LDR r0, [r6, #4]
|
||||
LDR r3, [r0] ; r3 = SYSCON co-processor CPU control status
|
||||
ANDS r3, r3, r5 ; r3 = (Bit 0: 1 = M4 is master, 0 = M4 is slave)
|
||||
|
||||
; Select boot based on selected master core and core ID
|
||||
select_boot
|
||||
EORS r3, r3, r4 ; r4 = (Bit 0: 0 = master, 1 = slave)
|
||||
BNE slave_boot
|
||||
B normal_boot
|
||||
|
||||
; Slave boot
|
||||
slave_boot
|
||||
LDR r0, [r6, #8]
|
||||
LDR r2, [r0] ; r1 = SYSCON co-processor boot address
|
||||
CMP r2, #0 ; Slave boot address = 0 (not set up)?
|
||||
BEQ cpu_sleep
|
||||
LDR r0, [r6, #12]
|
||||
LDR r1, [r0] ; r5 = SYSCON co-processor stack address
|
||||
MOV sp, r1 ; Update slave CPU stack pointer
|
||||
; Be sure to update VTOR for the slave MCU to point to the
|
||||
; slave vector table in boot memory
|
||||
BX r2 ; Jump to slave boot address
|
||||
|
||||
; Slave isn't yet setup for system boot from the master
|
||||
; so sleep until the master sets it up and then reboots it
|
||||
cpu_sleep
|
||||
MOV sp, r5 ; Will force exception if something happens
|
||||
cpu_sleep_wfi
|
||||
WFI ; Sleep forever until master reboots
|
||||
B cpu_sleep_wfi
|
||||
#endif ; defined(SLAVEBOOT)
|
||||
|
||||
; Normal boot for master/slave
|
||||
normal_boot
|
||||
LDR r0, =SystemInit
|
||||
BLX r0
|
||||
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 MemManage_Handler
|
||||
SECTION .text:CODE:REORDER:NOROOT(1)
|
||||
MemManage_Handler
|
||||
B .
|
||||
|
||||
PUBWEAK BusFault_Handler
|
||||
SECTION .text:CODE:REORDER:NOROOT(1)
|
||||
BusFault_Handler
|
||||
B .
|
||||
|
||||
PUBWEAK UsageFault_Handler
|
||||
SECTION .text:CODE:REORDER:NOROOT(1)
|
||||
UsageFault_Handler
|
||||
B .
|
||||
|
||||
PUBWEAK SVC_Handler
|
||||
SECTION .text:CODE:REORDER:NOROOT(1)
|
||||
SVC_Handler
|
||||
B .
|
||||
|
||||
PUBWEAK DebugMon_Handler
|
||||
SECTION .text:CODE:REORDER:NOROOT(1)
|
||||
DebugMon_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 WDT_BOD_IRQHandler
|
||||
PUBWEAK WDT_BOD_DriverIRQHandler
|
||||
SECTION .text:CODE:REORDER:NOROOT(2)
|
||||
WDT_BOD_IRQHandler
|
||||
LDR R0, =WDT_BOD_DriverIRQHandler
|
||||
BX R0
|
||||
PUBWEAK DMA0_IRQHandler
|
||||
PUBWEAK DMA0_DriverIRQHandler
|
||||
SECTION .text:CODE:REORDER:NOROOT(2)
|
||||
DMA0_IRQHandler
|
||||
LDR R0, =DMA0_DriverIRQHandler
|
||||
BX R0
|
||||
PUBWEAK GINT0_IRQHandler
|
||||
PUBWEAK GINT0_DriverIRQHandler
|
||||
SECTION .text:CODE:REORDER:NOROOT(2)
|
||||
GINT0_IRQHandler
|
||||
LDR R0, =GINT0_DriverIRQHandler
|
||||
BX R0
|
||||
PUBWEAK GINT1_IRQHandler
|
||||
PUBWEAK GINT1_DriverIRQHandler
|
||||
SECTION .text:CODE:REORDER:NOROOT(2)
|
||||
GINT1_IRQHandler
|
||||
LDR R0, =GINT1_DriverIRQHandler
|
||||
BX R0
|
||||
PUBWEAK PIN_INT0_IRQHandler
|
||||
PUBWEAK PIN_INT0_DriverIRQHandler
|
||||
SECTION .text:CODE:REORDER:NOROOT(2)
|
||||
PIN_INT0_IRQHandler
|
||||
LDR R0, =PIN_INT0_DriverIRQHandler
|
||||
BX R0
|
||||
PUBWEAK PIN_INT1_IRQHandler
|
||||
PUBWEAK PIN_INT1_DriverIRQHandler
|
||||
SECTION .text:CODE:REORDER:NOROOT(2)
|
||||
PIN_INT1_IRQHandler
|
||||
LDR R0, =PIN_INT1_DriverIRQHandler
|
||||
BX R0
|
||||
PUBWEAK PIN_INT2_IRQHandler
|
||||
PUBWEAK PIN_INT2_DriverIRQHandler
|
||||
SECTION .text:CODE:REORDER:NOROOT(2)
|
||||
PIN_INT2_IRQHandler
|
||||
LDR R0, =PIN_INT2_DriverIRQHandler
|
||||
BX R0
|
||||
PUBWEAK PIN_INT3_IRQHandler
|
||||
PUBWEAK PIN_INT3_DriverIRQHandler
|
||||
SECTION .text:CODE:REORDER:NOROOT(2)
|
||||
PIN_INT3_IRQHandler
|
||||
LDR R0, =PIN_INT3_DriverIRQHandler
|
||||
BX R0
|
||||
PUBWEAK UTICK0_IRQHandler
|
||||
PUBWEAK UTICK0_DriverIRQHandler
|
||||
SECTION .text:CODE:REORDER:NOROOT(2)
|
||||
UTICK0_IRQHandler
|
||||
LDR R0, =UTICK0_DriverIRQHandler
|
||||
BX R0
|
||||
PUBWEAK MRT0_IRQHandler
|
||||
PUBWEAK MRT0_DriverIRQHandler
|
||||
SECTION .text:CODE:REORDER:NOROOT(2)
|
||||
MRT0_IRQHandler
|
||||
LDR R0, =MRT0_DriverIRQHandler
|
||||
BX R0
|
||||
PUBWEAK CTIMER0_IRQHandler
|
||||
PUBWEAK CTIMER0_DriverIRQHandler
|
||||
SECTION .text:CODE:REORDER:NOROOT(2)
|
||||
CTIMER0_IRQHandler
|
||||
LDR R0, =CTIMER0_DriverIRQHandler
|
||||
BX R0
|
||||
PUBWEAK CTIMER1_IRQHandler
|
||||
PUBWEAK CTIMER1_DriverIRQHandler
|
||||
SECTION .text:CODE:REORDER:NOROOT(2)
|
||||
CTIMER1_IRQHandler
|
||||
LDR R0, =CTIMER1_DriverIRQHandler
|
||||
BX R0
|
||||
PUBWEAK SCT0_IRQHandler
|
||||
PUBWEAK SCT0_DriverIRQHandler
|
||||
SECTION .text:CODE:REORDER:NOROOT(2)
|
||||
SCT0_IRQHandler
|
||||
LDR R0, =SCT0_DriverIRQHandler
|
||||
BX R0
|
||||
PUBWEAK CTIMER3_IRQHandler
|
||||
PUBWEAK CTIMER3_DriverIRQHandler
|
||||
SECTION .text:CODE:REORDER:NOROOT(2)
|
||||
CTIMER3_IRQHandler
|
||||
LDR R0, =CTIMER3_DriverIRQHandler
|
||||
BX R0
|
||||
PUBWEAK FLEXCOMM0_IRQHandler
|
||||
PUBWEAK FLEXCOMM0_DriverIRQHandler
|
||||
SECTION .text:CODE:REORDER:NOROOT(2)
|
||||
FLEXCOMM0_IRQHandler
|
||||
LDR R0, =FLEXCOMM0_DriverIRQHandler
|
||||
BX R0
|
||||
PUBWEAK FLEXCOMM1_IRQHandler
|
||||
PUBWEAK FLEXCOMM1_DriverIRQHandler
|
||||
SECTION .text:CODE:REORDER:NOROOT(2)
|
||||
FLEXCOMM1_IRQHandler
|
||||
LDR R0, =FLEXCOMM1_DriverIRQHandler
|
||||
BX R0
|
||||
PUBWEAK FLEXCOMM2_IRQHandler
|
||||
PUBWEAK FLEXCOMM2_DriverIRQHandler
|
||||
SECTION .text:CODE:REORDER:NOROOT(2)
|
||||
FLEXCOMM2_IRQHandler
|
||||
LDR R0, =FLEXCOMM2_DriverIRQHandler
|
||||
BX R0
|
||||
PUBWEAK FLEXCOMM3_IRQHandler
|
||||
PUBWEAK FLEXCOMM3_DriverIRQHandler
|
||||
SECTION .text:CODE:REORDER:NOROOT(2)
|
||||
FLEXCOMM3_IRQHandler
|
||||
LDR R0, =FLEXCOMM3_DriverIRQHandler
|
||||
BX R0
|
||||
PUBWEAK FLEXCOMM4_IRQHandler
|
||||
PUBWEAK FLEXCOMM4_DriverIRQHandler
|
||||
SECTION .text:CODE:REORDER:NOROOT(2)
|
||||
FLEXCOMM4_IRQHandler
|
||||
LDR R0, =FLEXCOMM4_DriverIRQHandler
|
||||
BX R0
|
||||
PUBWEAK FLEXCOMM5_IRQHandler
|
||||
PUBWEAK FLEXCOMM5_DriverIRQHandler
|
||||
SECTION .text:CODE:REORDER:NOROOT(2)
|
||||
FLEXCOMM5_IRQHandler
|
||||
LDR R0, =FLEXCOMM5_DriverIRQHandler
|
||||
BX R0
|
||||
PUBWEAK FLEXCOMM6_IRQHandler
|
||||
PUBWEAK FLEXCOMM6_DriverIRQHandler
|
||||
SECTION .text:CODE:REORDER:NOROOT(2)
|
||||
FLEXCOMM6_IRQHandler
|
||||
LDR R0, =FLEXCOMM6_DriverIRQHandler
|
||||
BX R0
|
||||
PUBWEAK FLEXCOMM7_IRQHandler
|
||||
PUBWEAK FLEXCOMM7_DriverIRQHandler
|
||||
SECTION .text:CODE:REORDER:NOROOT(2)
|
||||
FLEXCOMM7_IRQHandler
|
||||
LDR R0, =FLEXCOMM7_DriverIRQHandler
|
||||
BX R0
|
||||
PUBWEAK ADC0_SEQA_IRQHandler
|
||||
PUBWEAK ADC0_SEQA_DriverIRQHandler
|
||||
SECTION .text:CODE:REORDER:NOROOT(2)
|
||||
ADC0_SEQA_IRQHandler
|
||||
LDR R0, =ADC0_SEQA_DriverIRQHandler
|
||||
BX R0
|
||||
PUBWEAK ADC0_SEQB_IRQHandler
|
||||
PUBWEAK ADC0_SEQB_DriverIRQHandler
|
||||
SECTION .text:CODE:REORDER:NOROOT(2)
|
||||
ADC0_SEQB_IRQHandler
|
||||
LDR R0, =ADC0_SEQB_DriverIRQHandler
|
||||
BX R0
|
||||
PUBWEAK ADC0_THCMP_IRQHandler
|
||||
PUBWEAK ADC0_THCMP_DriverIRQHandler
|
||||
SECTION .text:CODE:REORDER:NOROOT(2)
|
||||
ADC0_THCMP_IRQHandler
|
||||
LDR R0, =ADC0_THCMP_DriverIRQHandler
|
||||
BX R0
|
||||
PUBWEAK DMIC0_IRQHandler
|
||||
PUBWEAK DMIC0_DriverIRQHandler
|
||||
SECTION .text:CODE:REORDER:NOROOT(2)
|
||||
DMIC0_IRQHandler
|
||||
LDR R0, =DMIC0_DriverIRQHandler
|
||||
BX R0
|
||||
PUBWEAK HWVAD0_IRQHandler
|
||||
PUBWEAK HWVAD0_DriverIRQHandler
|
||||
SECTION .text:CODE:REORDER:NOROOT(2)
|
||||
HWVAD0_IRQHandler
|
||||
LDR R0, =HWVAD0_DriverIRQHandler
|
||||
BX R0
|
||||
PUBWEAK USB0_NEEDCLK_IRQHandler
|
||||
PUBWEAK USB0_NEEDCLK_DriverIRQHandler
|
||||
SECTION .text:CODE:REORDER:NOROOT(2)
|
||||
USB0_NEEDCLK_IRQHandler
|
||||
LDR R0, =USB0_NEEDCLK_DriverIRQHandler
|
||||
BX R0
|
||||
PUBWEAK USB0_IRQHandler
|
||||
PUBWEAK USB0_DriverIRQHandler
|
||||
SECTION .text:CODE:REORDER:NOROOT(2)
|
||||
USB0_IRQHandler
|
||||
LDR R0, =USB0_DriverIRQHandler
|
||||
BX R0
|
||||
PUBWEAK RTC_IRQHandler
|
||||
PUBWEAK RTC_DriverIRQHandler
|
||||
SECTION .text:CODE:REORDER:NOROOT(2)
|
||||
RTC_IRQHandler
|
||||
LDR R0, =RTC_DriverIRQHandler
|
||||
BX R0
|
||||
PUBWEAK IOH_IRQHandler
|
||||
PUBWEAK IOH_DriverIRQHandler
|
||||
SECTION .text:CODE:REORDER:NOROOT(2)
|
||||
IOH_IRQHandler
|
||||
LDR R0, =IOH_DriverIRQHandler
|
||||
BX R0
|
||||
PUBWEAK MAILBOX_IRQHandler
|
||||
PUBWEAK MAILBOX_DriverIRQHandler
|
||||
SECTION .text:CODE:REORDER:NOROOT(2)
|
||||
MAILBOX_IRQHandler
|
||||
LDR R0, =MAILBOX_DriverIRQHandler
|
||||
BX R0
|
||||
PUBWEAK PIN_INT4_IRQHandler
|
||||
PUBWEAK PIN_INT4_DriverIRQHandler
|
||||
SECTION .text:CODE:REORDER:NOROOT(2)
|
||||
PIN_INT4_IRQHandler
|
||||
LDR R0, =PIN_INT4_DriverIRQHandler
|
||||
BX R0
|
||||
PUBWEAK PIN_INT5_IRQHandler
|
||||
PUBWEAK PIN_INT5_DriverIRQHandler
|
||||
SECTION .text:CODE:REORDER:NOROOT(2)
|
||||
PIN_INT5_IRQHandler
|
||||
LDR R0, =PIN_INT5_DriverIRQHandler
|
||||
BX R0
|
||||
PUBWEAK PIN_INT6_IRQHandler
|
||||
PUBWEAK PIN_INT6_DriverIRQHandler
|
||||
SECTION .text:CODE:REORDER:NOROOT(2)
|
||||
PIN_INT6_IRQHandler
|
||||
LDR R0, =PIN_INT6_DriverIRQHandler
|
||||
BX R0
|
||||
PUBWEAK PIN_INT7_IRQHandler
|
||||
PUBWEAK PIN_INT7_DriverIRQHandler
|
||||
SECTION .text:CODE:REORDER:NOROOT(2)
|
||||
PIN_INT7_IRQHandler
|
||||
LDR R0, =PIN_INT7_DriverIRQHandler
|
||||
BX R0
|
||||
PUBWEAK CTIMER2_IRQHandler
|
||||
PUBWEAK CTIMER2_DriverIRQHandler
|
||||
SECTION .text:CODE:REORDER:NOROOT(2)
|
||||
CTIMER2_IRQHandler
|
||||
LDR R0, =CTIMER2_DriverIRQHandler
|
||||
BX R0
|
||||
PUBWEAK CTIMER4_IRQHandler
|
||||
PUBWEAK CTIMER4_DriverIRQHandler
|
||||
SECTION .text:CODE:REORDER:NOROOT(2)
|
||||
CTIMER4_IRQHandler
|
||||
LDR R0, =CTIMER4_DriverIRQHandler
|
||||
BX R0
|
||||
PUBWEAK Reserved54_IRQHandler
|
||||
PUBWEAK Reserved54_DriverIRQHandler
|
||||
SECTION .text:CODE:REORDER:NOROOT(2)
|
||||
Reserved54_IRQHandler
|
||||
LDR R0, =Reserved54_DriverIRQHandler
|
||||
BX R0
|
||||
PUBWEAK SPIFI0_IRQHandler
|
||||
PUBWEAK SPIFI0_DriverIRQHandler
|
||||
SECTION .text:CODE:REORDER:NOROOT(2)
|
||||
SPIFI0_IRQHandler
|
||||
LDR R0, =SPIFI0_DriverIRQHandler
|
||||
BX R0
|
||||
WDT_BOD_DriverIRQHandler
|
||||
DMA0_DriverIRQHandler
|
||||
GINT0_DriverIRQHandler
|
||||
GINT1_DriverIRQHandler
|
||||
PIN_INT0_DriverIRQHandler
|
||||
PIN_INT1_DriverIRQHandler
|
||||
PIN_INT2_DriverIRQHandler
|
||||
PIN_INT3_DriverIRQHandler
|
||||
UTICK0_DriverIRQHandler
|
||||
MRT0_DriverIRQHandler
|
||||
CTIMER0_DriverIRQHandler
|
||||
CTIMER1_DriverIRQHandler
|
||||
SCT0_DriverIRQHandler
|
||||
CTIMER3_DriverIRQHandler
|
||||
FLEXCOMM0_DriverIRQHandler
|
||||
FLEXCOMM1_DriverIRQHandler
|
||||
FLEXCOMM2_DriverIRQHandler
|
||||
FLEXCOMM3_DriverIRQHandler
|
||||
FLEXCOMM4_DriverIRQHandler
|
||||
FLEXCOMM5_DriverIRQHandler
|
||||
FLEXCOMM6_DriverIRQHandler
|
||||
FLEXCOMM7_DriverIRQHandler
|
||||
ADC0_SEQA_DriverIRQHandler
|
||||
ADC0_SEQB_DriverIRQHandler
|
||||
ADC0_THCMP_DriverIRQHandler
|
||||
DMIC0_DriverIRQHandler
|
||||
HWVAD0_DriverIRQHandler
|
||||
USB0_NEEDCLK_DriverIRQHandler
|
||||
USB0_DriverIRQHandler
|
||||
RTC_DriverIRQHandler
|
||||
IOH_DriverIRQHandler
|
||||
MAILBOX_DriverIRQHandler
|
||||
PIN_INT4_DriverIRQHandler
|
||||
PIN_INT5_DriverIRQHandler
|
||||
PIN_INT6_DriverIRQHandler
|
||||
PIN_INT7_DriverIRQHandler
|
||||
CTIMER2_DriverIRQHandler
|
||||
CTIMER4_DriverIRQHandler
|
||||
Reserved54_DriverIRQHandler
|
||||
SPIFI0_DriverIRQHandler
|
||||
DefaultISR
|
||||
B .
|
||||
|
||||
END
|
||||
@@ -0,0 +1,359 @@
|
||||
/*
|
||||
** ###################################################################
|
||||
** Processors: LPC54114J256BD64_cm4
|
||||
** LPC54114J256UK49_cm4
|
||||
**
|
||||
** Compilers: Keil ARM C/C++ Compiler
|
||||
** GNU C Compiler
|
||||
** IAR ANSI C/C++ Compiler for ARM
|
||||
**
|
||||
** Reference manual: LPC5411x User manual Rev. 1.0 16 February 2016
|
||||
** Version: rev. 1.0, 2016-04-29
|
||||
** Build: b160525
|
||||
**
|
||||
** 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) 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.
|
||||
**
|
||||
** http: www.freescale.com
|
||||
** mail: support@freescale.com
|
||||
**
|
||||
** Revisions:
|
||||
** - rev. 1.0 (2016-04-29)
|
||||
** Initial version.
|
||||
**
|
||||
** ###################################################################
|
||||
*/
|
||||
|
||||
/*!
|
||||
* @file LPC54114_cm4
|
||||
* @version 1.0
|
||||
* @date 2016-04-29
|
||||
* @brief Device specific configuration file for LPC54114_cm4 (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"
|
||||
|
||||
#define NVALMAX (0x100)
|
||||
#define PVALMAX (0x20)
|
||||
#define MVALMAX (0x8000)
|
||||
#define PLL_SSCG0_MDEC_VAL_P (0) /* MDEC is in bits 16 downto 0 */
|
||||
#define PLL_SSCG0_MDEC_VAL_M (0x1FFFFUL << PLL_SSCG0_MDEC_VAL_P) /* NDEC is in bits 9 downto 0 */
|
||||
#define PLL_NDEC_VAL_P (0) /* NDEC is in bits 9:0 */
|
||||
#define PLL_NDEC_VAL_M (0x3FFUL << PLL_NDEC_VAL_P)
|
||||
#define PLL_PDEC_VAL_P (0) /* PDEC is in bits 6:0 */
|
||||
#define PLL_PDEC_VAL_M (0x3FFUL << PLL_PDEC_VAL_P)
|
||||
|
||||
extern void *__Vectors;
|
||||
|
||||
/* ----------------------------------------------------------------------------
|
||||
-- Core clock
|
||||
---------------------------------------------------------------------------- */
|
||||
|
||||
uint32_t SystemCoreClock = DEFAULT_SYSTEM_CLOCK;
|
||||
|
||||
static const uint8_t wdtFreqLookup[32] = {0, 8, 12, 15, 18, 20, 24, 26, 28, 30, 32, 34, 36, 38, 40, 41, 42, 44, 45, 46,
|
||||
48, 49, 50, 52, 53, 54, 56, 57, 58, 59, 60, 61};
|
||||
|
||||
static uint32_t GetWdtOscFreq(void)
|
||||
{
|
||||
uint8_t freq_sel, div_sel;
|
||||
div_sel = ((SYSCON->WDTOSCCTRL & SYSCON_WDTOSCCTRL_DIVSEL_MASK) + 1) << 1;
|
||||
freq_sel = wdtFreqLookup[((SYSCON->WDTOSCCTRL & SYSCON_WDTOSCCTRL_FREQSEL_MASK) >> SYSCON_WDTOSCCTRL_FREQSEL_SHIFT)];
|
||||
return ((uint32_t) freq_sel * 50000U)/((uint32_t)div_sel);
|
||||
}
|
||||
|
||||
/* Find decoded N value for raw NDEC value */
|
||||
static uint32_t pllDecodeN(uint32_t NDEC)
|
||||
{
|
||||
uint32_t n, x, i;
|
||||
|
||||
/* Find NDec */
|
||||
switch (NDEC)
|
||||
{
|
||||
case 0xFFF:
|
||||
n = 0;
|
||||
break;
|
||||
case 0x302:
|
||||
n = 1;
|
||||
break;
|
||||
case 0x202:
|
||||
n = 2;
|
||||
break;
|
||||
default:
|
||||
x = 0x080;
|
||||
n = 0xFFFFFFFF;
|
||||
for (i = NVALMAX; ((i >= 3) && (n == 0xFFFFFFFF)); i--)
|
||||
{
|
||||
x = (((x ^ (x >> 2) ^ (x >> 3) ^ (x >> 4)) & 1) << 7) | ((x >> 1) & 0x7F);
|
||||
if ((x & (PLL_NDEC_VAL_M >> PLL_NDEC_VAL_P)) == NDEC)
|
||||
{
|
||||
/* Decoded value of NDEC */
|
||||
n = i;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
return n;
|
||||
}
|
||||
|
||||
/* Find decoded P value for raw PDEC value */
|
||||
static uint32_t pllDecodeP(uint32_t PDEC)
|
||||
{
|
||||
uint32_t p, x, i;
|
||||
/* Find PDec */
|
||||
switch (PDEC)
|
||||
{
|
||||
case 0xFF:
|
||||
p = 0;
|
||||
break;
|
||||
case 0x62:
|
||||
p = 1;
|
||||
break;
|
||||
case 0x42:
|
||||
p = 2;
|
||||
break;
|
||||
default:
|
||||
x = 0x10;
|
||||
p = 0xFFFFFFFF;
|
||||
for (i = PVALMAX; ((i >= 3) && (p == 0xFFFFFFFF)); i--)
|
||||
{
|
||||
x = (((x ^ (x >> 2)) & 1) << 4) | ((x >> 1) & 0xF);
|
||||
if ((x & (PLL_PDEC_VAL_M >> PLL_PDEC_VAL_P)) == PDEC)
|
||||
{
|
||||
/* Decoded value of PDEC */
|
||||
p = i;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
return p;
|
||||
}
|
||||
|
||||
/* Find decoded M value for raw MDEC value */
|
||||
static uint32_t pllDecodeM(uint32_t MDEC)
|
||||
{
|
||||
uint32_t m, i, x;
|
||||
|
||||
/* Find MDec */
|
||||
switch (MDEC)
|
||||
{
|
||||
case 0xFFFFF:
|
||||
m = 0;
|
||||
break;
|
||||
case 0x18003:
|
||||
m = 1;
|
||||
break;
|
||||
case 0x10003:
|
||||
m = 2;
|
||||
break;
|
||||
default:
|
||||
x = 0x04000;
|
||||
m = 0xFFFFFFFF;
|
||||
for (i = MVALMAX; ((i >= 3) && (m == 0xFFFFFFFF)); i--)
|
||||
{
|
||||
x = (((x ^ (x >> 1)) & 1) << 14) | ((x >> 1) & 0x3FFF);
|
||||
if ((x & (PLL_SSCG0_MDEC_VAL_M >> PLL_SSCG0_MDEC_VAL_P)) == MDEC)
|
||||
{
|
||||
/* Decoded value of MDEC */
|
||||
m = i;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
return m;
|
||||
}
|
||||
|
||||
/* Get predivider (N) from PLL NDEC setting */
|
||||
static uint32_t findPllPreDiv(uint32_t ctrlReg, uint32_t nDecReg)
|
||||
{
|
||||
uint32_t preDiv = 1;
|
||||
|
||||
/* Direct input is not used? */
|
||||
if ((ctrlReg & SYSCON_SYSPLLCTRL_DIRECTI_MASK) == 0)
|
||||
{
|
||||
/* Decode NDEC value to get (N) pre divider */
|
||||
preDiv = pllDecodeN(nDecReg & 0x3FF);
|
||||
if (preDiv == 0)
|
||||
{
|
||||
preDiv = 1;
|
||||
}
|
||||
}
|
||||
/* Adjusted by 1, directi is used to bypass */
|
||||
return preDiv;
|
||||
}
|
||||
|
||||
/* Get postdivider (P) from PLL PDEC setting */
|
||||
static uint32_t findPllPostDiv(uint32_t ctrlReg, uint32_t pDecReg)
|
||||
{
|
||||
uint32_t postDiv = 1;
|
||||
|
||||
/* Direct input is not used? */
|
||||
if ((ctrlReg & SYSCON_SYSPLLCTRL_DIRECTO_MASK) == 0)
|
||||
{
|
||||
/* Decode PDEC value to get (P) post divider */
|
||||
postDiv = 2 * pllDecodeP(pDecReg & 0x7F);
|
||||
if (postDiv == 0)
|
||||
{
|
||||
postDiv = 2;
|
||||
}
|
||||
}
|
||||
/* Adjusted by 1, directo is used to bypass */
|
||||
return postDiv;
|
||||
}
|
||||
|
||||
/* Get multiplier (M) from PLL MDEC and BYPASS_FBDIV2 settings */
|
||||
static uint32_t findPllMMult(uint32_t ctrlReg, uint32_t mDecReg)
|
||||
{
|
||||
uint32_t mMult = 1;
|
||||
|
||||
/* Decode MDEC value to get (M) multiplier */
|
||||
mMult = pllDecodeM(mDecReg & 0x1FFFF);
|
||||
/* Extra multiply by 2 needed? */
|
||||
if ((ctrlReg & SYSCON_SYSPLLCTRL_BYPASSCCODIV2_MASK) == 0)
|
||||
{
|
||||
mMult = mMult << 1;
|
||||
}
|
||||
if (mMult == 0)
|
||||
{
|
||||
mMult = 1;
|
||||
}
|
||||
return mMult;
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------------------
|
||||
-- SystemInit()
|
||||
---------------------------------------------------------------------------- */
|
||||
|
||||
void SystemInit(void)
|
||||
{
|
||||
#if ((__FPU_PRESENT == 1) && (__FPU_USED == 1)) || (defined(__VFP_FP__) && !defined(__SOFTFP__))
|
||||
SCB->CPACR |= ((3UL << 10 * 2) | (3UL << 11 * 2)); /* set CP10, CP11 Full Access */
|
||||
#endif /* ((__FPU_PRESENT == 1) && (__FPU_USED == 1)) */
|
||||
SCB->VTOR = (uint32_t)&__Vectors;
|
||||
/* Optionally enable RAM banks that may be off by default at reset */
|
||||
#if !defined(DONT_ENABLE_DISABLED_RAMBANKS)
|
||||
SYSCON->AHBCLKCTRLSET[0] = SYSCON_AHBCLKCTRL_SRAM2_MASK;
|
||||
#endif
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------------------
|
||||
-- SystemCoreClockUpdate()
|
||||
---------------------------------------------------------------------------- */
|
||||
|
||||
void SystemCoreClockUpdate(void)
|
||||
{
|
||||
uint32_t clkRate = 0;
|
||||
uint32_t prediv, postdiv;
|
||||
uint64_t workRate;
|
||||
|
||||
switch (SYSCON->MAINCLKSELB & SYSCON_MAINCLKSELB_SEL_MASK)
|
||||
{
|
||||
case 0x00: /* MAINCLKSELA clock (main_clk_a)*/
|
||||
switch (SYSCON->MAINCLKSELA & SYSCON_MAINCLKSELA_SEL_MASK)
|
||||
{
|
||||
case 0x00: /* FRO 12 MHz (fro_12m) */
|
||||
clkRate = CLK_FRO_12MHZ;
|
||||
break;
|
||||
case 0x01: /* CLKIN (clk_in) */
|
||||
clkRate = CLK_CLK_IN;
|
||||
break;
|
||||
case 0x02: /* Watchdog oscillator (wdt_clk) */
|
||||
clkRate = GetWdtOscFreq();
|
||||
break;
|
||||
default: /* = 0x03 = FRO 96 or 48 MHz (fro_hf) */
|
||||
if (SYSCON->FROCTRL & SYSCON_FROCTRL_SEL_MASK)
|
||||
{
|
||||
clkRate = CLK_FRO_96MHZ;
|
||||
}
|
||||
else
|
||||
{
|
||||
clkRate = CLK_FRO_48MHZ;
|
||||
}
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case 0x02: /* System PLL clock (pll_clk)*/
|
||||
switch (SYSCON->SYSPLLCLKSEL & SYSCON_SYSPLLCLKSEL_SEL_MASK)
|
||||
{
|
||||
case 0x00: /* FRO 12 MHz (fro_12m) */
|
||||
clkRate = CLK_FRO_12MHZ;
|
||||
break;
|
||||
case 0x01: /* CLKIN (clk_in) */
|
||||
clkRate = CLK_CLK_IN;
|
||||
break;
|
||||
case 0x02: /* Watchdog oscillator (wdt_clk) */
|
||||
clkRate = GetWdtOscFreq();
|
||||
break;
|
||||
case 0x03: /* RTC oscillator 32 kHz output (32k_clk) */
|
||||
clkRate = CLK_RTC_32K_CLK;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
if ((SYSCON->SYSPLLCTRL & SYSCON_SYSPLLCTRL_BYPASS_MASK) == 0)
|
||||
{
|
||||
/* PLL is not in bypass mode, get pre-divider, post-divider, and M divider */
|
||||
prediv = findPllPreDiv(SYSCON->SYSPLLCTRL, SYSCON->SYSPLLNDEC);
|
||||
postdiv = findPllPostDiv(SYSCON->SYSPLLCTRL, SYSCON->SYSPLLPDEC);
|
||||
/* Adjust input clock */
|
||||
clkRate = clkRate / prediv;
|
||||
/* If using the SS, use the multiplier */
|
||||
if (SYSCON->SYSPLLSSCTRL1 & SYSCON_SYSPLLSSCTRL1_PD_MASK)
|
||||
{
|
||||
/* MDEC used for rate */
|
||||
workRate = (uint64_t)clkRate * (uint64_t)findPllMMult(SYSCON->SYSPLLCTRL, SYSCON->SYSPLLSSCTRL0);
|
||||
}
|
||||
else
|
||||
{
|
||||
/* SS multipler used for rate */
|
||||
workRate = 0;
|
||||
/* Adjust by fractional */
|
||||
workRate = workRate + ((clkRate * (uint64_t)((SYSCON->SYSPLLSSCTRL1 & 0x7FF) >> 0)) / 0x800);
|
||||
}
|
||||
clkRate = workRate / ((uint64_t)postdiv);
|
||||
}
|
||||
break;
|
||||
case 0x03: /* RTC oscillator 32 kHz output (32k_clk) */
|
||||
clkRate = CLK_RTC_32K_CLK;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
SystemCoreClock = clkRate / ((SYSCON->AHBCLKDIV & 0xFF) + 1);
|
||||
}
|
||||
@@ -0,0 +1,119 @@
|
||||
/*
|
||||
** ###################################################################
|
||||
** Processors: LPC54114J256BD64_cm4
|
||||
** LPC54114J256UK49_cm4
|
||||
**
|
||||
** Compilers: Keil ARM C/C++ Compiler
|
||||
** GNU C Compiler
|
||||
** IAR ANSI C/C++ Compiler for ARM
|
||||
**
|
||||
** Reference manual: LPC5411x User manual Rev. 1.0 16 February 2016
|
||||
** Version: rev. 1.0, 2016-04-29
|
||||
** Build: b160525
|
||||
**
|
||||
** 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) 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.
|
||||
**
|
||||
** http: www.freescale.com
|
||||
** mail: support@freescale.com
|
||||
**
|
||||
** Revisions:
|
||||
** - rev. 1.0 (2016-04-29)
|
||||
** Initial version.
|
||||
**
|
||||
** ###################################################################
|
||||
*/
|
||||
|
||||
/*!
|
||||
* @file LPC54114_cm4
|
||||
* @version 1.0
|
||||
* @date 2016-04-29
|
||||
* @brief Device specific configuration file for LPC54114_cm4 (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_LPC54114_cm4_H_
|
||||
#define _SYSTEM_LPC54114_cm4_H_ /**< Symbol preventing repeated inclusion */
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
|
||||
#define DEFAULT_SYSTEM_CLOCK 12000000u /* Default System clock value */
|
||||
#define CLK_RTC_32K_CLK 32768u /* RTC oscillator 32 kHz output (32k_clk */
|
||||
#define CLK_FRO_12MHZ 12000000u /* FRO 12 MHz (fro_12m) */
|
||||
#define CLK_FRO_48MHZ 48000000u /* FRO 48 MHz (fro_48m) */
|
||||
#define CLK_FRO_96MHZ 96000000u /* FRO 96 MHz (fro_96m) */
|
||||
#define CLK_CLK_IN 0u /* Default CLK_IN pin clock */
|
||||
|
||||
|
||||
/**
|
||||
* @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 /* _SYSTEM_LPC54114_cm4_H_ */
|
||||
@@ -0,0 +1,13 @@
|
||||
/* mbed Microcontroller Library - CMSIS
|
||||
* Copyright (C) 2009-2011 ARM Limited. All rights reserved.
|
||||
*
|
||||
* A generic CMSIS include header, pulling in LPC54114 specifics
|
||||
*/
|
||||
|
||||
#ifndef MBED_CMSIS_H
|
||||
#define MBED_CMSIS_H
|
||||
|
||||
#include "fsl_device_registers.h"
|
||||
#include "cmsis_nvic.h"
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,46 @@
|
||||
/* mbed Microcontroller Library
|
||||
* CMSIS-style functionality to support dynamic vectors
|
||||
*******************************************************************************
|
||||
* Copyright (c) 2011 ARM Limited. All rights reserved.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
* this list of conditions and the following disclaimer in the documentation
|
||||
* and/or other materials provided with the distribution.
|
||||
* 3. Neither the name of ARM Limited nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*******************************************************************************
|
||||
*/
|
||||
|
||||
#ifndef MBED_CMSIS_NVIC_H
|
||||
#define MBED_CMSIS_NVIC_H
|
||||
|
||||
#if defined(__CC_ARM) || (defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050))
|
||||
extern uint32_t Image$$VECTOR_RAM$$Base[];
|
||||
#define __VECTOR_RAM Image$$VECTOR_RAM$$Base
|
||||
#else
|
||||
extern uint32_t __VECTOR_RAM[];
|
||||
#endif
|
||||
|
||||
/* Symbols defined by the linker script */
|
||||
#define NVIC_NUM_VECTORS (16 + 40) // CORE + MCU Peripherals
|
||||
#define NVIC_RAM_VECTOR_ADDRESS (__VECTOR_RAM) // Vectors positioned at start of RAM
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,65 @@
|
||||
/*
|
||||
* Copyright (c) 2014 - 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.
|
||||
*/
|
||||
|
||||
#ifndef __FSL_DEVICE_REGISTERS_H__
|
||||
#define __FSL_DEVICE_REGISTERS_H__
|
||||
|
||||
/*
|
||||
* Include the cpu specific register header files.
|
||||
*
|
||||
* The CPU macro should be declared in the project or makefile.
|
||||
*/
|
||||
#if (defined(CPU_LPC54114J256BD64_cm4) || defined(CPU_LPC54114J256UK49_cm4))
|
||||
|
||||
#define LPC54114_cm4_SERIES
|
||||
|
||||
/* CMSIS-style register definitions */
|
||||
#include "LPC54114_cm4.h"
|
||||
/* CPU specific feature definitions */
|
||||
#include "LPC54114_cm4_features.h"
|
||||
|
||||
#elif (defined(CPU_LPC54114J256BD64_cm0plus) || defined(CPU_LPC54114J256UK49_cm0plus))
|
||||
|
||||
#define LPC54114_cm0plus_SERIES
|
||||
|
||||
/* CMSIS-style register definitions */
|
||||
#include "LPC54114_cm0plus.h"
|
||||
/* CPU specific feature definitions */
|
||||
#include "LPC54114_cm0plus_features.h"
|
||||
|
||||
#else
|
||||
#error "No valid CPU defined!"
|
||||
#endif
|
||||
|
||||
#endif /* __FSL_DEVICE_REGISTERS_H__ */
|
||||
|
||||
/*******************************************************************************
|
||||
* EOF
|
||||
******************************************************************************/
|
||||
Reference in New Issue
Block a user