mirror of
https://github.com/saymrwulf/xous-core.git
synced 2026-11-18 08:52:45 +00:00
try to improve system stability in debug modes
This commit is contained in:
parent
d42658a65d
commit
7921b0216f
2 changed files with 19 additions and 4 deletions
|
|
@ -272,9 +272,24 @@ mod implementation {
|
||||||
}
|
}
|
||||||
pub fn set_uart_mux(&mut self, mux: UartType) {
|
pub fn set_uart_mux(&mut self, mux: UartType) {
|
||||||
match mux {
|
match mux {
|
||||||
UartType::Kernel => self.gpio_csr.wfo(utra::gpio::UARTSEL_UARTSEL, 0),
|
UartType::Kernel => {
|
||||||
UartType::Log => self.gpio_csr.wfo(utra::gpio::UARTSEL_UARTSEL, 1),
|
log::warn!("disabling WFI so that kernel console works as expected");
|
||||||
UartType::Application => self.gpio_csr.wfo(utra::gpio::UARTSEL_UARTSEL, 2),
|
self.power_csr.rmwf(utra::power::POWER_DISABLE_WFI, 1);
|
||||||
|
self.gpio_csr.wfo(utra::gpio::UARTSEL_UARTSEL, 0);
|
||||||
|
},
|
||||||
|
UartType::Log => {
|
||||||
|
// this is a command mainly for debugging, so we'll accept the chance that we re-enabled WFI e.g.
|
||||||
|
// during a critical operation like SPINOR flashing because we swapped consoles at a bad time. Should be
|
||||||
|
// very rare and only affect devs...
|
||||||
|
log::warn!("unsafe re-enabling WFI -- if you issued this command at a bad time, could have side effects");
|
||||||
|
self.power_csr.rmwf(utra::power::POWER_DISABLE_WFI, 0);
|
||||||
|
self.gpio_csr.wfo(utra::gpio::UARTSEL_UARTSEL, 1)
|
||||||
|
},
|
||||||
|
UartType::Application => {
|
||||||
|
log::warn!("disabling WFI so that app console works as expected");
|
||||||
|
self.power_csr.rmwf(utra::power::POWER_DISABLE_WFI, 1);
|
||||||
|
self.gpio_csr.wfo(utra::gpio::UARTSEL_UARTSEL, 2)
|
||||||
|
},
|
||||||
_ => info!("invalid UART type specified for mux, doing nothing."),
|
_ => info!("invalid UART type specified for mux, doing nothing."),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -533,7 +533,7 @@ impl RootKeys {
|
||||||
}
|
}
|
||||||
|
|
||||||
fn make_gateware_backup(&mut self, prog_start: u32, prog_end: u32, progress_modal: &mut Modal, progress_action: &mut Slider) {
|
fn make_gateware_backup(&mut self, prog_start: u32, prog_end: u32, progress_modal: &mut Modal, progress_action: &mut Slider) {
|
||||||
// println!("this is a test of stdlib");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(feature = "hazardous-debug")]
|
#[cfg(feature = "hazardous-debug")]
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue