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:
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.
Hello! I am following along the rust discovery uart example by running the microbit v1 (nrf51) in qemu.
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:
https://github.com/nrf-rs/nrf-hal/blob/939c0175dbbebdb9457a492a9912b755cc56737c/nrf-hal-common/src/uart.rs#L134-L141
This check for
txdrdy
hangs when trying to send the first byte. The reference manual says thetxdrdy
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.