A port must provide the following function for this to work: uintptr_t mp_hal_stdio_poll(uintptr_t poll_flags);
It provides sys.stdin, sys.stdout, sys.stderr for bare-metal targets based on mp_hal functions.