Explorar o código

Call SystemInit in the very beginning of Reset_Handler

Alexander Fedotov %!s(int64=7) %!d(string=hai) anos
pai
achega
2f440b6f02
Modificáronse 26 ficheiros con 78 adicións e 51 borrados
  1. 2 1
      Device/ARM/ARMCM0/Source/GCC/startup_ARMCM0.S
  2. 2 1
      Device/ARM/ARMCM0/Source/GCC/startup_ARMCM0.c
  3. 2 1
      Device/ARM/ARMCM0plus/Source/GCC/startup_ARMCM0plus.S
  4. 2 1
      Device/ARM/ARMCM0plus/Source/GCC/startup_ARMCM0plus.c
  5. 2 1
      Device/ARM/ARMCM1/Source/GCC/startup_ARMCM1.S
  6. 2 1
      Device/ARM/ARMCM1/Source/GCC/startup_ARMCM1.c
  7. 5 4
      Device/ARM/ARMCM23/Source/GCC/startup_ARMCM23.S
  8. 4 3
      Device/ARM/ARMCM23/Source/GCC/startup_ARMCM23.c
  9. 2 1
      Device/ARM/ARMCM3/Source/GCC/startup_ARMCM3.S
  10. 2 1
      Device/ARM/ARMCM3/Source/GCC/startup_ARMCM3.c
  11. 6 4
      Device/ARM/ARMCM33/Source/GCC/startup_ARMCM33.S
  12. 4 3
      Device/ARM/ARMCM33/Source/GCC/startup_ARMCM33.c
  13. 5 4
      Device/ARM/ARMCM35P/Source/GCC/startup_ARMCM35P.S
  14. 4 3
      Device/ARM/ARMCM35P/Source/GCC/startup_ARMCM35P.c
  15. 2 1
      Device/ARM/ARMCM4/Source/GCC/startup_ARMCM4.S
  16. 2 1
      Device/ARM/ARMCM4/Source/GCC/startup_ARMCM4.c
  17. 2 1
      Device/ARM/ARMCM7/Source/GCC/startup_ARMCM7.S
  18. 2 1
      Device/ARM/ARMCM7/Source/GCC/startup_ARMCM7.c
  19. 2 1
      Device/ARM/ARMSC000/Source/GCC/startup_ARMSC000.S
  20. 2 1
      Device/ARM/ARMSC000/Source/GCC/startup_ARMSC000.c
  21. 2 1
      Device/ARM/ARMSC300/Source/GCC/startup_ARMSC300.S
  22. 2 1
      Device/ARM/ARMSC300/Source/GCC/startup_ARMSC300.c
  23. 5 4
      Device/ARM/ARMv8MBL/Source/GCC/startup_ARMv8MBL.S
  24. 4 3
      Device/ARM/ARMv8MBL/Source/GCC/startup_ARMv8MBL.c
  25. 5 4
      Device/ARM/ARMv8MML/Source/GCC/startup_ARMv8MML.S
  26. 4 3
      Device/ARM/ARMv8MML/Source/GCC/startup_ARMv8MML.c

+ 2 - 1
Device/ARM/ARMCM0/Source/GCC/startup_ARMCM0.S

@@ -119,6 +119,8 @@ __Vectors_End:
                 .globl   Reset_Handler
                 .fnstart
 Reset_Handler:
+                bl       SystemInit
+
 /* Firstly it copies data from read only memory to RAM.
  * There are two schemes to copy. One can copy more than one sections.
  * Another can copy only one section. The former scheme needs more
@@ -246,7 +248,6 @@ Reset_Handler:
 .L_loop3_done:
 #endif /* __STARTUP_CLEAR_BSS_MULTIPLE || __STARTUP_CLEAR_BSS */
 
-                bl       SystemInit
                 bl       _start
 
                 .fnend

+ 2 - 1
Device/ARM/ARMCM0/Source/GCC/startup_ARMCM0.c

