import uasyncio, usys
def can_write(s):
yield uasyncio.core._io_queue.queue_write(s)
async def write_stdout(data):
await can_write(usys.stdout.buffer)
usys.stdout.buffer.write(data.encode())
uasyncio.run(write_stdout('hello\n'))
This blocks indefinitely on RP2.
The corresponding code for reading works.