Skip to content

Commit d6fa066

Browse files
authored
Merge pull request #8 from wugensheng-code/master
[fix]:modify entry
2 parents 8bef209 + e9dc507 commit d6fa066

30 files changed

+1163
-2416
lines changed

libraries/CMSIS/Device/ST/STM32L4xx/Source/Templates/gcc/startup_stm32l412xx.S

Lines changed: 26 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,13 @@
1515
******************************************************************************
1616
* @attention
1717
*
18-
* Copyright (c) 2018 STMicroelectronics.
19-
* All rights reserved.
18+
* <h2><center>&copy; Copyright (c) 2018 STMicroelectronics.
19+
* All rights reserved.</center></h2>
2020
*
21-
* This software is licensed under terms that can be found in the LICENSE file
22-
* in the root directory of this software component.
23-
* If no LICENSE file comes with this software, it is provided AS-IS.
21+
* This software component is licensed by ST under Apache License, Version 2.0,
22+
* the "License"; You may not use this file except in compliance with the
23+
* License. You may obtain a copy of the License at:
24+
* opensource.org/licenses/Apache-2.0
2425
*
2526
******************************************************************************
2627
*/
@@ -65,40 +66,37 @@ Reset_Handler:
6566
bl SystemInit
6667

6768
/* Copy the data segment initializers from flash to SRAM */
68-
ldr r0, =_sdata
69-
ldr r1, =_edata
70-
ldr r2, =_sidata
71-
movs r3, #0
72-
b LoopCopyDataInit
69+
movs r1, #0
70+
b LoopCopyDataInit
7371

7472
CopyDataInit:
75-
ldr r4, [r2, r3]
76-
str r4, [r0, r3]
77-
adds r3, r3, #4
73+
ldr r3, =_sidata
74+
ldr r3, [r3, r1]
75+
str r3, [r0, r1]
76+
adds r1, r1, #4
7877

7978
LoopCopyDataInit:
80-
adds r4, r0, r3
81-
cmp r4, r1
82-
bcc CopyDataInit
83-
79+
ldr r0, =_sdata
80+
ldr r3, =_edata
81+
adds r2, r0, r1
82+
cmp r2, r3
83+
bcc CopyDataInit
84+
ldr r2, =_sbss
85+
b LoopFillZerobss
8486
/* Zero fill the bss segment. */
85-
ldr r2, =_sbss
86-
ldr r4, =_ebss
87-
movs r3, #0
88-
b LoopFillZerobss
89-
9087
FillZerobss:
91-
str r3, [r2]
92-
adds r2, r2, #4
88+
movs r3, #0
89+
str r3, [r2], #4
9390

9491
LoopFillZerobss:
95-
cmp r2, r4
96-
bcc FillZerobss
92+
ldr r3, = _ebss
93+
cmp r2, r3
94+
bcc FillZerobss
9795

9896
/* Call static constructors */
9997
bl __libc_init_array
10098
/* Call the application's entry point.*/
101-
bl main
99+
bl entry
102100

103101
LoopForever:
104102
b LoopForever
@@ -434,4 +432,4 @@ g_pfnVectors:
434432

435433
.weak CRS_IRQHandler
436434
.thumb_set CRS_IRQHandler,Default_Handler
437-
435+
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/

libraries/CMSIS/Device/ST/STM32L4xx/Source/Templates/gcc/startup_stm32l422xx.S

Lines changed: 26 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,13 @@
1515
******************************************************************************
1616
* @attention
1717
*
18-
* Copyright (c) 2018 STMicroelectronics.
19-
* All rights reserved.
18+
* <h2><center>&copy; Copyright (c) 2018 STMicroelectronics.
19+
* All rights reserved.</center></h2>
2020
*
21-
* This software is licensed under terms that can be found in the LICENSE file
22-
* in the root directory of this software component.
23-
* If no LICENSE file comes with this software, it is provided AS-IS.
21+
* This software component is licensed by ST under Apache License, Version 2.0,
22+
* the "License"; You may not use this file except in compliance with the
23+
* License. You may obtain a copy of the License at:
24+
* opensource.org/licenses/Apache-2.0
2425
*
2526
******************************************************************************
2627
*/
@@ -65,40 +66,37 @@ Reset_Handler:
6566
bl SystemInit
6667

