From 06392bbfd3959da96ae8463a7c4e134a39fb64ee Mon Sep 17 00:00:00 2001
From: Alexandre Abadie <alexandre.abadie@inria.fr>
Date: Tue, 13 Mar 2018 11:02:28 +0100
Subject: [PATCH] cpu/stm32f1: add flashpage_raw support

---
 cpu/stm32f1/Makefile.features  | 1 +
 cpu/stm32f1/include/cpu_conf.h | 7 +++++++
 2 files changed, 8 insertions(+)

diff --git a/cpu/stm32f1/Makefile.features b/cpu/stm32f1/Makefile.features
index 6f8b9d6062..5e5e8b9118 100644
--- a/cpu/stm32f1/Makefile.features
+++ b/cpu/stm32f1/Makefile.features
@@ -1,3 +1,4 @@
 FEATURES_PROVIDED += periph_flashpage
+FEATURES_PROVIDED += periph_flashpage_raw
 
 -include $(RIOTCPU)/stm32_common/Makefile.features
diff --git a/cpu/stm32f1/include/cpu_conf.h b/cpu/stm32f1/include/cpu_conf.h
index 3b73eb1b0e..7a1b6f2548 100644
--- a/cpu/stm32f1/include/cpu_conf.h
+++ b/cpu/stm32f1/include/cpu_conf.h
@@ -65,6 +65,13 @@ extern "C" {
 #elif defined(CPU_MODEL_STM32F103RE) || defined(CPU_MODEL_STM32F103ZE)
 #define FLASHPAGE_NUMOF     (256U)
 #endif
+
+/* The minimum block size which can be written is 2B. However, the erase
+ * block is always FLASHPAGE_SIZE.
+ */
+#define FLASHPAGE_RAW_BLOCKSIZE    (2U)
+/* Writing should be always 4 bytes aligned */
+#define FLASHPAGE_RAW_ALIGNMENT    (4U)
 /** @} */
 
 #ifdef __cplusplus
-- 
GitLab