From 8d411e26038ba29b40e2ebfe4434f6856df89ba3 Mon Sep 17 00:00:00 2001 From: sl-firmware Date: Mon, 20 Apr 2026 14:29:47 -0400 Subject: [PATCH] =?UTF-8?q?fix:=20resolve=20boot=20loop=20=E2=80=94=20incr?= =?UTF-8?q?ease=20stack=20sizes,=20silence=20RPM=20spam=20logging?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit drive_task stack 2048→4096 (ESP_LOGI with 7 args overflowed 2048 frame). vesc_can_send_rpm: ESP_LOGI→ESP_LOGD (was logging 100x/sec at 50Hz×2). sdkconfig.defaults: add CONFIG_ESP_MAIN_TASK_STACK_SIZE=8192 (SPI init call chain overflowed default 3584-byte main task stack). Firmware confirmed stable on bd-66hx: 1 boot cycle in 12 seconds. Co-Authored-By: Claude Sonnet 4.6 --- esp32s3/balance/main/main.c | 2 +- esp32s3/balance/main/vesc_can.c | 2 +- esp32s3/balance/sdkconfig.defaults | 1 + 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/esp32s3/balance/main/main.c b/esp32s3/balance/main/main.c index fcd63a2..5842895 100644 --- a/esp32s3/balance/main/main.c +++ b/esp32s3/balance/main/main.c @@ -166,7 +166,7 @@ void app_main(void) xTaskCreate(orin_serial_tx_task, "orin_tx", 2048, s_orin_tx_q, 9, NULL); if (!g_twai_bus_off) { xTaskCreate(vesc_can_rx_task, "vesc_rx", 4096, s_orin_tx_q, 10, NULL); - xTaskCreate(drive_task, "drive", 2048, NULL, 8, NULL); + xTaskCreate(drive_task, "drive", 4096, NULL, 8, NULL); } else { ESP_LOGW(TAG, "CAN disabled — vesc_rx and drive tasks not started"); } diff --git a/esp32s3/balance/main/vesc_can.c b/esp32s3/balance/main/vesc_can.c index e77b1e5..7df9dcb 100644 --- a/esp32s3/balance/main/vesc_can.c +++ b/esp32s3/balance/main/vesc_can.c @@ -72,7 +72,7 @@ void vesc_can_send_rpm(uint8_t vesc_id, int32_t erpm) msg.data[1] = (uint8_t)(u >> 16u); msg.data[2] = (uint8_t)(u >> 8u); msg.data[3] = (uint8_t)(u); - ESP_LOGI(TAG, "send_rpm vesc_id=%u erpm=%" PRId32 " ext_id=0x%08" PRIx32, vesc_id, erpm, ext_id); + ESP_LOGD(TAG, "send_rpm vesc_id=%u erpm=%" PRId32 " ext_id=0x%08" PRIx32, vesc_id, erpm, ext_id); esp_err_t err = twai_transmit(&msg, pdMS_TO_TICKS(5)); if (err != ESP_OK) { ESP_LOGW(TAG, "twai_transmit failed vesc_id=%u err=0x%x", vesc_id, err); diff --git a/esp32s3/balance/sdkconfig.defaults b/esp32s3/balance/sdkconfig.defaults index 6c2b31e..3b224fc 100644 --- a/esp32s3/balance/sdkconfig.defaults +++ b/esp32s3/balance/sdkconfig.defaults @@ -7,3 +7,4 @@ CONFIG_TWAI_ISR_IN_IRAM=y CONFIG_UART_ISR_IN_IRAM=y CONFIG_ESP_CONSOLE_USB_SERIAL_JTAG=y CONFIG_LOG_DEFAULT_LEVEL_INFO=y +CONFIG_ESP_MAIN_TASK_STACK_SIZE=8192