@@ -148,6 +148,8 @@ void Reset_Handler(void) {
   uint32_t *pSrc, *pDest;
   uint32_t *pTable __attribute__((unused));
 
+  SystemInit();                             /* CMSIS System Initialization */
+
 /* Firstly it copies data from read only memory to RAM.
  * There are two schemes to copy. One can copy more than one sections.
  * Another can copy only one section. The former scheme needs more
@@ -235,7 +237,6 @@ void Reset_Handler(void) {
   }
 #endif /* __STARTUP_CLEAR_BSS_MULTIPLE || __STARTUP_CLEAR_BSS */
 
-  SystemInit();                             /* CMSIS System Initialization */
   _start();                                 /* Enter PreeMain (C library entry point) */
 }
 

+ 2 - 1
Device/ARM/ARMCM0plus/Source/GCC/startup_ARMCM0plus.S

@@ -119,6 +119,8 @@ __Vectors_End:
                 .globl   Reset_Handler
                 .fnstart
 Reset_Handler:
+                bl       SystemInit
+
 /* Firstly it copies data from read only memory to RAM.
  * There are two schemes to copy. One can copy more than one sections.
  * Another can copy only one section. The former scheme needs more
@@ -246,7 +248,6 @@ Reset_Handler:
 .L_loop3_done:
 #endif /* __STARTUP_CLEAR_BSS_MULTIPLE || __STARTUP_CLEAR_BSS */
 
-                bl       SystemInit
                 bl       _start
 
                 .fnend

+ 2 - 1
Device/ARM/ARMCM0plus/Source/GCC/startup_ARMCM0plus.c

@@ -148,6 +148,8 @@ void Reset_Handler(void) {
   uint32_t *pSrc, *pDest;
   uint32_t *pTable __attribute__((unused));
 
+  SystemInit();                             /* CMSIS System Initialization */
+
 /* Firstly it copies data from read only memory to RAM.
  * There are two schemes to copy. One can copy more than one sections.
  * Another can copy only one section. The former scheme needs more
@@ -235,7 +237,6 @@ void Reset_Handler(void) {
   }
 #endif /* __STARTUP_CLEAR_BSS_MULTIPLE || __STARTUP_CLEAR_BSS */
 
-  SystemInit();                             /* CMSIS System Initialization */
   _start();                                 /* Enter PreeMain (C library entry point) */
 }
 

+ 2 - 1
Device/ARM/ARMCM1/Source/GCC/startup_ARMCM1.S

@@ -119,6 +119,8 @@ __Vectors_End:
                 .globl   Reset_Handler
                 .fnstart
 Reset_Handler:
+                bl       SystemInit
+
 /* Firstly it copies data from read only memory to RAM.
  * There are two schemes to copy. One can copy more than one sections.
  * Another can copy only one section. The former scheme needs more
@@ -246,7 +248,6 @@ Reset_Handler:
 .L_loop3_done:
 #endif /* __STARTUP_CLEAR_BSS_MULTIPLE || __STARTUP_CLEAR_BSS */
 
-                bl       SystemInit
                 bl       _start
 
                 .fnend

+ 2 - 1
Device/ARM/ARMCM1/Source/GCC/startup_ARMCM1.c

@@ -148,6 +148,8 @@ void Reset_Handler(void) {
   uint32_t *pSrc, *pDest;
   uint32_t *pTable __attribute__((unused));
 
+  SystemInit();                             /* CMSIS System Initialization */
+
 /* Firstly it copies data from read only memory to RAM.
  * There are two schemes to copy. One can copy more than one sections.
  * Another can copy only one section. The former scheme needs more
@@ -235,7 +237,6 @@ void Reset_Handler(void) {
   }
 #endif /* __STARTUP_CLEAR_BSS_MULTIPLE || __STARTUP_CLEAR_BSS */
 
-  SystemInit();                             /* CMSIS System Initialization */
   _start();                                 /* Enter PreeMain (C library entry point) */
 }
 

+ 5 - 4
Device/ARM/ARMCM23/Source/GCC/startup_ARMCM23.S

@@ -119,6 +119,11 @@ __Vectors_End:
                 .globl   Reset_Handler
                 .fnstart
 Reset_Handler:
+                ldr      r0, =__StackLimit
+                msr      msplim, r0
+
+                bl       SystemInit
+
 /* Firstly it copies data from read only memory to RAM.
  * There are two schemes to copy. One can copy more than one sections.
  * Another can copy only one section. The former scheme needs more
@@ -246,10 +251,6 @@ Reset_Handler:
 .L_loop3_done:
 #endif /* __STARTUP_CLEAR_BSS_MULTIPLE || __STARTUP_CLEAR_BSS */
 
