From b913d1d6f215388a6260bb8f7ab424064ec36c3b Mon Sep 17 00:00:00 2001 From: whitequark Date: Fri, 21 Apr 2017 16:46:40 +0000 Subject: [PATCH] runtime: make a copy of startup/idle kernel firmware before loading. Fixes #716. --- artiq/firmware/runtime/session.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/artiq/firmware/runtime/session.rs b/artiq/firmware/runtime/session.rs index 6cca523b5..b1bbf49d0 100644 --- a/artiq/firmware/runtime/session.rs +++ b/artiq/firmware/runtime/session.rs @@ -618,7 +618,11 @@ fn flash_kernel_worker(io: &Io, config::read(config_key, |result| { match result { - Ok(kernel) if kernel.len() > 0 => unsafe { kern_load(io, &mut session, &kernel) }, + Ok(kernel) if kernel.len() > 0 => unsafe { + // kernel CPU cannot access the SPI flash address space directly, + // so make a copy. + kern_load(io, &mut session, Vec::from(kernel).as_ref()) + }, _ => Err(io::Error::new(io::ErrorKind::NotFound, "kernel not found")), } })?;