From 8cece4f260d5f3db9a80946a53839d79398bda7b Mon Sep 17 00:00:00 2001 From: whitequark Date: Fri, 15 Dec 2017 06:19:31 +0000 Subject: [PATCH] runtime: hotswap slightly more carefully. This generally lets some last characters out of UART, last ACKs out of queues, etc. Nothing guaranteed though. --- artiq/firmware/runtime/mgmt.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/artiq/firmware/runtime/mgmt.rs b/artiq/firmware/runtime/mgmt.rs index 2078e2a3a..0cdb7eef6 100644 --- a/artiq/firmware/runtime/mgmt.rs +++ b/artiq/firmware/runtime/mgmt.rs @@ -82,9 +82,10 @@ fn worker(io: &Io, stream: &mut TcpStream) -> io::Result<()> { }, Request::Hotswap(firmware) => { + warn!("hotswapping firmware"); Reply::RebootImminent.write_to(stream)?; stream.close()?; - warn!("hotswapping firmware"); + stream.flush()?; unsafe { board::boot::hotswap(&firmware) } },