diff --git a/Target/Source/ARMCM0_STM32F0/cpu.c b/Target/Source/ARMCM0_STM32F0/cpu.c index f747ccfd..ba3fc257 100644 --- a/Target/Source/ARMCM0_STM32F0/cpu.c +++ b/Target/Source/ARMCM0_STM32F0/cpu.c @@ -117,10 +117,10 @@ void CpuStartUserProgram(void) /* release the communication interface */ ComFree(); #endif - /* reset the timer */ - TimerReset(); /* reset the HAL */ HAL_DeInit(); + /* reset the timer */ + TimerReset(); /* enable system configuration peripheral, which is needed to remap the RAM later on */ LL_APB1_GRP2_EnableClock(LL_APB1_GRP2_PERIPH_SYSCFG); /* copy user program vector's to RAM */ diff --git a/Target/Source/ARMCM0_STM32F0/timer.c b/Target/Source/ARMCM0_STM32F0/timer.c index 661f0a45..00d0f25d 100644 --- a/Target/Source/ARMCM0_STM32F0/timer.c +++ b/Target/Source/ARMCM0_STM32F0/timer.c @@ -70,8 +70,10 @@ void TimerInit(void) ****************************************************************************************/ void TimerReset(void) { - /* set the systick's status and control register back into the default reset value */ + /* set the systick's registers back into the default reset value. */ SysTick->CTRL = 0; + SysTick->LOAD = 0; + SysTick->VAL = 0; } /* end of TimerReset */ diff --git a/Target/Source/ARMCM0_STM32G0/cpu.c b/Target/Source/ARMCM0_STM32G0/cpu.c index 6eb22674..ea047de7 100644 --- a/Target/Source/ARMCM0_STM32G0/cpu.c +++ b/Target/Source/ARMCM0_STM32G0/cpu.c @@ -111,10 +111,10 @@ void CpuStartUserProgram(void) /* release the communication interface */ ComFree(); #endif - /* reset the timer */ - TimerReset(); /* reset the HAL */ HAL_DeInit(); + /* reset the timer */ + TimerReset(); /* remap user program's vector table */ SCB->VTOR = CPU_USER_PROGRAM_VECTABLE_OFFSET & (blt_int32u)0x1FFFFF80; /* set the address where the bootloader needs to jump to. this is the address of diff --git a/Target/Source/ARMCM0_STM32G0/timer.c b/Target/Source/ARMCM0_STM32G0/timer.c index 19b96f57..38a7b23b 100644 --- a/Target/Source/ARMCM0_STM32G0/timer.c +++ b/Target/Source/ARMCM0_STM32G0/timer.c @@ -70,8 +70,10 @@ void TimerInit(void) ****************************************************************************************/ void TimerReset(void) { - /* set the systick's status and control register back into the default reset value */ + /* set the systick's registers back into the default reset value. */ SysTick->CTRL = 0; + SysTick->LOAD = 0; + SysTick->VAL = 0; } /* end of TimerReset */ diff --git a/Target/Source/ARMCM3_STM32F1/cpu.c b/Target/Source/ARMCM3_STM32F1/cpu.c index daac2860..bae50bd0 100644 --- a/Target/Source/ARMCM3_STM32F1/cpu.c +++ b/Target/Source/ARMCM3_STM32F1/cpu.c @@ -109,10 +109,10 @@ void CpuStartUserProgram(void) /* release the communication interface */ ComFree(); #endif - /* reset the timer */ - TimerReset(); /* reset the HAL */ HAL_DeInit(); + /* reset the timer */ + TimerReset(); /* remap user program's vector table */ SCB->VTOR = CPU_USER_PROGRAM_VECTABLE_OFFSET & (blt_int32u)0x1FFFFF80; /* set the address where the bootloader needs to jump to. this is the address of diff --git a/Target/Source/ARMCM3_STM32F1/timer.c b/Target/Source/ARMCM3_STM32F1/timer.c index 414d22e1..df4aa43b 100644 --- a/Target/Source/ARMCM3_STM32F1/timer.c +++ b/Target/Source/ARMCM3_STM32F1/timer.c @@ -71,8 +71,10 @@ void TimerInit(void) ****************************************************************************************/ void TimerReset(void) { - /* Set the systick's status and control register back into the default reset value. */ + /* Set the systick's registers back into the default reset value. */ SysTick->CTRL = 0; + SysTick->LOAD = 0; + SysTick->VAL = 0; } /* end of TimerReset */ diff --git a/Target/Source/ARMCM3_STM32F2/cpu.c b/Target/Source/ARMCM3_STM32F2/cpu.c index c0301d89..f7f3ba0d 100644 --- a/Target/Source/ARMCM3_STM32F2/cpu.c +++ b/Target/Source/ARMCM3_STM32F2/cpu.c @@ -109,10 +109,10 @@ void CpuStartUserProgram(void) /* release the communication interface */ ComFree(); #endif - /* reset the timer */ - TimerReset(); /* reset the HAL */ HAL_DeInit(); + /* reset the timer */ + TimerReset(); /* remap user program's vector table */ SCB->VTOR = CPU_USER_PROGRAM_VECTABLE_OFFSET & (blt_int32u)0x1FFFFF80; /* set the address where the bootloader needs to jump to. this is the address of diff --git a/Target/Source/ARMCM3_STM32F2/timer.c b/Target/Source/ARMCM3_STM32F2/timer.c index a215ed6f..5f1a16f5 100644 --- a/Target/Source/ARMCM3_STM32F2/timer.c +++ b/Target/Source/ARMCM3_STM32F2/timer.c @@ -71,8 +71,10 @@ void TimerInit(void) ****************************************************************************************/ void TimerReset(void) { - /* Set the systick's status and control register back into the default reset value. */ + /* Set the systick's registers back into the default reset value. */ SysTick->CTRL = 0; + SysTick->LOAD = 0; + SysTick->VAL = 0; } /* end of TimerReset */ diff --git a/Target/Source/ARMCM4_STM32F3/cpu.c b/Target/Source/ARMCM4_STM32F3/cpu.c index 8d2d86b7..90438fd8 100644 --- a/Target/Source/ARMCM4_STM32F3/cpu.c +++ b/Target/Source/ARMCM4_STM32F3/cpu.c @@ -60,7 +60,8 @@ void CpuInit(void) /* bootloader runs in polling mode so disable the global interrupts. this is done for * safety reasons. if the bootloader was started from a running user program, it could * be that the user program did not properly disable the interrupt generation of - * peripherals. */ + * peripherals. + */ CpuIrqDisable(); } /*** end of CpuInit ***/ @@ -109,10 +110,10 @@ void CpuStartUserProgram(void) /* release the communication interface */ ComFree(); #endif - /* reset the timer */ - TimerReset(); /* reset the HAL */ HAL_DeInit(); + /* reset the timer */ + TimerReset(); /* remap user program's vector table */ SCB->VTOR = CPU_USER_PROGRAM_VECTABLE_OFFSET & (blt_int32u)0x1FFFFF80; /* set the address where the bootloader needs to jump to. this is the address of diff --git a/Target/Source/ARMCM4_STM32F3/timer.c b/Target/Source/ARMCM4_STM32F3/timer.c index 8e06e728..60770eb7 100644 --- a/Target/Source/ARMCM4_STM32F3/timer.c +++ b/Target/Source/ARMCM4_STM32F3/timer.c @@ -71,8 +71,10 @@ void TimerInit(void) ****************************************************************************************/ void TimerReset(void) { - /* Set the systick's status and control register back into the default reset value. */ + /* Set the systick's registers back into the default reset value. */ SysTick->CTRL = 0; + SysTick->LOAD = 0; + SysTick->VAL = 0; } /* end of TimerReset */ diff --git a/Target/Source/ARMCM4_STM32F4/cpu.c b/Target/Source/ARMCM4_STM32F4/cpu.c index 23883e3b..7960eab8 100644 --- a/Target/Source/ARMCM4_STM32F4/cpu.c +++ b/Target/Source/ARMCM4_STM32F4/cpu.c @@ -60,7 +60,8 @@ void CpuInit(void) /* bootloader runs in polling mode so disable the global interrupts. this is done for * safety reasons. if the bootloader was started from a running user program, it could * be that the user program did not properly disable the interrupt generation of - * peripherals. */ + * peripherals. + */ CpuIrqDisable(); } /*** end of CpuInit ***/ @@ -109,10 +110,10 @@ void CpuStartUserProgram(void) /* release the communication interface */ ComFree(); #endif - /* reset the timer */ - TimerReset(); /* reset the HAL */ HAL_DeInit(); + /* reset the timer */ + TimerReset(); /* remap user program's vector table */ SCB->VTOR = CPU_USER_PROGRAM_VECTABLE_OFFSET & (blt_int32u)0x1FFFFF80; /* set the address where the bootloader needs to jump to. this is the address of diff --git a/Target/Source/ARMCM4_STM32F4/timer.c b/Target/Source/ARMCM4_STM32F4/timer.c index 18d8f3a9..9cd3547a 100644 --- a/Target/Source/ARMCM4_STM32F4/timer.c +++ b/Target/Source/ARMCM4_STM32F4/timer.c @@ -71,8 +71,10 @@ void TimerInit(void) ****************************************************************************************/ void TimerReset(void) { - /* Set the systick's status and control register back into the default reset value. */ + /* Set the systick's registers back into the default reset value. */ SysTick->CTRL = 0; + SysTick->LOAD = 0; + SysTick->VAL = 0; } /* end of TimerReset */ diff --git a/Target/Source/ARMCM4_STM32L4/cpu.c b/Target/Source/ARMCM4_STM32L4/cpu.c index 37b78fea..69320749 100644 --- a/Target/Source/ARMCM4_STM32L4/cpu.c +++ b/Target/Source/ARMCM4_STM32L4/cpu.c @@ -60,7 +60,8 @@ void CpuInit(void) /* bootloader runs in polling mode so disable the global interrupts. this is done for * safety reasons. if the bootloader was started from a running user program, it could * be that the user program did not properly disable the interrupt generation of - * peripherals. */ + * peripherals. + */ CpuIrqDisable(); } /*** end of CpuInit ***/ @@ -109,10 +110,10 @@ void CpuStartUserProgram(void) /* release the communication interface */ ComFree(); #endif - /* reset the timer */ - TimerReset(); /* reset the HAL */ HAL_DeInit(); + /* reset the timer */ + TimerReset(); /* remap user program's vector table */ SCB->VTOR = CPU_USER_PROGRAM_VECTABLE_OFFSET & (blt_int32u)0x1FFFFF80; /* set the address where the bootloader needs to jump to. this is the address of diff --git a/Target/Source/ARMCM4_STM32L4/timer.c b/Target/Source/ARMCM4_STM32L4/timer.c index 1bd50c0e..985db04b 100644 --- a/Target/Source/ARMCM4_STM32L4/timer.c +++ b/Target/Source/ARMCM4_STM32L4/timer.c @@ -71,8 +71,10 @@ void TimerInit(void) ****************************************************************************************/ void TimerReset(void) { - /* Set the systick's status and control register back into the default reset value. */ + /* Set the systick's registers back into the default reset value. */ SysTick->CTRL = 0; + SysTick->LOAD = 0; + SysTick->VAL = 0; } /* end of TimerReset */ diff --git a/Target/Source/ARMCM7_STM32F7/cpu.c b/Target/Source/ARMCM7_STM32F7/cpu.c index 2dbaa95c..e3cb19b6 100644 --- a/Target/Source/ARMCM7_STM32F7/cpu.c +++ b/Target/Source/ARMCM7_STM32F7/cpu.c @@ -110,10 +110,10 @@ void CpuStartUserProgram(void) /* release the communication interface */ ComFree(); #endif - /* reset the timer */ - TimerReset(); /* reset the HAL */ HAL_DeInit(); + /* reset the timer */ + TimerReset(); /* remap user program's vector table */ SCB->VTOR = CPU_USER_PROGRAM_VECTABLE_OFFSET & (blt_int32u)0x1FFFFF80; /* set the address where the bootloader needs to jump to. this is the address of diff --git a/Target/Source/ARMCM7_STM32F7/timer.c b/Target/Source/ARMCM7_STM32F7/timer.c index 83fa692c..63f8a6ec 100644 --- a/Target/Source/ARMCM7_STM32F7/timer.c +++ b/Target/Source/ARMCM7_STM32F7/timer.c @@ -71,8 +71,10 @@ void TimerInit(void) ****************************************************************************************/ void TimerReset(void) { - /* Set the systick's status and control register back into the default reset value. */ + /* Set the systick's registers back into the default reset value. */ SysTick->CTRL = 0; + SysTick->LOAD = 0; + SysTick->VAL = 0; } /* end of TimerReset */