From 3d6b80b94d6e0f4f0dd4b329b4992a3a53823336 Mon Sep 17 00:00:00 2001 From: mwojcik Date: Thu, 1 Sep 2022 12:02:44 +0800 Subject: [PATCH] soft_panic: print the reason --- src/runtime/src/comms.rs | 4 ++-- src/runtime/src/main.rs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/runtime/src/comms.rs b/src/runtime/src/comms.rs index fe0e042..dc1226a 100644 --- a/src/runtime/src/comms.rs +++ b/src/runtime/src/comms.rs @@ -494,11 +494,11 @@ pub fn main(timer: GlobalTimer, cfg: Config) { } -pub fn soft_panic_setup(timer: GlobalTimer, cfg: Config) { +pub fn soft_panic_setup(timer: GlobalTimer, cfg: Config, reason: &'static str) { let net_addresses = net_settings::get_addresses(&cfg); info!("network addresses: {}", net_addresses); - error!("There has been an error configuring the device. Only mgmt interface will be available."); + error!("There has been an error configuring the device: {}. Only mgmt interface will be available.", reason); #[cfg(feature = "target_kasli_soc")] { let mut err_led = ErrorLED::error_led(); diff --git a/src/runtime/src/main.rs b/src/runtime/src/main.rs index 2078dd2..5c957a6 100644 --- a/src/runtime/src/main.rs +++ b/src/runtime/src/main.rs @@ -124,6 +124,6 @@ pub fn main_core0() { match rtio_clocking::init(&mut timer, &cfg) { Ok(()) => { comms::main(timer, cfg); } - Err(_) => { comms::soft_panic_setup(timer, cfg)} + Err(reason) => { comms::soft_panic_setup(timer, cfg, reason); } }; }