Posts

Showing posts with the label Clock

Untangling the Clock Tree of an STM32L4S5xx Microcontroller !

Image
What is the Clock Tree? The clock tree is a hierarchical structure within a microcontroller that distributes clock signals to various parts of the chip. It consists of Clock Sources, Distribution networks, Clock-Gating elements, and Multiplexers to choose specific clock sources. The clock tree ensures that all parts of the chip receive synchronized clock signals and operate in sync with each other, preventing timing issues. Clock gating elements in the clock tree can selectively disable clock signals to unused or idle parts of the chip, reducing power consumption. Read the Wikipedia page on Clock Signal to learn more about the Clock sources and Clock Distribution Network. Clock Sources for the Microcontroller The clock sources available in the STM32L4S5 are  16 MHz High-Speed Internal RC Oscillator clock ( HSI16 ) Multispeed Internal RC Oscillator clock ( MSI ) 4 MHz - 48 MHz High-Speed External Oscillator Clock ( HSE-OSC ) Internal Phase Locked Loop ( PLLCLK ) 32 k...

Generating True Random Numbers | STM32L4 | RNG | CMSIS

Image
True Random Number Generator Randomness is necessary for cryptography operations to be unpredictable and to fend off attacks. We need randomization for everything from key generation to data encryption. We use True Random Number Generators, which create random numbers from an entropy source, to get around this predictability. The STM32L4's RNG peripheral is a true RNG that produces high-quality random numbers. The application is guaranteed to receive all entropy from its 32-bit samples via its built-in conditioning component and analog entropy generator. Read this blog on Random Number generators and their limitations  for more information. The RNG runs on two different clocks: the AHB bus clock and a dedicated RNG clock . The AHB clock is used to clock the AHB banked registers and conditioning components. The RNG clock is used for noise source sampling RNG Registers The RNG peripheral on the STM32L4S5xxx has few registers compared to that of STM32L4P5xxx and STM32L4Q5xxx mic...