aboutsummaryrefslogtreecommitdiffstats
path: root/os/hal/ports/STM32/STM32L4xx/hal_lld.c
diff options
context:
space:
mode:
authorGiovanni Di Sirio <gdisirio@gmail.com>2019-06-30 07:16:02 +0000
committerGiovanni Di Sirio <gdisirio@gmail.com>2019-06-30 07:16:02 +0000
commita9b5eab94a4e3b2e2bb9215111954e2845500d7a (patch)
tree5062e78305bc54ab4b98ab12f08d2bebd5040703 /os/hal/ports/STM32/STM32L4xx/hal_lld.c
parente8fb1f777f38f1dc5368c03ff2990bd3404cfc18 (diff)
downloadChibiOS-a9b5eab94a4e3b2e2bb9215111954e2845500d7a.tar.gz
ChibiOS-a9b5eab94a4e3b2e2bb9215111954e2845500d7a.tar.bz2
ChibiOS-a9b5eab94a4e3b2e2bb9215111954e2845500d7a.zip
Fixed bug #1035.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/branches/stable_19.1.x@12854 27425a3e-05d8-49a3-a47f-9c15f0e5edd8
Diffstat (limited to 'os/hal/ports/STM32/STM32L4xx/hal_lld.c')
-rw-r--r--os/hal/ports/STM32/STM32L4xx/hal_lld.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/os/hal/ports/STM32/STM32L4xx/hal_lld.c b/os/hal/ports/STM32/STM32L4xx/hal_lld.c
index 216002fc2..7abdd7893 100644
--- a/os/hal/ports/STM32/STM32L4xx/hal_lld.c
+++ b/os/hal/ports/STM32/STM32L4xx/hal_lld.c
@@ -18,7 +18,7 @@
* @file STM32L4xx/hal_lld.c
* @brief STM32L4xx HAL subsystem low level driver source.
*
- * @addtogroup STM32L4xx_ISR
+ * @addtogroup HAL
* @{
*/
@@ -351,8 +351,12 @@ void stm32_clock_init(void) {
}
/* Set flash WS's for SYSCLK source */
- if (STM32_FLASHBITS > STM32_MSI_FLASHBITS)
+ if (STM32_FLASHBITS > STM32_MSI_FLASHBITS) {
FLASH->ACR = (FLASH->ACR & ~FLASH_ACR_LATENCY_Msk) | STM32_FLASHBITS;
+ while ((FLASH->ACR & FLASH_ACR_LATENCY_Msk) !=
+ (STM32_FLASHBITS & FLASH_ACR_LATENCY_Msk)) {
+ }
+ }
/* Switching to the configured SYSCLK source if it is different from MSI.*/
#if (STM32_SW != STM32_SW_MSI)
@@ -363,8 +367,12 @@ void stm32_clock_init(void) {
#endif
/* Reduce the flash WS's for SYSCLK source if they are less than MSI WSs */
- if (STM32_FLASHBITS < STM32_MSI_FLASHBITS)
+ if (STM32_FLASHBITS < STM32_MSI_FLASHBITS) {
FLASH->ACR = (FLASH->ACR & ~FLASH_ACR_LATENCY_Msk) | STM32_FLASHBITS;
+ while ((FLASH->ACR & FLASH_ACR_LATENCY_Msk) !=
+ (STM32_FLASHBITS & FLASH_ACR_LATENCY_Msk)) {
+ }
+ }
#endif /* STM32_NO_INIT */