6768
/* Copy the data segment initializers from flash to SRAM */
68-
ldr r0, =_sdata
69-
ldr r1, =_edata
70-
ldr r2, =_sidata
71-
movs r3, #0
72-
b LoopCopyDataInit
69+
movs r1, #0
70+
b LoopCopyDataInit
7371

7472
CopyDataInit:
75-
ldr r4, [r2, r3]
76-
str r4, [r0, r3]
77-
adds r3, r3, #4
73+
ldr r3, =_sidata
74+
ldr r3, [r3, r1]
75+
str r3, [r0, r1]
76+
adds r1, r1, #4
7877

7978
LoopCopyDataInit:
80-
adds r4, r0, r3
81-
cmp r4, r1
82-
bcc CopyDataInit
83-
79+
ldr r0, =_sdata
80+
ldr r3, =_edata
81+
adds r2, r0, r1
82+
cmp r2, r3
83+
bcc CopyDataInit
84+
ldr r2, =_sbss
85+
b LoopFillZerobss
8486
/* Zero fill the bss segment. */
85-
ldr r2, =_sbss
86-
ldr r4, =_ebss
87-
movs r3, #0
88-
b LoopFillZerobss
89-
9087
FillZerobss:
91-
str r3, [r2]
92-
adds r2, r2, #4
88+
movs r3, #0
89+
str r3, [r2], #4
9390

9491
LoopFillZerobss:
95-
cmp r2, r4
96-
bcc FillZerobss
92+
ldr r3, = _ebss
93+
cmp r2, r3
94+
bcc FillZerobss
9795

9896
/* Call static constructors */
9997
bl __libc_init_array
10098
/* Call the application's entry point.*/
101-
bl main
99+
bl entry
102100

103101
LoopForever:
104102
b LoopForever
@@ -437,4 +435,4 @@ g_pfnVectors:
437435

438436
.weak CRS_IRQHandler
439437
.thumb_set CRS_IRQHandler,Default_Handler
440-
438+
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/

libraries/CMSIS/Device/ST/STM32L4xx/Source/Templates/gcc/startup_stm32l431xx.S

Lines changed: 26 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,13 @@
1515
******************************************************************************
1616
* @attention
1717
*
18-
* Copyright (c) 2017 STMicroelectronics.
19-
* All rights reserved.
18+
* <h2><center>&copy; Copyright (c) 2017 STMicroelectronics.
19+
* All rights reserved.</center></h2>
2020
*
21-
* This software is licensed under terms that can be found in the LICENSE file
22-
* in the root directory of this software component.
23-
* If no LICENSE file comes with this software, it is provided AS-IS.
21+
* This software component is licensed by ST under Apache License, Version 2.0,
22+
* the "License"; You may not use this file except in compliance with the
23+
* License. You may obtain a copy of the License at:
24+
* opensource.org/licenses/Apache-2.0
2425
*
2526
******************************************************************************
2627
*/
@@ -65,40 +66,37 @@ Reset_Handler:
6566
bl SystemInit
6667

6768
/* Copy the data segment initializers from flash to SRAM */
68-
ldr r0, =_sdata
69-
ldr r1, =_edata
70-
ldr r2, =_sidata
71-
movs r3, #0
72-
b LoopCopyDataInit
69+
movs r1, #0
70+
b LoopCopyDataInit
7371

7472
CopyDataInit:
75-
ldr r4, [r2, r3]
76-
str r4, [r0, r3]
77-
adds r3, r3, #4
73+
ldr r3, =_sidata
74+
ldr r3, [r3, r1]
75+
str r3, [r0, r1]
76+
adds r1, r1, #4
7877

