diff --git a/szl/src/main.rs b/szl/src/main.rs index 669a29c..7c4abcc 100644 --- a/szl/src/main.rs +++ b/szl/src/main.rs @@ -7,6 +7,7 @@ extern crate log; mod netboot; use alloc::rc::Rc; +use libboard_zynq::sdio::sd_card::CardInitializationError; use core::mem; use core::ptr::{addr_of_mut, addr_of}; use libboard_zynq::{ @@ -78,7 +79,7 @@ pub fn main_core0() { (C) 2020-2022 M-Labs "# ); - info!("Simple Zynq Loader starting..."); + info!("Modified Simple Zynq Loader starting..."); #[cfg(not(any(feature = "target_kasli_soc", feature = "target_ebaz4205")))] const CPU_FREQ: u32 = 800_000_000; @@ -99,7 +100,11 @@ pub fn main_core0() { let sdio0 = sdio::Sdio::sdio0(true); let fs = if sdio0.is_card_inserted() { info!("Card inserted. Mounting file system."); - let sd = sdio::sd_card::SdCard::from_sdio(sdio0).unwrap(); + let sd = match sdio::sd_card::SdCard::from_sdio(sdio0) { + Ok(sd) => sd, + Err(_) => { debug!("failed to get sd card"); panic!() } + } + debug!("got sd card"); let reader = sd_reader::SdReader::new(sd); reader .mount_fatfs(sd_reader::PartitionEntry::Entry1)