summaryrefslogtreecommitdiff
path: root/chip/stm32/flash-stm32l.c
diff options
context:
space:
mode:
Diffstat (limited to 'chip/stm32/flash-stm32l.c')
-rw-r--r--chip/stm32/flash-stm32l.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/chip/stm32/flash-stm32l.c b/chip/stm32/flash-stm32l.c
index afb614b921..a08328baa0 100644
--- a/chip/stm32/flash-stm32l.c
+++ b/chip/stm32/flash-stm32l.c
@@ -263,11 +263,10 @@ int flash_physical_erase(int offset, int size)
address += CONFIG_FLASH_ERASE_SIZE / sizeof(uint32_t)) {
timestamp_t deadline;
- /*
- * crosbug.com/p/13066
- * We can't do the flash_is_erased() trick on stm32l since
- * bits erase to 0, not 1. Will address later if needed.
- */
+ /* Do nothing if already erased */
+ if (flash_is_erased((uint32_t)address - CONFIG_FLASH_BASE,
+ CONFIG_FLASH_ERASE_SIZE))
+ continue;
/* Start erase */
*address = 0x00000000;