File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change 72
72
#ifdef STM32F0xx
73
73
// Flash base address (Bank2, page 256)
74
74
#define FLASH_BASE_ADDRESS 0x0803F800
75
+ #elif defined (STM32F1xx )
76
+ #define FLASH_BASE_ADDRESS ((uint32_t)((FLASH_BANK1_END + 1) - FLASH_PAGE_SIZE)) //0x0801FC00
77
+ #define FLASH_PAGE_NUMBER 127
75
78
#elif defined (STM32F3xx )
76
79
#define FLASH_BASE_ADDRESS ((uint32_t)((0x0807FFFF + 1) - FLASH_PAGE_SIZE)) //0x0807F800
77
80
#elif defined (STM32F4xx )
@@ -173,7 +176,8 @@ void set_data_to_flash(void)
173
176
uint32_t offset = 0 ;
174
177
uint32_t address = FLASH_BASE_ADDRESS ;
175
178
uint32_t address_end = FLASH_BASE_ADDRESS + E2END ;
176
- #if defined (STM32F0xx ) || defined (STM32F3xx ) || defined (STM32L0xx ) || defined(STM32L4xx )
179
+ #if defined (STM32F0xx ) || defined (STM32F1xx ) || defined (STM32F3xx ) || \
180
+ defined (STM32L0xx ) || defined(STM32L4xx )
177
181
uint32_t pageError = 0 ;
178
182
uint64_t data = 0 ;
179
183
@@ -183,6 +187,9 @@ void set_data_to_flash(void)
183
187
EraseInitStruct .Banks = FLASH_BANK_NUMBER ;
184
188
EraseInitStruct .Page = FLASH_PAGE_NUMBER ;
185
189
#else // STM32F4xx
190
+ #ifdef STM32F1xx
191
+ EraseInitStruct .Banks = FLASH_BANK_1 ;
192
+ #endif
186
193
EraseInitStruct .PageAddress = FLASH_BASE_ADDRESS ;
187
194
#endif
188
195
EraseInitStruct .NbPages = 1 ;
You can’t perform that action at this time.
0 commit comments