Skip to main content
5 votes
Accepted

How do I read the cpuid in aarch64 asm?

On aarch64 the cpuid can be read using __asm__("mrs %0, MIDR_EL1" : "=r"(arm_cpuid));
Goswin von Brederlow's user avatar
4 votes
Accepted

How can I run 32-bit compiled assembly code on Rasberry PI 4 B, if possible at all?

First of all to clear up ambiguities: Aarch32/Aarch64: These are two main Instruction Set Architectures for ARM (Advanced RISC Machine) architecture processors. Armv7-A/Armv8-A: These are the most ...
Balázs Börcsök's user avatar
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

bootcode.bin RPi 3

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

gcc does not compile code that compiles in 'as'

You need to tell gcc the architecture when just assembling like this. So gcc -march=native -o test test.s tells it to assemble for your native architecture (arm on a RPi). This will yield link errors ...
patthoyts's user avatar
  • 501
2 votes

How can I run 32-bit compiled assembly code on Rasberry PI 4 B, if possible at all?

You can always run 32 bit programs/operating systems on a 64 bit architecture. That is downstream compatible. You cannot run 64 bit programs on a 32 bit architecture, of course. So it is no problem to ...
Ingo's user avatar
  • 42.6k
2 votes
Accepted

Is there a program to execute assembly code and check registers?

You may be able to do what you want with the debugger gdb. Compile and link a small test program. q.c #include <stdio.h> int main(int argc, char *argv[]) { int i; for (i=0; i<10; i++...
joan's user avatar
  • 71.6k
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
2 votes
Accepted

Which raspberry pi nowadays is compatible with 32bit ARMv7 assembly code?

I'm not an assembly programmer, but the only model with a 32-bit ARMv7 core is the Pi 2. Unfortunately right now they are going to be hard to find and expensive (eg., while there are none on that ...
goldilocks's user avatar
  • 60.1k
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

How can I run 32-bit compiled assembly code on Rasberry PI 4 B, if possible at all?

do you say that it does not matter if the the processor is 32 or 64 bit because if I have a 32-bit OS running on it, 32 bit programs will run just fine on it? Yes; this is also true for x86-64: You ...
goldilocks's user avatar
  • 60.1k
1 vote

Radio Transmission

You need to check your country's laws regarding wireless transmission systems. You need to make sure that you're not exceeding any limits in terms of, for example, power transmission, and that you are ...
David's user avatar
  • 713
1 vote

Read/Write GPIO

Ok found the solution. There were some coding issues. This code is working now: .section .init .globl _start _start: @ Base adress for gpio controller ldr r0, =0x20200000 @ Set GPIO 24 as ...
Kampi's user avatar
  • 201
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

Write an OS for Raspberry Pi in C

s-matyukevich/raspberry-pi-os https://github.com/s-matyukevich/raspberry-pi-os This awesome repo does both the C bootstraping, and goes into pretty complex topics. Furthermore, it looks into how ...
Ciro Santilli OurBigBook.com's user avatar

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