The SuperMini ESP32C3 is a super cool and tiny board I enjoy a lot using. I used it for a project where it is running 24/7 powered from an USB wall adapter. However, I saw a problem first time a powered it with someting that is not a PC: it didn’t boot.

I spent a few hours trying to diagnose it and found that when using the USB Serial configuration (not the classic UART one), it gets stuck in __esp32c3_start() function at showprogress(“A”). Going down the rabbit hole, this in turn calls esp32c3_usbserial_write(char ch), which waits forever on the USB Serial Peripheral to have some free space in its TX buffer. That never happens without a host attached (and with Serial Monitor opened). The fix is simple:

diff --git a/arch/risc-v/src/esp32c3-legacy/esp32c3_lowputc.c b/arch/risc-v/src/esp32c3-legacy/esp32c3_lowputc.c
index 2afa7e3f4c..5469f5838b 100644
--- a/arch/risc-v/src/esp32c3-legacy/esp32c3_lowputc.c
+++ b/arch/risc-v/src/esp32c3-legacy/esp32c3_lowputc.c
@@ -849,7 +849,11 @@ void riscv_lowputc(char ch)
   esp32c3_lowputc_send_byte(priv, ch);

 #elif defined (CONFIG_ESP32C3_USBSERIAL)
-  esp32c3_usbserial_write(ch);
+  /* Disable early serial because without USB connection to host
+   * this call will block forever, keeping the OS from booting up.
+   */
+
+  // esp32c3_usbserial_write(ch);
 #endif /* CONSOLE_UART */
 }

With this patch applied it worked flawlessly. However, if the UART Serial Driver’s buffer gets filled up and if there’s no host attached to consume the data, the system will again get stuck. Fortunately, my system doesn’t print things to stdout, only to RAMLOG.