diff options
| author | chemicstry <[email protected]> | 2022-07-14 20:58:01 +0300 |
|---|---|---|
| committer | chemicstry <[email protected]> | 2022-07-14 20:58:01 +0300 |
| commit | 5a265661bb432de4d91a50f6250afde696b7f0f3 (patch) | |
| tree | bc5ea99d2c47572e9745cb89bc7663757e9cd6ee /examples | |
| parent | 039acda3a8b9549a6056aafdc4344ea4c76b9f60 (diff) | |
Fix erasing across banks
Diffstat (limited to 'examples')
| -rw-r--r-- | examples/stm32f4/src/bin/flash.rs | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/examples/stm32f4/src/bin/flash.rs b/examples/stm32f4/src/bin/flash.rs index ad45df825..265072aea 100644 --- a/examples/stm32f4/src/bin/flash.rs +++ b/examples/stm32f4/src/bin/flash.rs | |||
| @@ -7,6 +7,7 @@ use embassy::executor::Spawner; | |||
| 7 | use embassy::time::{Duration, Timer}; | 7 | use embassy::time::{Duration, Timer}; |
| 8 | use embassy_stm32::flash::Flash; | 8 | use embassy_stm32::flash::Flash; |
| 9 | use embassy_stm32::Peripherals; | 9 | use embassy_stm32::Peripherals; |
| 10 | use embedded_storage::nor_flash::{NorFlash, ReadNorFlash}; | ||
| 10 | use {defmt_rtt as _, panic_probe as _}; | 11 | use {defmt_rtt as _, panic_probe as _}; |
| 11 | 12 | ||
| 12 | #[embassy::main] | 13 | #[embassy::main] |
| @@ -18,11 +19,8 @@ async fn main(_spawner: Spawner, p: Peripherals) { | |||
| 18 | // Sector 5 | 19 | // Sector 5 |
| 19 | test_flash(&mut f, 128 * 1024, 128 * 1024); | 20 | test_flash(&mut f, 128 * 1024, 128 * 1024); |
| 20 | 21 | ||
| 21 | // Sector 11, last in bank 1 | 22 | // Sectors 11..=16, across banks (128K, 16K, 16K, 16K, 16K, 64K) |
| 22 | test_flash(&mut f, (1024 - 128) * 1024, 128 * 1024); | 23 | test_flash(&mut f, (1024 - 128) * 1024, 256 * 1024); |
| 23 | |||
| 24 | // Sectors 12..=16, start of bank 2 (16K, 16K, 16K, 16K, 64K) | ||
| 25 | test_flash(&mut f, 1024 * 1024, 128 * 1024); | ||
| 26 | 24 | ||
| 27 | // Sectors 23, last in bank 2 | 25 | // Sectors 23, last in bank 2 |
| 28 | test_flash(&mut f, (2048 - 128) * 1024, 128 * 1024); | 26 | test_flash(&mut f, (2048 - 128) * 1024, 128 * 1024); |
