Fix: Waveshare S3 Touch LCD 2 Windows connectivity & USB detection
What changed, and why it matters
This commit fixes a hardware compatibility problem for one specific Blockstream Jade device variant (Waveshare S3 Touch LCD 2). It swaps the USB debug/serial interface from the chip's built-in JTAG controller to the TinyUSB software stack so Windows computers can recognize the device reliably. It also improves how the device detects whether it is running on USB power. There is no direct evidence in the commit that this fixes a security vulnerability; it appears to be a connectivity and power-detection improvement.
Treat as a normal hardware-compatibility and reliability fix. Review the TinyUSB CDC integration for correct descriptor and endpoint configuration, and verify that disabling the hardware USB JTAG console does not remove required debug access or affect secure-boot/flash-encryption workflows. No urgent security response is indicated by the commit itself.
Security signals we found
USB stack change from native JTAG/serial to TinyUSB CDC
Power-detection logic now uses TinyUSB mount/suspend state
No mention of security, CVE, vulnerability, or researcher attribution in commit
No explicit bounds checks, memory safety, or cryptographic changes
Evidence from the diff
The patch changes the ESP32-S3 sdkconfig for the Waveshare S3 Touch LCD 2 build: it disables CONFIG_ESP_CONSOLE_USB_SERIAL_JTAG and CONFIG_JADE_USE_USB_JTAG_SERIAL, sets both console options to NONE, and relies on TinyUSB CDC for USB communication. In main/power/wslcdtouch2.inc it replaces a simple battery-voltage heuristic for USB power detection with tud_mounted()/tud_suspended() checks plus a low-voltage fallback. The change is specific to this display configuration and is framed by the vendor as fixing Windows driver enumeration, not a security flaw.
Changed components
configs/sdkconfig_display_waveshares3_touch_lcd2.defaultsmain/power/wslcdtouch2.incWaveshare S3 Touch LCD 2 variant of Blockstream JadeInspect captured patch +19 / −5
diff --git a/configs/sdkconfig_display_waveshares3_touch_lcd2.defaults b/configs/sdkconfig_display_waveshares3_touch_lcd2.defaults
index f357ea9..6a82022 100644
--- a/configs/sdkconfig_display_waveshares3_touch_lcd2.defaults
+++ b/configs/sdkconfig_display_waveshares3_touch_lcd2.defaults
@@ -27,7 +27,8 @@ CONFIG_COMPILER_WARN_WRITE_STRINGS=y
CONFIG_DEBUG_MODE=y
CONFIG_ESPTOOLPY_FLASHMODE_QIO=y
CONFIG_ESPTOOLPY_FLASHSIZE_16MB=y
-CONFIG_ESP_CONSOLE_USB_SERIAL_JTAG=y
+CONFIG_ESP_CONSOLE_NONE=y
+CONFIG_ESP_CONSOLE_SECONDARY_NONE=y
CONFIG_ESP_DEFAULT_CPU_FREQ_MHZ_240=y
CONFIG_ESP_ERR_TO_NAME_LOOKUP=n
CONFIG_ESP_MAIN_TASK_STACK_SIZE=12288
@@ -51,7 +52,6 @@ CONFIG_FREERTOS_THREAD_LOCAL_STORAGE_POINTERS=3
CONFIG_GC032A_SUPPORT=n
CONFIG_GC2145_SUPPORT=n
CONFIG_IDF_TARGET="esp32s3"
-CONFIG_JADE_USE_USB_JTAG_SERIAL=y
CONFIG_MBEDTLS_CERTIFICATE_BUNDLE=n
CONFIG_MBEDTLS_ECP_RESTARTABLE=y
CONFIG_NEWLIB_NANO_FORMAT=y
diff --git a/main/power/wslcdtouch2.inc b/main/power/wslcdtouch2.inc
index bb5c88a..b2eecc6 100644
--- a/main/power/wslcdtouch2.inc
+++ b/main/power/wslcdtouch2.inc
@@ -1,4 +1,4 @@
-// Waveshare LCD Touch 2 implmentation
+// Waveshare LCD Touch 2 implementation
//
#include <driver/gpio.h>
#include <driver/ledc.h>
@@ -14,6 +14,7 @@
#include "iot_button.h"
#include "power.h"
#include "soc/gpio_num.h"
+#include "tusb.h"
#define BATTERY_ADC_CHANNEL ADC_CHANNEL_4
#define BATTERY_ADC_ATTEN ADC_ATTEN_DB_12
@@ -205,5 +206,18 @@ uint16_t power_get_temp(void) { return 0; }
void disable_usb_host(void) {}
void enable_usb_host(void) {}
-// This is only a guess by the ADC voltage when the USB is plugged in
-bool usb_is_powered(void) { return power_get_vbat() > 1350; }
+bool usb_is_powered(void)
+{
+ // Check if USB is mounted and not suspended (active connection)
+ if (tud_mounted() && !tud_suspended()) {
+ return true;
+ }
+
+ // Fallback: If voltage is near zero (<1V) but chip is on,
+ // we must be running on USB power without a battery.
+ if (power_get_vbat() < 1000) {
+ return true;
+ }
+
+ return false;
+}
\ No newline at end of file
Why this scored 16/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.