immedately change clock rate to load data sections faster

This commit is contained in:
Conor Patrick 2019-02-06 17:55:27 -05:00
parent 765d532f82
commit 2ed8667f18
2 changed files with 31 additions and 27 deletions

View File

@ -7,7 +7,7 @@
* - Set the initial SP * - Set the initial SP
* - Set the initial PC == Reset_Handler, * - Set the initial PC == Reset_Handler,
* - Set the vector table entries with the exceptions ISR address, * - Set the vector table entries with the exceptions ISR address,
* - Configure the clock system * - Configure the clock system
* - Branches to main in the C library (which eventually * - Branches to main in the C library (which eventually
* calls main()). * calls main()).
* After Reset the Cortex-M4 processor is in Thread mode, * After Reset the Cortex-M4 processor is in Thread mode,
@ -79,6 +79,8 @@ Reset_Handler:
ldr sp, =_estack /* Atollic update: set stack pointer */ ldr sp, =_estack /* Atollic update: set stack pointer */
/* Copy the data segment initializers from flash to SRAM */ /* Copy the data segment initializers from flash to SRAM */
/* Call the clock system intitialization function.*/
bl SystemInit
movs r1, #0 movs r1, #0
b LoopCopyDataInit b LoopCopyDataInit
@ -106,8 +108,7 @@ LoopFillZerobss:
cmp r2, r3 cmp r2, r3
bcc FillZerobss bcc FillZerobss
/* Call the clock system intitialization function.*/
bl SystemInit
/* Call static constructors */ /* Call static constructors */
bl __libc_init_array bl __libc_init_array
/* Call the application's entry point.*/ /* Call the application's entry point.*/
@ -115,7 +116,7 @@ LoopFillZerobss:
LoopForever: LoopForever:
b LoopForever b LoopForever
.size Reset_Handler, .-Reset_Handler .size Reset_Handler, .-Reset_Handler
/** /**
@ -414,49 +415,49 @@ g_pfnVectors:
.weak COMP_IRQHandler .weak COMP_IRQHandler
.thumb_set COMP_IRQHandler,Default_Handler .thumb_set COMP_IRQHandler,Default_Handler
.weak LPTIM1_IRQHandler .weak LPTIM1_IRQHandler
.thumb_set LPTIM1_IRQHandler,Default_Handler .thumb_set LPTIM1_IRQHandler,Default_Handler
.weak LPTIM2_IRQHandler .weak LPTIM2_IRQHandler
.thumb_set LPTIM2_IRQHandler,Default_Handler .thumb_set LPTIM2_IRQHandler,Default_Handler
.weak USB_IRQHandler .weak USB_IRQHandler
.thumb_set USB_IRQHandler,Default_Handler .thumb_set USB_IRQHandler,Default_Handler
.weak DMA2_Channel6_IRQHandler .weak DMA2_Channel6_IRQHandler
.thumb_set DMA2_Channel6_IRQHandler,Default_Handler .thumb_set DMA2_Channel6_IRQHandler,Default_Handler
.weak DMA2_Channel7_IRQHandler .weak DMA2_Channel7_IRQHandler
.thumb_set DMA2_Channel7_IRQHandler,Default_Handler .thumb_set DMA2_Channel7_IRQHandler,Default_Handler
.weak LPUART1_IRQHandler .weak LPUART1_IRQHandler
.thumb_set LPUART1_IRQHandler,Default_Handler .thumb_set LPUART1_IRQHandler,Default_Handler
.weak QUADSPI_IRQHandler .weak QUADSPI_IRQHandler
.thumb_set QUADSPI_IRQHandler,Default_Handler .thumb_set QUADSPI_IRQHandler,Default_Handler
.weak I2C3_EV_IRQHandler .weak I2C3_EV_IRQHandler
.thumb_set I2C3_EV_IRQHandler,Default_Handler .thumb_set I2C3_EV_IRQHandler,Default_Handler
.weak I2C3_ER_IRQHandler .weak I2C3_ER_IRQHandler
.thumb_set I2C3_ER_IRQHandler,Default_Handler .thumb_set I2C3_ER_IRQHandler,Default_Handler
.weak SAI1_IRQHandler .weak SAI1_IRQHandler
.thumb_set SAI1_IRQHandler,Default_Handler .thumb_set SAI1_IRQHandler,Default_Handler
.weak SWPMI1_IRQHandler .weak SWPMI1_IRQHandler
.thumb_set SWPMI1_IRQHandler,Default_Handler .thumb_set SWPMI1_IRQHandler,Default_Handler
.weak TSC_IRQHandler .weak TSC_IRQHandler
.thumb_set TSC_IRQHandler,Default_Handler .thumb_set TSC_IRQHandler,Default_Handler
.weak RNG_IRQHandler .weak RNG_IRQHandler
.thumb_set RNG_IRQHandler,Default_Handler .thumb_set RNG_IRQHandler,Default_Handler
.weak FPU_IRQHandler .weak FPU_IRQHandler
.thumb_set FPU_IRQHandler,Default_Handler .thumb_set FPU_IRQHandler,Default_Handler
.weak CRS_IRQHandler .weak CRS_IRQHandler
.thumb_set CRS_IRQHandler,Default_Handler .thumb_set CRS_IRQHandler,Default_Handler
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/

View File

@ -106,6 +106,7 @@
*/ */
#include "stm32l4xx.h" #include "stm32l4xx.h"
#include "init.h"
#if !defined (HSE_VALUE) #if !defined (HSE_VALUE)
#define HSE_VALUE 8000000U /*!< Value of the External oscillator in Hz */ #define HSE_VALUE 8000000U /*!< Value of the External oscillator in Hz */
@ -219,6 +220,8 @@ void SystemInit(void)
/* Disable all interrupts */ /* Disable all interrupts */
RCC->CIER = 0x00000000U; RCC->CIER = 0x00000000U;
SystemClock_Config_LF();
} }
/** /**