The Raspberry Pi, as originally conceived, was designed to be a low cost computer learning platform - something akin to the throwback days of the Timex TS-1000, TI-99, or the incredibly popular Commodore 64. But an oddity I find ironic (about a computer learning platform) is that the materials one would need to program this platform bare metal are not easy to find. The Raspberry Pi foundation and Broadcom have notoriously been know to publish scant information about low-level programming. But resources do exist, if disjointedly. Here is my attempt to organize what I have found useful.
A very well written set of examples and accompanying tutorial that starts very simply and then builds into some complex subject areas including graphics through the HDMI port. It covers the startup of the ARM CPUs on the Raspberry Pi nicely, in assembler, step by step. The author was recently updating the tutorials to work on the Pi 4.
An early online course from the University of Cambridge that document a series of tasks using bare metal programming techniques on the Raspberry Pi, that when taken together, cover the big picture components of operating system development. Written at an advanced high school level and does not assume much programming experience. Written in C and assembler.
An academic bachelor’s-level documentation project with comprehensive examples in C, published in a PDF.
All assembler approach to bare metal RPi programming, done step by step with code repo.
Ambitious attempt to building an operating system from scratch for the RPi3 with comparisons and inspiration from the Linux kernel.
Innovative write-up describing how to write and run bare-metal on one RPi3 core, along side the Linux kernel running on three others. This is called Asymmetric Multi Processing (AMP). Interprocess communication techniques are discussed. This technique can blend the benefits of a real-time kernel, one you develop for a specific task, with a more general, feature-rich, Linux kernel, to yield a system that performs well without everything having to be developed from scratch.
One of the earliest collections of sample applications written in C covering UARTs, SPI, serial bootloaders, timers, interrupts, GPIO and more.
A more advanced set of examples with light write-ups. 64-bit only in C and some assembler.
The circle project is not a tutorial but a library of fully worked bare metal classes in C/C++. This includes USB with numerous drivers, UART, SPI, I2C, audio, NIC, file system drivers, graphics, and networking.
This is a bare metal programming library which builds and embeds a Java runtime with your bare metal kernel. Supports Arduino, Raspberry Pi, Asuro, RCX.
This may belong in the tutorial section, as the repo is not a programming environment for Rust per se. But Rust is the focus. The most important section that can be universally applied to other languages for bare metal is the testing section. It’s brilliant.
A micropython port targeting the Raspberry Pi.
This is one of the few worked examples of showing how to use the JTAG GPIOs on the Raspbarry Pi to debug the Pi itself, bare metal, and NOT using the Pi as a host debugger.
An openocd configuration file for bare metal RPi2 JTAG debugging.
An openocd configuration file for bare metal RPi Zero JTAG debugging.
A link list would not be complete without a reference to this manual. But do not read this manual without looking at the eratta. Very important!
Very hard to come by, this post documents some of the more important ARM->GPU mailbox messages.
A nice description of the C runtime initialization. The code is not very useful, but the description of what happens is very good.
Definitive CPU documentation for the RPi Zero.
Bare metal RPi development requires moving an SD card back and forth between target and host, unless you have a way to boot over serial, JTAG, or network.