Skip to content

Commit a4ae9f1

Browse files
committed
STM32 TRNG : update init to match all config
1 parent 20e4a35 commit a4ae9f1

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

targets/TARGET_STM/trng_api.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,8 +128,8 @@ void trng_init(trng_t *obj)
128128
}
129129

130130
/* first random number generated after setting the RNGEN bit should not be used */
131-
if (HAL_RNG_GenerateRandomNumber(&obj->handle, &dummy) != HAL_OK) {
132-
printf("trng_init: HAL_RNG_GenerateRandomNumber error 0x%x\n", obj->handle.ErrorCode); // should not occur
131+
/* could be executed few times in case of long init (obj->handle.ErrorCode can be checked for debug) */
132+
while (HAL_RNG_GenerateRandomNumber(&obj->handle, &dummy) != HAL_OK) {
133133
}
134134

135135
#if defined(CFG_HW_RNG_SEMID)

0 commit comments

Comments
 (0)