fix trng service in baosec environment

fix missing initializers
This commit is contained in:
bunnie 2025-11-11 07:53:52 +08:00
parent 5c98af9dfa
commit c2c135bfdc
2 changed files with 4 additions and 2 deletions

View file

@ -262,6 +262,8 @@ fn main() {
// claim BIO
#[cfg(feature = "board-baosec")]
let bio_ss = Arc::new(Mutex::new(xous_bio_bdma::BioSharedState::new()));
#[cfg(feature = "board-baosec")]
bio_ss.lock().unwrap().init();
// setup TRNG server - baosec only because it has an external AV generator
#[cfg(feature = "board-baosec")]
servers::trng::start_trng_service(&bio_ss);

View file

@ -37,7 +37,7 @@ impl HwTrng {
bio_ss.load_code(avtrng_bio_code(), 0, BioCore::Core0);
// don't use QDIV
bio_ss.bio.wo(utra::bio_bdma::SFR_QDIV0, 0x1_0000);
bio_ss.bio.wo(utra::bio_bdma::SFR_QDIV0, 0x1_0001);
// use extclock on channel 0, tied to the trng pin
bio_ss.bio.wo(
@ -47,7 +47,7 @@ impl HwTrng {
);
// start the machine
bio_ss.set_core_run_states([true, false, false, true]);
bio_ss.set_core_run_states([true, false, false, false]);
bio_ss.bio.wo(utra::bio_bdma::SFR_TXF0, trng_pin as u32); // start the sampling
// server_id is a random number from the hardware entropy pool. Note that this