-                ldr      r0, =__StackLimit
-                msr      msplim, r0
-
-                bl       SystemInit
                 bl       _start
 
                 .fnend

+ 4 - 3
Device/ARM/ARMCM23/Source/GCC/startup_ARMCM23.c

@@ -154,6 +154,10 @@ void Reset_Handler(void) {
   uint32_t *pSrc, *pDest;
   uint32_t *pTable __attribute__((unused));
 
+  __set_MSPLIM((uint32_t)&__StackLimit);
+
+  SystemInit();                             /* CMSIS System Initialization */
+
 /* Firstly it copies data from read only memory to RAM.
  * There are two schemes to copy. One can copy more than one sections.
  * Another can copy only one section. The former scheme needs more
@@ -241,9 +245,6 @@ void Reset_Handler(void) {
   }
 #endif /* __STARTUP_CLEAR_BSS_MULTIPLE || __STARTUP_CLEAR_BSS */
 
-  __set_MSPLIM((uint32_t)&__StackLimit);
-
-  SystemInit();                             /* CMSIS System Initialization */
   _start();                                 /* Enter PreeMain (C library entry point) */
 }
 

+ 2 - 1
Device/ARM/ARMCM3/Source/GCC/startup_ARMCM3.S

@@ -119,6 +119,8 @@ __Vectors_End:
                 .globl   Reset_Handler
                 .fnstart
 Reset_Handler:
+                bl       SystemInit
+
 /* Firstly it copies data from read only memory to RAM.
  * There are two schemes to copy. One can copy more than one sections.
  * Another can copy only one section. The former scheme needs more
@@ -237,7 +239,6 @@ Reset_Handler:
                 blt      .L_loop3
 #endif /* __STARTUP_CLEAR_BSS_MULTIPLE || __STARTUP_CLEAR_BSS */
 
-                bl       SystemInit
                 bl       _start
 
                 .fnend

+ 2 - 1
Device/ARM/ARMCM3/Source/GCC/startup_ARMCM3.c

@@ -152,6 +152,8 @@ void Reset_Handler(void) {
   uint32_t *pSrc, *pDest;
   uint32_t *pTable __attribute__((unused));
 
+  SystemInit();                             /* CMSIS System Initialization */
+
 /* Firstly it copies data from read only memory to RAM.
  * There are two schemes to copy. One can copy more than one sections.
  * Another can copy only one section. The former scheme needs more
@@ -239,7 +241,6 @@ void Reset_Handler(void) {
   }
 #endif /* __STARTUP_CLEAR_BSS_MULTIPLE || __STARTUP_CLEAR_BSS */
 
-  SystemInit();                             /* CMSIS System Initialization */
   _start();                                 /* Enter PreeMain (C library entry point) */
 }
 

+ 6 - 4
Device/ARM/ARMCM33/Source/GCC/startup_ARMCM33.S

@@ -119,6 +119,12 @@ __Vectors_End:
                 .globl   Reset_Handler
                 .fnstart
 Reset_Handler:
+                ldr      r0, =__StackLimit
+                msr      msplim, r0
+
+/* CMSIS System Initialization */
+                bl       SystemInit
+
 /* Firstly it copies data from read only memory to RAM.
  * There are two schemes to copy. One can copy more than one sections.
  * Another can copy only one section. The former scheme needs more
@@ -237,10 +243,6 @@ Reset_Handler:
                 blt      .L_loop3
 #endif /* __STARTUP_CLEAR_BSS_MULTIPLE || __STARTUP_CLEAR_BSS */
 
-                ldr      r0, =__StackLimit
-                msr      msplim, r0
-
-                bl       SystemInit
                 bl       _start
 
                 .fnend

+ 4 - 3
Device/ARM/ARMCM33/Source/GCC/startup_ARMCM33.c

