diff options
Diffstat (limited to 'chip/stm32')
-rw-r--r-- | chip/stm32/system.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/chip/stm32/system.c b/chip/stm32/system.c index 1a9da8c3a4..1f5f9c9108 100644 --- a/chip/stm32/system.c +++ b/chip/stm32/system.c @@ -373,6 +373,15 @@ void system_reset(int flags) chip_save_reset_flags(save_flags); +#ifdef CONFIG_ARMV7M_CACHE + /* + * Disable caches (D-cache is also flushed and invalidated) + * so changes that lives in cache are saved in memory now. + * Any subsequent writes will be done immediately. + */ + cpu_disable_caches(); +#endif + if (flags & SYSTEM_RESET_HARD) { #ifdef CONFIG_SOFTWARE_PANIC uint32_t reason, info; |