summaryrefslogtreecommitdiff
path: root/chip
diff options
context:
space:
mode:
Diffstat (limited to 'chip')
-rw-r--r--chip/stm32/flash-stm32h7.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/chip/stm32/flash-stm32h7.c b/chip/stm32/flash-stm32h7.c
index 6c8c797c41..087ddbf062 100644
--- a/chip/stm32/flash-stm32h7.c
+++ b/chip/stm32/flash-stm32h7.c
@@ -410,7 +410,12 @@ int crec_flash_physical_erase(int offset, int size)
/* Wait for erase to complete */
while ((STM32_FLASH_SR(bank) & FLASH_SR_BUSY) &&
(get_time().val < deadline.val)) {
- usleep(5000);
+ /*
+ * Interrupts may not be enabled, so we are using
+ * udelay() instead of usleep() which can trigger
+ * Forced Hard Fault (see b/180761547).
+ */
+ udelay(5000);
}
if (STM32_FLASH_SR(bank) & FLASH_SR_BUSY) {
res = EC_ERROR_TIMEOUT;