From 4005f4832fefcf3146244c10cc02bae91a501ade Mon Sep 17 00:00:00 2001 From: Andrew Kozlik Date: Wed, 15 Jul 2020 16:49:54 +0200 Subject: [PATCH] core/embed: Set VCP write timeout to 0. --- core/embed/firmware/mphalport.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/core/embed/firmware/mphalport.c b/core/embed/firmware/mphalport.c index 7f364f8b4..9c5c9f141 100644 --- a/core/embed/firmware/mphalport.c +++ b/core/embed/firmware/mphalport.c @@ -33,8 +33,9 @@ int mp_hal_stdin_rx_chr(void) { void mp_hal_stdout_tx_strn(const char *str, size_t len) { if (vcp_iface_num >= 0) { - int r = - usb_vcp_write_blocking(vcp_iface_num, (const uint8_t *)str, len, 500); + // The write timeout is set to 0, because otherwise when the VCP receive + // buffer on the host gets full, the timeout will block device operation. + int r = usb_vcp_write_blocking(vcp_iface_num, (const uint8_t *)str, len, 0); (void)r; } }