From 37fa3b29da81f74885cad04f90a3055beaf47fdd Mon Sep 17 00:00:00 2001 From: hartytp Date: Sat, 20 Jan 2018 00:19:31 +0000 Subject: [PATCH] firmware: add register dump on HMC830 lock timeout. --- artiq/firmware/libboard_artiq/hmc830_7043.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/artiq/firmware/libboard_artiq/hmc830_7043.rs b/artiq/firmware/libboard_artiq/hmc830_7043.rs index 4747f7557..a567d27ec 100644 --- a/artiq/firmware/libboard_artiq/hmc830_7043.rs +++ b/artiq/firmware/libboard_artiq/hmc830_7043.rs @@ -107,6 +107,13 @@ mod hmc830 { info!("waiting for lock..."); while read(0x12) & 0x02 == 0 { if clock::get_ms() > t + 2000 { + error!("lock timeout"); + info!("register dump:"); + for addr in 0x00..0x14 { + // These registers don't exist (in the data sheet at least) + if addr == 0x0d || addr == 0x0e { continue; } + info!("[0x{:02x}] = 0x{:04x}", addr, read(addr)); + } return Err("HMC830 lock timeout"); } }