From aa8d84f0079f045e1d951cc9d4464f55c5d2170c Mon Sep 17 00:00:00 2001 From: bunnie Date: Thu, 23 May 2024 14:48:11 +0800 Subject: [PATCH] print a message if memory reads timeout --- loader/src/platform/cramium/swap.rs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/loader/src/platform/cramium/swap.rs b/loader/src/platform/cramium/swap.rs index 719de9d09..6c29c5782 100644 --- a/loader/src/platform/cramium/swap.rs +++ b/loader/src/platform/cramium/swap.rs @@ -358,11 +358,16 @@ impl SwapHal { // cheaper than the Refcell bookkeeping. let mut aad = [0u8; 64]; aad[..self.aad_len].copy_from_slice(self.aad()); - self.flash_spim.mem_read( + if !self.flash_spim.mem_read( (self.image_mac_start + (offset / 4096) * size_of::()) as u32, &mut tag, false, - ); + ) { + println!( + " ** Memory read timed out reading {:x}", + (self.image_mac_start + (offset / 4096) * size_of::()) as u32 + ); + }; match self.src_cipher.decrypt_in_place_detached( Nonce::from_slice(&nonce), &aad[..self.aad_len],