Skip to content

Commit

Permalink
Merge pull request #11030 from SteveCEvans/f7_flash_lockup
Browse files Browse the repository at this point in the history
  • Loading branch information
mikeller committed Nov 3, 2021
1 parent e341107 commit 45102aa
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/main/drivers/system_stm32f7xx.c
Expand Up @@ -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 ;
Expand Down
7 changes: 7 additions & 0 deletions src/main/startup/system_stm32f7xx.c
Expand Up @@ -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();
Expand Down

0 comments on commit 45102aa

Please sign in to comment.