mirror of https://github.com/ARMmbed/mbed-os.git
FastModels: add FVP_MPS2_M4 target support
add cmsis drivers and toolchain scripts for FVP_MPS2_M4pull/6862/head
parent
2e4a023489
commit
ce2c21a1f4
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,614 @@
|
|||
/* MPS2 CMSIS Library
|
||||
*
|
||||
* Copyright (c) 2006-2018 ARM Limited
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
*
|
||||
* 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 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.
|
||||
*******************************************************************************
|
||||
* File: smm_mps2.h
|
||||
* Release: Version 1.1
|
||||
*******************************************************************************/
|
||||
|
||||
#ifndef __SMM_MPS2_H
|
||||
#define __SMM_MPS2_H
|
||||
|
||||
#include "peripherallink.h" /* device specific header file */
|
||||
|
||||
#if defined ( __CC_ARM )
|
||||
#pragma anon_unions
|
||||
#endif
|
||||
|
||||
/******************************************************************************/
|
||||
/* FPGA System Register declaration */
|
||||
/******************************************************************************/
|
||||
|
||||
typedef struct
|
||||
{
|
||||
__IO uint32_t LED; // Offset: 0x000 (R/W) LED connections
|
||||
// [31:2] : Reserved
|
||||
// [1:0] : LEDs
|
||||
uint32_t RESERVED1[1];
|
||||
__IO uint32_t BUTTON; // Offset: 0x008 (R/W) Buttons
|
||||
// [31:2] : Reserved
|
||||
// [1:0] : Buttons
|
||||
uint32_t RESERVED2[1];
|
||||
__IO uint32_t CLK1HZ; // Offset: 0x010 (R/W) 1Hz up counter
|
||||
__IO uint32_t CLK100HZ; // Offset: 0x014 (R/W) 100Hz up counter
|
||||
__IO uint32_t COUNTER; // Offset: 0x018 (R/W) Cycle Up Counter
|
||||
// Increments when 32-bit prescale counter reach zero
|
||||
uint32_t RESERVED3[1];
|
||||
__IO uint32_t PRESCALE; // Offset: 0x020 (R/W) Prescaler
|
||||
// Bit[31:0] : reload value for prescale counter
|
||||
__IO uint32_t PSCNTR; // Offset: 0x024 (R/W) 32-bit Prescale counter
|
||||
// current value of the pre-scaler counter
|
||||
// The Cycle Up Counter increment when the prescale down counter reach 0
|
||||
// The pre-scaler counter is reloaded with PRESCALE after reaching 0.
|
||||
uint32_t RESERVED4[9];
|
||||
__IO uint32_t MISC; // Offset: 0x04C (R/W) Misc control */
|
||||
// [31:10] : Reserved
|
||||
// [9] : SHIELD_1_SPI_nCS
|
||||
// [8] : SHIELD_0_SPI_nCS
|
||||
// [7] : ADC_SPI_nCS
|
||||
// [6] : CLCD_BL_CTRL
|
||||
// [5] : CLCD_RD
|
||||
// [4] : CLCD_RS
|
||||
// [3] : CLCD_RESET
|
||||
// [2] : RESERVED
|
||||
// [1] : SPI_nSS
|
||||
// [0] : CLCD_CS
|
||||
} MPS2_FPGAIO_TypeDef;
|
||||
|
||||
// MISC register bit definitions
|
||||
|
||||
#define CLCD_CS_Pos 0
|
||||
#define CLCD_CS_Msk (1UL<<CLCD_CS_Pos)
|
||||
#define SPI_nSS_Pos 1
|
||||
#define SPI_nSS_Msk (1UL<<SPI_nSS_Pos)
|
||||
#define CLCD_RESET_Pos 3
|
||||
#define CLCD_RESET_Msk (1UL<<CLCD_RESET_Pos)
|
||||
#define CLCD_RS_Pos 4
|
||||
#define CLCD_RS_Msk (1UL<<CLCD_RS_Pos)
|
||||
#define CLCD_RD_Pos 5
|
||||
#define CLCD_RD_Msk (1UL<<CLCD_RD_Pos)
|
||||
#define CLCD_BL_Pos 6
|
||||
#define CLCD_BL_Msk (1UL<<CLCD_BL_Pos)
|
||||
#define ADC_nCS_Pos 7
|
||||
#define ADC_nCS_Msk (1UL<<ADC_nCS_Pos)
|
||||
#define SHIELD_0_nCS_Pos 8
|
||||
#define SHIELD_0_nCS_Msk (1UL<<SHIELD_0_nCS_Pos)
|
||||
#define SHIELD_1_nCS_Pos 9
|
||||
#define SHIELD_1_nCS_Msk (1UL<<SHIELD_1_nCS_Pos)
|
||||
|
||||
/******************************************************************************/
|
||||
/* SCC Register declaration */
|
||||
/******************************************************************************/
|
||||
|
||||
typedef struct //
|
||||
{
|
||||
__IO uint32_t CFG_REG0; // Offset: 0x000 (R/W) Remaps block RAM to ZBT
|
||||
// [31:1] : Reserved
|
||||
// [0] 1 : REMAP BlockRam to ZBT
|
||||
__IO uint32_t LEDS; // Offset: 0x004 (R/W) Controls the MCC user LEDs
|
||||
// [31:8] : Reserved
|
||||
// [7:0] : MCC LEDs
|
||||
uint32_t RESERVED0[1];
|
||||
__I uint32_t SWITCHES; // Offset: 0x00C (R/ ) Denotes the state of the MCC user switches
|
||||
// [31:8] : Reserved
|
||||
// [7:0] : These bits indicate state of the MCC switches
|
||||
__I uint32_t CFG_REG4; // Offset: 0x010 (R/ ) Denotes the board revision
|
||||
// [31:4] : Reserved
|
||||
// [3:0] : Used by the MCC to pass PCB revision. 0 = A 1 = B
|
||||
uint32_t RESERVED1[35];
|
||||
__IO uint32_t SYS_CFGDATA_RTN; // Offset: 0x0A0 (R/W) User data register
|
||||
// [31:0] : Data
|
||||
__IO uint32_t SYS_CFGDATA_OUT; // Offset: 0x0A4 (R/W) User data register
|
||||
// [31:0] : Data
|
||||
__IO uint32_t SYS_CFGCTRL; // Offset: 0x0A8 (R/W) Control register
|
||||
// [31] : Start (generates interrupt on write to this bit)
|
||||
// [30] : R/W access
|
||||
// [29:26] : Reserved
|
||||
// [25:20] : Function value
|
||||
// [19:12] : Reserved
|
||||
// [11:0] : Device (value of 0/1/2 for supported clocks)
|
||||
__IO uint32_t SYS_CFGSTAT; // Offset: 0x0AC (R/W) Contains status information
|
||||
// [31:2] : Reserved
|
||||
// [1] : Error
|
||||
// [0] : Complete
|
||||
__IO uint32_t RESERVED2[20];
|
||||
__IO uint32_t SCC_DLL; // Offset: 0x100 (R/W) DLL Lock Register
|
||||
// [31:24] : DLL LOCK MASK[7:0] - Indicate if the DLL locked is masked
|
||||
// [23:16] : DLL LOCK MASK[7:0] - Indicate if the DLLs are locked or unlocked
|
||||
// [15:1] : Reserved
|
||||
// [0] : This bit indicates if all enabled DLLs are locked
|
||||
uint32_t RESERVED3[957];
|
||||
__I uint32_t SCC_AID; // Offset: 0xFF8 (R/ ) SCC AID Register
|
||||
// [31:24] : FPGA build number
|
||||
// [23:20] : V2M-MPS2 target board revision (A = 0, B = 1)
|
||||
// [19:11] : Reserved
|
||||
// [10] : if “1” SCC_SW register has been implemented
|
||||
// [9] : if “1” SCC_LED register has been implemented
|
||||
// [8] : if “1” DLL lock register has been implemented
|
||||
// [7:0] : number of SCC configuration register
|
||||
__I uint32_t SCC_ID; // Offset: 0xFFC (R/ ) Contains information about the FPGA image
|
||||
// [31:24] : Implementer ID: 0x41 = ARM
|
||||
// [23:20] : Application note IP variant number
|
||||
// [19:16] : IP Architecture: 0x4 =AHB
|
||||
// [15:4] : Primary part number: 386 = AN386
|
||||
// [3:0] : Application note IP revision number
|
||||
} MPS2_SCC_TypeDef;
|
||||
|
||||
|
||||
/******************************************************************************/
|
||||
/* SSP Peripheral declaration */
|
||||
/******************************************************************************/
|
||||
|
||||
typedef struct // Document DDI0194G_ssp_pl022_r1p3_trm.pdf
|
||||
{
|
||||
__IO uint32_t CR0; // Offset: 0x000 (R/W) Control register 0
|
||||
// [31:16] : Reserved
|
||||
// [15:8] : Serial clock rate
|
||||
// [7] : SSPCLKOUT phase, applicable to Motorola SPI frame format only
|
||||
// [6] : SSPCLKOUT polarity, applicable to Motorola SPI frame format only
|
||||
// [5:4] : Frame format
|
||||
// [3:0] : Data Size Select
|
||||
__IO uint32_t CR1; // Offset: 0x004 (R/W) Control register 1
|
||||
// [31:4] : Reserved
|
||||
// [3] : Slave-mode output disable
|
||||
// [2] : Master or slave mode select
|
||||
// [1] : Synchronous serial port enable
|
||||
// [0] : Loop back mode
|
||||
__IO uint32_t DR; // Offset: 0x008 (R/W) Data register
|
||||
// [31:16] : Reserved
|
||||
// [15:0] : Transmit/Receive FIFO
|
||||
__I uint32_t SR; // Offset: 0x00C (R/ ) Status register
|
||||
// [31:5] : Reserved
|
||||
// [4] : PrimeCell SSP busy flag
|
||||
// [3] : Receive FIFO full
|
||||
// [2] : Receive FIFO not empty
|
||||
// [1] : Transmit FIFO not full
|
||||
// [0] : Transmit FIFO empty
|
||||
__IO uint32_t CPSR; // Offset: 0x010 (R/W) Clock prescale register
|
||||
// [31:8] : Reserved
|
||||
// [8:0] : Clock prescale divisor
|
||||
__IO uint32_t IMSC; // Offset: 0x014 (R/W) Interrupt mask set or clear register
|
||||
// [31:4] : Reserved
|
||||
// [3] : Transmit FIFO interrupt mask
|
||||
// [2] : Receive FIFO interrupt mask
|
||||
// [1] : Receive timeout interrupt mask
|
||||
// [0] : Receive overrun interrupt mask
|
||||
__I uint32_t RIS; // Offset: 0x018 (R/ ) Raw interrupt status register
|
||||
// [31:4] : Reserved
|
||||
// [3] : raw interrupt state, prior to masking, of the SSPTXINTR interrupt
|
||||
// [2] : raw interrupt state, prior to masking, of the SSPRXINTR interrupt
|
||||
// [1] : raw interrupt state, prior to masking, of the SSPRTINTR interrupt
|
||||
// [0] : raw interrupt state, prior to masking, of the SSPRORINTR interrupt
|
||||
__I uint32_t MIS; // Offset: 0x01C (R/ ) Masked interrupt status register
|
||||
// [31:4] : Reserved
|
||||
// [3] : transmit FIFO masked interrupt state, after masking, of the SSPTXINTR interrupt
|
||||
// [2] : receive FIFO masked interrupt state, after masking, of the SSPRXINTR interrupt
|
||||
// [1] : receive timeout masked interrupt state, after masking, of the SSPRTINTR interrupt
|
||||
// [0] : receive over run masked interrupt status, after masking, of the SSPRORINTR interrupt
|
||||
__O uint32_t ICR; // Offset: 0x020 ( /W) Interrupt clear register
|
||||
// [31:2] : Reserved
|
||||
// [1] : Clears the SSPRTINTR interrupt
|
||||
// [0] : Clears the SSPRORINTR interrupt
|
||||
__IO uint32_t DMACR; // Offset: 0x024 (R/W) DMA control register
|
||||
// [31:2] : Reserved
|
||||
// [1] : Transmit DMA Enable
|
||||
// [0] : Receive DMA Enable
|
||||
} MPS2_SSP_TypeDef;
|
||||
|
||||
|
||||
// SSP_CR0 Control register 0
|
||||
#define SSP_CR0_DSS_Pos 0 // Data Size Select
|
||||
#define SSP_CR0_DSS_Msk (0xF<<SSP_CR0_DSS_Pos)
|
||||
#define SSP_CR0_FRF_Pos 4 // Frame Format Select
|
||||
#define SSP_CR0_FRF_Msk (3UL<<SSP_CR0_FRM_Pos)
|
||||
#define SSP_CR0_SPO_Pos 6 // SSPCLKOUT polarity
|
||||
#define SSP_CR0_SPO_Msk (1UL<<SSP_CR0_SPO_Pos)
|
||||
#define SSP_CR0_SPH_Pos 7 // SSPCLKOUT phase
|
||||
#define SSP_CR0_SPH_Msk (1UL<<SSP_CR0_SPH_Pos)
|
||||
#define SSP_CR0_SCR_Pos 8 // Serial Clock Rate (divide)
|
||||
#define SSP_CR0_SCR_Msk (0xFF<<SSP_CR0_SCR_Pos)
|
||||
|
||||
#define SSP_CR0_SCR_DFLT 0x0300 // Serial Clock Rate (divide), default set at 3
|
||||
#define SSP_CR0_FRF_MOT 0x0000 // Frame format, Motorola
|
||||
#define SSP_CR0_DSS_8 0x0007 // Data packet size, 8bits
|
||||
#define SSP_CR0_DSS_16 0x000F // Data packet size, 16bits
|
||||
|
||||
// SSP_CR1 Control register 1
|
||||
#define SSP_CR1_LBM_Pos 0 // Loop Back Mode
|
||||
#define SSP_CR1_LBM_Msk (1UL<<SSP_CR1_LBM_Pos)
|
||||
#define SSP_CR1_SSE_Pos 1 // Serial port enable
|
||||
#define SSP_CR1_SSE_Msk (1UL<<SSP_CR1_SSE_Pos)
|
||||
#define SSP_CR1_MS_Pos 2 // Master or Slave mode
|
||||
#define SSP_CR1_MS_Msk (1UL<<SSP_CR1_MS_Pos)
|
||||
#define SSP_CR1_SOD_Pos 3 // Slave Output mode Disable
|
||||
#define SSP_CR1_SOD_Msk (1UL<<SSP_CR1_SOD_Pos)
|
||||
|
||||
// SSP_SR Status register
|
||||
#define SSP_SR_TFE_Pos 0 // Transmit FIFO empty
|
||||
#define SSP_SR_TFE_Msk (1UL<<SSP_SR_TFE_Pos)
|
||||
#define SSP_SR_TNF_Pos 1 // Transmit FIFO not full
|
||||
#define SSP_SR_TNF_Msk (1UL<<SSP_SR_TNF_Pos)
|
||||
#define SSP_SR_RNE_Pos 2 // Receive FIFO not empty
|
||||
#define SSP_SR_RNE_Msk (1UL<<SSP_SR_RNE_Pos)
|
||||
#define SSP_SR_RFF_Pos 3 // Receive FIFO full
|
||||
#define SSP_SR_RFF_Msk (1UL<<SSP_SR_RFF_Pos)
|
||||
#define SSP_SR_BSY_Pos 4 // Busy
|
||||
#define SSP_SR_BSY_Msk (1UL<<SSP_SR_BSY_Pos)
|
||||
|
||||
// SSP_CPSR Clock prescale register
|
||||
#define SSP_CPSR_CPD_Pos 0 // Clock prescale divisor
|
||||
#define SSP_CPSR_CPD_Msk (0xFF<<SSP_CPSR_CDP_Pos)
|
||||
|
||||
#define SSP_CPSR_DFLT 0x0008 // Clock prescale (use with SCR), default set at 8
|
||||
|
||||
// SSPIMSC Interrupt mask set and clear register
|
||||
#define SSP_IMSC_RORIM_Pos 0 // Receive overrun not Masked
|
||||
#define SSP_IMSC_RORIM_Msk (1UL<<SSP_IMSC_RORIM_Pos)
|
||||
#define SSP_IMSC_RTIM_Pos 1 // Receive timeout not Masked
|
||||
#define SSP_IMSC_RTIM_Msk (1UL<<SSP_IMSC_RTIM_Pos)
|
||||
#define SSP_IMSC_RXIM_Pos 2 // Receive FIFO not Masked
|
||||
#define SSP_IMSC_RXIM_Msk (1UL<<SSP_IMSC_RXIM_Pos)
|
||||
#define SSP_IMSC_TXIM_Pos 3 // Transmit FIFO not Masked
|
||||
#define SSP_IMSC_TXIM_Msk (1UL<<SSP_IMSC_TXIM_Pos)
|
||||
|
||||
// SSPRIS Raw interrupt status register
|
||||
#define SSP_RIS_RORRIS_Pos 0 // Raw Overrun interrupt flag
|
||||
#define SSP_RIS_RORRIS_Msk (1UL<<SSP_RIS_RORRIS_Pos)
|
||||
#define SSP_RIS_RTRIS_Pos 1 // Raw Timemout interrupt flag
|
||||
#define SSP_RIS_RTRIS_Msk (1UL<<SSP_RIS_RTRIS_Pos)
|
||||
#define SSP_RIS_RXRIS_Pos 2 // Raw Receive interrupt flag
|
||||
#define SSP_RIS_RXRIS_Msk (1UL<<SSP_RIS_RXRIS_Pos)
|
||||
#define SSP_RIS_TXRIS_Pos 3 // Raw Transmit interrupt flag
|
||||
#define SSP_RIS_TXRIS_Msk (1UL<<SSP_RIS_TXRIS_Pos)
|
||||
|
||||
// SSPMIS Masked interrupt status register
|
||||
#define SSP_MIS_RORMIS_Pos 0 // Masked Overrun interrupt flag
|
||||
#define SSP_MIS_RORMIS_Msk (1UL<<SSP_MIS_RORMIS_Pos)
|
||||
#define SSP_MIS_RTMIS_Pos 1 // Masked Timemout interrupt flag
|
||||
#define SSP_MIS_RTMIS_Msk (1UL<<SSP_MIS_RTMIS_Pos)
|
||||
#define SSP_MIS_RXMIS_Pos 2 // Masked Receive interrupt flag
|
||||
#define SSP_MIS_RXMIS_Msk (1UL<<SSP_MIS_RXMIS_Pos)
|
||||
#define SSP_MIS_TXMIS_Pos 3 // Masked Transmit interrupt flag
|
||||
#define SSP_MIS_TXMIS_Msk (1UL<<SSP_MIS_TXMIS_Pos)
|
||||
|
||||
// SSPICR Interrupt clear register
|
||||
#define SSP_ICR_RORIC_Pos 0 // Clears Overrun interrupt flag
|
||||
#define SSP_ICR_RORIC_Msk (1UL<<SSP_ICR_RORIC_Pos)
|
||||
#define SSP_ICR_RTIC_Pos 1 // Clears Timemout interrupt flag
|
||||
#define SSP_ICR_RTIC_Msk (1UL<<SSP_ICR_RTIC_Pos)
|
||||
|
||||
// SSPDMACR DMA control register
|
||||
#define SSP_DMACR_RXDMAE_Pos 0 // Enable Receive FIFO DMA
|
||||
#define SSP_DMACR_RXDMAE_Msk (1UL<<SSP_DMACR_RXDMAE_Pos)
|
||||
#define SSP_DMACR_TXDMAE_Pos 1 // Enable Transmit FIFO DMA
|
||||
#define SSP_DMACR_TXDMAE_Msk (1UL<<SSP_DMACR_TXDMAE_Pos)
|
||||
|
||||
/******************************************************************************/
|
||||
/* Audio and Touch Screen (I2C) Peripheral declaration */
|
||||
/******************************************************************************/
|
||||
|
||||
typedef struct
|
||||
{
|
||||
union {
|
||||
__O uint32_t CONTROLS; // Offset: 0x000 CONTROL Set Register ( /W)
|
||||
__I uint32_t CONTROL; // Offset: 0x000 CONTROL Status Register (R/ )
|
||||
};
|
||||
__O uint32_t CONTROLC; // Offset: 0x004 CONTROL Clear Register ( /W)
|
||||
} MPS2_I2C_TypeDef;
|
||||
|
||||
#define SDA 1 << 1
|
||||
#define SCL 1 << 0
|
||||
|
||||
|
||||
/******************************************************************************/
|
||||
/* Audio I2S Peripheral declaration */
|
||||
/******************************************************************************/
|
||||
|
||||
typedef struct
|
||||
{
|
||||
/*!< Offset: 0x000 CONTROL Register (R/W) */
|
||||
__IO uint32_t CONTROL; // <h> CONTROL </h>
|
||||
// <o.0> TX Enable
|
||||
// <0=> TX disabled
|
||||
// <1=> TX enabled
|
||||
// <o.1> TX IRQ Enable
|
||||
// <0=> TX IRQ disabled
|
||||
// <1=> TX IRQ enabled
|
||||
// <o.2> RX Enable
|
||||
// <0=> RX disabled
|
||||
// <1=> RX enabled
|
||||
// <o.3> RX IRQ Enable
|
||||
// <0=> RX IRQ disabled
|
||||
// <1=> RX IRQ enabled
|
||||
// <o.10..8> TX Buffer Water Level
|
||||
// <0=> / IRQ triggers when any space available
|
||||
// <1=> / IRQ triggers when more than 1 space available
|
||||
// <2=> / IRQ triggers when more than 2 space available
|
||||
// <3=> / IRQ triggers when more than 3 space available
|
||||
// <4=> Undefined!
|
||||
// <5=> Undefined!
|
||||
// <6=> Undefined!
|
||||
// <7=> Undefined!
|
||||
// <o.14..12> RX Buffer Water Level
|
||||
// <0=> Undefined!
|
||||
// <1=> / IRQ triggers when less than 1 space available
|
||||
// <2=> / IRQ triggers when less than 2 space available
|
||||
// <3=> / IRQ triggers when less than 3 space available
|
||||
// <4=> / IRQ triggers when less than 4 space available
|
||||
// <5=> Undefined!
|
||||
// <6=> Undefined!
|
||||
// <7=> Undefined!
|
||||
// <o.16> FIFO reset
|
||||
// <0=> Normal operation
|
||||
// <1=> FIFO reset
|
||||
// <o.17> Audio Codec reset
|
||||
// <0=> Normal operation
|
||||
// <1=> Assert audio Codec reset
|
||||
/*!< Offset: 0x004 STATUS Register (R/ ) */
|
||||
__I uint32_t STATUS; // <h> STATUS </h>
|
||||
// <o.0> TX Buffer alert
|
||||
// <0=> TX buffer don't need service yet
|
||||
// <1=> TX buffer need service
|
||||
// <o.1> RX Buffer alert
|
||||
// <0=> RX buffer don't need service yet
|
||||
// <1=> RX buffer need service
|
||||
// <o.2> TX Buffer Empty
|
||||
// <0=> TX buffer have data
|
||||
// <1=> TX buffer empty
|
||||
// <o.3> TX Buffer Full
|
||||
// <0=> TX buffer not full
|
||||
// <1=> TX buffer full
|
||||
// <o.4> RX Buffer Empty
|
||||
// <0=> RX buffer have data
|
||||
// <1=> RX buffer empty
|
||||
// <o.5> RX Buffer Full
|
||||
// <0=> RX buffer not full
|
||||
// <1=> RX buffer full
|
||||
union {
|
||||
/*!< Offset: 0x008 Error Status Register (R/ ) */
|
||||
__I uint32_t ERROR; // <h> ERROR </h>
|
||||
// <o.0> TX error
|
||||
// <0=> Okay
|
||||
// <1=> TX overrun/underrun
|
||||
// <o.1> RX error
|
||||
// <0=> Okay
|
||||
// <1=> RX overrun/underrun
|
||||
/*!< Offset: 0x008 Error Clear Register ( /W) */
|
||||
__O uint32_t ERRORCLR; // <h> ERRORCLR </h>
|
||||
// <o.0> TX error
|
||||
// <0=> Okay
|
||||
// <1=> Clear TX error
|
||||
// <o.1> RX error
|
||||
// <0=> Okay
|
||||
// <1=> Clear RX error
|
||||
};
|
||||
/*!< Offset: 0x00C Divide ratio Register (R/W) */
|
||||
__IO uint32_t DIVIDE; // <h> Divide ratio for Left/Right clock </h>
|
||||
// <o.9..0> TX error (default 0x80)
|
||||
/*!< Offset: 0x010 Transmit Buffer ( /W) */
|
||||
__O uint32_t TXBUF; // <h> Transmit buffer </h>
|
||||
// <o.15..0> Right channel
|
||||
// <o.31..16> Left channel
|
||||
/*!< Offset: 0x014 Receive Buffer (R/ ) */
|
||||
__I uint32_t RXBUF; // <h> Receive buffer </h>
|
||||
// <o.15..0> Right channel
|
||||
// <o.31..16> Left channel
|
||||
uint32_t RESERVED1[186];
|
||||
__IO uint32_t ITCR; // <h> Integration Test Control Register </h>
|
||||
// <o.0> ITEN
|
||||
// <0=> Normal operation
|
||||
// <1=> Integration Test mode enable
|
||||
__O uint32_t ITIP1; // <h> Integration Test Input Register 1</h>
|
||||
// <o.0> SDIN
|
||||
__O uint32_t ITOP1; // <h> Integration Test Output Register 1</h>
|
||||
// <o.0> SDOUT
|
||||
// <o.1> SCLK
|
||||
// <o.2> LRCK
|
||||
// <o.3> IRQOUT
|
||||
} MPS2_I2S_TypeDef;
|
||||
|
||||
#define I2S_CONTROL_TXEN_Pos 0
|
||||
#define I2S_CONTROL_TXEN_Msk (1UL<<I2S_CONTROL_TXEN_Pos)
|
||||
|
||||
#define I2S_CONTROL_TXIRQEN_Pos 1
|
||||
#define I2S_CONTROL_TXIRQEN_Msk (1UL<<I2S_CONTROL_TXIRQEN_Pos)
|
||||
|
||||
#define I2S_CONTROL_RXEN_Pos 2
|
||||
#define I2S_CONTROL_RXEN_Msk (1UL<<I2S_CONTROL_RXEN_Pos)
|
||||
|
||||
#define I2S_CONTROL_RXIRQEN_Pos 3
|
||||
#define I2S_CONTROL_RXIRQEN_Msk (1UL<<I2S_CONTROL_RXIRQEN_Pos)
|
||||
|
||||
#define I2S_CONTROL_TXWLVL_Pos 8
|
||||
#define I2S_CONTROL_TXWLVL_Msk (7UL<<I2S_CONTROL_TXWLVL_Pos)
|
||||
|
||||
#define I2S_CONTROL_RXWLVL_Pos 12
|
||||
#define I2S_CONTROL_RXWLVL_Msk (7UL<<I2S_CONTROL_RXWLVL_Pos)
|
||||
/* FIFO reset*/
|
||||
#define I2S_CONTROL_FIFORST_Pos 16
|
||||
#define I2S_CONTROL_FIFORST_Msk (1UL<<I2S_CONTROL_FIFORST_Pos)
|
||||
/* Codec reset*/
|
||||
#define I2S_CONTROL_CODECRST_Pos 17
|
||||
#define I2S_CONTROL_CODECRST_Msk (1UL<<I2S_CONTROL_CODECRST_Pos)
|
||||
|
||||
#define I2S_STATUS_TXIRQ_Pos 0
|
||||
#define I2S_STATUS_TXIRQ_Msk (1UL<<I2S_STATUS_TXIRQ_Pos)
|
||||
|
||||
#define I2S_STATUS_RXIRQ_Pos 1
|
||||
#define I2S_STATUS_RXIRQ_Msk (1UL<<I2S_STATUS_RXIRQ_Pos)
|
||||
|
||||
#define I2S_STATUS_TXEmpty_Pos 2
|
||||
#define I2S_STATUS_TXEmpty_Msk (1UL<<I2S_STATUS_TXEmpty_Pos)
|
||||
|
||||
#define I2S_STATUS_TXFull_Pos 3
|
||||
#define I2S_STATUS_TXFull_Msk (1UL<<I2S_STATUS_TXFull_Pos)
|
||||
|
||||
#define I2S_STATUS_RXEmpty_Pos 4
|
||||
#define I2S_STATUS_RXEmpty_Msk (1UL<<I2S_STATUS_RXEmpty_Pos)
|
||||
|
||||
#define I2S_STATUS_RXFull_Pos 5
|
||||
#define I2S_STATUS_RXFull_Msk (1UL<<I2S_STATUS_RXFull_Pos)
|
||||
|
||||
#define I2S_ERROR_TXERR_Pos 0
|
||||
#define I2S_ERROR_TXERR_Msk (1UL<<I2S_ERROR_TXERR_Pos)
|
||||
|
||||
#define I2S_ERROR_RXERR_Pos 1
|
||||
#define I2S_ERROR_RXERR_Msk (1UL<<I2S_ERROR_RXERR_Pos)
|
||||
|
||||
/******************************************************************************/
|
||||
/* SMSC9220 Register Definitions */
|
||||
/******************************************************************************/
|
||||
|
||||
typedef struct // SMSC LAN9220
|
||||
{
|
||||
__I uint32_t RX_DATA_PORT; // Receive FIFO Ports (offset 0x0)
|
||||
uint32_t RESERVED1[0x7];
|
||||
__O uint32_t TX_DATA_PORT; // Transmit FIFO Ports (offset 0x20)
|
||||
uint32_t RESERVED2[0x7];
|
||||
|
||||
__I uint32_t RX_STAT_PORT; // Receive FIFO status port (offset 0x40)
|
||||
__I uint32_t RX_STAT_PEEK; // Receive FIFO status peek (offset 0x44)
|
||||
__I uint32_t TX_STAT_PORT; // Transmit FIFO status port (offset 0x48)
|
||||
__I uint32_t TX_STAT_PEEK; // Transmit FIFO status peek (offset 0x4C)
|
||||
|
||||
__I uint32_t ID_REV; // Chip ID and Revision (offset 0x50)
|
||||
__IO uint32_t IRQ_CFG; // Main Interrupt Configuration (offset 0x54)
|
||||
__IO uint32_t INT_STS; // Interrupt Status (offset 0x58)
|
||||
__IO uint32_t INT_EN; // Interrupt Enable Register (offset 0x5C)
|
||||
uint32_t RESERVED3; // Reserved for future use (offset 0x60)
|
||||
__I uint32_t BYTE_TEST; // Read-only byte order testing register 87654321h (offset 0x64)
|
||||
__IO uint32_t FIFO_INT; // FIFO Level Interrupts (offset 0x68)
|
||||
__IO uint32_t RX_CFG; // Receive Configuration (offset 0x6C)
|
||||
__IO uint32_t TX_CFG; // Transmit Configuration (offset 0x70)
|
||||
__IO uint32_t HW_CFG; // Hardware Configuration (offset 0x74)
|
||||
__IO uint32_t RX_DP_CTL; // RX Datapath Control (offset 0x78)
|
||||
__I uint32_t RX_FIFO_INF; // Receive FIFO Information (offset 0x7C)
|
||||
__I uint32_t TX_FIFO_INF; // Transmit FIFO Information (offset 0x80)
|
||||
__IO uint32_t PMT_CTRL; // Power Management Control (offset 0x84)
|
||||
__IO uint32_t GPIO_CFG; // General Purpose IO Configuration (offset 0x88)
|
||||
__IO uint32_t GPT_CFG; // General Purpose Timer Configuration (offset 0x8C)
|
||||
__I uint32_t GPT_CNT; // General Purpose Timer Count (offset 0x90)
|
||||
uint32_t RESERVED4; // Reserved for future use (offset 0x94)
|
||||
__IO uint32_t ENDIAN; // WORD SWAP Register (offset 0x98)
|
||||
__I uint32_t FREE_RUN; // Free Run Counter (offset 0x9C)
|
||||
__I uint32_t RX_DROP; // RX Dropped Frames Counter (offset 0xA0)
|
||||
__IO uint32_t MAC_CSR_CMD; // MAC CSR Synchronizer Command (offset 0xA4)
|
||||
__IO uint32_t MAC_CSR_DATA; // MAC CSR Synchronizer Data (offset 0xA8)
|
||||
__IO uint32_t AFC_CFG; // Automatic Flow Control Configuration (offset 0xAC)
|
||||
__IO uint32_t E2P_CMD; // EEPROM Command (offset 0xB0)
|
||||
__IO uint32_t E2P_DATA; // EEPROM Data (offset 0xB4)
|
||||
|
||||
} SMSC9220_TypeDef;
|
||||
|
||||
// SMSC9220 MAC Registers Indices
|
||||
#define SMSC9220_MAC_CR 0x1
|
||||
#define SMSC9220_MAC_ADDRH 0x2
|
||||
#define SMSC9220_MAC_ADDRL 0x3
|
||||
#define SMSC9220_MAC_HASHH 0x4
|
||||
#define SMSC9220_MAC_HASHL 0x5
|
||||
#define SMSC9220_MAC_MII_ACC 0x6
|
||||
#define SMSC9220_MAC_MII_DATA 0x7
|
||||
#define SMSC9220_MAC_FLOW 0x8
|
||||
#define SMSC9220_MAC_VLAN1 0x9
|
||||
#define SMSC9220_MAC_VLAN2 0xA
|
||||
#define SMSC9220_MAC_WUFF 0xB
|
||||
#define SMSC9220_MAC_WUCSR 0xC
|
||||
|
||||
// SMSC9220 PHY Registers Indices
|
||||
#define SMSC9220_PHY_BCONTROL 0x0
|
||||
#define SMSC9220_PHY_BSTATUS 0x1
|
||||
#define SMSC9220_PHY_ID1 0x2
|
||||
#define SMSC9220_PHY_ID2 0x3
|
||||
#define SMSC9220_PHY_ANEG_ADV 0x4
|
||||
#define SMSC9220_PHY_ANEG_LPA 0x5
|
||||
#define SMSC9220_PHY_ANEG_EXP 0x6
|
||||
#define SMSC9220_PHY_MCONTROL 0x17
|
||||
#define SMSC9220_PHY_MSTATUS 0x18
|
||||
#define SMSC9220_PHY_CSINDICATE 0x27
|
||||
#define SMSC9220_PHY_INTSRC 0x29
|
||||
#define SMSC9220_PHY_INTMASK 0x30
|
||||
#define SMSC9220_PHY_CS 0x31
|
||||
|
||||
/******************************************************************************/
|
||||
/* Peripheral memory map */
|
||||
/******************************************************************************/
|
||||
|
||||
#define MPS2_SSP1_BASE (0x40020000ul) /* User SSP Base Address */
|
||||
#define MPS2_SSP0_BASE (0x40021000ul) /* CLCD SSP Base Address */
|
||||
#define MPS2_TSC_I2C_BASE (0x40022000ul) /* Touch Screen I2C Base Address */
|
||||
#define MPS2_AAIC_I2C_BASE (0x40023000ul) /* Audio Interface I2C Base Address */
|
||||
#define MPS2_AAIC_I2S_BASE (0x40024000ul) /* Audio Interface I2S Base Address */
|
||||
#define MPS2_SSP2_BASE (0x40025000ul) /* adc SSP Base Address */
|
||||
#define MPS2_SSP3_BASE (0x40026000ul) /* Shield 0 SSP Base Address */
|
||||
#define MPS2_SSP4_BASE (0x40027000ul) /* Shield 1 SSP Base Address */
|
||||
#define MPS2_FPGAIO_BASE (0x40028000ul) /* FPGAIO Base Address */
|
||||
#define MPS2_SHIELD0_I2C_BASE (0x40029000ul) /* Shield 0 I2C Base Address */
|
||||
#define MPS2_SHIELD1_I2C_BASE (0x4002A000ul) /* Shield 1 I2C Base Address */
|
||||
#define MPS2_SCC_BASE (0x4002F000ul) /* SCC Base Address */
|
||||
|
||||
#ifdef CORTEX_M7
|
||||
#define SMSC9220_BASE (0xA0000000ul) /* Ethernet SMSC9220 Base Address */
|
||||
#else
|
||||
#define SMSC9220_BASE (0x40200000ul) /* Ethernet SMSC9220 Base Address */
|
||||
#endif
|
||||
|
||||
#define MPS2_VGA_TEXT_BUFFER (0x41000000ul) /* VGA Text Buffer Address */
|
||||
#define MPS2_VGA_BUFFER (0x41100000ul) /* VGA Buffer Base Address */
|
||||
|
||||
/******************************************************************************/
|
||||
/* Peripheral declaration */
|
||||
/******************************************************************************/
|
||||
|
||||
#define SMSC9220 ((SMSC9220_TypeDef *) SMSC9220_BASE )
|
||||
#define MPS2_TS_I2C ((MPS2_I2C_TypeDef *) MPS2_TSC_I2C_BASE )
|
||||
#define MPS2_AAIC_I2C ((MPS2_I2C_TypeDef *) MPS2_AAIC_I2C_BASE )
|
||||
#define MPS2_SHIELD0_I2C ((MPS2_I2C_TypeDef *) MPS2_SHIELD0_I2C_BASE )
|
||||
#define MPS2_SHIELD1_I2C ((MPS2_I2C_TypeDef *) MPS2_SHIELD1_I2C_BASE )
|
||||
#define MPS2_AAIC_I2S ((MPS2_I2S_TypeDef *) MPS2_AAIC_I2S_BASE )
|
||||
#define MPS2_FPGAIO ((MPS2_FPGAIO_TypeDef *) MPS2_FPGAIO_BASE )
|
||||
#define MPS2_SCC ((MPS2_SCC_TypeDef *) MPS2_SCC_BASE )
|
||||
#define MPS2_SSP0 ((MPS2_SSP_TypeDef *) MPS2_SSP0_BASE )
|
||||
#define MPS2_SSP1 ((MPS2_SSP_TypeDef *) MPS2_SSP1_BASE )
|
||||
#define MPS2_SSP2 ((MPS2_SSP_TypeDef *) MPS2_SSP2_BASE )
|
||||
#define MPS2_SSP3 ((MPS2_SSP_TypeDef *) MPS2_SSP3_BASE )
|
||||
#define MPS2_SSP4 ((MPS2_SSP_TypeDef *) MPS2_SSP4_BASE )
|
||||
|
||||
/******************************************************************************/
|
||||
/* General Function Definitions */
|
||||
/******************************************************************************/
|
||||
|
||||
|
||||
/******************************************************************************/
|
||||
/* General MACRO Definitions */
|
||||
/******************************************************************************/
|
||||
|
||||
|
||||
|
||||
#endif /* __SMM_MPS2_H */
|
|
@ -0,0 +1,47 @@
|
|||
;* MPS2 CMSIS Library
|
||||
;*
|
||||
;* Copyright (c) 2006-2018 ARM Limited
|
||||
;* All rights reserved.
|
||||
;*
|
||||
;* Redistribution and use in source and binary forms, with or without
|
||||
;* modification, are permitted provided that the following conditions are met:
|
||||
;*
|
||||
;* 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 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.
|
||||
;*
|
||||
; *************************************************************
|
||||
; *** Scatter-Loading Description File ***
|
||||
; *************************************************************
|
||||
|
||||
LR_IROM1 0x00000000 0x00400000 { ; load region size_region
|
||||
ER_IROM1 0x00000000 0x00400000 { ; load address = execution address
|
||||
*.o (RESET, +First)
|
||||
*(InRoot$$Sections)
|
||||
.ANY (+RO)
|
||||
}
|
||||
; Total: 64 vectors = 256 bytes (0x100) to be reserved in RAM
|
||||
RW_IRAM1 (0x20000000+0x100) (0x400000-0x100) { ; RW data
|
||||
.ANY (+RW +ZI)
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,290 @@
|
|||
; MPS2 CMSIS Library
|
||||
;
|
||||
; Copyright (c) 2006-2018 ARM Limited
|
||||
; All rights reserved.
|
||||
;
|
||||
; Redistribution and use in source and binary forms, with or without
|
||||
; modification, are permitted provided that the following conditions are met:
|
||||
;
|
||||
; 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 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.
|
||||
;******************************************************************************
|
||||
; @file startup_CMSDK_CM4.s
|
||||
; @brief CMSIS Core Device Startup File for
|
||||
; CMSDK_CM4 Device
|
||||
;
|
||||
;******************************************************************************
|
||||
;
|
||||
;-------- <<< Use Configuration Wizard in Context Menu >>> ------------------
|
||||
;
|
||||
|
||||
|
||||
; <h> Stack Configuration
|
||||
; <o> Stack Size (in Bytes) <0x0-0xFFFFFFFF:8>
|
||||
; </h>
|
||||
|
||||
Stack_Size EQU 0x00004000
|
||||
|
||||
AREA STACK, NOINIT, READWRITE, ALIGN=3
|
||||
Stack_Mem SPACE Stack_Size
|
||||
__initial_sp
|
||||
|
||||
|
||||
; <h> Heap Configuration
|
||||
; <o> Heap Size (in Bytes) <0x0-0xFFFFFFFF:8>
|
||||
; </h>
|
||||
|
||||
Heap_Size EQU 0x00001000
|
||||
|
||||
AREA HEAP, NOINIT, READWRITE, ALIGN=3
|
||||
__heap_base
|
||||
Heap_Mem SPACE Heap_Size
|
||||
__heap_limit
|
||||
|
||||
|
||||
PRESERVE8
|
||||
THUMB
|
||||
|
||||
|
||||
; Vector Table Mapped to Address 0 at Reset
|
||||
|
||||
AREA RESET, DATA, READONLY
|
||||
EXPORT __Vectors
|
||||
EXPORT __Vectors_End
|
||||
EXPORT __Vectors_Size
|
||||
|
||||
__Vectors DCD __initial_sp ; Top of Stack
|
||||
DCD Reset_Handler ; Reset Handler
|
||||
DCD NMI_Handler ; NMI Handler
|
||||
DCD HardFault_Handler ; Hard Fault Handler
|
||||
DCD MemManage_Handler ; MPU Fault Handler
|
||||
DCD BusFault_Handler ; Bus Fault Handler
|
||||
DCD UsageFault_Handler ; Usage Fault Handler
|
||||
DCD 0 ; Reserved
|
||||
DCD 0 ; Reserved
|
||||
DCD 0 ; Reserved
|
||||
DCD 0 ; Reserved
|
||||
DCD SVC_Handler ; SVCall Handler
|
||||
DCD DebugMon_Handler ; Debug Monitor Handler
|
||||
DCD 0 ; Reserved
|
||||
DCD PendSV_Handler ; PendSV Handler
|
||||
DCD SysTick_Handler ; SysTick Handler
|
||||
|
||||
; External Interrupts
|
||||
DCD UARTRX0_Handler ; UART 0 RX Handler
|
||||
DCD UARTTX0_Handler ; UART 0 TX Handler
|
||||
DCD UARTRX1_Handler ; UART 1 RX Handler
|
||||
DCD UARTTX1_Handler ; UART 1 TX Handler
|
||||
DCD UARTRX2_Handler ; UART 2 RX Handler
|
||||
DCD UARTTX2_Handler ; UART 2 TX Handler
|
||||
DCD PORT0_COMB_Handler ; GPIO Port 0 Combined Handler
|
||||
DCD PORT1_COMB_Handler ; GPIO Port 1 Combined Handler
|
||||
DCD TIMER0_Handler ; TIMER 0 handler
|
||||
DCD TIMER1_Handler ; TIMER 1 handler
|
||||
DCD DUALTIMER_HANDLER ; Dual timer handler
|
||||
DCD SPI_Handler ; SPI exceptions Handler
|
||||
DCD UARTOVF_Handler ; UART 0,1,2 Overflow Handler
|
||||
DCD ETHERNET_Handler ; Ethernet Overflow Handler
|
||||
DCD I2S_Handler ; I2S Handler
|
||||
DCD TSC_Handler ; Touch Screen handler
|
||||
DCD PORT2_COMB_Handler ; GPIO Port 2 Combined Handler
|
||||
DCD PORT3_COMB_Handler ; GPIO Port 3 Combined Handler
|
||||
DCD UARTRX3_Handler ; UART 3 RX Handler
|
||||
DCD UARTTX3_Handler ; UART 3 TX Handler
|
||||
DCD UARTRX4_Handler ; UART 4 RX Handler
|
||||
DCD UARTTX4_Handler ; UART 4 TX Handler
|
||||
DCD ADCSPI_Handler ; SHIELD ADC SPI exceptions Handler
|
||||
DCD SHIELDSPI_Handler ; SHIELD SPI exceptions Handler
|
||||
DCD PORT0_0_Handler ; GPIO Port 0 pin 0 Handler
|
||||
DCD PORT0_1_Handler ; GPIO Port 0 pin 1 Handler
|
||||
DCD PORT0_2_Handler ; GPIO Port 0 pin 2 Handler
|
||||
DCD PORT0_3_Handler ; GPIO Port 0 pin 3 Handler
|
||||
DCD PORT0_4_Handler ; GPIO Port 0 pin 4 Handler
|
||||
DCD PORT0_5_Handler ; GPIO Port 0 pin 5 Handler
|
||||
DCD PORT0_6_Handler ; GPIO Port 0 pin 6 Handler
|
||||
DCD PORT0_7_Handler ; GPIO Port 0 pin 7 Handler
|
||||
__Vectors_End
|
||||
|
||||
__Vectors_Size EQU __Vectors_End - __Vectors
|
||||
|
||||
AREA |.text|, CODE, READONLY
|
||||
|
||||
|
||||
; Reset Handler
|
||||
|
||||
Reset_Handler PROC
|
||||
EXPORT Reset_Handler [WEAK]
|
||||
IMPORT SystemInit
|
||||
IMPORT __main
|
||||
LDR R0, =SystemInit
|
||||
BLX R0
|
||||
LDR R0, =__main
|
||||
BX R0
|
||||
ENDP
|
||||
|
||||
|
||||
; Dummy Exception Handlers (infinite loops which can be modified)
|
||||
|
||||
NMI_Handler PROC
|
||||
EXPORT NMI_Handler [WEAK]
|
||||
B .
|
||||
ENDP
|
||||
HardFault_Handler\
|
||||
PROC
|
||||
EXPORT HardFault_Handler [WEAK]
|
||||
B .
|
||||
ENDP
|
||||
MemManage_Handler\
|
||||
PROC
|
||||
EXPORT MemManage_Handler [WEAK]
|
||||
B .
|
||||
ENDP
|
||||
BusFault_Handler\
|
||||
PROC
|
||||
EXPORT BusFault_Handler [WEAK]
|
||||
B .
|
||||
ENDP
|
||||
UsageFault_Handler\
|
||||
PROC
|
||||
EXPORT UsageFault_Handler [WEAK]
|
||||
B .
|
||||
ENDP
|
||||
SVC_Handler PROC
|
||||
EXPORT SVC_Handler [WEAK]
|
||||
B .
|
||||
ENDP
|
||||
DebugMon_Handler\
|
||||
PROC
|
||||
EXPORT DebugMon_Handler [WEAK]
|
||||
B .
|
||||
ENDP
|
||||
PendSV_Handler PROC
|
||||
EXPORT PendSV_Handler [WEAK]
|
||||
B .
|
||||
ENDP
|
||||
SysTick_Handler PROC
|
||||
EXPORT SysTick_Handler [WEAK]
|
||||
B .
|
||||
ENDP
|
||||
|
||||
Default_Handler PROC
|
||||
EXPORT UARTRX0_Handler [WEAK]
|
||||
EXPORT UARTTX0_Handler [WEAK]
|
||||
EXPORT UARTRX1_Handler [WEAK]
|
||||
EXPORT UARTTX1_Handler [WEAK]
|
||||
EXPORT UARTRX2_Handler [WEAK]
|
||||
EXPORT UARTTX2_Handler [WEAK]
|
||||
EXPORT PORT0_COMB_Handler [WEAK]
|
||||
EXPORT PORT1_COMB_Handler [WEAK]
|
||||
EXPORT TIMER0_Handler [WEAK]
|
||||
EXPORT TIMER1_Handler [WEAK]
|
||||
EXPORT DUALTIMER_HANDLER [WEAK]
|
||||
EXPORT SPI_Handler [WEAK]
|
||||
EXPORT UARTOVF_Handler [WEAK]
|
||||
EXPORT ETHERNET_Handler [WEAK]
|
||||
EXPORT I2S_Handler [WEAK]
|
||||
EXPORT TSC_Handler [WEAK]
|
||||
EXPORT PORT2_COMB_Handler [WEAK]
|
||||
EXPORT PORT3_COMB_Handler [WEAK]
|
||||
EXPORT UARTRX3_Handler [WEAK]
|
||||
EXPORT UARTTX3_Handler [WEAK]
|
||||
EXPORT UARTRX4_Handler [WEAK]
|
||||
EXPORT UARTTX4_Handler [WEAK]
|
||||
EXPORT ADCSPI_Handler [WEAK]
|
||||
EXPORT SHIELDSPI_Handler [WEAK]
|
||||
EXPORT PORT0_0_Handler [WEAK]
|
||||
EXPORT PORT0_1_Handler [WEAK]
|
||||
EXPORT PORT0_2_Handler [WEAK]
|
||||
EXPORT PORT0_3_Handler [WEAK]
|
||||
EXPORT PORT0_4_Handler [WEAK]
|
||||
EXPORT PORT0_5_Handler [WEAK]
|
||||
EXPORT PORT0_6_Handler [WEAK]
|
||||
EXPORT PORT0_7_Handler [WEAK]
|
||||
|
||||
UARTRX0_Handler
|
||||
UARTTX0_Handler
|
||||
UARTRX1_Handler
|
||||
UARTTX1_Handler
|
||||
UARTRX2_Handler
|
||||
UARTTX2_Handler
|
||||
PORT0_COMB_Handler
|
||||
PORT1_COMB_Handler
|
||||
TIMER0_Handler
|
||||
TIMER1_Handler
|
||||
DUALTIMER_HANDLER
|
||||
SPI_Handler
|
||||
UARTOVF_Handler
|
||||
ETHERNET_Handler
|
||||
I2S_Handler
|
||||
TSC_Handler
|
||||
PORT2_COMB_Handler
|
||||
PORT3_COMB_Handler
|
||||
UARTRX3_Handler
|
||||
UARTTX3_Handler
|
||||
UARTRX4_Handler
|
||||
UARTTX4_Handler
|
||||
ADCSPI_Handler
|
||||
SHIELDSPI_Handler
|
||||
PORT0_0_Handler
|
||||
PORT0_1_Handler
|
||||
PORT0_2_Handler
|
||||
PORT0_3_Handler
|
||||
PORT0_4_Handler
|
||||
PORT0_5_Handler
|
||||
PORT0_6_Handler
|
||||
PORT0_7_Handler
|
||||
B .
|
||||
|
||||
ENDP
|
||||
|
||||
|
||||
ALIGN
|
||||
|
||||
|
||||
; User Initial Stack & Heap
|
||||
|
||||
IF :DEF:__MICROLIB
|
||||
|
||||
EXPORT __initial_sp
|
||||
EXPORT __heap_base
|
||||
EXPORT __heap_limit
|
||||
|
||||
ELSE
|
||||
|
||||
IMPORT __use_two_region_memory
|
||||
EXPORT __user_initial_stackheap
|
||||
|
||||
__user_initial_stackheap PROC
|
||||
LDR R0, = Heap_Mem
|
||||
LDR R1, =(Stack_Mem + Stack_Size)
|
||||
LDR R2, = (Heap_Mem + Heap_Size)
|
||||
LDR R3, = Stack_Mem
|
||||
BX LR
|
||||
ENDP
|
||||
|
||||
ALIGN
|
||||
|
||||
ENDIF
|
||||
|
||||
|
||||
END
|
|
@ -0,0 +1,211 @@
|
|||
/*
|
||||
* MPS2 CMSIS Library
|
||||
*/
|
||||
/*
|
||||
* Copyright (c) 2009-2018 ARM Limited. All rights reserved.
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the License); you may
|
||||
* not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an AS IS BASIS, WITHOUT
|
||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
/*
|
||||
* This file is derivative of CMSIS V5.00 gcc_arm.ld
|
||||
*/
|
||||
/* Linker script for mbed FVP Cortex-M4 on MPS2 */
|
||||
|
||||
/* Linker script to configure memory regions. */
|
||||
/* The length of the VECTORS region is a bit larger than
|
||||
* is necessary based on the number of exception handlers.
|
||||
*/
|
||||
MEMORY
|
||||
{
|
||||
VECTORS (rx) : ORIGIN = 0x00000000, LENGTH = 0x00000400
|
||||
FLASH (rx) : ORIGIN = 0x00000400, LENGTH = 0x00040000 - 0x00000400
|
||||
RAM (rwx) : ORIGIN = 0x20000000, LENGTH = 0x00020000
|
||||
}
|
||||
|
||||
/* Linker script to place sections and symbol values. Should be used together
|
||||
* with other linker script that defines memory regions FLASH and RAM.
|
||||
* It references following symbols, which must be defined in code:
|
||||
* Reset_Handler : Entry of reset handler
|
||||
*
|
||||
* It defines following symbols, which code can use without definition:
|
||||
* __exidx_start
|
||||
* __exidx_end
|
||||
* __etext
|
||||
* __data_start__
|
||||
* __preinit_array_start
|
||||
* __preinit_array_end
|
||||
* __init_array_start
|
||||
* __init_array_end
|
||||
* __fini_array_start
|
||||
* __fini_array_end
|
||||
* __data_end__
|
||||
* __bss_start__
|
||||
* __bss_end__
|
||||
* __end__
|
||||
* end
|
||||
* __HeapLimit
|
||||
* __StackLimit
|
||||
* __StackTop
|
||||
* __stack
|
||||
*/
|
||||
ENTRY(Reset_Handler)
|
||||
|
||||
HEAP_SIZE = 0x4000;
|
||||
STACK_SIZE = 0x1000;
|
||||
|
||||
/* Size of the vector table in SRAM */
|
||||
M_VECTOR_RAM_SIZE = 0x140;
|
||||
|
||||
SECTIONS
|
||||
{
|
||||
.isr_vector :
|
||||
{
|
||||
__vector_table = .;
|
||||
KEEP(*(.vector_table))
|
||||
. = ALIGN(4);
|
||||
} > VECTORS
|
||||
|
||||
.text :
|
||||
{
|
||||
. = ALIGN(4);
|
||||
*(.text*)
|
||||
|
||||
KEEP(*(.init))
|
||||
KEEP(*(.fini))
|
||||
|
||||
/* .ctors */
|
||||
*crtbegin.o(.ctors)
|
||||
*crtbegin?.o(.ctors)
|
||||
*(EXCLUDE_FILE(*crtend?.o *crtend.o) .ctors)
|
||||
*(SORT(.ctors.*))
|
||||
*(.ctors)
|
||||
|
||||
/* .dtors */
|
||||
*crtbegin.o(.dtors)
|
||||
*crtbegin?.o(.dtors)
|
||||
*(EXCLUDE_FILE(*crtend?.o *crtend.o) .dtors)
|
||||
*(SORT(.dtors.*))
|
||||
*(.dtors)
|
||||
|
||||
*(.rodata*)
|
||||
|
||||
KEEP(*(.eh_frame*))
|
||||
} > FLASH
|
||||
|
||||
.ARM.extab :
|
||||
{
|
||||
*(.ARM.extab* .gnu.linkonce.armextab.*)
|
||||
} > FLASH
|
||||
|
||||
__exidx_start = .;
|
||||
.ARM.exidx :
|
||||
{
|
||||
*(.ARM.exidx* .gnu.linkonce.armexidx.*)
|
||||
} > FLASH
|
||||
__exidx_end = .;
|
||||
|
||||
.interrupts_ram :
|
||||
{
|
||||
. = ALIGN(4);
|
||||
__VECTOR_RAM__ = .;
|
||||
__interrupts_ram_start__ = .; /* Create a global symbol at data start */
|
||||
. += M_VECTOR_RAM_SIZE;
|
||||
. = ALIGN(4);
|
||||
__interrupts_ram_end__ = .; /* Define a global symbol at data end */
|
||||
} > RAM
|
||||
|
||||
.data :
|
||||
{
|
||||
PROVIDE(__etext = LOADADDR(.data));
|
||||
. = ALIGN(4);
|
||||
__data_start__ = .;
|
||||
*(vtable)
|
||||
*(.data)
|
||||
*(.data*)
|
||||
|
||||
. = ALIGN(4);
|
||||
/* preinit data */
|
||||
PROVIDE (__preinit_array_start = .);
|
||||
KEEP(*(.preinit_array))
|
||||
PROVIDE (__preinit_array_end = .);
|
||||
|
||||
. = ALIGN(4);
|
||||
/* init data */
|
||||
PROVIDE (__init_array_start = .);
|
||||
KEEP(*(SORT(.init_array.*)))
|
||||
KEEP(*(.init_array))
|
||||
PROVIDE (__init_array_end = .);
|
||||
|
||||
|
||||
. = ALIGN(4);
|
||||
/* finit data */
|
||||
PROVIDE (__fini_array_start = .);
|
||||
KEEP(*(SORT(.fini_array.*)))
|
||||
KEEP(*(.fini_array))
|
||||
PROVIDE (__fini_array_end = .);
|
||||
|
||||
. = ALIGN(4);
|
||||
/* All data end */
|
||||
__data_end__ = .;
|
||||
|
||||
} > RAM AT > FLASH
|
||||
|
||||
.uninitialized (NOLOAD):
|
||||
{
|
||||
. = ALIGN(32);
|
||||
__uninitialized_start = .;
|
||||
*(.uninitialized)
|
||||
KEEP(*(.keep.uninitialized))
|
||||
. = ALIGN(32);
|
||||
__uninitialized_end = .;
|
||||
} > RAM
|
||||
|
||||
.bss :
|
||||
{
|
||||
. = ALIGN(4);
|
||||
__START_BSS = .;
|
||||
__bss_start__ = .;
|
||||
*(.bss)
|
||||
*(.bss*)
|
||||
*(COMMON)
|
||||
. = ALIGN(4);
|
||||
__bss_end__ = .;
|
||||
__END_BSS = .;
|
||||
|
||||
} > RAM
|
||||
|
||||
bss_size = __bss_end__ - __bss_start__;
|
||||
|
||||
.heap :
|
||||
{
|
||||
. = ALIGN(8);
|
||||
__end__ = .;
|
||||
PROVIDE(end = .);
|
||||
__HeapBase = .;
|
||||
. += HEAP_SIZE;
|
||||
__HeapLimit = .;
|
||||
__heap_limit = .; /* Add for _sbrk */
|
||||
} > RAM
|
||||
|
||||
/* Set stack top to end of RAM, and stack limit move down by
|
||||
* size of stack_dummy section */
|
||||
__StackTop = ORIGIN(RAM) + LENGTH(RAM);
|
||||
__StackLimit = __StackTop - STACK_SIZE;
|
||||
PROVIDE(__stack = __StackTop);
|
||||
|
||||
/* Check if data + heap + stack exceeds RAM limit */
|
||||
ASSERT(__StackLimit >= __HeapLimit, "region RAM overflowed with stack")
|
||||
|
||||
} /* End of sections */
|
|
@ -0,0 +1,257 @@
|
|||
/*
|
||||
* MPS2 CMSIS Library
|
||||
*/
|
||||
/*
|
||||
* Copyright (c) 2009-2018 ARM Limited. All rights reserved.
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the License); you may
|
||||
* not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an AS IS BASIS, WITHOUT
|
||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
/*
|
||||
* This file is derivative of CMSIS V5.00 startup_ARMCM4.S
|
||||
*/
|
||||
.syntax unified
|
||||
.arch armv7-m
|
||||
|
||||
.section .vector_table,"a",%progbits
|
||||
.align 2
|
||||
.globl __isr_vector
|
||||
__isr_vector:
|
||||
.long __StackTop /* Top of Stack */
|
||||
.long Reset_Handler /* Reset Handler */
|
||||
.long NMI_Handler /* NMI Handler */
|
||||
.long HardFault_Handler /* Hard Fault Handler */
|
||||
.long MemManage_Handler /* MPU Fault Handler */
|
||||
.long BusFault_Handler /* Bus Fault Handler */
|
||||
.long UsageFault_Handler /* Usage Fault Handler */
|
||||
.long 0 /* Reserved */
|
||||
.long 0 /* Reserved */
|
||||
.long 0 /* Reserved */
|
||||
.long 0 /* Reserved */
|
||||
.long SVC_Handler /* SVCall Handler */
|
||||
.long DebugMon_Handler /* Debug Monitor Handler */
|
||||
.long 0 /* Reserved */
|
||||
.long PendSV_Handler /* PendSV Handler */
|
||||
.long SysTick_Handler /* SysTick Handler */
|
||||
|
||||
/* External Interrupts */
|
||||
.long UART0_IRQHandler /* 0: UART 0 RX and TX Combined Interrupt */
|
||||
.long Spare_IRQHandler /* 1: Undefined */
|
||||
.long UART1_IRQHandler /* 2: UART 1 RX and TX Combined Interrupt */
|
||||
.long APB_Slave0_IRQHandler /* 3: Reserved for APB Slave */
|
||||
.long APB_Slave1_IRQHandler /* 4: Reserved for APB Slave */
|
||||
.long RTC_IRQHandler /* 5: RTC Interrupt */
|
||||
.long PORT0_IRQHandler /* 6: GPIO Port 0 combined Interrupt */
|
||||
.long PORT1_ALL_IRQHandler /* 7: GPIO Port 1 combined Interrupt */
|
||||
.long TIMER0_IRQHandler /* 8: TIMER 0 Interrupt */
|
||||
.long TIMER1_IRQHandler /* 9: TIMER 1 Interrupt */
|
||||
.long DUALTIMER_IRQHandler /* 10: Dual Timer Interrupt */
|
||||
.long APB_Slave2_IRQHandler /* 11: Reserved for APB Slave */
|
||||
.long UARTOVF_IRQHandler /* 12: UART 0,1,2 Overflow Interrupt */
|
||||
.long APB_Slave3_IRQHandler /* 13: Reserved for APB Slave */
|
||||
.long RESERVED0_IRQHandler /* 14: Reserved */
|
||||
.long TSC_IRQHandler /* 15: Touch Screen Interrupt */
|
||||
.long PORT0_0_IRQHandler /* 16: GPIO Port 0 pin 0 Handler */
|
||||
.long PORT0_1_IRQHandler /* 17: GPIO Port 0 pin 1 Handler */
|
||||
.long PORT0_2_IRQHandler /* 18: GPIO Port 0 pin 2 Handler */
|
||||
.long PORT0_3_IRQHandler /* 19: GPIO Port 0 pin 3 Handler */
|
||||
.long PORT0_4_IRQHandler /* 20: GPIO Port 0 pin 4 Handler */
|
||||
.long PORT0_5_IRQHandler /* 21: GPIO Port 0 pin 5 Handler */
|
||||
.long PORT0_6_IRQHandler /* 22: GPIO Port 0 pin 6 Handler */
|
||||
.long PORT0_7_IRQHandler /* 23: GPIO Port 0 pin 7 Handler */
|
||||
.long PORT0_8_IRQHandler /* 24: GPIO Port 0 pin 8 Handler */
|
||||
.long PORT0_9_IRQHandler /* 25: GPIO Port 0 pin 9 Handler */
|
||||
.long PORT0_10_IRQHandler /* 26: GPIO Port 0 pin 10 Handler */
|
||||
.long PORT0_11_IRQHandler /* 27: GPIO Port 0 pin 11 Handler */
|
||||
.long PORT0_12_IRQHandler /* 28: GPIO Port 0 pin 12 Handler */
|
||||
.long PORT0_13_IRQHandler /* 29: GPIO Port 0 pin 13 Handler */
|
||||
.long PORT0_14_IRQHandler /* 30: GPIO Port 0 pin 14 Handler */
|
||||
.long PORT0_15_IRQHandler /* 31: GPIO Port 0 pin 15 Handler */
|
||||
.long FLASH0_IRQHandler /* 32: Reserved for Flash */
|
||||
.long FLASH1_IRQHandler /* 33: Reserved for Flash */
|
||||
.long RESERVED1_IRQHandler /* 34: Reserved */
|
||||
.long RESERVED2_IRQHandler /* 35: Reserved */
|
||||
.long RESERVED3_IRQHandler /* 36: Reserved */
|
||||
.long RESERVED4_IRQHandler /* 37: Reserved */
|
||||
.long RESERVED5_IRQHandler /* 38: Reserved */
|
||||
.long RESERVED6_IRQHandler /* 39: Reserved */
|
||||
.long RESERVED7_IRQHandler /* 40: Reserved */
|
||||
.long RESERVED8_IRQHandler /* 41: Reserved */
|
||||
.long PORT2_ALL_IRQHandler /* 42: GPIO Port 2 combined Interrupt */
|
||||
.long PORT3_ALL_IRQHandler /* 43: GPIO Port 3 combined Interrupt */
|
||||
.long TRNG_IRQHandler /* 44: Random number generator Interrupt */
|
||||
.long UART2_IRQHandler /* 45: UART 2 RX and TX Combined Interrupt */
|
||||
.long UART3_IRQHandler /* 46: UART 3 RX and TX Combined Interrupt */
|
||||
.long ETHERNET_IRQHandler /* 47: Ethernet interrupt t.b.a. */
|
||||
.long I2S_IRQHandler /* 48: I2S Interrupt */
|
||||
.long MPS2_SPI0_IRQHandler /* 49: SPI Interrupt (spi header) */
|
||||
.long MPS2_SPI1_IRQHandler /* 50: SPI Interrupt (clcd) */
|
||||
.long MPS2_SPI2_IRQHandler /* 51: SPI Interrupt (spi 1 ADC replacement) */
|
||||
.long MPS2_SPI3_IRQHandler /* 52: SPI Interrupt (spi 0 shield 0 replacement) */
|
||||
.long MPS2_SPI4_IRQHandler /* 53: SPI Interrupt (shield 1) */
|
||||
.long PORT4_ALL_IRQHandler /* 54: GPIO Port 4 combined Interrupt */
|
||||
.long PORT5_ALL_IRQHandler /* 55: GPIO Port 5 combined Interrupt */
|
||||
.long UART4_IRQHandler /* 56: UART 4 RX and TX Combined Interrupt */
|
||||
|
||||
.size __isr_vector, . - __isr_vector
|
||||
|
||||
.section .text.Reset_Handler
|
||||
.thumb
|
||||
.thumb_func
|
||||
.align 2
|
||||
.globl Reset_Handler
|
||||
.type Reset_Handler, %function
|
||||
Reset_Handler:
|
||||
ldr r0, =SystemInit
|
||||
blx r0
|
||||
/*
|
||||
* Loop to copy data from read only memory to RAM. The ranges
|
||||
* of copy from/to are specified by following symbols evaluated in
|
||||
* linker script.
|
||||
* _etext: End of code section, i.e., begin of data sections to copy from.
|
||||
* __data_start__/__data_end__: RAM address range that data should be
|
||||
* copied to. Both must be aligned to 4 bytes boundary.
|
||||
*/
|
||||
|
||||
ldr r1, =__etext
|
||||
ldr r2, =__data_start__
|
||||
ldr r3, =__data_end__
|
||||
|
||||
subs r3, r2
|
||||
ble .Lflash_to_ram_loop_end
|
||||
|
||||
movs r4, 0
|
||||
.Lflash_to_ram_loop:
|
||||
ldr r0, [r1,r4]
|
||||
str r0, [r2,r4]
|
||||
adds r4, 4
|
||||
cmp r4, r3
|
||||
blt .Lflash_to_ram_loop
|
||||
.Lflash_to_ram_loop_end:
|
||||
|
||||
/* Initialize .bss */
|
||||
init_bss:
|
||||
ldr r1, =__bss_start__
|
||||
ldr r2, =__bss_end__
|
||||
ldr r3, =bss_size
|
||||
|
||||
cmp r3, #0
|
||||
beq system_startup
|
||||
|
||||
mov r4, #0
|
||||
zero:
|
||||
strb r4, [r1], #1
|
||||
subs r3, r3, #1
|
||||
bne zero
|
||||
|
||||
system_startup:
|
||||
ldr r0, =SystemInit
|
||||
blx r0
|
||||
ldr r0, =_start
|
||||
bx r0
|
||||
.pool
|
||||
.size Reset_Handler, . - Reset_Handler
|
||||
|
||||
.text
|
||||
/*
|
||||
* Macro to define default handlers. Default handler
|
||||
* will be weak symbol and just dead loops. They can be
|
||||
* overwritten by other handlers
|
||||
*/
|
||||
.macro def_default_handler handler_name
|
||||
.align 1
|
||||
.thumb_func
|
||||
.weak \handler_name
|
||||
.type \handler_name, %function
|
||||
\handler_name :
|
||||
b .
|
||||
.size \handler_name, . - \handler_name
|
||||
.endm
|
||||
|
||||
def_default_handler NMI_Handler
|
||||
def_default_handler HardFault_Handler
|
||||
def_default_handler MemManage_Handler
|
||||
def_default_handler BusFault_Handler
|
||||
def_default_handler UsageFault_Handler
|
||||
def_default_handler SVC_Handler
|
||||
def_default_handler DebugMon_Handler
|
||||
def_default_handler PendSV_Handler
|
||||
def_default_handler SysTick_Handler
|
||||
def_default_handler Default_Handler
|
||||
|
||||
.macro def_irq_default_handler handler_name
|
||||
.weak \handler_name
|
||||
.set \handler_name, Default_Handler
|
||||
.endm
|
||||
|
||||
/* External interrupts */
|
||||
def_irq_default_handler UART0_IRQHandler /* 0: UART 0 RX and TX Combined Interrupt */
|
||||
def_irq_default_handler Spare_IRQHandler /* 1: Undefined */
|
||||
def_irq_default_handler UART1_IRQHandler /* 2: UART 1 RX and TX Combined Interrupt */
|
||||
def_irq_default_handler APB_Slave0_IRQHandler /* 3: Reserved for APB Slave */
|
||||
def_irq_default_handler APB_Slave1_IRQHandler /* 4: Reserved for APB Slave */
|
||||
def_irq_default_handler RTC_IRQHandler /* 5: RTC Interrupt */
|
||||
def_irq_default_handler PORT0_IRQHandler /* 6: GPIO Port 0 combined Interrupt */
|
||||
def_irq_default_handler PORT1_ALL_IRQHandler /* 7: GPIO Port 1 combined Interrupt */
|
||||
def_irq_default_handler TIMER0_IRQHandler /* 8: TIMER 0 Interrupt */
|
||||
def_irq_default_handler TIMER1_IRQHandler /* 9: TIMER 1 Interrupt */
|
||||
def_irq_default_handler DUALTIMER_IRQHandler /* 10: Dual Timer Interrupt */
|
||||
def_irq_default_handler APB_Slave2_IRQHandler /* 11: Reserved for APB Slave */
|
||||
def_irq_default_handler UARTOVF_IRQHandler /* 12: UART 0,1,2 Overflow Interrupt */
|
||||
def_irq_default_handler APB_Slave3_IRQHandler /* 13: Reserved for APB Slave */
|
||||
def_irq_default_handler RESERVED0_IRQHandler /* 14: Reserved */
|
||||
def_irq_default_handler TSC_IRQHandler /* 15: Touch Screen Interrupt */
|
||||
def_irq_default_handler PORT0_0_IRQHandler /* 16: GPIO Port 0 pin 0 Handler */
|
||||
def_irq_default_handler PORT0_1_IRQHandler /* 17: GPIO Port 0 pin 1 Handler */
|
||||
def_irq_default_handler PORT0_2_IRQHandler /* 18: GPIO Port 0 pin 2 Handler */
|
||||
def_irq_default_handler PORT0_3_IRQHandler /* 19: GPIO Port 0 pin 3 Handler */
|
||||
def_irq_default_handler PORT0_4_IRQHandler /* 20: GPIO Port 0 pin 4 Handler */
|
||||
def_irq_default_handler PORT0_5_IRQHandler /* 21: GPIO Port 0 pin 5 Handler */
|
||||
def_irq_default_handler PORT0_6_IRQHandler /* 22: GPIO Port 0 pin 6 Handler */
|
||||
def_irq_default_handler PORT0_7_IRQHandler /* 23: GPIO Port 0 pin 7 Handler */
|
||||
def_irq_default_handler PORT0_8_IRQHandler /* 24: GPIO Port 0 pin 8 Handler */
|
||||
def_irq_default_handler PORT0_9_IRQHandler /* 25: GPIO Port 0 pin 9 Handler */
|
||||
def_irq_default_handler PORT0_10_IRQHandler /* 26: GPIO Port 0 pin 10 Handler */
|
||||
def_irq_default_handler PORT0_11_IRQHandler /* 27: GPIO Port 0 pin 11 Handler */
|
||||
def_irq_default_handler PORT0_12_IRQHandler /* 28: GPIO Port 0 pin 12 Handler */
|
||||
def_irq_default_handler PORT0_13_IRQHandler /* 29: GPIO Port 0 pin 13 Handler */
|
||||
def_irq_default_handler PORT0_14_IRQHandler /* 30: GPIO Port 0 pin 14 Handler */
|
||||
def_irq_default_handler PORT0_15_IRQHandler /* 31: GPIO Port 0 pin 15 Handler */
|
||||
def_irq_default_handler FLASH0_IRQHandler /* 32: Reserved for Flash */
|
||||
def_irq_default_handler FLASH1_IRQHandler /* 33: Reserved for Flash */
|
||||
def_irq_default_handler RESERVED1_IRQHandler /* 34: Reserved */
|
||||
def_irq_default_handler RESERVED2_IRQHandler /* 35: Reserved */
|
||||
def_irq_default_handler RESERVED3_IRQHandler /* 36: Reserved */
|
||||
def_irq_default_handler RESERVED4_IRQHandler /* 37: Reserved */
|
||||
def_irq_default_handler RESERVED5_IRQHandler /* 38: Reserved */
|
||||
def_irq_default_handler RESERVED6_IRQHandler /* 39: Reserved */
|
||||
def_irq_default_handler RESERVED7_IRQHandler /* 40: Reserved */
|
||||
def_irq_default_handler RESERVED8_IRQHandler /* 41: Reserved */
|
||||
def_irq_default_handler PORT2_ALL_IRQHandler /* 42: GPIO Port 2 combined Interrupt */
|
||||
def_irq_default_handler PORT3_ALL_IRQHandler /* 43: GPIO Port 3 combined Interrupt */
|
||||
def_irq_default_handler TRNG_IRQHandler /* 44: Random number generator Interrupt */
|
||||
def_irq_default_handler UART2_IRQHandler /* 45: UART 2 RX and TX Combined Interrupt */
|
||||
def_irq_default_handler UART3_IRQHandler /* 46: UART 3 RX and TX Combined Interrupt */
|
||||
def_irq_default_handler ETHERNET_IRQHandler /* 47: Ethernet interrupt t.b.a. */
|
||||
def_irq_default_handler I2S_IRQHandler /* 48: I2S Interrupt */
|
||||
def_irq_default_handler MPS2_SPI0_IRQHandler /* 49: SPI Interrupt (spi header) */
|
||||
def_irq_default_handler MPS2_SPI1_IRQHandler /* 50: SPI Interrupt (clcd) */
|
||||
def_irq_default_handler MPS2_SPI2_IRQHandler /* 51: SPI Interrupt (spi 1 ADC replacement) */
|
||||
def_irq_default_handler MPS2_SPI3_IRQHandler /* 52: SPI Interrupt (spi 0 shield 0 replacement) */
|
||||
def_irq_default_handler MPS2_SPI4_IRQHandler /* 53: SPI Interrupt (shield 1) */
|
||||
def_irq_default_handler PORT4_ALL_IRQHandler /* 54: GPIO Port 4 combined Interrupt */
|
||||
def_irq_default_handler PORT5_ALL_IRQHandler /* 55: GPIO Port 5 combined Interrupt */
|
||||
def_irq_default_handler UART4_IRQHandler /* 56: UART 4 RX and TX Combined Interrupt */
|
||||
|
||||
.end
|
|
@ -0,0 +1,56 @@
|
|||
/*
|
||||
* MPS2 CMSIS Library
|
||||
*/
|
||||
/*
|
||||
* Copyright (c) 2009-2018 ARM Limited. All rights reserved.
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the License) you may
|
||||
* not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an AS IS BASIS, WITHOUT
|
||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
/* The RAM region doesn't start at the beginning of the RAM address
|
||||
* space to create space for the vector table copied over to the RAM by mbed.
|
||||
* The space left is a bit bigger than is necessary based on the number of
|
||||
* interrupt handlers.
|
||||
*/
|
||||
/*###ICF### Section handled by ICF editor, don't touch! ****/
|
||||
/*-Editor annotation file-*/
|
||||
/* IcfEditorFile="$TOOLKIT_DIR$\config\ide\IcfEditor\cortex_v1_0.xml" */
|
||||
/*-Specials-*/
|
||||
define symbol __ICFEDIT_intvec_start__ = 0x00000000;
|
||||
/*-Memory Regions-*/
|
||||
define symbol __ICFEDIT_region_ROM_start__ = 0x00000000;
|
||||
define symbol __ICFEDIT_region_ROM_end__ = 0x0003FFFF;
|
||||
define symbol __ICFEDIT_region_RAM_start__ = 0x20000140;
|
||||
define symbol __ICFEDIT_region_RAM_end__ = 0x2001FFFF;
|
||||
/*-Sizes-*/
|
||||
/* Heap and Stack size */
|
||||
define symbol __ICFEDIT_size_heap__ = 0x4000;
|
||||
define symbol __ICFEDIT_size_cstack__ = 0x1000;
|
||||
/**** End of ICF editor section. ###ICF###*/
|
||||
|
||||
define memory mem with size = 4G;
|
||||
define region ROM_region = mem:[from __ICFEDIT_region_ROM_start__ to __ICFEDIT_region_ROM_end__];
|
||||
define region RAM_region = mem:[from __ICFEDIT_region_RAM_start__ to __ICFEDIT_region_RAM_end__];
|
||||
|
||||
initialize by copy { readwrite };
|
||||
do not initialize { section .noinit };
|
||||
|
||||
define block CSTACK with alignment = 8, size = __ICFEDIT_size_cstack__ { };
|
||||
define block HEAP with alignment = 8, size = __ICFEDIT_size_heap__ { };
|
||||
|
||||
place at address mem:__ICFEDIT_intvec_start__ { readonly section .intvec };
|
||||
place in ROM_region { readonly };
|
||||
place in RAM_region { readwrite,
|
||||
block CSTACK, block HEAP };
|
|
@ -0,0 +1,340 @@
|
|||
;/*
|
||||
; * MPS2 CMSIS Library
|
||||
; */
|
||||
;/*
|
||||
; * Copyright (c) 2009-2018 ARM Limited. All rights reserved.
|
||||
; *
|
||||
; * SPDX-License-Identifier: Apache-2.0
|
||||
; *
|
||||
; * Licensed under the Apache License, Version 2.0 (the License); you may
|
||||
; * not use this file except in compliance with the License.
|
||||
; * You may obtain a copy of the License at
|
||||
; *
|
||||
; * http://www.apache.org/licenses/LICENSE-2.0
|
||||
; *
|
||||
; * Unless required by applicable law or agreed to in writing, software
|
||||
; * distributed under the License is distributed on an AS IS BASIS, WITHOUT
|
||||
; * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
; * See the License for the specific language governing permissions and
|
||||
; * limitations under the License.
|
||||
; */
|
||||
;/*
|
||||
; * This file is derivative of CMSIS V5.00 startup_Device.s
|
||||
; */
|
||||
|
||||
|
||||
;
|
||||
; 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 UARTRX0_Handler ; 0: UART 0 RX Handler
|
||||
DCD UARTTX0_Handler ; 1: UART 0 TX Handler
|
||||
DCD UARTRX1_Handler ; 2: UART 1 RX Handler
|
||||
DCD UARTTX1_Handler ; 3: UART 1 TX Handler
|
||||
DCD UARTRX2_Handler ; 4: UART 2 RX Handler
|
||||
DCD UARTTX2_Handler ; 5: UART 2 TX Handler
|
||||
DCD PORT0_COMB_Handler ; 6: GPIO Port 0 Combined Handler
|
||||
DCD PORT1_COMB_Handler ; 7: GPIO Port 1 Combined Handler
|
||||
DCD TIMER0_Handler ; 8: TIMER 0 handler
|
||||
DCD TIMER1_Handler ; 9: TIMER 1 handler
|
||||
DCD DUALTIMER_HANDLER ; 10: Dual timer handler
|
||||
DCD SPI_Handler ; 11: SPI exceptions Handler
|
||||
DCD UARTOVF_Handler ; 12: UART 0,1,2 Overflow Handler
|
||||
DCD ETHERNET_Handler ; 13: Ethernet Overflow Handler
|
||||
DCD I2S_Handler ; 14: I2S Handler
|
||||
DCD TSC_Handler ; 15: Touch Screen handler
|
||||
DCD PORT2_COMB_Handler ; 16: GPIO Port 2 Combined Handler
|
||||
DCD PORT3_COMB_Handler ; 17: GPIO Port 3 Combined Handler
|
||||
DCD UARTRX3_Handler ; 18: UART 3 RX Handler
|
||||
DCD UARTTX3_Handler ; 19: UART 3 TX Handler
|
||||
DCD UARTRX4_Handler ; 20: UART 4 RX Handler
|
||||
DCD UARTTX4_Handler ; 21: UART 4 TX Handler
|
||||
DCD ADCSPI_Handler ; 22: SHIELD ADC SPI exceptions Handler
|
||||
DCD SHIELDSPI_Handler ; 23: SHIELD SPI exceptions Handler
|
||||
DCD PORT0_0_Handler ; 24: GPIO Port 0 pin 0 Handler
|
||||
DCD PORT0_1_Handler ; 25: GPIO Port 0 pin 1 Handler
|
||||
DCD PORT0_2_Handler ; 26: GPIO Port 0 pin 2 Handler
|
||||
DCD PORT0_3_Handler ; 27: GPIO Port 0 pin 3 Handler
|
||||
DCD PORT0_4_Handler ; 28: GPIO Port 0 pin 4 Handler
|
||||
DCD PORT0_5_Handler ; 29: GPIO Port 0 pin 5 Handler
|
||||
DCD PORT0_6_Handler ; 30: GPIO Port 0 pin 6 Handler
|
||||
DCD PORT0_7_Handler ; 31: GPIO Port 0 pin 7 Handler
|
||||
|
||||
__Vectors_End
|
||||
|
||||
__Vectors EQU __vector_table
|
||||
__Vectors_Size EQU __Vectors_End - __Vectors
|
||||
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;;
|
||||
;; Default interrupt handlers.
|
||||
;;
|
||||
THUMB
|
||||
|
||||
PUBWEAK Reset_Handler
|
||||
SECTION .text:CODE:REORDER:NOROOT(2)
|
||||
Reset_Handler
|
||||
LDR R0, =SystemInit
|
||||
BLX R0
|
||||
LDR R0, =__iar_program_start
|
||||
BX R0
|
||||
|
||||
PUBWEAK NMI_Handler
|
||||
SECTION .text:CODE:REORDER:NOROOT(1)
|
||||
NMI_Handler
|
||||
B NMI_Handler
|
||||
|
||||
PUBWEAK HardFault_Handler
|
||||
SECTION .text:CODE:REORDER:NOROOT(1)
|
||||
HardFault_Handler
|
||||
B HardFault_Handler
|
||||
|
||||
PUBWEAK MemManage_Handler
|
||||
SECTION .text:CODE:REORDER:NOROOT(1)
|
||||
MemManage_Handler
|
||||
B MemManage_Handler
|
||||
|
||||
PUBWEAK BusFault_Handler
|
||||
SECTION .text:CODE:REORDER:NOROOT(1)
|
||||
BusFault_Handler
|
||||
B BusFault_Handler
|
||||
|
||||
PUBWEAK UsageFault_Handler
|
||||
SECTION .text:CODE:REORDER:NOROOT(1)
|
||||
UsageFault_Handler
|
||||
B UsageFault_Handler
|
||||
|
||||
PUBWEAK SVC_Handler
|
||||
SECTION .text:CODE:REORDER:NOROOT(1)
|
||||
SVC_Handler
|
||||
B SVC_Handler
|
||||
|
||||
PUBWEAK DebugMon_Handler
|
||||
SECTION .text:CODE:REORDER:NOROOT(1)
|
||||
DebugMon_Handler
|
||||
B DebugMon_Handler
|
||||
|
||||
PUBWEAK PendSV_Handler
|
||||
SECTION .text:CODE:REORDER:NOROOT(1)
|
||||
PendSV_Handler
|
||||
B PendSV_Handler
|
||||
|
||||
PUBWEAK SysTick_Handler
|
||||
SECTION .text:CODE:REORDER:NOROOT(1)
|
||||
SysTick_Handler
|
||||
B SysTick_Handler
|
||||
|
||||
|
||||
PUBWEAK UARTRX0_Handler
|
||||
SECTION .text:CODE:REORDER:NOROOT(1)
|
||||
UARTRX0_Handler
|
||||
B UARTRX0_Handler
|
||||
|
||||
PUBWEAK UARTTX0_Handler
|
||||
SECTION .text:CODE:REORDER:NOROOT(1)
|
||||
UARTTX0_Handler
|
||||
B UARTTX0_Handler
|
||||
|
||||
PUBWEAK UARTRX1_Handler
|
||||
SECTION .text:CODE:REORDER:NOROOT(1)
|
||||
UARTRX1_Handler
|
||||
B UARTRX1_Handler
|
||||
|
||||
PUBWEAK UARTTX1_Handler
|
||||
SECTION .text:CODE:REORDER:NOROOT(1)
|
||||
UARTTX1_Handler
|
||||
B UARTTX1_Handler
|
||||
|
||||
PUBWEAK UARTRX2_Handler
|
||||
SECTION .text:CODE:REORDER:NOROOT(1)
|
||||
UARTRX2_Handler
|
||||
B UARTRX2_Handler
|
||||
|
||||
PUBWEAK UARTTX2_Handler
|
||||
SECTION .text:CODE:REORDER:NOROOT(1)
|
||||
UARTTX2_Handler
|
||||
B UARTTX2_Handler
|
||||
|
||||
PUBWEAK PORT0_COMB_Handler
|
||||
SECTION .text:CODE:REORDER:NOROOT(1)
|
||||
PORT0_COMB_Handler
|
||||
B PORT0_COMB_Handler
|
||||
|
||||
PUBWEAK PORT1_COMB_Handler
|
||||
SECTION .text:CODE:REORDER:NOROOT(1)
|
||||
PORT1_COMB_Handler
|
||||
B PORT1_COMB_Handler
|
||||
|
||||
PUBWEAK TIMER0_Handler
|
||||
SECTION .text:CODE:REORDER:NOROOT(1)
|
||||
TIMER0_Handler
|
||||
B TIMER0_Handler
|
||||
|
||||
PUBWEAK TIMER1_Handler
|
||||
SECTION .text:CODE:REORDER:NOROOT(1)
|
||||
TIMER1_Handler
|
||||
B TIMER1_Handler
|
||||
|
||||
PUBWEAK DUALTIMER_HANDLER
|
||||
SECTION .text:CODE:REORDER:NOROOT(1)
|
||||
DUALTIMER_HANDLER
|
||||
B DUALTIMER_HANDLER
|
||||
|
||||
PUBWEAK SPI_Handler
|
||||
SECTION .text:CODE:REORDER:NOROOT(1)
|
||||
SPI_Handler
|
||||
B SPI_Handler
|
||||
|
||||
PUBWEAK UARTOVF_Handler
|
||||
SECTION .text:CODE:REORDER:NOROOT(1)
|
||||
UARTOVF_Handler
|
||||
B UARTOVF_Handler
|
||||
|
||||
PUBWEAK ETHERNET_Handler
|
||||
SECTION .text:CODE:REORDER:NOROOT(1)
|
||||
ETHERNET_Handler
|
||||
B ETHERNET_Handler
|
||||
|
||||
PUBWEAK I2S_Handler
|
||||
SECTION .text:CODE:REORDER:NOROOT(1)
|
||||
I2S_Handler
|
||||
B I2S_Handler
|
||||
|
||||
PUBWEAK TSC_Handler
|
||||
SECTION .text:CODE:REORDER:NOROOT(1)
|
||||
TSC_Handler
|
||||
B TSC_Handler
|
||||
|
||||
PUBWEAK PORT2_COMB_Handler
|
||||
SECTION .text:CODE:REORDER:NOROOT(1)
|
||||
PORT2_COMB_Handler
|
||||
B PORT2_COMB_Handler
|
||||
|
||||
PUBWEAK PORT3_COMB_Handler
|
||||
SECTION .text:CODE:REORDER:NOROOT(1)
|
||||
PORT3_COMB_Handler
|
||||
B PORT3_COMB_Handler
|
||||
|
||||
PUBWEAK UARTRX3_Handler
|
||||
SECTION .text:CODE:REORDER:NOROOT(1)
|
||||
UARTRX3_Handler
|
||||
B UARTRX3_Handler
|
||||
|
||||
PUBWEAK UARTTX3_Handler
|
||||
SECTION .text:CODE:REORDER:NOROOT(1)
|
||||
UARTTX3_Handler
|
||||
B UARTTX3_Handler
|
||||
|
||||
PUBWEAK UARTRX4_Handler
|
||||
SECTION .text:CODE:REORDER:NOROOT(1)
|
||||
UARTRX4_Handler
|
||||
B UARTRX4_Handler
|
||||
|
||||
PUBWEAK UARTTX4_Handler
|
||||
SECTION .text:CODE:REORDER:NOROOT(1)
|
||||
UARTTX4_Handler
|
||||
B UARTTX4_Handler
|
||||
|
||||
PUBWEAK ADCSPI_Handler
|
||||
SECTION .text:CODE:REORDER:NOROOT(1)
|
||||
ADCSPI_Handler
|
||||
B ADCSPI_Handler
|
||||
|
||||
PUBWEAK SHIELDSPI_Handler
|
||||
SECTION .text:CODE:REORDER:NOROOT(1)
|
||||
SHIELDSPI_Handler
|
||||
B SHIELDSPI_Handler
|
||||
|
||||
PUBWEAK PORT0_0_Handler
|
||||
SECTION .text:CODE:REORDER:NOROOT(1)
|
||||
PORT0_0_Handler
|
||||
B PORT0_0_Handler
|
||||
|
||||
PUBWEAK PORT0_1_Handler
|
||||
SECTION .text:CODE:REORDER:NOROOT(1)
|
||||
PORT0_1_Handler
|
||||
B PORT0_1_Handler
|
||||
|
||||
PUBWEAK PORT0_2_Handler
|
||||
SECTION .text:CODE:REORDER:NOROOT(1)
|
||||
PORT0_2_Handler
|
||||
B PORT0_2_Handler
|
||||
|
||||
PUBWEAK PORT0_3_Handler
|
||||
SECTION .text:CODE:REORDER:NOROOT(1)
|
||||
PORT0_3_Handler
|
||||
B PORT0_3_Handler
|
||||
|
||||
PUBWEAK PORT0_4_Handler
|
||||
SECTION .text:CODE:REORDER:NOROOT(1)
|
||||
PORT0_4_Handler
|
||||
B PORT0_4_Handler
|
||||
|
||||
PUBWEAK PORT0_5_Handler
|
||||
SECTION .text:CODE:REORDER:NOROOT(1)
|
||||
PORT0_5_Handler
|
||||
B PORT0_5_Handler
|
||||
|
||||
PUBWEAK PORT0_6_Handler
|
||||
SECTION .text:CODE:REORDER:NOROOT(1)
|
||||
PORT0_6_Handler
|
||||
B PORT0_6_Handler
|
||||
|
||||
PUBWEAK PORT0_7_Handler
|
||||
SECTION .text:CODE:REORDER:NOROOT(1)
|
||||
PORT0_7_Handler
|
||||
B PORT0_7_Handler
|
||||
|
||||
|
||||
END
|
|
@ -0,0 +1,42 @@
|
|||
/* MPS2 CMSIS Library
|
||||
*
|
||||
* Copyright (c) 2006-2018 ARM Limited
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
*
|
||||
* 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 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.
|
||||
*******************************************************************************
|
||||
* A generic CMSIS include header, pulling in MPS2 specifics
|
||||
*******************************************************************************/
|
||||
|
||||
#ifndef MBED_CMSIS_H
|
||||
#define MBED_CMSIS_H
|
||||
|
||||
#include "CMSDK_CM4.h"
|
||||
#include "SMM_MPS2.h"
|
||||
#include "cmsis_nvic.h"
|
||||
|
||||
#endif
|
|
@ -0,0 +1,39 @@
|
|||
/* MPS2 CMSIS Library
|
||||
*
|
||||
* Copyright (c) 2006-2018 ARM Limited
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
*
|
||||
* 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 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.
|
||||
*******************************************************************************/
|
||||
|
||||
#ifndef MBED_CMSIS_NVIC_H
|
||||
#define MBED_CMSIS_NVIC_H
|
||||
|
||||
#define NVIC_NUM_VECTORS (16 + 48)
|
||||
#define NVIC_RAM_VECTOR_ADDRESS 0x20000000 // Location of vectors in RAM
|
||||
|
||||
#endif
|
|
@ -0,0 +1,53 @@
|
|||
/* MPS2 CMSIS Library
|
||||
*
|
||||
* Copyright (c) 2006-2018 ARM Limited
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
*
|
||||
* 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 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.
|
||||
*******************************************************************************
|
||||
* Name: Device.h
|
||||
* Purpose: Include the correct device header file
|
||||
*******************************************************************************/
|
||||
|
||||
#ifndef __DEVICE_H
|
||||
#define __DEVICE_H
|
||||
|
||||
#if defined CMSDK_CM0
|
||||
#include "CMSDK_CM0.h" /* device specific header file */
|
||||
#elif defined CMSDK_CM0plus
|
||||
#include "CMSDK_CM0plus.h" /* device specific header file */
|
||||
#elif defined CMSDK_CM3
|
||||
#include "CMSDK_CM3.h" /* device specific header file */
|
||||
#elif defined CMSDK_CM4
|
||||
#include "CMSDK_CM4.h" /* device specific header file */
|
||||
#elif defined CMSDK_CM7
|
||||
#include "CMSDK_CM7.h" /* device specific header file */
|
||||
#else
|
||||
#warning "no appropriate header file found!"
|
||||
#endif
|
||||
|
||||
#endif /* __DEVICE_H */
|
|
@ -0,0 +1,96 @@
|
|||
/* MPS2 CMSIS Library
|
||||
*
|
||||
* Copyright (c) 2006-2018 ARM Limited
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
*
|
||||
* 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 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.
|
||||
*******************************************************************************
|
||||
* @file system_CMSDK_CM4.c
|
||||
* @brief CMSIS Device System Source File for
|
||||
* CMSDK_M4 Device
|
||||
*
|
||||
*******************************************************************************/
|
||||
|
||||
|
||||
#include "CMSDK_CM4.h"
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
Define clocks
|
||||
*----------------------------------------------------------------------------*/
|
||||
#define __XTAL (50000000UL) /* Oscillator frequency */
|
||||
|
||||
#define __SYSTEM_CLOCK (__XTAL / 2)
|
||||
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
Clock Variable definitions
|
||||
*----------------------------------------------------------------------------*/
|
||||
uint32_t SystemCoreClock = __SYSTEM_CLOCK;/*!< System Clock Frequency (Core Clock)*/
|
||||
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
Clock functions
|
||||
*----------------------------------------------------------------------------*/
|
||||
/**
|
||||
* Update SystemCoreClock variable
|
||||
*
|
||||
* @param none
|
||||
* @return none
|
||||
*
|
||||
* @brief Updates the SystemCoreClock with current core Clock
|
||||
* retrieved from cpu registers.
|
||||
*/
|
||||
void SystemCoreClockUpdate (void)
|
||||
{
|
||||
|
||||
SystemCoreClock = __SYSTEM_CLOCK;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Initialize the system
|
||||
*
|
||||
* @param none
|
||||
* @return none
|
||||
*
|
||||
* @brief Setup the microcontroller system.
|
||||
* Initialize the System.
|
||||
*/
|
||||
void SystemInit (void)
|
||||
{
|
||||
#if (__FPU_USED == 1)
|
||||
SCB->CPACR |= ((3UL << 10*2) | /* set CP10 Full Access */
|
||||
(3UL << 11*2) ); /* set CP11 Full Access */
|
||||
#endif
|
||||
|
||||
#ifdef UNALIGNED_SUPPORT_DISABLE
|
||||
SCB->CCR |= SCB_CCR_UNALIGN_TRP_Msk;
|
||||
#endif
|
||||
|
||||
SystemCoreClock = __SYSTEM_CLOCK;
|
||||
|
||||
}
|
|
@ -0,0 +1,75 @@
|
|||
/* MPS2 CMSIS Library
|
||||
*
|
||||
* Copyright (c) 2006-2018 ARM Limited
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
*
|
||||
* 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 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.
|
||||
*
|
||||
*******************************************************************************
|
||||
* @file system_CMSDK_CM4.h
|
||||
* @brief CMSIS Device Peripheral Access Layer Header File for
|
||||
* CMSDK_CM4 Device
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
|
||||
#ifndef SYSTEM_CMSDK_CM4_H
|
||||
#define SYSTEM_CMSDK_CM4_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
extern uint32_t SystemCoreClock; /*!< System Clock Frequency (Core Clock) */
|
||||
|
||||
|
||||
/**
|
||||
* Initialize the system
|
||||
*
|
||||
* @param none
|
||||
* @return none
|
||||
*
|
||||
* @brief Setup the microcontroller system.
|
||||
* Initialize the System and update the SystemCoreClock variable.
|
||||
*/
|
||||
extern void SystemInit (void);
|
||||
|
||||
/**
|
||||
* Update SystemCoreClock variable
|
||||
*
|
||||
* @param none
|
||||
* @return none
|
||||
*
|
||||
* @brief Updates the SystemCoreClock with current core Clock
|
||||
* retrieved from cpu registers.
|
||||
*/
|
||||
extern void SystemCoreClockUpdate (void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif /* SYSTEM_CMSDK_CM4_H */
|
Loading…
Reference in New Issue