From e6b9d5ebcb1a4567e4c635915dd7e1d9c55a87be Mon Sep 17 00:00:00 2001 From: mwojcik Date: Tue, 14 Feb 2023 11:13:51 +0800 Subject: [PATCH] set fclk before doing anything else --- src/runtime/src/main.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/runtime/src/main.rs b/src/runtime/src/main.rs index b83b2a4..d6c0fb1 100644 --- a/src/runtime/src/main.rs +++ b/src/runtime/src/main.rs @@ -22,6 +22,7 @@ use void::Void; use libconfig::Config; use libcortex_a9::l2c::enable_l2_cache; use libboard_artiq::{logger, identifier_read, init_gateware, pl}; +use embedded_hal::blocking::delay::DelayUs; const ASYNC_ERROR_COLLISION: u8 = 1 << 0; const ASYNC_ERROR_BUSY: u8 = 1 << 1; @@ -108,6 +109,9 @@ pub fn main_core0() { info!("NAR3/Zynq7000 starting..."); + init_gateware(); + timer.delay_us(500); // wait for FCLK to switch and MMCM to lock + ram::init_alloc_core0(); gic::InterruptController::gic(mpcore::RegisterBlock::mpcore()).enable_interrupts(); @@ -141,9 +145,8 @@ pub fn main_core0() { Config::new_dummy() } }; - + rtio_clocking::init(&mut timer, &cfg); - init_gateware(); task::spawn(report_async_rtio_errors());