From 5c98af9dfaa59b9970bade5ea5ac040dc1b4f605 Mon Sep 17 00:00:00 2001 From: bunnie Date: Tue, 11 Nov 2025 07:53:18 +0800 Subject: [PATCH] fix errors in TRNG setup - qdiv frac non-zero - only enable core 0 --- bao1x-boot/boot1/src/platform/bao1x/trng.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bao1x-boot/boot1/src/platform/bao1x/trng.rs b/bao1x-boot/boot1/src/platform/bao1x/trng.rs index 7fda54441..5a6c26f81 100644 --- a/bao1x-boot/boot1/src/platform/bao1x/trng.rs +++ b/bao1x-boot/boot1/src/platform/bao1x/trng.rs @@ -34,7 +34,7 @@ impl ManagedTrng { 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( @@ -44,7 +44,7 @@ impl ManagedTrng { ); // 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 // check if the TRNG seems to be working. If not, reject the board setting and reboot