cracen_rng_reset() soft-resets the TRNG and enables it, leaving the sampling period and the start-up wait
at their reset values, and uses one 128-bit block for conditioning. trng_init() in nrfx_cracen.c programs
TRNG_CLK_DIV and a wait of 512, and uses four blocks.
The reset values differ between parts. An nRF54LM20 resets to a sampling period of 0xFFF, where nrfx uses 1:
since each draw starts from a soft reset, every draw took 33 ms there, more than the 100000 iterations of
RNG_TIMEOUT last, so all of them failed. An nRF54L15 resets to a start-up wait of 0xFFFF, which is the 0.5 ms
a draw takes on it today.
cracen_rng_reset()soft-resets the TRNG and enables it with one 128-bit block for conditioning, leaving everything else at its reset value.trng_init()innrfx_cracen.calso programs the off timer,TRNG_CLK_DIVand a start-up wait of 512, and uses four blocks.Since #6 every draw starts with that reset, so every draw pays for a TRNG start:
On the nRF54L15 this is only waiting:
INITWAITVALresets to0xFFFF.On the nRF54LM20 it is a failure.
SAMPLINGPERIODresets to0xFFFwhere nrfx uses 1, and ~167,700 iterations run past the 100,000 ofRNG_TIMEOUT, so every draw fails.seed_softdevice_rng()then fails,Bluefruit.begin()returns false and there is no BLE. The nRF54LM20 is not in this repo yet, but anyone taking it to 0.5.x will hit this. I did, while rebasing an nRF54LM20-DK onto v0.5.1.One thing to look at: this also takes
number_128_blocksfrom 1 to 4. I took nrfx's value because I can't judge the entropy of a single block, and that way the whole configuration is Nordic's. If the 1 was deliberate, I can drop that line; I have not timed that combination precisely.Testing
Figures from temporary counters around
rng_draw()(polling iterations, and µs from the GRTC), not part of this PR.Not tested: entropy quality beyond the TRNG's own start-up tests, and the nRF54L05, nRF54L10 and XIAO boards.
Summary by CodeRabbit