Commit a5643a46 authored by Jordan Yates's avatar Jordan Yates Committed by Benjamin Cabé
Browse files

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: default avatarJordan Yates <jordan@embeint.com>
parent 59b1bb20
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -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)
+4 −1
Original line number Diff line number Diff line
@@ -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)