File tree Expand file tree Collapse file tree
rom/dev/tests/rom_integration_tests Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -100,8 +100,16 @@ fn fuses_with_random_uds() -> Fuses {
100100 const UDS_LEN : usize = core:: mem:: size_of :: < u32 > ( ) * 16 ;
101101 let mut uds_bytes = [ 0 ; UDS_LEN ] ;
102102 rand_bytes ( & mut uds_bytes) . unwrap ( ) ;
103- let mut uds_seed = [ 0u32 ; 16 ] ;
104103
104+ // WORKAROUND: On FPGA subsystem (core_test mode), UDS words 8-15 are written to OTP at
105+ // 0xac8 (DOT_FUSE_ARRAY). MCU ROM treats an odd total popcount as DOT-locked,
106+ // and if the DOT blob is absent, it errors out. This ensures an even number of bits are set.
107+ let dot_fuse_bits: u32 = uds_bytes[ 32 ..64 ] . iter ( ) . map ( |b| b. count_ones ( ) ) . sum ( ) ;
108+ if dot_fuse_bits & 1 == 1 {
109+ uds_bytes[ 32 ] ^= 1 ;
110+ }
111+
112+ let mut uds_seed = [ 0u32 ; 16 ] ;
105113 for ( word, bytes) in uds_seed. iter_mut ( ) . zip ( uds_bytes. chunks_exact ( 4 ) ) {
106114 * word = u32:: from_be_bytes ( bytes. try_into ( ) . unwrap ( ) ) ;
107115 }
You can’t perform that action at this time.
0 commit comments