Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

STM trng_api uses always RCC_RNGCLKSOURCE_PLL #11674

Closed
jarlamsa opened this issue Oct 11, 2019 · 4 comments · Fixed by #11679
Closed

STM trng_api uses always RCC_RNGCLKSOURCE_PLL #11674

jarlamsa opened this issue Oct 11, 2019 · 4 comments · Fixed by #11679

Comments

@jarlamsa
Copy link
Contributor

@jarlamsa jarlamsa commented Oct 11, 2019

Description

All the STM targets that have TRNG will use RCC_RNGCLKSOURCE_PLL even if the
CLOCK_SOURCE is defined to be USE_PLL_MSI and TRNG should use RCC_RNGCLKSOURCE_MSI instead.

This is because the USE_PLL_MSI is defined in the system_clock.c and isn't seen in the trng_api.c thus evaluating to 0 when preprocessing. This causes issues when the same 48MHz clock is used between multiple peripherals and the TRNG modifies the RCC_CCIPR -register, while other peripherals think that the MSI-clock is used.

Tested with DISCO_L475VG_IOT01A, seems very likely that all the devices that are using the same STM-specific trng_api.c are having similar symptoms.

Issue request type

[ ] Question
[ ] Enhancement
[x] Bug
@jarlamsa

This comment has been minimized.

Copy link
Contributor Author

@jarlamsa jarlamsa commented Oct 11, 2019

@ciarmcom

This comment has been minimized.

Copy link
Member

@ciarmcom ciarmcom commented Oct 11, 2019

@jeromecoutant

This comment has been minimized.

Copy link
Contributor

@jeromecoutant jeromecoutant commented Oct 11, 2019

Hi

Oups... I confirm the issue
Need to add

#define USE_PLL_MSI 0x1 // Use MSI internal clock

@jeromecoutant

This comment has been minimized.

Copy link
Contributor

@jeromecoutant jeromecoutant commented Oct 14, 2019

@0xc0170 could you set it as device st ?
Thx

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.