Mbed-os: STM trng_api uses always RCC_RNGCLKSOURCE_PLL

Created on 11 Oct 2019  路  4Comments  路  Source: ARMmbed/mbed-os

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

CLOSED st mirrored bug

Most helpful comment

Hi

Oups... I confirm the issue
Need to add

define USE_PLL_MSI 0x1 // Use MSI internal clock

All 4 comments

ping @MarceloSalazar

Hi

Oups... I confirm the issue
Need to add

define USE_PLL_MSI 0x1 // Use MSI internal clock

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

Was this page helpful?
0 / 5 - 0 ratings