7978
LoopCopyDataInit:
80-
adds r4, r0, r3
81-
cmp r4, r1
82-
bcc CopyDataInit
83-
79+
ldr r0, =_sdata
80+
ldr r3, =_edata
81+
adds r2, r0, r1
82+
cmp r2, r3
83+
bcc CopyDataInit
84+
ldr r2, =_sbss
85+
b LoopFillZerobss
8486
/* Zero fill the bss segment. */
85-
ldr r2, =_sbss
86-
ldr r4, =_ebss
87-
movs r3, #0
88-
b LoopFillZerobss
89-
9087
FillZerobss:
91-
str r3, [r2]
92-
adds r2, r2, #4
88+
movs r3, #0
89+
str r3, [r2], #4
9390

9491
LoopFillZerobss:
95-
cmp r2, r4
96-
bcc FillZerobss
92+
ldr r3, = _ebss
93+
cmp r2, r3
94+
bcc FillZerobss
9795

9896
/* Call static constructors */
9997
bl __libc_init_array
10098
/* Call the application's entry point.*/
101-
bl main
99+
bl entry
102100

103101
LoopForever:
104102
b LoopForever
@@ -458,4 +456,4 @@ g_pfnVectors:
458456

459457
.weak CRS_IRQHandler
460458
.thumb_set CRS_IRQHandler,Default_Handler
461-
459+
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/

libraries/CMSIS/Device/ST/STM32L4xx/Source/Templates/gcc/startup_stm32l432xx.S

Lines changed: 26 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,13 @@
1515
******************************************************************************
1616
* @attention
1717
*
18-
* Copyright (c) 2017 STMicroelectronics.
19-
* All rights reserved.
18+
* <h2><center>&copy; Copyright (c) 2017 STMicroelectronics.
19+
* All rights reserved.</center></h2>
2020
*
21-
* This software is licensed under terms that can be found in the LICENSE file
22-
* in the root directory of this software component.
23-
* If no LICENSE file comes with this software, it is provided AS-IS.
21+
* This software component is licensed by ST under Apache License, Version 2.0,
22+
* the "License"; You may not use this file except in compliance with the
23+
* License. You may obtain a copy of the License at:
24+
* opensource.org/licenses/Apache-2.0
2425
*
2526
******************************************************************************
2627
*/
@@ -65,40 +66,37 @@ Reset_Handler:
6566
bl SystemInit
6667

6768
/* Copy the data segment initializers from flash to SRAM */
68-
ldr r0, =_sdata
69-
ldr r1, =_edata
70-
ldr r2, =_sidata
71-
movs r3, #0
72-
b LoopCopyDataInit
69+
movs r1, #0
70+
b LoopCopyDataInit
7371

7472
CopyDataInit:
75-
ldr r4, [r2, r3]
76-
str r4, [r0, r3]
77-
adds r3, r3, #4
73+
ldr r3, =_sidata
74+
ldr r3, [r3, r1]
75+
str r3, [r0, r1]
76+
adds r1, r1, #4
7877

7978
LoopCopyDataInit:
80-
adds r4, r0, r3
81-
cmp r4, r1
82-
bcc CopyDataInit
83-
79+
ldr r0, =_sdata
80+
ldr r3, =_edata
81+
adds r2, r0, r1
82+
cmp r2, r3
83+
bcc CopyDataInit
84+
ldr r2, =_sbss
85+
b LoopFillZerobss
8486
/* Zero fill the bss segment. */
85-
ldr r2, =_sbss
86-
ldr r4, =_ebss
87-
movs r3, #0
88-
b LoopFillZerobss
89-
9087
FillZerobss:
91-
str r3, [r2]
92-
adds r2, r2, #4
88+
movs r3, #0
89+
str r3, [r2], #4
9390

9491
LoopFillZerobss:
95-
cmp r2, r4
96-
bcc FillZerobss
92+
ldr r3, = _ebss
93+
cmp r2, r3
94+
bcc FillZerobss
9795

9896
/* Call static constructors */
9997
bl __libc_init_array
10098
/* Call the application's entry point.*/
101-
bl main
99+
bl entry
102100

103101
LoopForever:
104102
b LoopForever
@@ -446,4 +444,4 @@ g_pfnVectors:
446444

447445
.weak CRS_IRQHandler
448446
.thumb_set CRS_IRQHandler,Default_Handler
449-
447+
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/

0 commit comments

Comments
 (0)