1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-15 12:25:20 +03:00

Merge pull request #11030 from SteveCEvans/f7_flash_lockup

This commit is contained in:
Michael Keller 2021-11-04 07:08:14 +13:00 committed by GitHub
commit 4537f0c394
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 1 deletions

View file

@ -76,7 +76,7 @@ static void checkForBootLoaderRequest(void)
if (bootloaderRequest != RESET_BOOTLOADER_REQUEST_ROM) { if (bootloaderRequest != RESET_BOOTLOADER_REQUEST_ROM) {
return; return;
} }
persistentObjectWrite(PERSISTENT_OBJECT_RESET_REASON, RESET_NONE); persistentObjectWrite(PERSISTENT_OBJECT_RESET_REASON, RESET_BOOTLOADER_POST);
__SYSCFG_CLK_ENABLE(); __SYSCFG_CLK_ENABLE();
SYSCFG->MEMRMP |= SYSCFG_MEM_BOOT_ADD0 ; SYSCFG->MEMRMP |= SYSCFG_MEM_BOOT_ADD0 ;

View file

@ -313,6 +313,13 @@ void OverclockRebootIfNecessary(uint32_t overclockLevel)
*/ */
void SystemInit(void) void SystemInit(void)
{ {
uint32_t bootloaderRequest = persistentObjectRead(PERSISTENT_OBJECT_RESET_REASON);
if (bootloaderRequest == RESET_BOOTLOADER_POST) {
persistentObjectWrite(PERSISTENT_OBJECT_RESET_REASON, RESET_NONE);
NVIC_SystemReset();
}
initialiseMemorySections(); initialiseMemorySections();
SystemInitOC(); SystemInitOC();