-
Notifications
You must be signed in to change notification settings - Fork 146
Closed
Description
Hello! I am following along the rust discovery uart example by running the microbit v1 (nrf51) in qemu.
$ cargo build --features v1 --target thumbv6m-none-eabi
$ qemu-system-arm -machine microbit -display none -serial stdio -s -kernel target/thumbv6m-none-eabi/debug/uart
At first I thought the qemu emulation might be at fault, but I found this forum post where they seem to see a similar problem on real hardware with code that matches the uart write impl here:
nrf-hal/nrf-hal-common/src/uart.rs
Lines 134 to 141 in 939c017
fn write(&mut self, byte: u8) -> nb::Result<(), Self::Error> { | |
// Are we ready for sending out next byte? | |
if self.0.events_txdrdy.read().bits() == 1 { | |
// Reset ready for transmit event. | |
self.0.events_txdrdy.reset(); | |
// Send byte. | |
self.0.txd.write(|w| unsafe { w.bits(u32::from(byte)) }); |
This check for txdrdy
hangs when trying to send the first byte. The reference manual says the txdrdy
event is triggered only when a byte is actually sent. That aligns with the findings in the forum post that show very similar code blocking indefinitely.
Unfortunately I don't have real hardware to test this on at the moment.
Metadata
Metadata
Assignees
Labels
No labels