diff --git a/firmware/build.sh b/firmware/build.sh index bf4acd4..f5e3670 100755 --- a/firmware/build.sh +++ b/firmware/build.sh @@ -23,7 +23,7 @@ svd2rust -i $BUILD_DIR/csr.svd --target riscv # Build the firmware .elf file cd $FW_ROOT/litex-fw -cargo build --target=riscv32imac-unknown-none-elf --release +cargo build --target=riscv32imac-unknown-none-elf # Copy it into a binary that litex_term can upload. -${OBJCOPY} target/riscv32imac-unknown-none-elf/release/litex-fw -O binary $BUILD_DIR/rust-fw.bin +${OBJCOPY} target/riscv32imac-unknown-none-elf/debug/litex-fw -O binary $BUILD_DIR/rust-fw.bin diff --git a/firmware/litex-fw/src/log.rs b/firmware/litex-fw/src/log.rs index f546bac..33c64ed 100644 --- a/firmware/litex-fw/src/log.rs +++ b/firmware/litex-fw/src/log.rs @@ -54,18 +54,13 @@ fn default_handler() { let offset = peripherals.DMA_WRITER0.offset.read().bits(); //info!("dmaw0 {:x} {:x}", pending_type, offset); unsafe { - asm!( - "fence iorw, iorw", - ); + asm!("fence iorw, iorw"); } if offset == 0x10 { for i in 0..0x10 { unsafe { BUF_IN_CP[i] = BUF_IN[i]; - fence(Ordering::Release); - BUF_IN_CP[i] = BUF_IN[i]; - fence(Ordering::Release); } } } @@ -74,9 +69,6 @@ fn default_handler() { for i in 0x10..0x20 { unsafe { BUF_IN_CP[i] = BUF_IN[i]; - fence(Ordering::Release); - BUF_IN_CP[i] = BUF_IN[i]; - fence(Ordering::Release); } } } diff --git a/firmware/litex-fw/src/main.rs b/firmware/litex-fw/src/main.rs index 51bf32a..b5d6eed 100644 --- a/firmware/litex-fw/src/main.rs +++ b/firmware/litex-fw/src/main.rs @@ -82,6 +82,7 @@ fn main() -> ! { loop { log::info!("READ"); unsafe { + asm!("fence iorw, iorw"); for i in 0..BUF_SZ_WORDS { log::info!("{:x}@{:x}", i, BUF_IN_CP[i]);