stm32l4/flashpage: fix page erase
- The PNB in FLASH_CR wasn't cleared before every erase operation and the new value was just stacked on top. After a couple of erase the PNB written was overlapping with old ones failing to erase the correct page.
This commit is contained in:
parent
135ad3817b
commit
26a8013502
@ -111,6 +111,7 @@ static void _erase_page(void *page_addr)
|
||||
}
|
||||
pn = (uint8_t)page;
|
||||
#endif
|
||||
CNTRL_REG &= ~FLASH_CR_PNB;
|
||||
CNTRL_REG |= (uint32_t)(pn << FLASH_CR_PNB_Pos);
|
||||
CNTRL_REG |= FLASH_CR_STRT;
|
||||
#else /* CPU_FAM_STM32F0 || CPU_FAM_STM32F1 */
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user