@@ -163,6 +163,10 @@ void Reset_Handler(void) {
   uint32_t *pSrc, *pDest;
   uint32_t *pTable __attribute__((unused));
 
+  __set_MSPLIM((uint32_t)&__StackLimit);
+
+  SystemInit();                             /* CMSIS System Initialization */
+
 /* Firstly it copies data from read only memory to RAM.
  * There are two schemes to copy. One can copy more than one sections.
  * Another can copy only one section. The former scheme needs more
@@ -250,9 +254,6 @@ void Reset_Handler(void) {
   }
 #endif /* __STARTUP_CLEAR_BSS_MULTIPLE || __STARTUP_CLEAR_BSS */
 
-  __set_MSPLIM((uint32_t)&__StackLimit);
-
-  SystemInit();                             /* CMSIS System Initialization */
   _start();                                 /* Enter PreeMain (C library entry point) */
 }
 

+ 5 - 4
Device/ARM/ARMCM35P/Source/GCC/startup_ARMCM35P.S

@@ -119,6 +119,11 @@ __Vectors_End:
                 .globl   Reset_Handler
                 .fnstart
 Reset_Handler:
+                ldr      r0, =__StackLimit
+                msr      msplim, r0
+
+                bl       SystemInit
+
 /* Firstly it copies data from read only memory to RAM.
  * There are two schemes to copy. One can copy more than one sections.
  * Another can copy only one section. The former scheme needs more
@@ -237,10 +242,6 @@ Reset_Handler:
                 blt      .L_loop3
 #endif /* __STARTUP_CLEAR_BSS_MULTIPLE || __STARTUP_CLEAR_BSS */
 
-                ldr      r0, =__StackLimit
-                msr      msplim, r0
-
-                bl       SystemInit
                 bl       _start
 
                 .fnend

+ 4 - 3
Device/ARM/ARMCM35P/Source/GCC/startup_ARMCM35P.c

@@ -163,6 +163,10 @@ void Reset_Handler(void) {
   uint32_t *pSrc, *pDest;
   uint32_t *pTable __attribute__((unused));
 
+  __set_MSPLIM((uint32_t)&__StackLimit);
+
+  SystemInit();                             /* CMSIS System Initialization */
+
 /* Firstly it copies data from read only memory to RAM.
  * There are two schemes to copy. One can copy more than one sections.
  * Another can copy only one section. The former scheme needs more
@@ -250,9 +254,6 @@ void Reset_Handler(void) {
   }
 #endif /* __STARTUP_CLEAR_BSS_MULTIPLE || __STARTUP_CLEAR_BSS */
 
-  __set_MSPLIM((uint32_t)&__StackLimit);
-
-  SystemInit();                             /* CMSIS System Initialization */
   _start();                                 /* Enter PreeMain (C library entry point) */
 }
 

+ 2 - 1
Device/ARM/ARMCM4/Source/GCC/startup_ARMCM4.S

@@ -119,6 +119,8 @@ __Vectors_End:
                 .globl   Reset_Handler
                 .fnstart
 Reset_Handler:
+                bl       SystemInit
+
 /* Firstly it copies data from read only memory to RAM.
  * There are two schemes to copy. One can copy more than one sections.
  * Another can copy only one section. The former scheme needs more
@@ -237,7 +239,6 @@ Reset_Handler:
                 blt      .L_loop3
 #endif /* __STARTUP_CLEAR_BSS_MULTIPLE || __STARTUP_CLEAR_BSS */
 
-                bl       SystemInit
                 bl       _start
 
                 .fnend

+ 2 - 1
Device/ARM/ARMCM4/Source/GCC/startup_ARMCM4.c

@@ -158,6 +158,8 @@ void Reset_Handler(void) {
   uint32_t *pSrc, *pDest;
   uint32_t *pTable __attribute__((unused));
 
+  SystemInit();                             /* CMSIS System Initialization */
+
 /* Firstly it copies data from read only memory to RAM.
  * There are two schemes to copy. One can copy more than one sections.
  * Another can copy only one section. The former scheme needs more
@@ -245,7 +247,6 @@ void Reset_Handler(void) {
   }
 #endif /* __STARTUP_CLEAR_BSS_MULTIPLE || __STARTUP_CLEAR_BSS */
 
-  SystemInit();                             /* CMSIS System Initialization */
   _start();                                 /* Enter PreeMain (C library entry point) */
 }
 

+ 2 - 1
Device/ARM/ARMCM7/Source/GCC/startup_ARMCM7.S

