From 798774192dc69a6e2963f1cbe1ee431269d8ce74 Mon Sep 17 00:00:00 2001 From: occheung Date: Wed, 25 Aug 2021 15:23:22 +0800 Subject: [PATCH] slave_fpga/bootloader: read in little endian --- artiq/firmware/bootloader/main.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/artiq/firmware/bootloader/main.rs b/artiq/firmware/bootloader/main.rs index b33722d5a..1ef7426a1 100644 --- a/artiq/firmware/bootloader/main.rs +++ b/artiq/firmware/bootloader/main.rs @@ -121,8 +121,8 @@ fn load_slave_fpga() { const GATEWARE: *mut u8 = board_misoc::csr::CONFIG_SLAVE_FPGA_GATEWARE as *mut u8; let header = unsafe { slice::from_raw_parts(GATEWARE, 8) }; - let magic = BigEndian::read_u32(&header[0..]); - let length = BigEndian::read_u32(&header[4..]) as usize; + let magic = LittleEndian::read_u32(&header[0..]); + let length = LittleEndian::read_u32(&header[4..]) as usize; println!(" magic: 0x{:08x}, length: 0x{:08x}", magic, length); if magic != 0x5352544d { println!(" ...Error: bad magic");