joare
Posts: 3
Joined: Fri Jan 01, 2016 6:45 pm

Problem reading memory properties on RPi 2

Fri Sep 23, 2016 9:31 pm

I'm trying to use the VC mailbox property interface to get hold of various system info.

When I ask for the ARM and VC memory base / sizes (using the GET_ARM_MEMORY and GET_VC_MEMORY tags),
the response says ARM memory is 128MB starting at 0, and VC memory is also 128MB, starting at 0x8000000.

As I'm running this on a RPi 2, I would expect these numbers to be different? I'm using recent start.elf and bootcode.bin
files, and a config.txt containing kernel_old=1.

--
Jo.

User avatar
Ultibo
Posts: 160
Joined: Wed Sep 30, 2015 10:29 am
Location: Australia
Contact: Website

Re: Problem reading memory properties on RPi 2

Sat Sep 24, 2016 1:00 am

joare wrote:the response says ARM memory is 128MB starting at 0, and VC memory is also 128MB, starting at 0x8000000.
I'm using recent start.elf and bootcode.bin
Make sure you also have the matching fixup.dat file on the SD card, without it the VC can only report 256MB total (128MB each) because the start.elf cannot be relocated.

A little piece of information that many guides forget to mention.
Ultibo.org | Make something amazing
https://ultibo.org

Threads, multi-core, OpenGL, Camera, FAT, NTFS, TCP/IP, USB and more in 3MB with 2 second boot!

joare
Posts: 3
Joined: Fri Jan 01, 2016 6:45 pm

Re: Problem reading memory properties on RPi 2

Sat Sep 24, 2016 9:34 am

That was it, thank you so much!

Now, for a followup. When I get the command_line property, it includes the following:

vc_mem.mem_base=0x3dc00000 vc_mem.mem_size=0x3f000000

The previously mentioned properties, on the other hand, now show:

ARM: base=00000000 size=3b000000
VC: base=3b000000 size=04000000

Again, there's a discrepancy?

User avatar
Ultibo
Posts: 160
Joined: Wed Sep 30, 2015 10:29 am
Location: Australia
Contact: Website

Re: Problem reading memory properties on RPi 2

Sun Sep 25, 2016 12:54 am

joare wrote:vc_mem.mem_base=0x3dc00000 vc_mem.mem_size=0x3f000000
While I have noticed that these command line parameters don't match up with anything about the actual memory layout I haven't thought too much about why, instead I just use the values from the VC mailbox properties or from the ARM tags which are always correct.

Many of the command line parameters are put their by the firmware to supply information for specific Linux drivers, it's possible that these two are also for a particular driver and nothing to do with overall memory layout.
Ultibo.org | Make something amazing
https://ultibo.org

Threads, multi-core, OpenGL, Camera, FAT, NTFS, TCP/IP, USB and more in 3MB with 2 second boot!

Return to “Bare metal, Assembly language”