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) {
return;
}
persistentObjectWrite(PERSISTENT_OBJECT_RESET_REASON, RESET_NONE);
persistentObjectWrite(PERSISTENT_OBJECT_RESET_REASON, RESET_BOOTLOADER_POST);
__SYSCFG_CLK_ENABLE();
SYSCFG->MEMRMP |= SYSCFG_MEM_BOOT_ADD0 ;

View File

@ -313,6 +313,13 @@ void OverclockRebootIfNecessary(uint32_t overclockLevel)
*/
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();
SystemInitOC();