summaryrefslogtreecommitdiff
path: root/rcc/flash.cpp
diff options
context:
space:
mode:
authorKarl Palsson <karlp@tweak.net.au>2021-09-15 00:57:59 +0200
committerVegard Storheil Eriksen <zyp@jvnv.net>2021-09-16 20:29:55 +0200
commit8916162e6847e5e0e5456cd68ea0baff7dd68a28 (patch)
treef08ccda624c2296b742206e544895a5fb003915f /rcc/flash.cpp
parentd5beba45db3f11a91bb10f6f7a76d218e83fc03d (diff)
flash: stm32wb: oldstyle: add register map and basic init
Flash hasn't yet been ported to new style. Signed-off-by: Karl Palsson <karlp@tweak.net.au>
Diffstat (limited to 'rcc/flash.cpp')
-rw-r--r--rcc/flash.cpp7
1 files changed, 7 insertions, 0 deletions
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
}