From 0003aaea412056ff73f449286881bb0235dcb497 Mon Sep 17 00:00:00 2001 From: Alexandre Abadie 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 6f8b9d6062d52..5e5e8b9118b41 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 3b73eb1b0ea00..3b7582748ae12 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 4B. However, the erase + * block is always FLASHPAGE_SIZE. + */ +#define FLASHPAGE_RAW_BLOCKSIZE (4U) +/* Writing should be always 4 bytes aligned */ +#define FLASHPAGE_RAW_ALIGNMENT (4U) /** @} */ #ifdef __cplusplus