Fix end address for assertion

This commit is contained in:
Rasmus Melchior Jacobsen
2023-05-25 22:48:54 +02:00
parent 41a632a56c
commit 88543445d8
2 changed files with 3 additions and 3 deletions

View File

@ -443,7 +443,7 @@ pub(crate) fn assert_not_corrupted_read(end_address: u32) {
const REVISION_3: u16 = 0x2001;
#[allow(unused)]
let second_bank_read = get_flash_regions().last().unwrap().bank == FlashBank::Bank2 && end_address > FLASH_SIZE / 2;
let second_bank_read = get_flash_regions().last().unwrap().bank == FlashBank::Bank2 && end_address > (FLASH_SIZE / 2) as u32;
#[cfg(any(
feature = "stm32f427ai",
@ -491,7 +491,7 @@ pub(crate) fn assert_not_corrupted_read(end_address: u32) {
feature = "stm32f439vg",
feature = "stm32f439zg",
))]
if second_bank_read && unsafe { &&pac::DBGMCU.idcode().read().rev_id() < REVISION_3 && !pa12_is_output_pull_low() }
if second_bank_read && unsafe { pac::DBGMCU.idcode().read().rev_id() < REVISION_3 && !pa12_is_output_pull_low() }
{
panic!("Read corruption for stm32f42xxG and stm32f43xxG in dual bank mode when PA12 is in use for chips below revision 3, see errata 2.2.11");
}