mirror of
https://github.com/saymrwulf/xous-core.git
synced 2026-11-19 09:00:54 +00:00
add a function to recycle the PDDB for faster PDDB testing cycles
This commit is contained in:
parent
8b37303b06
commit
bc98064a59
1 changed files with 7 additions and 1 deletions
|
|
@ -10,6 +10,7 @@ pub struct Keys {
|
||||||
rootkeys: root_keys::RootKeys,
|
rootkeys: root_keys::RootKeys,
|
||||||
}
|
}
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
|
#[allow(dead_code)]
|
||||||
#[cfg(not(feature="spinortest"))]
|
#[cfg(not(feature="spinortest"))]
|
||||||
pub struct Keys {
|
pub struct Keys {
|
||||||
spinor: spinor::Spinor,
|
spinor: spinor::Spinor,
|
||||||
|
|
@ -63,7 +64,7 @@ impl<'a> ShellCmdApi<'a> for Keys {
|
||||||
fn process(&mut self, args: String::<1024>, env: &mut CommonEnv) -> Result<Option<String::<1024>>, xous::Error> {
|
fn process(&mut self, args: String::<1024>, env: &mut CommonEnv) -> Result<Option<String::<1024>>, xous::Error> {
|
||||||
use core::fmt::Write;
|
use core::fmt::Write;
|
||||||
let mut ret = String::<1024>::new();
|
let mut ret = String::<1024>::new();
|
||||||
let helpstring = "keys [usblock] [usbunlock] [spinortest]";
|
let helpstring = "keys [usblock] [usbunlock] [pddbrecycle]";
|
||||||
|
|
||||||
let mut tokens = args.as_str().unwrap().split(' ');
|
let mut tokens = args.as_str().unwrap().split(' ');
|
||||||
|
|
||||||
|
|
@ -113,6 +114,11 @@ impl<'a> ShellCmdApi<'a> for Keys {
|
||||||
env.llio.debug_usb(Some(false)).unwrap();
|
env.llio.debug_usb(Some(false)).unwrap();
|
||||||
write!(ret, "USB debug port unlocked: all secrets are readable via USB!").unwrap();
|
write!(ret, "USB debug port unlocked: all secrets are readable via USB!").unwrap();
|
||||||
}
|
}
|
||||||
|
"pddbrecycle" => {
|
||||||
|
// erase the page table, which should effectively trigger a reformat on the next boot
|
||||||
|
self.spinor.bulk_erase(xous::PDDB_LOC, 1024 * 1024).expect("couldn't erase page table");
|
||||||
|
write!(ret, "PDDB page table ereased").unwrap();
|
||||||
|
}
|
||||||
#[cfg(feature="spinortest")]
|
#[cfg(feature="spinortest")]
|
||||||
"spinortest" => {
|
"spinortest" => {
|
||||||
let region = self.testing_range.as_slice::<u8>();
|
let region = self.testing_range.as_slice::<u8>();
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue