⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 startup_rvmdk.s

📁 eaayarm101自制小车源代码 周立功公司原创
💻 S
字号:
; <<< Use Configuration Wizard in Context Menu >>>;******************************************************************************;; startup_rvmdk.S - Startup code for Stellaris.;; Copyright (c) 2006-2007 Luminary Micro, Inc.  All rights reserved.;; Software License Agreement;; Luminary Micro, Inc. (LMI) is supplying this software for use solely and; exclusively on LMI's microcontroller products.;; The software is owned by LMI and/or its suppliers, and is protected under; applicable copyright laws.  All rights are reserved.  Any use in violation of; the foregoing restrictions may subject the user to criminal sanctions under; applicable laws, as well as to civil liability for the breach of the terms; and conditions of this license.;; THIS SOFTWARE IS PROVIDED "AS IS".  NO WARRANTIES, WHETHER EXPRESS, IMPLIED; OR STATUTORY, INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF; MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE APPLY TO THIS SOFTWARE.; LMI SHALL NOT, IN ANY CIRCUMSTANCES, BE LIABLE FOR SPECIAL, INCIDENTAL, OR; CONSEQUENTIAL DAMAGES, FOR ANY REASON WHATSOEVER.;; This is part of revision 199 of an01245.;;******************************************************************************;******************************************************************************;; <o> Stack Size (in Bytes) <0x0-0xFFFFFFFF:8>;;******************************************************************************Stack   EQU     0x00000100;******************************************************************************;; <o> Heap Size (in Bytes) <0x0-0xFFFFFFFF:8>;;******************************************************************************Heap    EQU     0x00000000;******************************************************************************;; <o> Use C Library <0=> No <1=> Yes;;******************************************************************************Startup EQU     0;******************************************************************************;; Allocate space for the stack.;;******************************************************************************        AREA    STACK, NOINIT, READWRITE, ALIGN=3StackMem        SPACE   Stack;******************************************************************************;; Allocate space for the heap.;;******************************************************************************    IF Startup = 1        AREA    HEAP, NOINIT, READWRITE, ALIGN=3HeapMem        SPACE   Heap    ENDIF;******************************************************************************;; Indicate that the code in this file preserves 8-byte alignment of the stack.;;******************************************************************************        PRESERVE8;******************************************************************************;; Place code into the reset code section.;;******************************************************************************        AREA    RESET, CODE, READONLY        THUMB;******************************************************************************;; The vector table.;;******************************************************************************Vectors        DCD     StackMem + Stack            ; Top of Stack        DCD     Reset_Handler               ; Reset Handler        EXTERN  IntDefaultHandler        DCD     IntDefaultHandler           ; NMI Handler        DCD     IntDefaultHandler           ; Hard Fault Handler        DCD     IntDefaultHandler           ; MPU Fault Handler        DCD     IntDefaultHandler           ; Bus Fault Handler        DCD     IntDefaultHandler           ; Usage Fault Handler        DCD     0                           ; Reserved        DCD     0                           ; Reserved        DCD     0                           ; Reserved        DCD     0                           ; Reserved        DCD     IntDefaultHandler           ; SVCall Handler        DCD     IntDefaultHandler           ; Debug Monitor Handler        DCD     0                           ; Reserved        DCD     IntDefaultHandler           ; PendSV Handler        EXTERN  SysTickHandler        DCD     SysTickHandler              ; SysTick Handler        DCD     IntDefaultHandler           ; GPIO Port A        DCD     IntDefaultHandler           ; GPIO Port B        DCD     IntDefaultHandler           ; GPIO Port C        DCD     IntDefaultHandler           ; GPIO Port D        DCD     IntDefaultHandler           ; GPIO Port E        DCD     IntDefaultHandler           ; UART0        DCD     IntDefaultHandler           ; UART1        DCD     IntDefaultHandler           ; SSI        DCD     IntDefaultHandler           ; I2C        DCD     IntDefaultHandler           ; PWM Fault        DCD     IntDefaultHandler           ; PWM Generator 0        DCD     IntDefaultHandler           ; PWM Generator 1        DCD     IntDefaultHandler           ; PWM Generator 2        DCD     IntDefaultHandler           ; Quadrature Encoder        EXTERN  ADC0IntHandler        DCD     ADC0IntHandler              ; ADC Sequence 0        DCD     IntDefaultHandler           ; ADC Sequence 1        DCD     IntDefaultHandler           ; ADC Sequence 2        DCD     IntDefaultHandler           ; ADC Sequence 3        DCD     IntDefaultHandler           ; Watchdog        DCD     IntDefaultHandler           ; Timer 0A        DCD     IntDefaultHandler           ; Timer 0B        DCD     IntDefaultHandler           ; Timer 1A        DCD     IntDefaultHandler           ; Timer 1B        DCD     IntDefaultHandler           ; Timer 2A        DCD     IntDefaultHandler           ; Timer 2B        EXTERN  CompIntHandler        DCD     CompIntHandler              ; Analog Comparator 0        DCD     IntDefaultHandler           ; Analog Comparator 1        DCD     IntDefaultHandler           ; Analog Comparator 2        DCD     IntDefaultHandler           ; System Control        DCD     IntDefaultHandler           ; Flash Control;******************************************************************************;; This is the code that gets called when the processor first starts execution; following a reset event.;;******************************************************************************        EXPORT  Reset_HandlerReset_Handler        ;        ; Call the C library enty point that handles startup.  This will copy        ; the .data section initializers from flash to SRAM and zero fill the        ; .bss section.  It will then call __rt_entry, which will be either the        ; C library version or the one supplied here depending on the        ; configured startup type.        ;        IMPORT  __main        B       __main;******************************************************************************;; Make sure the end of this section is aligned.;;******************************************************************************        ALIGN;******************************************************************************;; Some code in the normal code section for initializing the heap and stack.;;******************************************************************************        AREA    |.text|, CODE, READONLY;******************************************************************************;; This fucntion is called by the RV-MDK C library startup code to initialize; the C library and call the application's entry point.  For the non-C library; version of the startup code, provide a replacement function that simply calls; the application's entry point, avoiding the added code overhead of the C; library initialization code.;;******************************************************************************    IF Startup = 0        EXPORT  __rt_entry__rt_entry        ;        ; Branch to the application's entry point.        ;        IMPORT  main        B       main    ENDIF;******************************************************************************;; The function expected of the C library startup code for defining the stack; and heap memory locations.  For the C library version of the startup code,; provide this function so that the C library initialization code can find out; the location of the stack and heap.;;******************************************************************************    IF Startup = 1        IMPORT  __use_two_region_memory        EXPORT  __user_initial_stackheap__user_initial_stackheap        LDR     R0, =HeapMem        LDR     R1, =(StackMem + Stack)        LDR     R2, =(HeapMem + Heap)        LDR     R3, =StackMem        BX      LR    ENDIF;******************************************************************************;; Make sure the end of this section is aligned.;;******************************************************************************        ALIGN;******************************************************************************;; Tell the assembler that we're done.;;******************************************************************************        END

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -