mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-19 14:25:20 +03:00
Change position of checkForBootloaderRequest (F745 working)
This commit is contained in:
parent
6bacdc71ff
commit
a539997ffb
5 changed files with 8 additions and 5 deletions
|
@ -154,6 +154,8 @@ bool isMPUSoftReset(void)
|
||||||
|
|
||||||
void systemInit(void)
|
void systemInit(void)
|
||||||
{
|
{
|
||||||
|
checkForBootLoaderRequest();
|
||||||
|
|
||||||
// Mark ITCM-RAM as read-only
|
// Mark ITCM-RAM as read-only
|
||||||
LL_MPU_ConfigRegion(LL_MPU_REGION_NUMBER0, 0, RAMITCM_BASE, LL_MPU_REGION_SIZE_16KB | LL_MPU_REGION_PRIV_RO_URO);
|
LL_MPU_ConfigRegion(LL_MPU_REGION_NUMBER0, 0, RAMITCM_BASE, LL_MPU_REGION_SIZE_16KB | LL_MPU_REGION_PRIV_RO_URO);
|
||||||
LL_MPU_Enable(LL_MPU_CTRL_PRIVILEGED_DEFAULT);
|
LL_MPU_Enable(LL_MPU_CTRL_PRIVILEGED_DEFAULT);
|
||||||
|
@ -198,11 +200,16 @@ void checkForBootLoaderRequest(void)
|
||||||
}
|
}
|
||||||
|
|
||||||
void (*SysMemBootJump)(void);
|
void (*SysMemBootJump)(void);
|
||||||
|
|
||||||
__SYSCFG_CLK_ENABLE();
|
__SYSCFG_CLK_ENABLE();
|
||||||
SYSCFG->MEMRMP |= SYSCFG_MEM_BOOT_ADD0 ;
|
SYSCFG->MEMRMP |= SYSCFG_MEM_BOOT_ADD0 ;
|
||||||
|
|
||||||
uint32_t p = (*((uint32_t *) 0x1ff00000));
|
uint32_t p = (*((uint32_t *) 0x1ff00000));
|
||||||
__set_MSP(p); //Set the main stack pointer to its defualt values
|
|
||||||
|
__set_MSP(p); //Set the main stack pointer to its default values
|
||||||
|
|
||||||
SysMemBootJump = (void (*)(void)) (*((uint32_t *) 0x1ff00004)); // Point the PC to the System Memory reset vector (+4)
|
SysMemBootJump = (void (*)(void)) (*((uint32_t *) 0x1ff00004)); // Point the PC to the System Memory reset vector (+4)
|
||||||
SysMemBootJump();
|
SysMemBootJump();
|
||||||
|
|
||||||
while (1);
|
while (1);
|
||||||
}
|
}
|
||||||
|
|
|
@ -84,7 +84,6 @@ Reset_Handler:
|
||||||
ldr sp, =_estack /* set stack pointer */
|
ldr sp, =_estack /* set stack pointer */
|
||||||
|
|
||||||
bl persistentObjectInit
|
bl persistentObjectInit
|
||||||
bl checkForBootLoaderRequest
|
|
||||||
|
|
||||||
/* Copy the data segment initializers from flash to SRAM */
|
/* Copy the data segment initializers from flash to SRAM */
|
||||||
movs r1, #0
|
movs r1, #0
|
||||||
|
|
|
@ -84,7 +84,6 @@ Reset_Handler:
|
||||||
ldr sp, =_estack /* set stack pointer */
|
ldr sp, =_estack /* set stack pointer */
|
||||||
|
|
||||||
bl persistentObjectInit
|
bl persistentObjectInit
|
||||||
bl checkForBootLoaderRequest
|
|
||||||
|
|
||||||
/* Copy the data segment initializers from flash to SRAM */
|
/* Copy the data segment initializers from flash to SRAM */
|
||||||
movs r1, #0
|
movs r1, #0
|
||||||
|
|
|
@ -84,7 +84,6 @@ Reset_Handler:
|
||||||
ldr sp, =_estack /* set stack pointer */
|
ldr sp, =_estack /* set stack pointer */
|
||||||
|
|
||||||
bl persistentObjectInit
|
bl persistentObjectInit
|
||||||
bl checkForBootLoaderRequest
|
|
||||||
|
|
||||||
/* Copy the data segment initializers from flash to SRAM */
|
/* Copy the data segment initializers from flash to SRAM */
|
||||||
movs r1, #0
|
movs r1, #0
|
||||||
|
|
|
@ -84,7 +84,6 @@ Reset_Handler:
|
||||||
ldr sp, =_estack /* set stack pointer */
|
ldr sp, =_estack /* set stack pointer */
|
||||||
|
|
||||||
bl persistentObjectInit
|
bl persistentObjectInit
|
||||||
bl checkForBootLoaderRequest
|
|
||||||
|
|
||||||
/* Copy the data segment initializers from flash to SRAM */
|
/* Copy the data segment initializers from flash to SRAM */
|
||||||
movs r1, #0
|
movs r1, #0
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue