From c50e72f91ec6c37198500a4abb4d51c8868bfe16 Mon Sep 17 00:00:00 2001 From: pca006132 Date: Tue, 28 Jul 2020 11:39:46 +0800 Subject: [PATCH] experiments: use OCM instead of OCM3 (#54) --- experiments/link.x | 8 ++++---- experiments/src/main.rs | 37 +++++++++++++++++++------------------ 2 files changed, 23 insertions(+), 22 deletions(-) diff --git a/experiments/link.x b/experiments/link.x index f6471cc..6570f7f 100644 --- a/experiments/link.x +++ b/experiments/link.x @@ -32,19 +32,19 @@ SECTIONS *(.bss .bss.*); . = ALIGN(4); __bss_end = .; - } > OCM3 + } > OCM .stack1 (NOLOAD) : ALIGN(8) { __stack1_end = .; . += 0x200; __stack1_start = .; - } > OCM3 + } > OCM .stack0 (NOLOAD) : ALIGN(8) { __stack0_end = .; - . = ORIGIN(OCM3) + LENGTH(OCM3) - 8; + . = ORIGIN(OCM) + LENGTH(OCM) - 8; __stack0_start = .; - } > OCM3 + } > OCM /DISCARD/ : { diff --git a/experiments/src/main.rs b/experiments/src/main.rs index 38383a3..fc75433 100644 --- a/experiments/src/main.rs +++ b/experiments/src/main.rs @@ -83,24 +83,25 @@ pub fn main_core0() { clocks.cpu_1x() ); - let sd = libboard_zynq::sdio::SDIO::sdio0(true); - // only test SD card if it is inserted - if sd.is_card_inserted() { - let result = SdCard::from_sdio(sd); - match &result { - Ok(_) => info!("OK!"), - Err(a) => info!("{}", a), - }; - const SIZE: usize = 512 * 2 + 1; - let mut sd_card = result.unwrap(); - if false { - let buffer: [u8; SIZE] = [5; SIZE]; - sd_card.write_block(0x0, 2, &buffer).unwrap(); - } - let mut buffer: [u8; SIZE] = [0; SIZE]; - sd_card.read_block(0 /*0x1*/, 2, &mut buffer[1..]).unwrap(); - info!("buffer = {:?}", &buffer[..]); - } + // commented out due to OCM full + // let sd = libboard_zynq::sdio::SDIO::sdio0(true); + // // only test SD card if it is inserted + // if sd.is_card_inserted() { + // let result = SdCard::from_sdio(sd); + // match &result { + // Ok(_) => info!("OK!"), + // Err(a) => info!("{}", a), + // }; + // const SIZE: usize = 512 * 2 + 1; + // let mut sd_card = result.unwrap(); + // if false { + // let buffer: [u8; SIZE] = [5; SIZE]; + // sd_card.write_block(0x0, 2, &buffer).unwrap(); + // } + // let mut buffer: [u8; SIZE] = [0; SIZE]; + // sd_card.read_block(0 /*0x1*/, 2, &mut buffer[1..]).unwrap(); + // info!("buffer = {:?}", &buffer[..]); + // } let mut flash = zynq::flash::Flash::new(200_000_000).linear_addressing_mode(); let flash_ram: &[u8] = unsafe { core::slice::from_raw_parts(flash.ptr(), flash.size()) };