From 146744de98d5c9dc3f7fd3a9f69d1f7ffb6da7e2 Mon Sep 17 00:00:00 2001 From: Hoggormino <125792648+Hoggormino@users.noreply.github.com> Date: Wed, 16 Sep 2026 21:29:23 +0200 Subject: [PATCH] ESP32: silence the console that shares UART0 with the Flipper link sdkconfig.defaults asked for a USB-Serial-JTAG console, but the ESP32-S2 has no such peripheral: the option depends on SOC_USB_SERIAL_JTAG_SUPPORTED, which esp32s2 does not define. The choice therefore fell back to ESP_CONSOLE_UART_DEFAULT, so boot and WiFi logs went out on UART0 at 115200 before wifi_link_init() switched it to 230400. That is the same wire the framed protocol uses, and a log line printed mid-frame corrupts it; the FAP then drops the frame on the CRC check. - Select CONFIG_ESP_CONSOLE_NONE, as the Flipper's own devboard firmware does. Verified in the generated sdkconfig, not just the defaults file. - Rename CONFIG_ESP32_WIFI_*_BUFFER_NUM to CONFIG_ESP_WIFI_*, which ESP-IDF v5.2 warned about on every build. - wifi_link.c described UART1 on GPIO17/18. The code uses UART0, whose default pins are the ones wired to the Flipper header. Co-Authored-By: Claude Opus 5 --- esp32-wifi-fw/main/wifi_link.c | 9 +++++---- esp32-wifi-fw/sdkconfig.defaults | 19 ++++++++++--------- 2 files changed, 15 insertions(+), 13 deletions(-) diff --git a/esp32-wifi-fw/main/wifi_link.c b/esp32-wifi-fw/main/wifi_link.c index 1f14aae..7543439 100644 --- a/esp32-wifi-fw/main/wifi_link.c +++ b/esp32-wifi-fw/main/wifi_link.c @@ -1,11 +1,12 @@ /* * Framed UART link - implementation. * - * UART config: UART1 by default on the Flipper WiFi Dev Board. The numbers - * are picked to match the FAP-side defaults; if you change them on one side - * you must change them on the other. + * UART config: UART0 on the Flipper WiFi Dev Board, whose default IO_MUX + * pins are wired to the Flipper's GPIO header. The numbers are picked to + * match the FAP-side defaults; if you change them on one side you must + * change them on the other. * - * pin TX = GPIO17, pin RX = GPIO18, baud 230400, no flow control. + * pin TX = GPIO43, pin RX = GPIO44, baud 230400, no flow control. * * RX runs in a dedicated task that re-syncs on the 0xAA 0x55 SOF whenever * a CRC mismatch or oversize frame is seen. diff --git a/esp32-wifi-fw/sdkconfig.defaults b/esp32-wifi-fw/sdkconfig.defaults index ee6a495..26b0015 100644 --- a/esp32-wifi-fw/sdkconfig.defaults +++ b/esp32-wifi-fw/sdkconfig.defaults @@ -1,14 +1,15 @@ # TagTinker WiFi firmware - ESP-IDF defaults. -# Targets the Flipper Wi-Fi Devboard (ESP32-S2-MINI; no PSRAM). +# Targets the Flipper Wi-Fi Devboard (ESP32-S2, 4 MB flash). # Bigger stack for the main task: TLS handshake + JSON parse needs room. CONFIG_ESP_MAIN_TASK_STACK_SIZE=12288 -# UART0 is owned by our framed protocol to the Flipper. The IDF console -# is moved to USB-Serial-JTAG (the dev board's USB-C) so logs are visible -# during development without colliding with our binary frames. -CONFIG_ESP_CONSOLE_USB_SERIAL_JTAG=y -CONFIG_ESP_CONSOLE_SECONDARY_NONE=y +# UART0 is owned by our framed protocol to the Flipper, so the IDF console +# has to be off. The ESP32-S2 has no USB-Serial-JTAG peripheral, so asking +# for that console silently fell back to UART0 and put boot and WiFi logs +# on the same wire as our binary frames. CONFIG_ESP_CONSOLE_NONE is what +# the Flipper's own devboard firmware uses. +CONFIG_ESP_CONSOLE_NONE=y CONFIG_LOG_DEFAULT_LEVEL_INFO=y CONFIG_BOOTLOADER_LOG_LEVEL_NONE=y CONFIG_BOOTLOADER_LOG_LEVEL=0 @@ -19,9 +20,9 @@ CONFIG_FREERTOS_CHECK_STACKOVERFLOW_CANARY=y CONFIG_FREERTOS_WATCHPOINT_END_OF_STACK=y # WiFi tuning - we don't need the full feature matrix. -CONFIG_ESP32_WIFI_STATIC_RX_BUFFER_NUM=8 -CONFIG_ESP32_WIFI_DYNAMIC_RX_BUFFER_NUM=16 -CONFIG_ESP32_WIFI_DYNAMIC_TX_BUFFER_NUM=16 +CONFIG_ESP_WIFI_STATIC_RX_BUFFER_NUM=8 +CONFIG_ESP_WIFI_DYNAMIC_RX_BUFFER_NUM=16 +CONFIG_ESP_WIFI_DYNAMIC_TX_BUFFER_NUM=16 # mbedTLS: the small "common subset" Mozilla bundle (~20 CAs incl. the # Cloudflare DigiCert + ISRG roots), with stock buffer sizes so we don't