Skip to content

Commit b27fcd1

Browse files
committed
[otlib] Add delay to QEMU monitor creation
Signed-off-by: James Wainwright <[email protected]>
1 parent b4433ca commit b27fcd1

File tree

1 file changed

+6
-0
lines changed
  • sw/host/opentitanlib/src/transport/qemu

1 file changed

+6
-0
lines changed

sw/host/opentitanlib/src/transport/qemu/mod.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ pub mod uart;
1212
use std::cell::RefCell;
1313
use std::rc::Rc;
1414
use std::str::FromStr;
15+
use std::thread;
16+
use std::time::Duration;
1517

1618
use anyhow::{Context, bail};
1719

@@ -173,6 +175,10 @@ impl Qemu {
173175
let reset = QemuReset::new(Rc::clone(&monitor));
174176
let reset = Rc::new(reset);
175177

178+
// QEMU polls once per second to see if PTYs have been connected to. We must wait that
179+
// full second to be sure that QEMU is watching all of them.
180+
thread::sleep(Duration::from_secs(1));
181+
176182
Ok(Qemu {
177183
monitor,
178184
reset,

0 commit comments

Comments
 (0)