Add native USB CDC broker transport

This commit is contained in:
2026-08-23 00:47:56 +02:00
parent 6793f6bcc2
commit aa5fa207b6
11 changed files with 1394 additions and 9 deletions
+8 -3
View File
@@ -11,6 +11,8 @@
#include "session_broker.h"
#include "session_console.h"
#include "status_led.h"
#include "usb_cdc_transport.h"
#include "usb_console.h"
#define CONSOLE_BAUD_RATE 115200
#define CONSOLE_TX_GPIO 43
@@ -20,7 +22,7 @@ static const char *TAG = "firmware";
void app_main(void)
{
ESP_LOGI(TAG, "ESP32-S3 Serial Swiss Army Knife Phase 2 started");
ESP_LOGI(TAG, "ESP32-S3 Serial Swiss Army Knife native USB CDC phase started");
if (esp_psram_is_initialized()) {
ESP_LOGI(TAG, "PSRAM initialized: %u bytes", (unsigned int)esp_psram_get_size());
@@ -45,9 +47,11 @@ void app_main(void)
}
ESP_ERROR_CHECK(serial_service_init(&serial_config));
ESP_ERROR_CHECK(session_broker_init());
/* Native USB owns GPIO19/20; UART0 logging stays on the USB-to-UART bridge. */
ESP_ERROR_CHECK(usb_cdc_transport_init());
ESP_LOGI(
TAG,
"Using %s serial configuration; UART service remains stopped until 'serial start'",
"Using %s serial configuration; UART service starts on 'serial start' or native USB open",
used_stored_config ? "stored" : "default");
esp_console_repl_config_t repl_config = ESP_CONSOLE_REPL_CONFIG_DEFAULT();
@@ -72,8 +76,9 @@ void app_main(void)
ESP_ERROR_CHECK(rs232_hw_test_register_console_commands());
ESP_ERROR_CHECK(serial_console_register_commands());
ESP_ERROR_CHECK(session_console_register_commands());
ESP_ERROR_CHECK(usb_console_register_commands());
ESP_ERROR_CHECK(esp_console_start_repl(repl));
ESP_LOGI(TAG, "Interactive test console ready at %d baud", CONSOLE_BAUD_RATE);
ESP_LOGI(TAG, "Type 'help' for commands; no serial service or test runs automatically");
ESP_LOGI(TAG, "Type 'help' for commands; native USB starts UART1 only when its host port opens");
}