Browse Source

stm32:L4:flash: support erasing pages on bank 2

Reviewed-by: Karl Palsson <karlp@tweak.net.au> (fixed code style)
pull/1167/head
balanceTWK 5 years ago
committed by Karl Palsson
parent
commit
6fc1ff225e
  1. 3
      lib/stm32/l4/flash.c

3
lib/stm32/l4/flash.c

@ -160,6 +160,9 @@ void flash_erase_page(uint32_t page)
/* page and bank are contiguous bits */
FLASH_CR &= ~((FLASH_CR_PNB_MASK << FLASH_CR_PNB_SHIFT) | FLASH_CR_BKER);
if (page > 255) {
FLASH_CR |= FLASH_CR_BKER;
}
FLASH_CR |= page << FLASH_CR_PNB_SHIFT;
FLASH_CR |= FLASH_CR_PER;
FLASH_CR |= FLASH_CR_START;

Loading…
Cancel
Save