From bc050fdeec9fb0c5cd98fa7a74fd7abc35d1124e Mon Sep 17 00:00:00 2001 From: Sebastien Bourdeauducq Date: Wed, 30 Oct 2019 21:46:06 +0800 Subject: [PATCH] bootloader: treat zero-length firmware in flash as no firmware --- artiq/firmware/bootloader/main.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/artiq/firmware/bootloader/main.rs b/artiq/firmware/bootloader/main.rs index ea338c142..2c7e8a959 100644 --- a/artiq/firmware/bootloader/main.rs +++ b/artiq/firmware/bootloader/main.rs @@ -120,7 +120,7 @@ fn flash_boot() { let length = BigEndian::read_u32(&header[0..]) as usize; let expected_crc = BigEndian::read_u32(&header[4..]); - if length == 0xffffffff { + if length == 0 || length == 0xffffffff { println!("No firmware present"); return } else if length > 4 * 1024 * 1024 {