From ebd5d890f17ba3f6eead8d16bd1aefe1deadbc04 Mon Sep 17 00:00:00 2001 From: Sebastien Bourdeauducq Date: Sun, 6 Oct 2019 23:10:08 +0800 Subject: [PATCH] satman: check for JESD ready --- artiq/firmware/satman/main.rs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/artiq/firmware/satman/main.rs b/artiq/firmware/satman/main.rs index 0434168bf..368e5d2b2 100644 --- a/artiq/firmware/satman/main.rs +++ b/artiq/firmware/satman/main.rs @@ -421,11 +421,20 @@ fn init_jdcgs() { for dacno in 0..csr::JDCG.len() { let dacno = dacno as u8; info!("DAC-{} initializing...", dacno); + board_artiq::jdcg::jesd_enable(dacno, false); board_artiq::jdcg::jesd_prbs(dacno, false); board_artiq::jdcg::jesd_stpl(dacno, false); clock::spin_us(10000); board_artiq::jdcg::jesd_enable(dacno, true); + let t = clock::get_ms(); + while !board_artiq::jdcg::jesd_ready(dacno) { + if clock::get_ms() > t + 200 { + error!("JESD ready timeout"); + break; + } + } + if let Err(e) = drtioaux::send(1, &drtioaux::Packet::JdacSetupRequest { destination: 0, dacno: dacno