diff --git a/src/runtime/src/rtio_clocking.rs b/src/runtime/src/rtio_clocking.rs index f1cec16..60e960f 100644 --- a/src/runtime/src/rtio_clocking.rs +++ b/src/runtime/src/rtio_clocking.rs @@ -1,6 +1,7 @@ use log::{info, warn, error}; use libboard_zynq::timer::GlobalTimer; use embedded_hal::blocking::delay::DelayMs; +use libasync::task; use libconfig::Config; use libboard_artiq::pl; #[cfg(has_si5324)] @@ -9,6 +10,7 @@ use libboard_zynq::i2c::I2c; use crate::i2c; #[cfg(has_si5324)] use libboard_artiq::si5324; +use crate::mgmt; #[derive(Debug, PartialEq, Copy, Clone)] #[allow(non_camel_case_types)] @@ -98,7 +100,10 @@ fn init_rtio(timer: &mut GlobalTimer, _clk: RtioClock) { error!("RTIO PLL failed to lock"); #[cfg(feature = "target_kasli_soc")] { - pl::csr::error_led::out_write(1); + unsafe { + pl::csr::error_led::out_write(1); + } + soft_panic(); // try "soft" panic } } @@ -256,4 +261,17 @@ pub fn init(timer: &mut GlobalTimer, cfg: &Config) { init_rtio(timer, clk); +} + +#[cfg(feature = "target_kasli_soc")] +fn soft_panic() { + // start mgmt service but nothing else + let cfg = match Config::new() { + Ok(cfg) => cfg, + Err(_) => Config::new_dummy() + }; + mgmt::start(cfg); + loop { + task::block_on(task::r#yield()); + } } \ No newline at end of file