diff options
| -rw-r--r-- | embassy-stm32/src/flash/f7.rs | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/embassy-stm32/src/flash/f7.rs b/embassy-stm32/src/flash/f7.rs index 09ebe9db9..043382590 100644 --- a/embassy-stm32/src/flash/f7.rs +++ b/embassy-stm32/src/flash/f7.rs | |||
| @@ -169,3 +169,13 @@ mod tests { | |||
| 169 | assert_sector(7, 0x080C_0000, LARGE_SECTOR_SIZE, 0x080F_FFFF); | 169 | assert_sector(7, 0x080C_0000, LARGE_SECTOR_SIZE, 0x080F_FFFF); |
| 170 | } | 170 | } |
| 171 | } | 171 | } |
| 172 | |||
| 173 | #[cfg(all(bank_setup_configurable))] | ||
| 174 | pub(crate) fn check_bank_setup() { | ||
| 175 | if cfg!(feature = "single-bank") && !pac::FLASH.optcr().read().n_dbank() { | ||
| 176 | panic!("Embassy is configured as single-bank, but the hardware is running in dual-bank mode. Change the hardware by changing the ndbank value in the user option bytes or configure embassy to use dual-bank config"); | ||
| 177 | } | ||
| 178 | if cfg!(feature = "dual-bank") && pac::FLASH.optcr().read().n_dbank() { | ||
| 179 | panic!("Embassy is configured as dual-bank, but the hardware is running in single-bank mode. Change the hardware by changing the ndbank value in the user option bytes or configure embassy to use single-bank config"); | ||
| 180 | } | ||
| 181 | } | ||
