flash: stm32l4/g4: force load option bytes after write

After writing option bytes, force them to be loaded. Failing to perform
this step means the values are never applied and not actually written
to non-volatile memory.

Signed-off-by: Jordan Yates <jordan@embeint.com>
This commit is contained in:
Jordan Yates 2025-01-05 11:37:08 +10:00 committed by Benjamin Cabé
parent 59b1bb2059
commit a5643a4664
2 changed files with 8 additions and 2 deletions

View file

@ -285,7 +285,10 @@ int flash_stm32_option_bytes_write(const struct device *dev, uint32_t mask,
return rc;
}
return 0;
/* Force the option byte loading */
regs->CR |= FLASH_CR_OBL_LAUNCH;
return flash_stm32_wait_flash_idle(dev);
}
uint32_t flash_stm32_option_bytes_read(const struct device *dev)

View file

@ -276,7 +276,10 @@ int flash_stm32_option_bytes_write(const struct device *dev, uint32_t mask,
return rc;
}
return 0;
/* Force the option byte loading */
regs->CR |= FLASH_CR_OBL_LAUNCH;
return flash_stm32_wait_flash_idle(dev);
}
uint32_t flash_stm32_option_bytes_read(const struct device *dev)