From 91085ca8d697d89689f9de1156ce25f0b8893a91 Mon Sep 17 00:00:00 2001 From: Astro Date: Wed, 22 Apr 2020 01:03:58 +0200 Subject: [PATCH] runtime: init the logger --- Cargo.lock | 4 +--- runtime/Cargo.toml | 1 + runtime/src/main.rs | 5 ++++- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index e99c7b0..d552949 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -45,9 +45,6 @@ checksum = "0f8cb7306107e4b10e64994de6d3274bd08996a7c1322a27b86482392f96be0a" [[package]] name = "dyld" version = "0.1.0" -dependencies = [ - "libboard_zynq", -] [[package]] name = "libasync" @@ -185,6 +182,7 @@ dependencies = [ "libboard_zynq", "libcortex_a9", "libsupport_zynq", + "log", "num-derive", "num-traits", ] diff --git a/runtime/Cargo.toml b/runtime/Cargo.toml index 04f5e51..1b06266 100644 --- a/runtime/Cargo.toml +++ b/runtime/Cargo.toml @@ -13,6 +13,7 @@ default = ["target_zc706"] num-traits = { version = "0.2", default-features = false } num-derive = "0.3" cslice = "0.3" +log = "0.4" libboard_zynq = { git = "https://git.m-labs.hk/M-Labs/zc706.git" } libsupport_zynq = { git = "https://git.m-labs.hk/M-Labs/zc706.git" } libcortex_a9 = { git = "https://git.m-labs.hk/M-Labs/zc706.git" } diff --git a/runtime/src/main.rs b/runtime/src/main.rs index 773b361..835c326 100644 --- a/runtime/src/main.rs +++ b/runtime/src/main.rs @@ -2,6 +2,7 @@ #![no_main] extern crate alloc; +extern crate log; use core::{cmp, str}; @@ -9,7 +10,7 @@ use libboard_zynq::{ println, self as zynq, clocks::Clocks, clocks::source::{ClockSource, ArmPll, IoPll}, }; -use libsupport_zynq::ram; +use libsupport_zynq::{logger, ram}; mod comms; mod pl; @@ -33,6 +34,8 @@ fn identifier_read(buf: &mut [u8]) -> &str { #[no_mangle] pub fn main_core0() { println!("ARTIQ runtime starting..."); + let _ = logger::init(); + log::set_max_level(log::LevelFilter::Debug); const CPU_FREQ: u32 = 800_000_000;