Closed NicolaiSoeborg closed 4 years ago
It's only checking one byte, so endianness isn't an issue. 0x60
checks the CEIS and SEIS bits (bits 5, 6), and the 0x06
checks SECS and CECS (bits 1, 2).
I suppose RNG->SR & 0x60
would be sufficient, since they indicate that either SECS or CECS would be set. But might as well check all at once (RNG->SR & 0x66
).
Wrong repo.
It seems like the
get_rng
command doesn't check the "RNG status register" (RNG_SR
).From page 659 of the reference manual [0]:
The check seems to be done in the embedded code at: https://github.com/solokeys/solo/blob/master/targets/stm32l432/src/rng.c#L28 but why is the check and'ing with
0x66
? The documentation says that CEIS and SEIS are bit 5 and 6, so shouldn't the check beRNG->SR & 0x60
orRNG->SR & 0x06
depending on endianness?).[0] RM0394: https://www.st.com/content/ccc/resource/technical/document/reference_manual/group0/b0/ac/3e/8f/6d/21/47/af/DM00151940/files/DM00151940.pdf/jcr:content/translations/en.DM00151940.pdf