forked from M-Labs/artiq
1
0
Fork 0

slave_fpga/bootloader: read in little endian

This commit is contained in:
occheung 2021-08-25 15:23:22 +08:00
parent eecd825d23
commit 798774192d
1 changed files with 2 additions and 2 deletions

View File

@ -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");