diff options
| -rw-r--r-- | common_features.mk | 39 | ||||
| -rw-r--r-- | quantum/mcu_selection.mk | 5 | ||||
| -rw-r--r-- | tmk_core/common/chibios/flash_stm32.c | 4 |
3 files changed, 10 insertions, 38 deletions
diff --git a/common_features.mk b/common_features.mk index 3fe834219..6a9754e58 100644 --- a/common_features.mk +++ b/common_features.mk | |||
| @@ -153,51 +153,18 @@ else | |||
| 153 | ifeq ($(PLATFORM),AVR) | 153 | ifeq ($(PLATFORM),AVR) |
| 154 | # Automatically provided by avr-libc, nothing required | 154 | # Automatically provided by avr-libc, nothing required |
| 155 | else ifeq ($(PLATFORM),CHIBIOS) | 155 | else ifeq ($(PLATFORM),CHIBIOS) |
| 156 | ifeq ($(MCU_SERIES), STM32F3xx) | 156 | ifneq ($(filter STM32F3xx_% STM32F1xx_% %_STM32F401xC %_STM32F401xE %_STM32F405xG %_STM32F411xE %_STM32F072xB %_STM32F042x6, $(MCU_SERIES)_$(MCU_LDSCRIPT)),) |
| 157 | OPT_DEFS += -DEEPROM_DRIVER | 157 | OPT_DEFS += -DEEPROM_DRIVER |
| 158 | COMMON_VPATH += $(DRIVER_PATH)/eeprom | 158 | COMMON_VPATH += $(DRIVER_PATH)/eeprom |
| 159 | SRC += eeprom_driver.c | 159 | SRC += eeprom_driver.c |
| 160 | SRC += $(PLATFORM_COMMON_DIR)/eeprom_stm32.c | 160 | SRC += $(PLATFORM_COMMON_DIR)/eeprom_stm32.c |
| 161 | SRC += $(PLATFORM_COMMON_DIR)/flash_stm32.c | 161 | SRC += $(PLATFORM_COMMON_DIR)/flash_stm32.c |
| 162 | OPT_DEFS += -DEEPROM_EMU_STM32F303xC | ||
| 163 | else ifeq ($(MCU_SERIES), STM32F1xx) | ||
| 164 | OPT_DEFS += -DEEPROM_DRIVER | ||
| 165 | COMMON_VPATH += $(DRIVER_PATH)/eeprom | ||
| 166 | SRC += eeprom_driver.c | ||
| 167 | SRC += $(PLATFORM_COMMON_DIR)/eeprom_stm32.c | ||
| 168 | SRC += $(PLATFORM_COMMON_DIR)/flash_stm32.c | ||
| 169 | OPT_DEFS += -DEEPROM_EMU_STM32F103xB | ||
| 170 | else ifeq ($(MCU_SERIES)_$(MCU_LDSCRIPT), STM32F0xx_STM32F072xB) | ||
| 171 | OPT_DEFS += -DEEPROM_DRIVER | ||
| 172 | COMMON_VPATH += $(DRIVER_PATH)/eeprom | ||
| 173 | SRC += eeprom_driver.c | ||
| 174 | SRC += $(PLATFORM_COMMON_DIR)/eeprom_stm32.c | ||
| 175 | SRC += $(PLATFORM_COMMON_DIR)/flash_stm32.c | ||
| 176 | OPT_DEFS += -DEEPROM_EMU_STM32F072xB | ||
| 177 | else ifneq ($(filter $(MCU_SERIES)_$(MCU_LDSCRIPT),STM32F4xx_STM32F401xC STM32F4xx_STM32F401xE STM32F4xx_STM32F411xE STM32F4xx_STM32F405xG),) | ||
| 178 | OPT_DEFS += -DEEPROM_DRIVER | ||
| 179 | COMMON_VPATH += $(DRIVER_PATH)/eeprom | ||
| 180 | SRC += eeprom_driver.c | ||
| 181 | SRC += $(PLATFORM_COMMON_DIR)/eeprom_stm32.c | ||
| 182 | SRC += $(PLATFORM_COMMON_DIR)/flash_stm32.c | ||
| 183 | OPT_DEFS += -DEEPROM_EMU_STM32F401xC | ||
| 184 | else ifeq ($(MCU_SERIES)_$(MCU_LDSCRIPT), STM32F0xx_STM32F042x6) | ||
| 185 | # Stack sizes: Since this chip has limited RAM capacity, the stack area needs to be reduced. | ||
| 186 | # This ensures that the EEPROM page buffer fits into RAM | ||
| 187 | USE_PROCESS_STACKSIZE = 0x600 | ||
| 188 | USE_EXCEPTIONS_STACKSIZE = 0x300 | ||
| 189 | |||
| 190 | OPT_DEFS += -DEEPROM_DRIVER | ||
| 191 | COMMON_VPATH += $(DRIVER_PATH)/eeprom | ||
| 192 | SRC += eeprom_driver.c | ||
| 193 | SRC += $(PLATFORM_COMMON_DIR)/eeprom_stm32.c | ||
| 194 | SRC += $(PLATFORM_COMMON_DIR)/flash_stm32.c | ||
| 195 | OPT_DEFS += -DEEPROM_EMU_STM32F042x6 | ||
| 196 | else ifneq ($(filter $(MCU_SERIES),STM32L0xx STM32L1xx),) | 162 | else ifneq ($(filter $(MCU_SERIES),STM32L0xx STM32L1xx),) |
| 197 | OPT_DEFS += -DEEPROM_DRIVER | 163 | OPT_DEFS += -DEEPROM_DRIVER |
| 198 | COMMON_VPATH += $(DRIVER_PATH)/eeprom | 164 | COMMON_VPATH += $(DRIVER_PATH)/eeprom |
| 199 | COMMON_VPATH += $(PLATFORM_PATH)/$(PLATFORM_KEY)/$(DRIVER_DIR)/eeprom | 165 | COMMON_VPATH += $(PLATFORM_PATH)/$(PLATFORM_KEY)/$(DRIVER_DIR)/eeprom |
| 200 | SRC += eeprom_driver.c eeprom_stm32_L0_L1.c | 166 | SRC += eeprom_driver.c |
| 167 | SRC += eeprom_stm32_L0_L1.c | ||
| 201 | else | 168 | else |
| 202 | # This will effectively work the same as "transient" if not supported by the chip | 169 | # This will effectively work the same as "transient" if not supported by the chip |
| 203 | SRC += $(PLATFORM_COMMON_DIR)/eeprom_teensy.c | 170 | SRC += $(PLATFORM_COMMON_DIR)/eeprom_teensy.c |
diff --git a/quantum/mcu_selection.mk b/quantum/mcu_selection.mk index 92e3a7c92..622b4a82f 100644 --- a/quantum/mcu_selection.mk +++ b/quantum/mcu_selection.mk | |||
| @@ -138,6 +138,11 @@ ifneq ($(findstring STM32F042, $(MCU)),) | |||
| 138 | 138 | ||
| 139 | # UF2 settings | 139 | # UF2 settings |
| 140 | UF2_FAMILY ?= STM32F0 | 140 | UF2_FAMILY ?= STM32F0 |
| 141 | |||
| 142 | # Stack sizes: Since this chip has limited RAM capacity, the stack area needs to be reduced. | ||
| 143 | # This ensures that the EEPROM page buffer fits into RAM | ||
| 144 | USE_PROCESS_STACKSIZE = 0x600 | ||
| 145 | USE_EXCEPTIONS_STACKSIZE = 0x300 | ||
| 141 | endif | 146 | endif |
| 142 | 147 | ||
| 143 | ifneq ($(findstring STM32F072, $(MCU)),) | 148 | ifneq ($(findstring STM32F072, $(MCU)),) |
diff --git a/tmk_core/common/chibios/flash_stm32.c b/tmk_core/common/chibios/flash_stm32.c index 8f10903d3..35fb0eebd 100644 --- a/tmk_core/common/chibios/flash_stm32.c +++ b/tmk_core/common/chibios/flash_stm32.c | |||
| @@ -19,11 +19,11 @@ | |||
| 19 | #include <hal.h> | 19 | #include <hal.h> |
| 20 | #include "flash_stm32.h" | 20 | #include "flash_stm32.h" |
| 21 | 21 | ||
| 22 | #if defined(EEPROM_EMU_STM32F103xB) | 22 | #if defined(STM32F1XX) |
| 23 | # define FLASH_SR_WRPERR FLASH_SR_WRPRTERR | 23 | # define FLASH_SR_WRPERR FLASH_SR_WRPRTERR |
| 24 | #endif | 24 | #endif |
| 25 | 25 | ||
| 26 | #if defined(EEPROM_EMU_STM32F401xC) | 26 | #if defined(STM32F4XX) |
| 27 | # define FLASH_SR_PGERR (FLASH_SR_PGSERR | FLASH_SR_PGPERR | FLASH_SR_PGAERR) | 27 | # define FLASH_SR_PGERR (FLASH_SR_PGSERR | FLASH_SR_PGPERR | FLASH_SR_PGAERR) |
| 28 | 28 | ||
| 29 | # define FLASH_KEY1 0x45670123U | 29 | # define FLASH_KEY1 0x45670123U |
