mirror of
https://github.com/saymrwulf/xous-core.git
synced 2026-11-15 08:30:02 +00:00
update selftest to what's used in production
This commit is contained in:
parent
c38214865f
commit
75c1faa652
1 changed files with 8 additions and 18 deletions
|
|
@ -2,7 +2,8 @@ use utralib::*;
|
|||
use xous_bio_bdma::*;
|
||||
|
||||
// pinmask 29 is not mapped out. This is tested by pushing the button to allow boot
|
||||
const DABAO_PINMASK: u32 = 0b0001_1111_1000_1111_0111_1000_0011_1110; // 0x1F8F783E;
|
||||
// pinmask 12 & 13 not mapped out. This is tested by tx/rx with the tester
|
||||
const DABAO_PINMASK: u32 = 0b0001_1111_1000_1111_0001_1000_0011_1110; // 0x1F8F183E;
|
||||
|
||||
pub fn dabao_selftest() {
|
||||
let one_way = bao1x_hal::acram::OneWayCounter::new();
|
||||
|
|
@ -14,34 +15,23 @@ pub fn dabao_selftest() {
|
|||
|
||||
let mut bio_ss = BioSharedState::new();
|
||||
let iox = bao1x_hal::iox::Iox::new(utra::iox::HW_IOX_BASE as *mut u32);
|
||||
iox.set_ports_from_bio_bitmask(DABAO_PINMASK);
|
||||
iox.set_ports_from_bio_bitmask(DABAO_PINMASK, bao1x_api::bio::IoConfigMode::Overwrite);
|
||||
bio_ss.init();
|
||||
bio_ss.load_code(db_pin_test_code(), 0, BioCore::Core0);
|
||||
bio_ss.bio.wo(utra::bio_bdma::SFR_QDIV0, 0x1_0001);
|
||||
bio_ss.set_core_run_states([true, false, false, false]);
|
||||
|
||||
let pin_ordering: [u32; 19] = [28, 27, 26, 25, 24, 23, 19, 18, 17, 16, 14, 13, 12, 11, 1, 2, 3, 4, 5];
|
||||
let pin_ordering: [u32; 17] = [28, 27, 26, 25, 24, 23, 19, 18, 17, 16, 12, 11, 1, 2, 3, 4, 5];
|
||||
|
||||
crate::println!(
|
||||
"Starting dabao mini self-test: sets each pin sequentially, in a counter-clockwise order."
|
||||
);
|
||||
crate::usb::flush();
|
||||
crate::delay(30);
|
||||
const TOTAL_ITERS: usize = 2;
|
||||
const TOTAL_ITERS: usize = 4;
|
||||
for i in 0..TOTAL_ITERS {
|
||||
crate::println!("Iter {}/{}", i + 1, TOTAL_ITERS);
|
||||
crate::usb::flush();
|
||||
for pin in pin_ordering {
|
||||
crate::print!("{} ", pin);
|
||||
crate::usb::flush();
|
||||
bio_ss.bio.wo(utra::bio_bdma::SFR_TXF0, 1u32 << pin);
|
||||
crate::delay(100);
|
||||
crate::delay(50);
|
||||
}
|
||||
crate::println!("");
|
||||
}
|
||||
crate::println!("Done; pin state reverted");
|
||||
crate::usb::flush();
|
||||
iox.set_ports_from_bio_bitmask(0x0);
|
||||
iox.set_ports_from_bio_bitmask(0x0, bao1x_api::bio::IoConfigMode::Overwrite);
|
||||
}
|
||||
|
||||
#[rustfmt::skip]
|
||||
|
|
@ -50,7 +40,7 @@ bio_code!(db_pin_test_code, BM_PIN_TEST_START, BM_PIN_TEST_END,
|
|||
"li a0, -1",
|
||||
"mv x26, a0", // mask
|
||||
"mv x25, a0", // inputs
|
||||
"li a1, 0x3F8F783E", // connected pin mask
|
||||
"li a1, 0x1F8F183E", // connected pin mask
|
||||
"mv x24, a1", // select pins as outputs
|
||||
// receive data from the FIFO, update it to the pins
|
||||
"10:",
|
||||
|
|
|
|||
Loading…
Reference in a new issue