We use some essential cookies to make our website work.

We use optional cookies, as detailed in our cookie policy, to remember your settings and understand how you use our website.

5 posts • Page 1 of 1
IsmaelGarHerr
Posts: 2
Joined: Mon Jun 02, 2025 7:52 pm

RaspBerry Pi 5 Memory Map

Tue Jun 03, 2025 1:55 pm

Hello to everyone! I'm new developing bare metal I just decided to start learning with my raspberry pi5. I'm following this tutorial https://satyria.de/arm/index.php?title=Hauptseite and all is pretty straightforward but I'm a little bit lost about the memory addresses for the registers being used to blink the LED.

The example says that base peripheral address is:

Code: Select all

//
// base.h
//
#ifndef _base_h
#define _base_h
.equ RPI_BASE, 0x107C000000UL
// GPIO
.equ ARM_GPIO2_BASE, RPI_BASE + 0x1517C00
.equ ARM_GPIO2_DATA0, ARM_GPIO2_BASE + 0x04
#endif
But according to RaspBerryPi RP1 peripherals. Base address starts at 0x40000000 where does the addresses used in the tutorial come from?
Last edited by IsmaelGarHerr on Tue Jun 03, 2025 3:39 pm, edited 2 times in total.

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 35174
Joined: Sat Jul 30, 2011 7:41 pm

Re: Rasp Berry Pi 5 Memory Map

Tue Jun 03, 2025 2:42 pm

Not an answer to your questions, but for learning baremetal I'd go with the Pico2 for running code and use the Pi for development and compiling.
Software guy, working in the applications team.

cleverca22
Posts: 9593
Joined: Sat Aug 18, 2012 2:33 pm

Re: RaspBerry Pi 5 Memory Map

Tue Jun 03, 2025 4:37 pm

IsmaelGarHerr wrote:
Tue Jun 03, 2025 1:55 pm
But according to RaspBerryPi RP1 peripherals. Base address starts at 0x40000000 where does the addresses used in the tutorial come from?
the pcie controller remaps things a lot

you have to parse the device-tree and the ranges= entries to know how to properly remap it
IsmaelGarHerr wrote:
Tue Jun 03, 2025 1:55 pm
.equ RPI_BASE, 0x107C000000UL

// GPIO
.equ ARM_GPIO2_BASE, RPI_BASE + 0x1517C00
also, this address isnt even the RP1, thats the bcm2712 gpio
so your looking at the entirely wrong document

IsmaelGarHerr
Posts: 2
Joined: Mon Jun 02, 2025 7:52 pm

Re: RaspBerry Pi 5 Memory Map

Tue Jun 03, 2025 7:53 pm

cleverca22 wrote:
Tue Jun 03, 2025 4:37 pm
IsmaelGarHerr wrote:
Tue Jun 03, 2025 1:55 pm
But according to RaspBerryPi RP1 peripherals. Base address starts at 0x40000000 where does the addresses used in the tutorial come from?
the pcie controller remaps things a lot

you have to parse the device-tree and the ranges= entries to know how to properly remap it
IsmaelGarHerr wrote:
Tue Jun 03, 2025 1:55 pm
.equ RPI_BASE, 0x107C000000UL

// GPIO
.equ ARM_GPIO2_BASE, RPI_BASE + 0x1517C00
also, this address isnt even the RP1, thats the bcm2712 gpio
so your looking at the entirely wrong document
So if that address corresponds to bcm2712_gpio peripheral, how does it manage to control raspberry's GPIO pins if they are supposed to be managed by the RP1? is somehow PCIe remapping data written to hats the bcm2712 gpio to the RP1? Sorry if my assumption is wrong btw as I mentioned im new at this

cleverca22
Posts: 9593
Joined: Sat Aug 18, 2012 2:33 pm

Re: RaspBerry Pi 5 Memory Map

Tue Jun 03, 2025 8:23 pm

IsmaelGarHerr wrote:
Tue Jun 03, 2025 7:53 pm
So if that address corresponds to bcm2712_gpio peripheral, how does it manage to control raspberry's GPIO pins if they are supposed to be managed by the RP1?
the onboard status led is tied to a bcm2712 gpio
the gpio header is going to the RP1

5 posts • Page 1 of 1

Return to "Bare metal, Assembly language"

AltStyle によって変換されたページ (->オリジナル) /