1/* 2 * Copyright (c) 2022-2022 Huawei Device Co., Ltd. All rights reserved. 3 * 4 * Redistribution and use in source and binary forms, with or without modification, 5 * are permitted provided that the following conditions are met: 6 * 7 * 1. Redistributions of source code must retain the above copyright notice, this list of 8 * conditions and the following disclaimer. 9 * 10 * 2. Redistributions in binary form must reproduce the above copyright notice, this list 11 * of conditions and the following disclaimer in the documentation and/or other materials 12 * provided with the distribution. 13 * 14 * 3. Neither the name of the copyright holder nor the names of its contributors may be used 15 * to endorse or promote products derived from this software without specific prior written 16 * permission. 17 * 18 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 20 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 21 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR 22 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 23 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 24 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 25 * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 26 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 27 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 28 * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 */ 30 31 .syntax unified 32 .arch armv8.1-m.main 33 .fpu vfpv3-d16-fp16 34 .thumb 35 36.extern HalExcNMI; 37.extern HalExcHardFault; 38.extern HalExcMemFault; 39.extern HalExcBusFault; 40.extern HalExcUsageFault; 41.extern HalExcSvcCall; 42.extern HalPendSV; 43.extern SysTick_Handler; 44.global Vector_Table 45.global Reset_Handler 46 47.section .text 48.type Reset_Handler, %function 49Reset_Handler: 50 ldr r0, =__bss_start 51 ldr r1, =__bss_end 52 mov r2, #0 53 54bss_loop: 55 str r2, [r0, #0] 56 add r0, r0, #4 57 subs r3, r1, r0 58 bne bss_loop 59 60 ldr sp, =__irq_stack_top 61 b main 62.size Reset_Handler, .-Reset_Handler 63 64.type DefaultHandler, %function 65DefaultHandler: 66loop: 67 b loop 68.size DefaultHandler, .-DefaultHandler 69 70.section .Vector_Table,"a",%progbits 71.type Vector_Table, %object 72Vector_Table: 73 .word _estack 74 .word Reset_Handler 75 .word HalExcNMI 76 .word HalExcHardFault 77 .word HalExcMemFault 78 .word HalExcBusFault 79 .word HalExcUsageFault 80 .word 0 81 .word 0 82 .word 0 83 .word 0 84 .word DefaultHandler 85 .word DefaultHandler 86 .word 0 87 .word HalPendSV 88 .word SysTick_Handler 89 90.size Vector_Table, .-Vector_Table 91 92