From 8916162e6847e5e0e5456cd68ea0baff7dd68a28 Mon Sep 17 00:00:00 2001 From: Karl Palsson Date: Tue, 14 Sep 2021 22:57:59 +0000 Subject: flash: stm32wb: oldstyle: add register map and basic init Flash hasn't yet been ported to new style. Signed-off-by: Karl Palsson --- rcc/flash.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'rcc/flash.cpp') diff --git a/rcc/flash.cpp b/rcc/flash.cpp index 0f46cf0..e17b6a1 100644 --- a/rcc/flash.cpp +++ b/rcc/flash.cpp @@ -1,5 +1,8 @@ #include "flash.h" +/** + * Configure the flash for maximum speed access. + */ void flash_init() { #if defined(STM32F1) || defined(STM32F3) @@ -18,5 +21,9 @@ void flash_init() { // SET flash latency. FLASH.ACR = 1 << 0; + #elif defined(STM32WB) + // Prefetch and both caches, plus 3WS for 64MHz + FLASH.ACR = 0x700 | 3; + #endif } -- cgit v1.2.3