6 votes
Accepted

Can't turn on ACT LED on baremetal Pi3

Models A and B The green activity LED (GPIO 16) may be written. Models A+ and B+ The green activity LED (GPIO 47) may be written. The red power LED (GPIO 35) may be written. The high USB power mode ...
joan's user avatar
  • 71.1k
4 votes
Accepted

How tp get USB to USB UART console without linux

Let me try to un-confuse you :) In the good old days, computers came with serial ports. The standard is known as RS232. These slowly disappeared, first from laptops and then from desktops. These days,...
JayEye's user avatar
  • 1,898
4 votes

How to build my very own device tree (and if I need to)

You only need to think about adding Device Tree support under following conditions: you know how to write operating systems you are currently in the process of writing an operating system your ...
flakeshake's user avatar
  • 6,235
4 votes

Raspberry Pi Baremetal Programming

Well, maybe you forgot to put "break" into your switch block case? switch (mode) { case GPIO_OUTPUT: *GPFSEL |= (1 << gpio_bit); break; case GPIO_INPUT: ...
NameNotFound's user avatar
4 votes

Using Hardware PWM in Raspberry Pi 4

The Pi has only two accessible hardware PWM channels. GPIO 12 and 18 share one setting, GPIO 13 and 19 the other. So if you set GPIO 12 to 15% dutycycle at 400Hz that will come out of GPIO 18 as ...
joan's user avatar
  • 71.1k
3 votes
Accepted

bootcode.bin RPi 3

This and the other resources in the Bare metal, Assembly forum are a great start.
T. M.'s user avatar
  • 871
3 votes
Accepted

BCM2835 GPIO Pins vs. Physical Pin Numbers

After doing a bit of research, as well as testing things out, I discovered that I was misinterpreting what I was hearing about physical pin numbers. The GPIO Pin numbers listed in official pinouts as ...
House's user avatar
  • 211
3 votes

OS-less raspberry pi 2 debugging of Assembly language

I would recommend taking a look at this site http://www.makeuseof.com/tag/emulate-raspberry-pi-pc/ which describes how to emulate the original raspberry pi on a pc. You then should be able to debug ...
SteelToe's user avatar
  • 131
3 votes
Accepted

Bare metal: Why does the CPU automatically read instructions from the SD card?

The ARM side of the SoC has quite a few hardware peripherals (e.g. UART, SPI, I2C, etc). In particular it has an External Mass Media Controller (EMMC) SD card interface. See page 65 of BCM2835 ARM ...
joan's user avatar
  • 71.1k
2 votes

Raspberry Pi 3 Model B Timers

I suggest you look through the documentation available at https://www.raspberrypi.org/documentation/hardware/raspberrypi/README.md In particular perhaps https://www.raspberrypi.org/documentation/...
joan's user avatar
  • 71.1k
2 votes

Questions about bus addresses

You can't use normal addresses because the DMA hardware is directly connected to the memory bus and uses (physical) bus addresses. Beware that the DMA controller is directly connected to the ...
joan's user avatar
  • 71.1k
2 votes

How can I find these files?

Do you still have the SD card with the original Raspbian image? ...Great. So you already have a SD card with a boot partition and the required files. If not then download one of the original raspberry ...
goldilocks's user avatar
  • 58.9k
2 votes

Booting the raspberry pi and running a bare metal program

Your question includes this and inserted into my Pi 2 At the very top of the tutorial page, you linked to in red is the following: This course has not yet been updated to work with the ...
Steve Robillard's user avatar
2 votes
Accepted

Reading files with a custom kernel

In bare metal , file access doesn't work automatically. You need to implement a SD card reader driver and a FAT32 driver before file access works even remotely correctly. This is the whole point of ...
flakeshake's user avatar
  • 6,235
2 votes
Accepted

Where to Find Documentation for GPIO Controller Pins of Pi4?

The BCM2711 peripherals documentation can be found on the Foundation website. https://datasheets.raspberrypi.org/bcm2711/bcm2711-peripherals.pdf The GPIO is a superset of the earlier GPIO i.e. it is ...
Milliways's user avatar
  • 60k
2 votes

BCM2835 datasheet addressing system

If you look at Section 1.2.3 of the same BCM2835 Peripherals Doc, it will tell you all about it.
House's user avatar
  • 211
1 vote

Bare metal LED access on RPi 4

The other answers claiming that the ACT_LED on the pi4 is not connect to the gpio is wrong. However, this was true on a previous version of the pi. One of the 3 series boards. (likely the source of ...
Myles's user avatar
  • 11
1 vote

Raspberry Pi Mailbox Interface Difficulties

The VideoCore mailbox protocol is downright awful, I've just dredged through it myself. The issue is that you are not forming your requests correctly. Here's the actual grammar for messages: [ ...
Allison's user avatar
  • 121
1 vote

Debugging potentially broken uart pins

The fist thing I do with UARTs is a loopback test: connect TX to RX, send something to the serial device and see if you're receiving the same characters back. This should work regardless of baudrate ...
Dmitry Grigoryev's user avatar
1 vote

Debugging potentially broken uart pins

Run my GPIO test. It needs the pigpio daemon to be running (sudo pigpiod). See https://elinux.org/R-Pi_Troubleshooting#Testing gpiotest #!/bin/bash skipped="" tested="" failed=&...
joan's user avatar
  • 71.1k
1 vote

How does the hardware cause long delays?

The Raspberry Pi 3 has multiple cores that all share the same bus and peripherals. So when some other core uses the bus or locks things down for exclusive access your code will be blocked for short ...
Goswin von Brederlow's user avatar
1 vote
Accepted

Why does adding a nop or constant break my code?

The solution lies in the config.txt. After reading many forums and the RPi site, there is a config option called disable_commandline_tags. If it is not set or is set to 0 in config.txt, ATAGS is ...
Jacob Calvert's user avatar
1 vote

Installing Wi-Fi on bare metal (no terminal)

I don't have much experience from bare metal programming on the Pi, but I do know that is much like working with a MCU. You should think of it as if the Pi is an Arduino and your programming ...
jogco's user avatar
  • 497
1 vote

How to build my very own device tree (and if I need to)

I've run across your (now old-ish) question during my research on a related subject. Creating your own device tree may be an ambitious undertaking, and beyond the scope of Q&A here. But your ...
Seamus's user avatar
  • 22k
1 vote

Can someone explain what the values are and where they are found?

Basically, those #define statements are assigning human-readable names to the GPIO pins, as documented for the Pi. See the official documentation, scroll to page 90.
tlhIngan's user avatar
  • 3,372
1 vote

Can't turn on ACT LED on baremetal Pi3

Expanding joan's answer: Raspberry Pi 3 B+ (1 GiB RAM) and A+ (512 MiB RAM) The green activity LED (GPIO 29) may be written The red power LED is connected to MXL7704 power management IC and is not ...
iBug's user avatar
  • 315
1 vote

Is it possible to get the state of the LEDs and GPIOs in a QEMU emulation like the HDMI and audio?

GPIO I think it is not possible, but I've found the QEMU 2.7.0 callback that gets called when you do GPIO: hw/gpio/pl061.c:pl061_write where PL061 is the GPIO controller of -M versatilepb (edit: -M ...
Ciro Santilli OurBigBook.com's user avatar
1 vote

Compile .img on OSX

Open the Disk Utility app and create a New Image. This will give you options such as format (Mac Extended, MS-DOS, etc). Once you create it, a disc image will be created and opened where ever you ...
GCass's user avatar
  • 31
1 vote

Different addressing systems

These are just different abstraction layers. This happens in most modern CPUs. The hardware addresses are abstracted by a layer of logical addresses, then further a specific process may have its own ...
Tyrel's user avatar
  • 203
1 vote

How to do QEMU emulation for bare metal Raspberry Pi images

bztsrc/raspi3-tutorial https://github.com/bztsrc/raspi3-tutorial # Get QEMU v2.12.0 for -M raspi3 # https://github.com/bztsrc/raspi3-tutorial git clone git://git.qemu.org/qemu.git cd qemu git ...
Ciro Santilli OurBigBook.com's user avatar

Only top scored, non community-wiki answers of a minimum length are eligible