diff --git a/baremetal/src/main.rs b/baremetal/src/main.rs index eab7739b0..bb04199a2 100644 --- a/baremetal/src/main.rs +++ b/baremetal/src/main.rs @@ -72,6 +72,8 @@ pub unsafe extern "C" fn rust_entry() -> ! { // provide some feedback on the run state of the BIO by peeking at the program counter // value, and provide feedback on the CPU operation by flashing the RGB LEDs. let mut repl = crate::repl::Repl::new(); + #[cfg(feature = "nto-bio")] + repl.init_cmd("bio"); // do a power-on BIO test loop { // Handle keyboard events. critical_section::with(|cs| { diff --git a/baremetal/src/repl.rs b/baremetal/src/repl.rs index 36c50ce39..5d1495ef1 100644 --- a/baremetal/src/repl.rs +++ b/baremetal/src/repl.rs @@ -29,6 +29,13 @@ const COLUMNS: usize = 4; impl Repl { pub fn new() -> Self { Self { cmdline: String::new(), do_cmd: false } } + #[allow(dead_code)] + pub fn init_cmd(&mut self, cmd: &str) { + self.cmdline.push_str(cmd); + self.cmdline.push('\n'); + self.do_cmd = true; + } + pub fn rx_char(&mut self, c: u8) { if c == b'\r' { crate::println!(""); @@ -338,18 +345,17 @@ impl Repl { let mut seed = 0; loop { crate::platform::bio::bdma_coincident_test(&args, seed); - // let mut rcurst = CSR::new(utra::sysctrl::HW_SYSCTRL_BASE as *mut u32); - // rcurst.wo(utra::sysctrl::SFR_RCURST0, 0x55AA); - // rcurst.wo(utra::sysctrl::SFR_RCURST1, 0x55AA); seed += 1; crate::println!("seed {}", seed); - if seed > 64 { + if seed > 32 { break; } } - /* let mut bio_ss = BioSharedState::new(); - bio_ss.init(); - */ + } + "reset" => { + let mut rcurst = CSR::new(utra::sysctrl::HW_SYSCTRL_BASE as *mut u32); + rcurst.wo(utra::sysctrl::SFR_RCURST0, 0x55AA); + // rcurst.wo(utra::sysctrl::SFR_RCURST1, 0x55AA); } #[cfg(feature = "cramium-soc")] "clocks" => {