Free Your Pi With This Bare Metal Programming Environment

[Rene Strange] has graced these fair pages a short while ago with a sweet Raspberry Pi software based poly synth, with a tantalising reference to it being a bare metal application. So now, we’ll look into circle, the bare metal programming environment that it is based upon. The platform consists of a large set of C++ classes to access the hardware as well as perform tasks such as task creation and scheduling in the cooperative multitasking, multicore environment. Supporting all Raspberry Pi boards from version 2 onwards (not including the Pico!) in both 32-bit and 64-bit flavours, the environment is pretty complete. Classes are provided for USB, networking, FatFS, as well as more mundane tasks such as dealing with interrupts. On top of these classes there are a pile of application-specific libraries, covering functions such as display interfacing, GUIs using a variety of frameworks, and some more esoteric applications such as interfacing to a Pico, and even sending the system log to a remote web browser!

Classes and libraries however, don’t always help by themselves, which is where the 42 (yes, we know) code examples come in very handy. They’ve provided example applications for some fun stuff like drawing Mandelbrot fractals to the display, as well as some more mundane tasks that we have to deal with such as getting that pesky DMA controller to play nice with the SPI hardware. All-in-all, this looks like a great set of tools for taking full advantage of some fairly beefy hardware for your next embedded project that needs plenty of resources, but not all that unnecessary operating system stuff.

Perhaps not quite as complete as circle, but we’ve seen a fair few Raspberry Pi Bare metal projects over the years, like the Nerdsynth, based on the PiZero, and this neat little bare metal assembly language clone of starfox.

Thanks [Ruhan] for the tip!

Header: Aryan Patidar, CC BY 4.0/Evan-Amos, Public domain.

3 thoughts on “Free Your Pi With This Bare Metal Programming Environment

  1. I downloaded this last night and installed the aarch64 toolchain to use it (using KUbuntu 22.04 as host). All sample files compiled just fine and then loaded the 01 blink project. Worked as advertised on a RPI4! I’ll now dig a bit deeper and actually see what it there. Where Ultibo (similar project) uses Free Pascal, the circle project uses C++. Anyway now to kick it’s wheels a bit!

  2. This is basically two switching tables and some glue code away from being a whole standalone OS kernel!

    I’ve been writing my own OSea, so seeing this has basically blown me away, and I’ll definitely be referring to it if/when I come to do my RPi ports.

    Describing it as “some C++ classes to make projects easier” seriously underestimates the scope here!

  3. Does anyone know if this could be modified/how hard it would be to modify/already is something similar for the RPi clones; specifically the original Banana Pi M1? I have a few I’d like to put to use.

Leave a Reply to RunnerPackCancel reply

Please be kind and respectful to help make the comments section excellent. (Comment Policy)

This site uses Akismet to reduce spam. Learn how your comment data is processed.