From d45330e65df1c786058cc725c2bf50bc81a160d8 Mon Sep 17 00:00:00 2001 From: bunnie Date: Tue, 18 Nov 2025 18:11:49 +0800 Subject: [PATCH] improve the bdma test this makes the output of the bdma test a bit more compact, and adds some features to help CI automation to pick out failures to help validate if fixes are durable --- baremetal/src/platform/bao1x/bio.rs | 9 ++++----- baremetal/src/repl.rs | 15 ++++++++++++--- 2 files changed, 16 insertions(+), 8 deletions(-) diff --git a/baremetal/src/platform/bao1x/bio.rs b/baremetal/src/platform/bao1x/bio.rs index 9110c828c..929b28c56 100644 --- a/baremetal/src/platform/bao1x/bio.rs +++ b/baremetal/src/platform/bao1x/bio.rs @@ -6,7 +6,7 @@ use utralib::utra::bio_bdma::SFR_CONFIG_CLOCKING_MODE; use utralib::*; use xous_bio_bdma::*; -use crate::{print, println}; +use crate::println; /* pub fn bdma_test(_args: &Vec, seed: u32) -> usize { @@ -204,8 +204,7 @@ impl TestPattern { } } -pub fn bdma_coincident_test(_args: &Vec, seed: u32) -> usize { - let clkmode = 0; +pub fn bdma_coincident_test(_args: &Vec, seed: u32, clkmode: u32) -> usize { const TEST_LEN: usize = 1024; let mut passing = 0; @@ -286,10 +285,10 @@ fn coincident_u32( for (i, &d) in src.iter().enumerate() { let rbk = unsafe { dst.as_ptr().add(i).read_volatile() }; if rbk != d { - if errs < 4 { + if errs < 3 { println!("{} err @{}, {:x} rbk: {:x}", name, i, d, rbk); } else { - print!("."); + // crate::print!("."); } errs += 1; pass = 0; diff --git a/baremetal/src/repl.rs b/baremetal/src/repl.rs index 64a72a4af..f936bdf63 100644 --- a/baremetal/src/repl.rs +++ b/baremetal/src/repl.rs @@ -458,11 +458,20 @@ impl Repl { #[cfg(feature = "bao1x-bio")] "bdma" => { let mut seed = 0; + let mut clkmode: u32 = 3; + let mut passing: bool; loop { - crate::platform::bio::bdma_coincident_test(&args, seed); + crate::println!("seed {}, clkmode {}", seed, clkmode); + if crate::platform::bio::bdma_coincident_test(&args, seed, clkmode) != 4 { + clkmode = (clkmode + 1) % 4; + passing = false; + crate::println!("~~BDMAFAIL~~"); + } else { + passing = true + }; + crate::println!(" pasing: {:?}", passing); seed += 1; - crate::println!("seed {}", seed); - if seed > 32 { + if passing || seed > 8 { break; } }