@@ -45,6 +45,31 @@ extern "C" {
45
45
46
46
/* Exported types ------------------------------------------------------------*/
47
47
/* Exported constants --------------------------------------------------------*/
48
+ #if defined(STM32MP1xx )
49
+ /* Note for STM32MP1xx devices:
50
+ * Those devices do not have non-volatile memory. The emulation is done
51
+ * in RETRAM. Therefore data will be preserved *only* when VBAT is supplied
52
+ * (e.g. A coin battery is connected to CN3 on STM32MP157A_DK1) and
53
+ * the coprocessor is waken up from STANBY mode.
54
+ * The data won't be preserved from cold boot, even if VBAT is connected.
55
+ * See: https://community.st.com/s/question/0D50X0000B44pHUSQY/doesnt-the-mcu-coprocessor-have-nonvolatile-memory
56
+ */
57
+ #define EEPROM_RETRAM_MODE
58
+ /* 4kB is the same size as EEPROM size of ATMega2560. */
59
+ #ifndef EEPROM_RETRAM_MODE_SIZE
60
+ #define EEPROM_RETRAM_MODE_SIZE ((uint32_t)(4*1024))
61
+ #endif
62
+ /* RETRAM start address is 0x00000000 (retset entry) and end address is
63
+ * 0x00020000 (64kB in total). The by default, ldscript.ld for STM32MP1xx
64
+ * does not define address between 0x00000298 (end of ISR Vector) and 0x00020000.
65
+ * So it is okay to use in this address range. Make sure ldscript.ld does not
66
+ * overrap the following address range.
67
+ */
68
+ #ifndef EEPROM_RETRAM_START_ADDRESS
69
+ #define EEPROM_RETRAM_START_ADDRESS (0x00000400UL)
70
+ #endif
71
+ #define E2END (EEPROM_RETRAM_MODE_SIZE - 1)
72
+ #else
48
73
#ifndef FLASH_PAGE_SIZE
49
74
/*
50
75
* FLASH_PAGE_SIZE is not defined for STM32F2xx, STM32F4xx and STM32F7xx
@@ -56,6 +81,7 @@ extern "C" {
56
81
#define FLASH_PAGE_SIZE ((uint32_t)(16*1024)) /* 16kB page */
57
82
#endif
58
83
#define E2END (FLASH_PAGE_SIZE - 1)
84
+ #endif
59
85
60
86
/* Exported macro ------------------------------------------------------------*/
61
87
/* Exported functions ------------------------------------------------------- */
0 commit comments