1
- / * mbed Microcontroller Library
2
- * SPDX - License - Identifier: BSD - 3 - Clause
3
- ******************************************************************************
4
- *
5
- * Copyright (c) 2020 STMicroelectronics.
6
- * All rights reserved.
7
- *
8
- * This software component is licensed by ST under BSD 3 - Clause license ,
9
- * the "License" ; You may not use this file except in compliance with the
10
- * License. You may obtain a copy of the License at :
11
- * opensource.org/licenses/BSD - 3 - Clause
12
- *
13
- ******************************************************************************
14
- * @file startup_stm32l071xx.s
15
- * @author MCD Application Team
16
- * @brief STM32L071xx Devices vector table for GCC toolchain.
17
- * This module performs:
18
- * - Set the initial SP
19
- * - Set the initial PC == Reset_Handler ,
20
- * - Set the vector table entries with the exceptions ISR address
21
- * - Branches to main in the C library (which eventually
22
- * calls main()).
23
- * After Reset the Cortex - M0 + processor is in Thread mode ,
24
- * priority is Privileged , and the Stack is set to Main.
25
- ******************************************************************************
26
- * /
1
+ / **
2
+ ******************************************************************************
3
+ * @file startup_stm32l071xx.s
4
+ * @author MCD Application Team
5
+ * @brief STM32L071xx Devices vector table for GCC toolchain.
6
+ * This module performs:
7
+ * - Set the initial SP
8
+ * - Set the initial PC == Reset_Handler ,
9
+ * - Set the vector table entries with the exceptions ISR address
10
+ * - Branches to main in the C library (which eventually
11
+ * calls main()).
12
+ * After Reset the Cortex - M0 + processor is in Thread mode ,
13
+ * priority is Privileged , and the Stack is set to Main.
14
+ ******************************************************************************
15
+ *
16
+ * Redistribution and use in source and binary forms , with or without modification ,
17
+ * are permitted provided th at the following conditions are met:
18
+ * 1 . Redistributions of source code must retain the above copyright notice ,
19
+ * this list of conditions and the following disclaimer.
20
+ * 2 . Redistributions in binary form must reproduce the above copyright notice ,
21
+ * this list of conditions and the following disclaimer in the documentation
22
+ * and / or other materials provided with the distribution.
23
+ * 3 . Neither the name of STMicroelectronics nor the names of its contributors
24
+ * may be used to endorse or promote products derived from this software
25
+ * without specific prior written permission.
26
+ *
27
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
28
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES , INCLUDING , BUT NOT LIMITED TO , THE
29
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
30
+ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
31
+ * FOR ANY DIRECT , INDIRECT , INCIDENTAL , SPECIAL , EXEMPLARY , OR CONSEQUENTIAL
32
+ * DAMAGES (INCLUDING , BUT NOT LIMITED TO , PROCUREMENT OF SUBSTITUTE GOODS OR
33
+ * SERVICES ; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
34
+ * CAUSED AND ON ANY THEORY OF LIABILITY , WHETHER IN CONTRACT , STRICT LIABILITY ,
35
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
36
+ * OF THIS SOFTWARE , EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
37
+ *
38
+ ******************************************************************************
39
+ * /
27
40
28
41
.syntax unified
29
42
. cpu cortex - m0plus
@@ -48,9 +61,9 @@ defined in linker script */
48
61
. section .text.Reset_Handler
49
62
.weak Reset_Handler
50
63
.type Reset_Handler , %function
51
- Reset_Handler:
52
- ldr r0 , =_estack
53
- mov sp , r0 / * set stack pointer * /
64
+ Reset_Handler:
65
+ ldr r0 , =_estack
66
+ mov sp , r0 / * set stack pointer * /
54
67
55
68
/ * Copy the data segment initializers from flash to SRAM * /
56
69
movs r1 , # 0
@@ -85,12 +98,13 @@ LoopFillZerobss:
85
98
/ * Call the clock system intitialization function. * /
86
99
bl SystemInit
87
100
/ * Call static constructors * /
88
- bl __libc_init_array
101
+ // bl __libc_init_array
89
102
/ * Call the application's entry point. * /
90
- bl main
103
+ // bl main
104
+ bl _start
91
105
92
106
LoopForever:
93
- b LoopForever
107
+ b LoopForever
94
108
95
109
96
110
.size Reset_Handler , . - Reset_Handler
0 commit comments