stm32wl: Fix incomplete RNG initialisation

This commit is contained in:
Olivier Fauchon
2023-01-23 15:43:17 +01:00
committed by Ron Evans
parent 334a12818d
commit eec915170d
3 changed files with 15 additions and 1 deletions
+7
View File
@@ -15,6 +15,13 @@ func GetRNG() (uint32, error) {
rngInitDone = true
}
if stm32.RNG.SR.HasBits(stm32.RNG_SR_CECS) {
return 0, ErrClockRNG
}
if stm32.RNG.SR.HasBits(stm32.RNG_SR_SECS) {
return 0, ErrSeedRNG
}
cnt := RNG_MAX_READ_RETRIES
for !stm32.RNG.SR.HasBits(stm32.RNG_SR_DRDY) {
cnt--