@@ -119,6 +119,8 @@ __Vectors_End:
                 .globl   Reset_Handler
                 .fnstart
 Reset_Handler:
+                bl       SystemInit
+
 /* Firstly it copies data from read only memory to RAM.
  * There are two schemes to copy. One can copy more than one sections.
  * Another can copy only one section. The former scheme needs more
@@ -237,7 +239,6 @@ Reset_Handler:
                 blt      .L_loop3
 #endif /* __STARTUP_CLEAR_BSS_MULTIPLE || __STARTUP_CLEAR_BSS */
 
-                bl       SystemInit
                 bl       _start
 
                 .fnend

+ 2 - 1
Device/ARM/ARMCM7/Source/GCC/startup_ARMCM7.c

@@ -160,6 +160,8 @@ void Reset_Handler(void) {
   uint32_t *pSrc, *pDest;
   uint32_t *pTable __attribute__((unused));
 
+  SystemInit();                             /* CMSIS System Initialization */
+
 /* Firstly it copies data from read only memory to RAM.
  * There are two schemes to copy. One can copy more than one sections.
  * Another can copy only one section. The former scheme needs more
@@ -247,7 +249,6 @@ void Reset_Handler(void) {
   }
 #endif /* __STARTUP_CLEAR_BSS_MULTIPLE || __STARTUP_CLEAR_BSS */
 
-  SystemInit();                             /* CMSIS System Initialization */
   _start();                                 /* Enter PreeMain (C library entry point) */
 }
 

+ 2 - 1
Device/ARM/ARMSC000/Source/GCC/startup_ARMSC000.S

@@ -119,6 +119,8 @@ __Vectors_End:
                 .globl   Reset_Handler
                 .fnstart
 Reset_Handler:
+                bl       SystemInit
+
 /* Firstly it copies data from read only memory to RAM.
  * There are two schemes to copy. One can copy more than one sections.
  * Another can copy only one section. The former scheme needs more
@@ -246,7 +248,6 @@ Reset_Handler:
 .L_loop3_done:
 #endif /* __STARTUP_CLEAR_BSS_MULTIPLE || __STARTUP_CLEAR_BSS */
 
-                bl       SystemInit
                 bl       _start
 
                 .fnend

+ 2 - 1
Device/ARM/ARMSC000/Source/GCC/startup_ARMSC000.c

@@ -148,6 +148,8 @@ void Reset_Handler(void) {
   uint32_t *pSrc, *pDest;
   uint32_t *pTable __attribute__((unused));
 
+  SystemInit();                             /* CMSIS System Initialization */
+
 /* Firstly it copies data from read only memory to RAM.
  * There are two schemes to copy. One can copy more than one sections.
  * Another can copy only one section. The former scheme needs more
@@ -235,7 +237,6 @@ void Reset_Handler(void) {
   }
 #endif /* __STARTUP_CLEAR_BSS_MULTIPLE || __STARTUP_CLEAR_BSS */
 
-  SystemInit();                             /* CMSIS System Initialization */
   _start();                                 /* Enter PreeMain (C library entry point) */
 }
 

+ 2 - 1
Device/ARM/ARMSC300/Source/GCC/startup_ARMSC300.S

@@ -119,6 +119,8 @@ __Vectors_End:
                 .globl   Reset_Handler
                 .fnstart
 Reset_Handler:
+                bl       SystemInit
+
 /* Firstly it copies data from read only memory to RAM.
  * There are two schemes to copy. One can copy more than one sections.
  * Another can copy only one section. The former scheme needs more
@@ -237,7 +239,6 @@ Reset_Handler:
                 blt      .L_loop3
 #endif /* __STARTUP_CLEAR_BSS_MULTIPLE || __STARTUP_CLEAR_BSS */
 
-                bl       SystemInit
                 bl       _start
 
                 .fnend

+ 2 - 1
Device/ARM/ARMSC300/Source/GCC/startup_ARMSC300.c

