@@ -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,18 +81,14 @@ 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 ------------------------------------------------------- */
62
88
63
89
uint8_t eeprom_read_byte (const uint32_t pos );
64
90
void eeprom_write_byte (uint32_t pos , uint8_t value );
65
91
66
- void eeprom_buffer_fill ();
67
- void eeprom_buffer_flush ();
68
- uint8_t eeprom_buffered_read_byte (const uint32_t pos );
69
- void eeprom_buffered_write_byte (uint32_t pos , uint8_t value );
70
-
71
92
#ifdef __cplusplus
72
93
}
73
94
#endif
0 commit comments