From 19024306fc834fbead89e749d64d352194befa84 Mon Sep 17 00:00:00 2001 From: DocYester <46453559+DocYester@users.noreply.github.com> Date: Mon, 8 Jun 2020 02:48:18 +0200 Subject: [PATCH] Robin E3D Flash-based EEPROM (#18219) --- Marlin/src/pins/stm32f1/pins_MKS_ROBIN_E3.h | 11 +++++++++++ Marlin/src/pins/stm32f1/pins_MKS_ROBIN_E3D.h | 11 +++++++++++ buildroot/share/PlatformIO/ldscripts/mks_robin_e3.ld | 2 +- 3 files changed, 23 insertions(+), 1 deletion(-) diff --git a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_E3.h b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_E3.h index 5e8f89d56d..9ef17e39c2 100644 --- a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_E3.h +++ b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_E3.h @@ -40,6 +40,17 @@ #define DISABLE_JTAG #define ENABLE_SPI2 +// +// EEPROM +// +#if EITHER(NO_EEPROM_SELECTED, FLASH_EEPROM_EMULATION) + #define FLASH_EEPROM_EMULATION + #define EEPROM_PAGE_SIZE (0x800U) // 2KB + #define EEPROM_START_ADDRESS (0x8000000UL + (STM32_FLASH_SIZE) * 1024UL - (EEPROM_PAGE_SIZE) * 2UL) + #undef E2END + #define E2END (EEPROM_PAGE_SIZE - 1) // 2KB +#endif + // // Servos // diff --git a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_E3D.h b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_E3D.h index e6cf4e528c..53cd8bb501 100644 --- a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_E3D.h +++ b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_E3D.h @@ -40,6 +40,17 @@ #define DISABLE_JTAG #define ENABLE_SPI2 +// +// EEPROM +// +#if EITHER(NO_EEPROM_SELECTED, FLASH_EEPROM_EMULATION) + #define FLASH_EEPROM_EMULATION + #define EEPROM_PAGE_SIZE (0x800U) // 2KB + #define EEPROM_START_ADDRESS (0x8000000UL + (STM32_FLASH_SIZE) * 1024UL - (EEPROM_PAGE_SIZE) * 2UL) + #undef E2END + #define E2END (EEPROM_PAGE_SIZE - 1) // 2KB +#endif + // // Servos // diff --git a/buildroot/share/PlatformIO/ldscripts/mks_robin_e3.ld b/buildroot/share/PlatformIO/ldscripts/mks_robin_e3.ld index 13fa48add4..2404e7cac9 100644 --- a/buildroot/share/PlatformIO/ldscripts/mks_robin_e3.ld +++ b/buildroot/share/PlatformIO/ldscripts/mks_robin_e3.ld @@ -1,7 +1,7 @@ MEMORY { ram (rwx) : ORIGIN = 0x20000000, LENGTH = 48K - 40 - rom (rx) : ORIGIN = 0x08005000, LENGTH = 256K - 20K + rom (rx) : ORIGIN = 0x08005000, LENGTH = 256K - 20K - 4K } /* Provide memory region aliases for common.inc */