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
TRNG on L4 pulls rug out from USB #8864
In system_clock.c, the USB/SDMMC/TRNG source clock is set to either MSI or PLLSAI1, depending on the clock source (HSE/HSI use PLLSAI1 for 48MHz source, and MSI uses MSI for 48MHz source).
trng_api.c does not take this into account, and incorrectly sets the 48MHz clock source, in contradiction to what it was set to in system_clock.c
Recommend a change in trng_api.c to choose the correct 48MHz source as it was set in system_clock.c, or remove this code as the 48MHz clock source was already set in system_clock.c, correct?
Issue request type
I also agree to remove the TRNG clock setting in the trng_api.c file and add it in the system_clock.c file instead (like we do for the USB). Just maybe add a "#ifdef DEVICE_TRNG". I will send a PR so you can test it and comment.