9

QEMU supports a platform called "raspi2" directly since version 2.6 at least. I believe work is ongoing to refine the support for all Pi models including the RPi3. Currently , only older Raspbian images and Windows IoT Core are partially supported. http://wiki.qemu.org/ChangeLog/2.6


6

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 (GPIO 38) may be written. Pi Zero and Pi Zero W The green activity LED (GPIO 47) may be written. Pi2B The green activity LED (GPIO 47) may be written. The ...


6

Update 25 Oct 2015: Raspberry Pi forum gave the answer to me. There is not concept of _start when using -nostdlib the code to be executed first should be the first file to be passed to the linker. If better control is needed, the code needs to be placed in an init section and ask linker to copy this section to 0x8000 Thanks all for the support. Learned a ...


4

This StackOverflow answer says that the processor starts out in secure mode: ... since TrustZone-capable processors start executing in Secure state on power-on, if the boot loader does nothing to change the security state, all software will run as Secure (removing any security benefits). No, the TrustZone environment is explicitly intended to run ...


4

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, you can use either internal cards, or USB-to-serial adaptors (but read on). The serial connection on the Pi (also on Arduinos and other such things) is not ...


4

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 operating system has to run on multiple different ARM devices, not only the Raspberry Pi your devices do not offer ACPI and have peripherals which cannot be ...


3

People have been writing hobby operating systems and bare metal code since 2012 for the Raspberry Pi. I think you fixation on the closed-source GPU blob is misguided - the lack of official public USB controller docs has been a bigger obstacle. Check out the Bare Metal subforum at https://www.raspberrypi.org/forums/viewforum.php?f=72 in any case. To your ...


3

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: { *GPFSEL &= ~(1 << gpio_bit); *GPFSEL &= ~(1 << (gpio_bit+1)); *GPFSEL &= ~(1 << (gpio_bit+2)); ...


3

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 and run assembly code on the emulated raspberry pi that you created.


3

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 Peripherals. The SoC has firmware which uses that peripheral to boot from SD card. The SoC firmware is not writable by anyone but Broadcom.


3

USPi is a bare metal USB driver for the Raspberry Pi written in C. The author has accessed the ethernet controller via internal USB hub https://github.com/rsta2/uspi/tree/master/sample/ethernet


3

This and the other resources in the Bare metal, Assembly forum are a great start.


2

Not sure what you are doing wrong. For comparison the following works. gpioReg is a uint32_t pointer to the base of the gpio peripheral. #define GPSET0 7 #define GPSET1 8 #define GPCLR0 10 #define GPCLR1 11 #define GPLEV0 13 #define GPLEV1 14 #define GPPUD 37 #define GPPUDCLK0 38 #define GPPUDCLK1 39 #define PI_BANK (gpio>>5) #define PI_BIT ...


2

According to this Datasheet of the ARM1176JZF-S CPU core (Chapter 16.17), the nop instruction takes 2 CPU cycles. So it would be seconds / (MCUFREQ * .5). To complete your initialization line: uint32 lpnr = useconds / (MCUFREQ * .5 * 1E6); I think this is true, if the branch prediction was correct, because the introduction of chapter 16 talks about best ...


2

Okay, I figured it out myself... The first ldr actually loads the address of the variable. And so to have the value of pattern in the register (rather than the address), I still have to load the value at the address into the register. Also check here


2

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/hardware/raspberrypi/bcm2836/QA7_rev3.4.pdf


2

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 peripherals. Thus the DMA controller must be set-up to use the Physical (hardware) addresses of the peripherals. Page 38 BCM2835 ARM Peripherals


2

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 boot images and copy them to the SD card. This seems pretty straightforward. Those can be found here. You might as well use the lite image, since you only ...


2

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 Raspberry Pi models B+ and A+. Some elements may not work, in particular the first few lessons about the LED. It has also not been updated for Raspberry Pi v2. ...


2

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 bare metal after all. The C libary simply makes the assumption those things are present , as if bare metal were a "hosted" implementation of C. Copy or write an ...


2

If you look at Section 1.2.3 of the same BCM2835 Peripherals Doc, it will tell you all about it.


2

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 GPIO## or BCM## do actually correspond to the raw GPIO pin numbers for the Broadcom SoC.


1

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 times and that's probably what you see. To verify try disabling the other cores before you start big banging.


1

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 loaded by start.elf starting at 0x100. My kernel was also using kernel_old=1, which starts loading at 0x0. The ATAGs entry was overwriting a piece of the kernel....


1

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 environment is a computer with cross compiler, kind of like the Arduino IDE. (just not an IDE in this case). Following that analogy, there are no drivers to "install". ...


1

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 available to software The USB power mode is fixed at high power


1

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 raspi2 was added in QEMU 2.6, see that instead) which is documented here. This is the setup I'm using to test it out. You could then monitor GPIO changes by ...


1

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 tell it to save it. You can then put whatever files you want in to it. Once you've put the files in, eject the open image. The disc image will be saved as a "....


1

I think the best chance you will have of achieving this on the Pi is my pigpio library or possibly RPIO.GPIO (not RPi.GPIO). Both allow for the construction of arbitrary waveforms using the DMA engine. With pigpio you would use a functionality called waves (C, Python). Waves are an arbitrary sequence of GPIO level changes. They can be repeated ...


1

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 page tables mapping the addresses to yet another space. This helps with running multiple programs at the same time, among other things. At the physical layer, ...


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