Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions drivers/entropy/entropy_mcux_trng.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,16 @@ static int entropy_mcux_trng_get_entropy(const struct device *dev,
ARG_UNUSED(dev);

status = TRNG_GetRandomData(config->base, buffer, length);
if (unlikely(status)) {
/*
* There can be a situation after certain types of resets
* where the underlying TRNG IP reports an error. The
* TRNG_GetRandomData() function will clear the error but
* doesn't try to retrieve random data so make the request
* again.
*/
status = TRNG_GetRandomData(config->base, buffer, length);
}
__ASSERT_NO_MSG(!status);

return 0;
Expand Down