bootloader: treat zero-length firmware in flash as no firmware

This commit is contained in:
Sebastien Bourdeauducq 2019-10-30 21:46:06 +08:00
parent 228e44a059
commit bc050fdeec

View File

@ -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 {