Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Add TRNG for NRF52832 #6116
3 times, most recently
Feb 16, 2018
@hanno-arm Thank you for the review!
Everything in the
Also, this is a temporary implementation until the new SDK upgrade arrives.
Build number : 1212
Build number : 883
I don't like that this PR introduces code under
! SOFTDEVICE_PRESENT which is known to be broken.
Leaving that side, I am ok with how
trng_api.c multiplexes between the NRF driver implementation in case SoftDevice is present + active, and a hand-crafted direct driver implementation.
As mentioned in the comments, though, I would prefer to do initialization and cleanup of the native driver resp. the SoftDevice driver in
trng_free, respectively, which is what these functions are intended for.
Given the importance of the PR and the fact that it looks fine from the perspective of functionality and security, the above concerns are no blockers, and I'm ok approving after @yanesca has given his opinion.
@hanno-arm I completely understand where you are coming from! It's an imperfect solution to a bad situation. I would also be uncomfortable adding files that I can't test because the SOFTDEVICE_PRESENT flag isn't working.
For reference, this is how the new implementation in SDK 14.2 looks like: https://github.com/ARMmbed/mbed-os/blob/feature-nrf528xx/targets/TARGET_NORDIC/TARGET_NRF5x/trng_api.c#L49-L79
Build number : 1223
Build number : 892