stm32-rs / stm32f7xx-hal

A Rust embedded-hal HAL for all MCUs in the STM32 F7 family
Apache License 2.0
115 stars 67 forks source link

Add support for flash.rs on bigger chips #168

Closed maximeborges closed 2 years ago

maximeborges commented 2 years ago

The current code to erase flash is only using the mer field. On bigger chips, there is two memory banks, so the mer field is split in two for the two memory banks, mer1 and mer2.

This PR add checks to configure either mer or mer[12] for erase functions.

hannobraun commented 2 years ago

See https://github.com/stm32-rs/stm32f7xx-hal/pull/167#issuecomment-1024871906.

maximeborges commented 2 years ago

I confirm that this example works on my Nucleo-F767ZI