summaryrefslogtreecommitdiff
path: root/tmk_core
diff options
context:
space:
mode:
authorAdrian <elagil@users.noreply.github.com>2020-10-22 12:05:01 +0200
committerDrashna Jael're <drashna@live.com>2021-01-12 22:43:32 -0800
commita1b24056f35a74f926827c0100a138e403941022 (patch)
tree306503dfd546e6e9020c9bc85ac8eb9b17fe1563 /tmk_core
parent6a285785f288d89e70cb53dd85610d0ce3241633 (diff)
Added EEPROM emulation for STM32F042x6 series processors (#10685)
* Added STM32F042x6 support for EEPROM emulation * Default to lower stack size on STM32F042 * Moved stack setting * Re-moved stack definition * Removed unnecessary check
Diffstat (limited to 'tmk_core')
-rw-r--r--tmk_core/common/chibios/eeprom_stm32.h6
-rw-r--r--tmk_core/common/chibios/flash_stm32.c3
2 files changed, 8 insertions, 1 deletions
diff --git a/tmk_core/common/chibios/eeprom_stm32.h b/tmk_core/common/chibios/eeprom_stm32.h
index e689145954..ea0ce06400 100644
--- a/tmk_core/common/chibios/eeprom_stm32.h
+++ b/tmk_core/common/chibios/eeprom_stm32.h
@@ -36,12 +36,14 @@
# define MCU_STM32F103RB
#elif defined(EEPROM_EMU_STM32F072xB)
# define MCU_STM32F072CB
+#elif defined(EEPROM_EMU_STM32F042x6)
+# define MCU_STM32F042K6
#else
# error "not implemented."
#endif
#ifndef EEPROM_PAGE_SIZE
-# if defined(MCU_STM32F103RB)
+# if defined(MCU_STM32F103RB) || defined(MCU_STM32F042K6)
# define FEE_PAGE_SIZE (uint16_t)0x400 // Page size = 1KByte
# define FEE_DENSITY_PAGES 2 // How many pages are used
# elif defined(MCU_STM32F103ZE) || defined(MCU_STM32F103RE) || defined(MCU_STM32F103RD) || defined(MCU_STM32F303CC) || defined(MCU_STM32F072CB)
@@ -55,6 +57,8 @@
#ifndef EEPROM_START_ADDRESS
# if defined(MCU_STM32F103RB) || defined(MCU_STM32F072CB)
# define FEE_MCU_FLASH_SIZE 128 // Size in Kb
+# elif defined(MCU_STM32F042K6)
+# define FEE_MCU_FLASH_SIZE 32 // Size in Kb
# elif defined(MCU_STM32F103ZE) || defined(MCU_STM32F103RE)
# define FEE_MCU_FLASH_SIZE 512 // Size in Kb
# elif defined(MCU_STM32F103RD)
diff --git a/tmk_core/common/chibios/flash_stm32.c b/tmk_core/common/chibios/flash_stm32.c
index e166fc5e6e..e8b3dc4bc9 100644
--- a/tmk_core/common/chibios/flash_stm32.c
+++ b/tmk_core/common/chibios/flash_stm32.c
@@ -25,6 +25,9 @@
#elif defined(EEPROM_EMU_STM32F072xB)
# define STM32F072xB
# include "stm32f0xx.h"
+#elif defined(EEPROM_EMU_STM32F042x6)
+# define STM32F042x6
+# include "stm32f0xx.h"
#else
# error "not implemented."
#endif