Skip to content

Commit 0e538e5

Browse files
committed
chore(wb0): add EEPROM support
Signed-off-by: Frederic Pillon <[email protected]>
1 parent 1335d1b commit 0e538e5

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

libraries/EEPROM/src/utility/stm32_eeprom.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -265,9 +265,10 @@ void eeprom_buffer_flush(void)
265265
EraseInitStruct.PageAddress = FLASH_BASE_ADDRESS;
266266
#endif
267267
EraseInitStruct.NbPages = 1;
268-
#if !defined(PROT_LEVEL_NONE)
268+
#if !defined(PROT_LEVEL_NONE) && !defined(STM32WL3x)
269269
if (HAL_FLASH_Unlock() == HAL_OK)
270-
#endif
270+
/* TODO: else HAL_FLASHEx_PageProtection? */
271+
#endif
271272
{
272273
__HAL_FLASH_CLEAR_FLAG(FLASH_FLAG_ALL_ERRORS);
273274
if (HAL_FLASHEx_Erase(&EraseInitStruct, &pageError) == HAL_OK) {
@@ -303,9 +304,9 @@ void eeprom_buffer_flush(void)
303304
}
304305
}
305306
}
306-
#if !defined(PROT_LEVEL_NONE)
307+
#if !defined(PROT_LEVEL_NONE) && !defined(STM32WL3x)
307308
HAL_FLASH_Lock();
308-
#endif /* FLASH_KEY1 || FLASH_PEKEY1 */
309+
#endif
309310
}
310311
#else /* FLASH_TYPEERASE_SECTORS */
311312
uint32_t SectorError = 0;

0 commit comments

Comments
 (0)