aboutsummaryrefslogtreecommitdiff
path: root/tmk_core
diff options
context:
space:
mode:
Diffstat (limited to 'tmk_core')
-rw-r--r--tmk_core/common.mk5
-rwxr-xr-xtmk_core/common/chibios/eeprom_stm32.h6
-rwxr-xr-xtmk_core/common/chibios/flash_stm32.c5
3 files changed, 13 insertions, 3 deletions
diff --git a/tmk_core/common.mk b/tmk_core/common.mk
index 063115acb..94f3c2380 100644
--- a/tmk_core/common.mk
+++ b/tmk_core/common.mk
@@ -41,6 +41,11 @@ ifeq ($(PLATFORM),CHIBIOS)
41 TMK_COMMON_SRC += $(PLATFORM_COMMON_DIR)/flash_stm32.c 41 TMK_COMMON_SRC += $(PLATFORM_COMMON_DIR)/flash_stm32.c
42 TMK_COMMON_DEFS += -DEEPROM_EMU_STM32F103xB 42 TMK_COMMON_DEFS += -DEEPROM_EMU_STM32F103xB
43 TMK_COMMON_DEFS += -DSTM32_EEPROM_ENABLE 43 TMK_COMMON_DEFS += -DSTM32_EEPROM_ENABLE
44 else ifeq ($(MCU_SERIES)_$(MCU_LDSCRIPT), STM32F0xx_STM32F072xB)
45 TMK_COMMON_SRC += $(PLATFORM_COMMON_DIR)/eeprom_stm32.c
46 TMK_COMMON_SRC += $(PLATFORM_COMMON_DIR)/flash_stm32.c
47 TMK_COMMON_DEFS += -DEEPROM_EMU_STM32F072xB
48 TMK_COMMON_DEFS += -DSTM32_EEPROM_ENABLE
44 else 49 else
45 TMK_COMMON_SRC += $(PLATFORM_COMMON_DIR)/eeprom_teensy.c 50 TMK_COMMON_SRC += $(PLATFORM_COMMON_DIR)/eeprom_teensy.c
46 endif 51 endif
diff --git a/tmk_core/common/chibios/eeprom_stm32.h b/tmk_core/common/chibios/eeprom_stm32.h
index 892e417b7..083eb16ee 100755
--- a/tmk_core/common/chibios/eeprom_stm32.h
+++ b/tmk_core/common/chibios/eeprom_stm32.h
@@ -34,6 +34,8 @@
34 #define MCU_STM32F303CC 34 #define MCU_STM32F303CC
35#elif defined(EEPROM_EMU_STM32F103xB) 35#elif defined(EEPROM_EMU_STM32F103xB)
36 #define MCU_STM32F103RB 36 #define MCU_STM32F103RB
37#elif defined(EEPROM_EMU_STM32F072xB)
38 #define MCU_STM32F072CB
37#else 39#else
38 #error "not implemented." 40 #error "not implemented."
39#endif 41#endif
@@ -42,7 +44,7 @@
42 #if defined (MCU_STM32F103RB) 44 #if defined (MCU_STM32F103RB)
43 #define FEE_PAGE_SIZE (uint16_t)0x400 // Page size = 1KByte 45 #define FEE_PAGE_SIZE (uint16_t)0x400 // Page size = 1KByte
44 #define FEE_DENSITY_PAGES 2 // How many pages are used 46 #define FEE_DENSITY_PAGES 2 // How many pages are used
45 #elif defined (MCU_STM32F103ZE) || defined (MCU_STM32F103RE) || defined (MCU_STM32F103RD) || defined (MCU_STM32F303CC) 47 #elif defined (MCU_STM32F103ZE) || defined (MCU_STM32F103RE) || defined (MCU_STM32F103RD) || defined (MCU_STM32F303CC) || defined(MCU_STM32F072CB)
46 #define FEE_PAGE_SIZE (uint16_t)0x800 // Page size = 2KByte 48 #define FEE_PAGE_SIZE (uint16_t)0x800 // Page size = 2KByte
47 #define FEE_DENSITY_PAGES 4 // How many pages are used 49 #define FEE_DENSITY_PAGES 4 // How many pages are used
48 #else 50 #else
@@ -51,7 +53,7 @@
51#endif 53#endif
52 54
53#ifndef EEPROM_START_ADDRESS 55#ifndef EEPROM_START_ADDRESS
54 #if defined (MCU_STM32F103RB) 56 #if defined (MCU_STM32F103RB) || defined(MCU_STM32F072CB)
55 #define FEE_MCU_FLASH_SIZE 128 // Size in Kb 57 #define FEE_MCU_FLASH_SIZE 128 // Size in Kb
56 #elif defined (MCU_STM32F103ZE) || defined (MCU_STM32F103RE) 58 #elif defined (MCU_STM32F103ZE) || defined (MCU_STM32F103RE)
57 #define FEE_MCU_FLASH_SIZE 512 // Size in Kb 59 #define FEE_MCU_FLASH_SIZE 512 // Size in Kb
diff --git a/tmk_core/common/chibios/flash_stm32.c b/tmk_core/common/chibios/flash_stm32.c
index 164654a15..832bf3908 100755
--- a/tmk_core/common/chibios/flash_stm32.c
+++ b/tmk_core/common/chibios/flash_stm32.c
@@ -22,6 +22,9 @@
22#elif defined(EEPROM_EMU_STM32F103xB) 22#elif defined(EEPROM_EMU_STM32F103xB)
23 #define STM32F103xB 23 #define STM32F103xB
24 #include "stm32f1xx.h" 24 #include "stm32f1xx.h"
25#elif defined(EEPROM_EMU_STM32F072xB)
26 #define STM32F072xB
27 #include "stm32f0xx.h"
25#else 28#else
26 #error "not implemented." 29 #error "not implemented."
27#endif 30#endif
@@ -193,7 +196,7 @@ void FLASH_Lock(void)
193 * This parameter can be any combination of the following values: 196 * This parameter can be any combination of the following values:
194 * @arg FLASH_FLAG_PGERR: FLASH Programming error flag flag 197 * @arg FLASH_FLAG_PGERR: FLASH Programming error flag flag
195 * @arg FLASH_FLAG_WRPERR: FLASH Write protected error flag 198 * @arg FLASH_FLAG_WRPERR: FLASH Write protected error flag
196 * @arg FLASH_FLAG_EOP: FLASH End of Programming flag 199 * @arg FLASH_FLAG_EOP: FLASH End of Programming flag
197 * @retval None 200 * @retval None
198 */ 201 */
199void FLASH_ClearFlag(uint32_t FLASH_FLAG) 202void FLASH_ClearFlag(uint32_t FLASH_FLAG)