Browse Source

stm32/mboot: Add support for F469/479 MCUs in fwupdate.py.

And don't assert on the sector number in sector_erase, so it can support
erasing arbitrary sectors.

Signed-off-by: Damien George <damien@micropython.org>
pull/8257/head
Damien George 3 years ago
parent
commit
26faf74d52
  1. 4
      ports/stm32/mboot/fwupdate.py

4
ports/stm32/mboot/fwupdate.py

@ -105,10 +105,11 @@ class Flash:
dev_id = 0 dev_id = 0
# Configure flash parameters based on MCU. # Configure flash parameters based on MCU.
if dev_id in (0x413, 0x419, 0x431, 0x451, 0x452): if dev_id in (0x413, 0x419, 0x431, 0x434, 0x451, 0x452):
# 0x413: STM32F405/407, STM32F415/417 # 0x413: STM32F405/407, STM32F415/417
# 0x419: STM32F42x/43x # 0x419: STM32F42x/43x
# 0x431: STM32F411 # 0x431: STM32F411
# 0x434: STM32F469/479
# 0x451: STM32F76x/77x # 0x451: STM32F76x/77x
# 0x452: STM32F72x/73x # 0x452: STM32F72x/73x
self._keyr = stm.FLASH + stm.FLASH_KEYR self._keyr = stm.FLASH + stm.FLASH_KEYR
@ -155,7 +156,6 @@ class Flash:
stm.mem32[self._cr] = self._cr_lock stm.mem32[self._cr] = self._cr_lock
def erase_sector(self, sector): def erase_sector(self, sector):
assert 0 <= sector <= 7
self.wait_not_busy() self.wait_not_busy()
stm.mem32[self._cr] = self._cr_init_erase(sector) stm.mem32[self._cr] = self._cr_init_erase(sector)
stm.mem32[self._cr] |= self._cr_start_erase stm.mem32[self._cr] |= self._cr_start_erase

Loading…
Cancel
Save