I have been working on a bare metal program on my Raspberry Pi 3 B and am currently working on using the Mailbox Property Interface. I have been able to use it to initialize a framebuffer using the following request:
[
//Headers: message size and type
35 * 4,
MBOX_REQUEST,
Tag::SetPhyDim as u32,
8,
8,
1920,
1080,
Tag::SetVirDim as u32,
8,
8,
1920,
1080,
Tag::SetVirOff as u32,
8,
8,
0,
0,
Tag::SetDepth as u32,
4,
4,
32,
Tag::SetPxlOrdr as u32,
4,
4,
1,
Tag::GetFB as u32,
8,
8,
4096,
0,
Tag::GetPitch as u32,
4,
4,
0,
Tag::EndOfMessage as u32,
0,
]
I have tried using other requests, such as 0x10001, which should return the board model number. The formatted request is:
[
32,
MBOX_REQUEST,
0x1001,
0, //Request Length
0, //Request Length
Tag::EndOfMessage as u32
]
When I send this message this is the response, which doesn't have the requested information:
[32, 0x80000000, 0x10001, 0, 0x80000004, 0]
Here is how I send the message:
println!("Testing Message Buffer");
let mut mb = MessageBuffer::new();
println!(
"Message Buffer Acquired At: {:#x}",
&mb as *const MessageBuffer as usize
);
mb.data[0] = 32;
mb.data[1] = 0; //Req
mb.data[2] = 0x10001;
mb.data[3] = 0;
mb.data[4] = 0;
mb.data[5] = 0;
let val = mailbox.call(&mb as *const MessageBuffer as u32, Channel::Prop) & !0b1111;
println!("Message Received at {:#x}: {:?}", val, unsafe {
core::slice::from_raw_parts(val as *const u32, 64)
});
On my boot disk, I did delete all of the device tree files. Could this be part of the issue?
Any help would be appreciated.