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

Fixed possibility of getting stuck in F7 bootloader mode (#5370)

This commit is contained in:
Andrey Mironov 2018-03-04 12:45:40 +03:00 committed by Michael Keller
parent 2f8e59f8fc
commit a24daa78d0

View file

@ -197,6 +197,9 @@ void checkForBootLoaderRequest(void)
bt = (*(__IO uint32_t *) (BKPSRAM_BASE + 4)) ; bt = (*(__IO uint32_t *) (BKPSRAM_BASE + 4)) ;
if ( bt == 0xDEADBEEF ) { if ( bt == 0xDEADBEEF ) {
(*(__IO uint32_t *) (BKPSRAM_BASE + 4)) = 0xCAFEFEED; // Reset our trigger (*(__IO uint32_t *) (BKPSRAM_BASE + 4)) = 0xCAFEFEED; // Reset our trigger
// Backup SRAM is write-back by default, ensure value actually reaches memory
// Another solution would be marking BKPSRAM as write-through in Memory Protection Unit settings
SCB_CleanDCache_by_Addr((uint32_t *) (BKPSRAM_BASE + 4), sizeof(uint32_t));
void (*SysMemBootJump)(void); void (*SysMemBootJump)(void);
__SYSCFG_CLK_ENABLE(); __SYSCFG_CLK_ENABLE();