@@ -152,6 +152,8 @@ void Reset_Handler(void) {
   uint32_t *pSrc, *pDest;
   uint32_t *pTable __attribute__((unused));
 
+  SystemInit();                             /* CMSIS System Initialization */
+
 /* Firstly it copies data from read only memory to RAM.
  * There are two schemes to copy. One can copy more than one sections.
  * Another can copy only one section. The former scheme needs more
@@ -239,7 +241,6 @@ void Reset_Handler(void) {
   }
 #endif /* __STARTUP_CLEAR_BSS_MULTIPLE || __STARTUP_CLEAR_BSS */
 
-  SystemInit();                             /* CMSIS System Initialization */
   _start();                                 /* Enter PreeMain (C library entry point) */
 }
 

+ 5 - 4
Device/ARM/ARMv8MBL/Source/GCC/startup_ARMv8MBL.S

@@ -119,6 +119,11 @@ __Vectors_End:
                 .globl   Reset_Handler
                 .fnstart
 Reset_Handler:
+                ldr      r0, =__StackLimit
+                msr      msplim, r0
+
+                bl       SystemInit
+
 /* Firstly it copies data from read only memory to RAM.
  * There are two schemes to copy. One can copy more than one sections.
  * Another can copy only one section. The former scheme needs more
@@ -246,10 +251,6 @@ Reset_Handler:
 .L_loop3_done:
 #endif /* __STARTUP_CLEAR_BSS_MULTIPLE || __STARTUP_CLEAR_BSS */
 
-                ldr      r0, =__StackLimit
-                msr      msplim, r0
-
-                bl       SystemInit
                 bl       _start
 
                 .fnend

+ 4 - 3
Device/ARM/ARMv8MBL/Source/GCC/startup_ARMv8MBL.c

@@ -148,6 +148,10 @@ void Reset_Handler(void) {
   uint32_t *pSrc, *pDest;
   uint32_t *pTable __attribute__((unused));
 
+  __set_MSPLIM((uint32_t)&__StackLimit);
+
+  SystemInit();                             /* CMSIS System Initialization */
+
 /* Firstly it copies data from read only memory to RAM.
  * There are two schemes to copy. One can copy more than one sections.
  * Another can copy only one section. The former scheme needs more
@@ -235,9 +239,6 @@ void Reset_Handler(void) {
   }
 #endif /* __STARTUP_CLEAR_BSS_MULTIPLE || __STARTUP_CLEAR_BSS */
 
-  __set_MSPLIM((uint32_t)&__StackLimit);
-
-  SystemInit();                             /* CMSIS System Initialization */
   _start();                                 /* Enter PreeMain (C library entry point) */
 }
 

+ 5 - 4
Device/ARM/ARMv8MML/Source/GCC/startup_ARMv8MML.S

@@ -119,6 +119,11 @@ __Vectors_End:
                 .globl   Reset_Handler
                 .fnstart
 Reset_Handler:
+                ldr      r0, =__StackLimit
+                msr      msplim, r0
+
+                bl       SystemInit
+
 /* Firstly it copies data from read only memory to RAM.
  * There are two schemes to copy. One can copy more than one sections.
  * Another can copy only one section. The former scheme needs more
@@ -237,10 +242,6 @@ Reset_Handler:
                 blt      .L_loop3
 #endif /* __STARTUP_CLEAR_BSS_MULTIPLE || __STARTUP_CLEAR_BSS */
 
-                ldr      r0, =__StackLimit
-                msr      msplim, r0
-
-                bl       SystemInit
                 bl       _start
 
                 .fnend

+ 4 - 3
Device/ARM/ARMv8MML/Source/GCC/startup_ARMv8MML.c

@@ -167,6 +167,10 @@ void Reset_Handler(void) {
   uint32_t *pSrc, *pDest;
   uint32_t *pTable __attribute__((unused));
 
+  __set_MSPLIM((uint32_t)&__StackLimit);
+
+  SystemInit();                             /* CMSIS System Initialization */
+
 /* Firstly it copies data from read only memory to RAM.
  * There are two schemes to copy. One can copy more than one sections.
  * Another can copy only one section. The former scheme needs more
@@ -254,9 +258,6 @@ void Reset_Handler(void) {
   }
 #endif /* __STARTUP_CLEAR_BSS_MULTIPLE || __STARTUP_CLEAR_BSS */
 
-  __set_MSPLIM((uint32_t)&__StackLimit);
-
-  SystemInit();                             /* CMSIS System Initialization */
   _start();                                 /* Enter PreeMain (C library entry point) */
 }