Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 5010

Bare metal, Assembly language • Re: Booting, UART and clock speed

$
0
0
The MiniUART's clock source is the VC clock, not the CPU clock, and that clock, just like the CPU clock, has a variable frequency. There are two ways you can fix your problem:
  1. Add a line with "force_turbo=1" to config.txt, which will make the firmware try to force the maximum clock frequencies short of overclocking (1.8GHz for the CPU and 500MHz for the VC, but only works on the latest versions of the Pi 4-B, Pi 400, and maybe CM4);
  2. Query the firmware for the current VC clock frequency using the get clocks tag, and configure the MiniUART appropriately.
If needed I can plug in a Raspberry Pi 4-B and show some sample code, though my psychiatrist warned me that I could go crazy if I continued to write C or C++ and prescribed exclusive use of Rust so that's the only language, other than assembly, that I write lower level code in these days.

PS: If you think the BCM2711 is poorly documented, don't even get me started on the BCM2712, whose only sources of information are the ARM documentation and the sources for Linux and Mesa3D.

Statistics: Posted by Fridux — Sun Jul 28, 2024 9:09 pm



Viewing all articles
Browse latest Browse all 5010

Trending Articles