Page 1 of 1

RaspBerry Pi 5 Memory Map

Posted: Tue Jun 03, 2025 1:55 pm
by IsmaelGarHerr
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?

Re: Rasp Berry Pi 5 Memory Map

Posted: Tue Jun 03, 2025 2:42 pm
by jamesh
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.

Re: RaspBerry Pi 5 Memory Map

Posted: Tue Jun 03, 2025 4:37 pm
by cleverca22
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

Re: RaspBerry Pi 5 Memory Map

Posted: Tue Jun 03, 2025 7:53 pm
by IsmaelGarHerr
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

Re: RaspBerry Pi 5 Memory Map

Posted: Tue Jun 03, 2025 8:23 pm
by cleverca22
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

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