Merge pull request #10766 from hydra/bf-fix-h7-reset-forced

Fix the RESET_FORCED case not being used.
This commit is contained in:
J Blackman 2021-09-06 14:17:43 +10:00 committed by GitHub
commit 98393667c2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 7 deletions

View File

@ -110,10 +110,8 @@ void systemReset(void)
NVIC_SystemReset();
}
void forcedSystemResetWithoutDisablingCaches(void)
void systemResetWithoutDisablingCaches(void)
{
// Don't overwrite the PERSISTENT_OBJECT_RESET_REASON; just make another attempt
__disable_irq();
NVIC_SystemReset();
}
@ -184,7 +182,8 @@ void systemCheckResetReason(void)
case RESET_BOOTLOADER_POST:
// Boot loader activity magically prevents SysTick from interrupting.
// Issue a soft reset to prevent the condition.
forcedSystemResetWithoutDisablingCaches(); // observed that disabling dcache after cold boot with BOOT pin high causes segfault.
persistentObjectWrite(PERSISTENT_OBJECT_RESET_REASON, RESET_FORCED);
systemResetWithoutDisablingCaches(); // observed that disabling dcache after cold boot with BOOT pin high causes segfault.
case RESET_MSC_REQUEST:
case RESET_NONE:

View File

@ -69,7 +69,7 @@
#include "build/debug.h"
void forcedSystemResetWithoutDisablingCaches(void);
void systemResetWithoutDisablingCaches(void);
#if !defined (HSE_VALUE)
#define HSE_VALUE ((uint32_t)25000000) /*!< Value of the External oscillator in Hz */
@ -179,7 +179,7 @@ void HandleStuckSysTick(void)
}
if (tickStart == tickEnd) {
forcedSystemResetWithoutDisablingCaches();
systemResetWithoutDisablingCaches();
}
}
@ -389,7 +389,7 @@ static void SystemClockHSE_Config(void)
#ifdef USE_H7_HSE_TIMEOUT_WORKAROUND
if (status == HAL_TIMEOUT) {
forcedSystemResetWithoutDisablingCaches(); // DC - sometimes HSERDY gets stuck, waiting longer doesn't help.
systemResetWithoutDisablingCaches(); // DC - sometimes HSERDY gets stuck, waiting longer doesn't help.
}
#endif