Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit a240021

Browse files
committed
chore(wl3): add EEPROM support
Signed-off-by: Frederic Pillon <frederic.pillon@st.com>
1 parent 3752a8f commit a240021

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

‎libraries/EEPROM/src/utility/stm32_eeprom.c‎

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,8 @@ extern "C" {
5454

5555
/* Be able to change EEPROM_FLASH_PAGE_NUMBER to use if relevant */
5656
#if !defined(EEPROM_FLASH_PAGE_NUMBER) && defined(FLASH_PAGE_SIZE)
57-
#if defined(STM32WB0x)
58-
/* STM32WB0x define the FLASH_PAGE_NUMBER */
57+
#if defined(STM32WB0x)|| defined(STM32WL3x)
58+
/* STM32WB0x and STM32WL3 define the FLASH_PAGE_NUMBER */
5959
#define EEPROM_FLASH_PAGE_NUMBER (FLASH_PAGE_NUMBER - 1)
6060
#else
6161
#define EEPROM_FLASH_PAGE_NUMBER ((uint32_t)(((LL_GetFlashSize() * 1024) / FLASH_PAGE_SIZE) - 1))
@@ -265,8 +265,9 @@ 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+
/* TODO: else HAL_FLASHEx_PageProtection? */
270271
#endif
271272
{
272273
__HAL_FLASH_CLEAR_FLAG(FLASH_FLAG_ALL_ERRORS);
@@ -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)

AltStyle によって変換されたページ (->オリジナル) /