金牌会员
- 积分
- 1765
- 金钱
- 1765
- 注册时间
- 2015-9-21
- 在线时间
- 544 小时
|
- ; Copyright (c) 2009-2021 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
- ;
- ; 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.
- ;
- ; NOTICE: This file has been modified by Nordic Semiconductor ASA.
- IF :DEF: __STARTUP_CONFIG
- #ifdef __STARTUP_CONFIG
- #include "startup_config.h"
- #ifndef __STARTUP_CONFIG_STACK_ALIGNEMENT
- #define __STARTUP_CONFIG_STACK_ALIGNEMENT 3
- #endif
- #endif
- ENDIF
- IF :DEF: __STARTUP_CONFIG
- Stack_Size EQU __STARTUP_CONFIG_STACK_SIZE
- ELIF :DEF: __STACK_SIZE
- Stack_Size EQU __STACK_SIZE
- ELSE
- Stack_Size EQU 2048
- ENDIF
-
- IF :DEF: __STARTUP_CONFIG
- Stack_Align EQU __STARTUP_CONFIG_STACK_ALIGNEMENT
- ELSE
- Stack_Align EQU 3
- ENDIF
- AREA STACK, NOINIT, READWRITE, ALIGN=Stack_Align
- Stack_Mem SPACE Stack_Size
- __initial_sp
- IF :DEF: __STARTUP_CONFIG
- Heap_Size EQU __STARTUP_CONFIG_HEAP_SIZE
- ELIF :DEF: __HEAP_SIZE
- Heap_Size EQU __HEAP_SIZE
- ELSE
- Heap_Size EQU 2048
- ENDIF
- 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 ;复位
- DCD NMI_Handler ;不可屏蔽中断
- DCD HardFault_Handler ;硬件故障处理程序
- DCD MemoryManagement_Handler ;内存管理程序
- DCD BusFault_Handler ;总线错误处理程序
- DCD UsageFault_Handler ;使用错误处理程序0
- DCD 0 ; Reserved
- DCD 0 ; Reserved
- DCD 0 ; Reserved
- DCD 0 ; Reserved
- DCD SVC_Handler ;系统调用
- DCD DebugMon_Handler
- DCD 0 ; Reserved
- DCD PendSV_Handler
- DCD SysTick_Handler
- ; External Interrupts
- DCD POWER_CLOCK_IRQHandler ;POWER_CLOCK 电源
- DCD RADIO_IRQHandler ;广播
- DCD UARTE0_UART0_IRQHandler ;UART0
- DCD TWIM0_TWIS0_TWI0_IRQHandler;两线接口
- DCD SPIM0_SPIS0_SPI0_IRQHandler;SPI接口
- DCD 0 ; Reserved
- DCD GPIOTE_IRQHandler;GPIO任务和事件
- DCD SAADC_IRQHandler;模拟数字转换
- DCD TIMER0_IRQHandler;定时器
- DCD TIMER1_IRQHandler
- DCD TIMER2_IRQHandler
- DCD RTC0_IRQHandler;RTC时钟
- DCD TEMP_IRQHandler;温度
- DCD RNG_IRQHandler;随机数
- DCD ECB_IRQHandler;AES电子码书模式块加密
- DCD CCM_AAR_IRQHandler;AES CCM模式加密
- DCD WDT_IRQHandler;看门口
- DCD RTC1_IRQHandler;RTC1
- DCD QDEC_IRQHandler;求积译码器
- DCD COMP_IRQHandler;通用比较器
- DCD SWI0_EGU0_IRQHandler;软件中断指令 用来切换ARM的工作模式
- DCD SWI1_EGU1_IRQHandler
- DCD SWI2_IRQHandler
- DCD SWI3_IRQHandler
- DCD SWI4_IRQHandler
- DCD SWI5_IRQHandler
- DCD 0 ; Reserved
- DCD 0 ; Reserved
- DCD PWM0_IRQHandler; PWM
- DCD PDM_IRQHandler;数字量表示模拟量
- DCD 0 ; Reserved
- DCD 0 ; Reserved
- DCD 0 ; Reserved
- DCD 0 ; Reserved
- DCD 0 ; Reserved
- DCD 0 ; Reserved
- DCD 0 ; Reserved
- DCD 0 ; Reserved
- DCD 0 ; Reserved
- DCD 0 ; Reserved
- DCD 0 ; Reserved
- DCD 0 ; Reserved
- DCD 0 ; Reserved
- DCD 0 ; Reserved
- DCD 0 ; Reserved
- DCD 0 ; Reserved
- DCD 0 ; Reserved
- DCD 0 ; Reserved
- DCD 0 ; Reserved
- DCD 0 ; Reserved
- DCD 0 ; Reserved
- DCD 0 ; Reserved
- DCD 0 ; Reserved
- DCD 0 ; Reserved
- DCD 0 ; Reserved
- DCD 0 ; Reserved
- DCD 0 ; Reserved
- DCD 0 ; Reserved
- DCD 0 ; Reserved
- DCD 0 ; Reserved
- DCD 0 ; Reserved
- DCD 0 ; Reserved
- DCD 0 ; Reserved
- DCD 0 ; Reserved
- DCD 0 ; Reserved
- DCD 0 ; Reserved
- DCD 0 ; Reserved
- DCD 0 ; Reserved
- DCD 0 ; Reserved
- DCD 0 ; Reserved
- DCD 0 ; Reserved
- DCD 0 ; Reserved
- DCD 0 ; Reserved
- DCD 0 ; Reserved
- DCD 0 ; Reserved
- DCD 0 ; Reserved
- DCD 0 ; Reserved
- DCD 0 ; Reserved
- DCD 0 ; Reserved
- DCD 0 ; Reserved
- DCD 0 ; Reserved
- DCD 0 ; Reserved
- DCD 0 ; Reserved
- DCD 0 ; Reserved
- DCD 0 ; Reserved
- DCD 0 ; Reserved
- DCD 0 ; Reserved
- DCD 0 ; Reserved
- DCD 0 ; Reserved
- DCD 0 ; Reserved
- DCD 0 ; Reserved
- DCD 0 ; Reserved
- DCD 0 ; Reserved
- DCD 0 ; Reserved
- DCD 0 ; Reserved
- DCD 0 ; Reserved
- DCD 0 ; Reserved
- DCD 0 ; Reserved
- DCD 0 ; Reserved
- DCD 0 ; Reserved
- DCD 0 ; Reserved
- DCD 0 ; Reserved
- DCD 0 ; Reserved
- DCD 0 ; Reserved
- DCD 0 ; Reserved
- DCD 0 ; Reserved
- DCD 0 ; Reserved
- DCD 0 ; Reserved
- DCD 0 ; Reserved
- DCD 0 ; Reserved
- DCD 0 ; Reserved
- DCD 0 ; Reserved
- __Vectors_End
- __Vectors_Size EQU __Vectors_End - __Vectors
- AREA |.text|, CODE, READONLY;定义一个代码段,名字是 |.text|,只可读;这里面的CODE属性表示|.text|是一个代码段
- ; Reset Handler
-
- Reset_Handler PROC
- EXPORT Reset_Handler [WEAK]
- IMPORT SystemInit
- IMPORT __main
- ; Workaround for Errata 185 RAM: RAM corruption at extreme corners
- ; found at the Errata document for your device located
- ; at https://infocenter.nordicsemi.com/index.jsp
-
- LDR R0, =0x10000130
- LDR R0, [R0]
- LDR R1, =0x10000134
- LDR R1, [R1]
-
- CMP R0, #0xA
- BNE skip
- CMP R1, #0x0
- BNE skip
-
- LDR R0, =0x40000EE4
- LDR R2, [R0]
- LDR R3, =0xFFFFFF8F
- ANDS R2, R2, R3
- LDR R3, =0x00000040
- ORRS R2, R2, R3
- STR R2, [R0]
-
- skip
- 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
- MemoryManagement_Handler\
- PROC
- EXPORT MemoryManagement_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 POWER_CLOCK_IRQHandler [WEAK]
- EXPORT RADIO_IRQHandler [WEAK]
- EXPORT UARTE0_UART0_IRQHandler [WEAK]
- EXPORT TWIM0_TWIS0_TWI0_IRQHandler [WEAK]
- EXPORT SPIM0_SPIS0_SPI0_IRQHandler [WEAK]
- EXPORT GPIOTE_IRQHandler [WEAK]
- EXPORT SAADC_IRQHandler [WEAK]
- EXPORT TIMER0_IRQHandler [WEAK]
- EXPORT TIMER1_IRQHandler [WEAK]
- EXPORT TIMER2_IRQHandler [WEAK]
- EXPORT RTC0_IRQHandler [WEAK]
- EXPORT TEMP_IRQHandler [WEAK]
- EXPORT RNG_IRQHandler [WEAK]
- EXPORT ECB_IRQHandler [WEAK]
- EXPORT CCM_AAR_IRQHandler [WEAK]
- EXPORT WDT_IRQHandler [WEAK]
- EXPORT RTC1_IRQHandler [WEAK]
- EXPORT QDEC_IRQHandler [WEAK]
- EXPORT COMP_IRQHandler [WEAK]
- EXPORT SWI0_EGU0_IRQHandler [WEAK]
- EXPORT SWI1_EGU1_IRQHandler [WEAK]
- EXPORT SWI2_IRQHandler [WEAK]
- EXPORT SWI3_IRQHandler [WEAK]
- EXPORT SWI4_IRQHandler [WEAK]
- EXPORT SWI5_IRQHandler [WEAK]
- EXPORT PWM0_IRQHandler [WEAK]
- EXPORT PDM_IRQHandler [WEAK]
- POWER_CLOCK_IRQHandler
- RADIO_IRQHandler
- UARTE0_UART0_IRQHandler
- TWIM0_TWIS0_TWI0_IRQHandler
- SPIM0_SPIS0_SPI0_IRQHandler
- GPIOTE_IRQHandler
- SAADC_IRQHandler
- TIMER0_IRQHandler
- TIMER1_IRQHandler
- TIMER2_IRQHandler
- RTC0_IRQHandler
- TEMP_IRQHandler
- RNG_IRQHandler
- ECB_IRQHandler
- CCM_AAR_IRQHandler
- WDT_IRQHandler
- RTC1_IRQHandler
- QDEC_IRQHandler
- COMP_IRQHandler
- SWI0_EGU0_IRQHandler
- SWI1_EGU1_IRQHandler
- SWI2_IRQHandler
- SWI3_IRQHandler
- SWI4_IRQHandler
- SWI5_IRQHandler
- PWM0_IRQHandler
- PDM_IRQHandler
- 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
复制代码
|
|