Programming a raspberry pi without linux

I was wondering if anyone had experimented with using a raspberry pi without an OS, just as a (very powerful) controller. You could then use something like RTFM to write your application.

My search so far:

  1. Found rust-raspi3-OS-tutorials, had a look through and see that it hard-codes the register addresses of peripherals, e.g. 03_uart1/src/gpio.rs.
  2. Wonder if there is a device crate for the bcm2837 (I'm using a pi3) - there isn't
  3. Had a look to see if there is some kind of specification of register locations etc. The best I can find is dtb files (e.g. https://github.com/raspberrypi/firmware/tree/master/boot) that seem to specify peripheral locations. Can I parse these like you would parse svd files?

But now I feel a bit stuck. Does anyone have any suggestions?

1 Like

You might want to follow this chap on the Raspberry forum who has just announced a Rust kernel of some sort for the Pi 3: https://www.raspberrypi.org/forums/viewtopic.php?f=72&t=247496#p1511308

And then there is this https://github.com/rust-embedded/rust-raspi3-OS-tutorials about running Rust on a bare metal Pi.

A few days ago I did find all kind of crates for driving GPIO, I2C, PWM on the Pi. Just have to search for the right term.

2 Likes

you can definitely parse it, it's a binary format supposed to be easy to parse by the kernel—for human readability prefer the dts source code—but as you say, it has only the base addresses

due to the popularity of rpi3 i'm on one hand surprised a svd or pac doesn't exist yet, on the other, linux-capable SoC like the bcm2837 and a board like the rpi3 have a huge number of peripherals and registers, and unless the vendor supplies some kind of machine-parsable register description (and they usually don't, definitely not for the larger SoCs), it would be an absurd amount of work to write one based on datasheets and linux source code

2 Likes