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 checkdaktil_manuform
parent
f9853433c1
commit
120c42255b
|
@ -114,6 +114,17 @@ else
|
||||||
SRC += $(PLATFORM_COMMON_DIR)/flash_stm32.c
|
SRC += $(PLATFORM_COMMON_DIR)/flash_stm32.c
|
||||||
OPT_DEFS += -DEEPROM_EMU_STM32F072xB
|
OPT_DEFS += -DEEPROM_EMU_STM32F072xB
|
||||||
OPT_DEFS += -DSTM32_EEPROM_ENABLE
|
OPT_DEFS += -DSTM32_EEPROM_ENABLE
|
||||||
|
else ifeq ($(MCU_SERIES)_$(MCU_LDSCRIPT), STM32F0xx_STM32F042x6)
|
||||||
|
|
||||||
|
# Stack sizes: Since this chip has limited RAM capacity, the stack area needs to be reduced.
|
||||||
|
# This ensures that the EEPROM page buffer fits into RAM
|
||||||
|
USE_PROCESS_STACKSIZE = 0x600
|
||||||
|
USE_EXCEPTIONS_STACKSIZE = 0x300
|
||||||
|
|
||||||
|
SRC += $(PLATFORM_COMMON_DIR)/eeprom_stm32.c
|
||||||
|
SRC += $(PLATFORM_COMMON_DIR)/flash_stm32.c
|
||||||
|
OPT_DEFS += -DEEPROM_EMU_STM32F042x6
|
||||||
|
OPT_DEFS += -DSTM32_EEPROM_ENABLE
|
||||||
else ifneq ($(filter $(MCU_SERIES),STM32L0xx STM32L1xx),)
|
else ifneq ($(filter $(MCU_SERIES),STM32L0xx STM32L1xx),)
|
||||||
OPT_DEFS += -DEEPROM_DRIVER
|
OPT_DEFS += -DEEPROM_DRIVER
|
||||||
COMMON_VPATH += $(DRIVER_PATH)/eeprom
|
COMMON_VPATH += $(DRIVER_PATH)/eeprom
|
||||||
|
|
|
@ -36,12 +36,14 @@
|
||||||
# define MCU_STM32F103RB
|
# define MCU_STM32F103RB
|
||||||
#elif defined(EEPROM_EMU_STM32F072xB)
|
#elif defined(EEPROM_EMU_STM32F072xB)
|
||||||
# define MCU_STM32F072CB
|
# define MCU_STM32F072CB
|
||||||
|
#elif defined(EEPROM_EMU_STM32F042x6)
|
||||||
|
# define MCU_STM32F042K6
|
||||||
#else
|
#else
|
||||||
# error "not implemented."
|
# error "not implemented."
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef EEPROM_PAGE_SIZE
|
#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_PAGE_SIZE (uint16_t)0x400 // Page size = 1KByte
|
||||||
# define FEE_DENSITY_PAGES 2 // How many pages are used
|
# 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)
|
# elif defined(MCU_STM32F103ZE) || defined(MCU_STM32F103RE) || defined(MCU_STM32F103RD) || defined(MCU_STM32F303CC) || defined(MCU_STM32F072CB)
|
||||||
|
@ -55,6 +57,8 @@
|
||||||
#ifndef EEPROM_START_ADDRESS
|
#ifndef EEPROM_START_ADDRESS
|
||||||
# if defined(MCU_STM32F103RB) || defined(MCU_STM32F072CB)
|
# if defined(MCU_STM32F103RB) || defined(MCU_STM32F072CB)
|
||||||
# define FEE_MCU_FLASH_SIZE 128 // Size in Kb
|
# 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)
|
# elif defined(MCU_STM32F103ZE) || defined(MCU_STM32F103RE)
|
||||||
# define FEE_MCU_FLASH_SIZE 512 // Size in Kb
|
# define FEE_MCU_FLASH_SIZE 512 // Size in Kb
|
||||||
# elif defined(MCU_STM32F103RD)
|
# elif defined(MCU_STM32F103RD)
|
||||||
|
|
|
@ -25,6 +25,9 @@
|
||||||
#elif defined(EEPROM_EMU_STM32F072xB)
|
#elif defined(EEPROM_EMU_STM32F072xB)
|
||||||
# define STM32F072xB
|
# define STM32F072xB
|
||||||
# include "stm32f0xx.h"
|
# include "stm32f0xx.h"
|
||||||
|
#elif defined(EEPROM_EMU_STM32F042x6)
|
||||||
|
# define STM32F042x6
|
||||||
|
# include "stm32f0xx.h"
|
||||||
#else
|
#else
|
||||||
# error "not implemented."
|
# error "not implemented."
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in New Issue