diff --git a/src/platform/mailbox.rs b/src/platform/mailbox.rs index 4286392..9c1fdd6 100644 --- a/src/platform/mailbox.rs +++ b/src/platform/mailbox.rs @@ -241,7 +241,8 @@ fn read(regs: &RegisterBlock, expected: u32, channel: u32) -> Result<()> { // is it a valid successful response? return Ok(()); } else { - return Err(MboxError::ResponseError); //@fixme ignore invalid responses and loop again? + // will return on Timeout if no response received... + // return Err(MboxError::ResponseError); //@fixme ignore invalid responses and loop again? } } } @@ -310,6 +311,7 @@ impl Mailbox { } _ => { println!("\n######\nMailbox::returning UnknownError"); + println!("{:x}\n######", self.buffer[1]); Err(MboxError::UnknownError) } } diff --git a/src/platform/vc.rs b/src/platform/vc.rs index 1fdc56b..0b2d842 100644 --- a/src/platform/vc.rs +++ b/src/platform/vc.rs @@ -1,4 +1,5 @@ use crate::{ + jtag_dbg_wait, platform::{ display::{Display, PixelOrder, Size2d, CHARSIZE_X, CHARSIZE_Y}, mailbox::{self, channel, response::VAL_LEN_FLAG, tag, Mailbox}, @@ -39,13 +40,15 @@ impl VC { mbox.buffer[16] = tag::AllocateBuffer as u32; mbox.buffer[17] = 8; // Buffer size // val buf size mbox.buffer[18] = 4; // Request size // val size - mbox.buffer[19] = 4096; // Alignment = 4096 -- fb_ptr will be here + mbox.buffer[19] = 16; // Alignment = 16 -- fb_ptr will be here mbox.buffer[20] = 0; // Space for response -- fb_size will be here mbox.buffer[21] = tag::End as u32; mbox.call(channel::PropertyTagsArmToVc).map_err(|_| ()); + jtag_dbg_wait(); + if (mbox.buffer[18] & VAL_LEN_FLAG) == 0 { return None; }