From 73cf53197543d3001f9f50b8853d3c54120a5b1b Mon Sep 17 00:00:00 2001 From: Christer Weinigel Date: Sun, 29 Jan 2017 10:35:43 +0100 Subject: [PATCH] soc: stm32f4xx: Make missing flash latency info a compile error If the flash latency isn't set most STM32F4xx MCU's won't be able to run from flash when the CPU frequency is changed. Make this a compile time error instead of an assert at runtime. Change-Id: Ic3421194545f8f83bd6e00f0cd011306c8d1eedd Signed-off-by: Christer Weinigel --- arch/arm/soc/st_stm32/stm32f4/flash_registers.h | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/arch/arm/soc/st_stm32/stm32f4/flash_registers.h b/arch/arm/soc/st_stm32/stm32f4/flash_registers.h index 3ce5cd2def6..4e77dcd6a1f 100644 --- a/arch/arm/soc/st_stm32/stm32f4/flash_registers.h +++ b/arch/arm/soc/st_stm32/stm32f4/flash_registers.h @@ -90,9 +90,7 @@ static inline void __setup_flash(void) regs->acr.bit.latency = STM32F4X_FLASH_LATENCY_5; } #else - else { - __ASSERT(0, "Flash latency not set"); - } +#error Flash latency configuration for MCU model is missing #endif /* Make sure latency was set */