diff --git a/esp32s3/balance/partitions.csv b/esp32s3/balance/partitions.csv new file mode 100644 index 0000000..fd003f5 --- /dev/null +++ b/esp32s3/balance/partitions.csv @@ -0,0 +1,7 @@ +# ESP32-S3 BALANCE — 4 MB flash, dual OTA partitions +# Name, Type, SubType, Offset, Size +nvs, data, nvs, 0x9000, 0x5000, +otadata, data, ota, 0xe000, 0x2000, +app0, app, ota_0, 0x10000, 0x1B0000, +app1, app, ota_1, 0x1C0000, 0x1B0000, +nvs_user, data, nvs, 0x370000, 0x50000, diff --git a/esp32s3/balance/sdkconfig.defaults b/esp32s3/balance/sdkconfig.defaults index fe9981c..f4506fb 100644 --- a/esp32s3/balance/sdkconfig.defaults +++ b/esp32s3/balance/sdkconfig.defaults @@ -9,3 +9,11 @@ CONFIG_ESP_CONSOLE_UART_DEFAULT=y CONFIG_ESP_CONSOLE_UART_NUM=0 CONFIG_ESP_CONSOLE_UART_BAUDRATE=115200 CONFIG_LOG_DEFAULT_LEVEL_INFO=y + +# OTA — bd-3gwo: dual OTA partitions + rollback +CONFIG_PARTITION_TABLE_CUSTOM=y +CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="partitions.csv" +CONFIG_BOOTLOADER_APP_ROLLBACK_ENABLE=y +CONFIG_OTA_ALLOW_HTTP=y +CONFIG_ESP_HTTPS_OTA_ALLOW_HTTP=y +CONFIG_MBEDTLS_CERTIFICATE_BUNDLE=y diff --git a/esp32s3/io/CMakeLists.txt b/esp32s3/io/CMakeLists.txt new file mode 100644 index 0000000..d3b25fb --- /dev/null +++ b/esp32s3/io/CMakeLists.txt @@ -0,0 +1,3 @@ +cmake_minimum_required(VERSION 3.16) +include($ENV{IDF_PATH}/tools/cmake/project.cmake) +project(esp32s3_io) diff --git a/esp32s3/io/main/config.h b/esp32s3/io/main/config.h new file mode 100644 index 0000000..032065e --- /dev/null +++ b/esp32s3/io/main/config.h @@ -0,0 +1,35 @@ +#pragma once +/* ESP32-S3 IO board — pin assignments (SAUL-TEE-SYSTEM-REFERENCE.md) */ + +/* ── Inter-board UART (to/from BALANCE board) ── */ +#define IO_UART_PORT UART_NUM_0 +#define IO_UART_BAUD 460800 +#define IO_UART_TX_GPIO 43 /* IO board UART0_TXD → BALANCE RX */ +#define IO_UART_RX_GPIO 44 /* IO board UART0_RXD ← BALANCE TX */ +/* Note: SAUL-TEE spec says IO TX=IO18, RX=IO21; BALANCE TX=IO17, RX=IO18. + * This is UART0 on the IO devkit (GPIO43/44). Adjust to match actual wiring. */ + +/* ── BTS7960 Left motor driver ── */ +#define MOTOR_L_RPWM 1 +#define MOTOR_L_LPWM 2 +#define MOTOR_L_EN_R 3 +#define MOTOR_L_EN_L 4 + +/* ── BTS7960 Right motor driver ── */ +#define MOTOR_R_RPWM 5 +#define MOTOR_R_LPWM 6 +#define MOTOR_R_EN_R 7 +#define MOTOR_R_EN_L 8 + +/* ── Arming button / kill switch ── */ +#define ARM_BTN_GPIO 9 +#define KILL_GPIO 10 + +/* ── WS2812B LED strip ── */ +#define LED_DATA_GPIO 13 + +/* ── OTA UART — receives firmware from BALANCE (bd-21hv) ── */ +/* Uses same IO_UART_PORT since Balance drives OTA over the inter-board link */ + +/* ── Firmware version ── */ +#define IO_FW_VERSION "1.0.0" diff --git a/esp32s3/io/partitions.csv b/esp32s3/io/partitions.csv new file mode 100644 index 0000000..c6cb331 --- /dev/null +++ b/esp32s3/io/partitions.csv @@ -0,0 +1,7 @@ +# ESP32-S3 IO — 4 MB flash, dual OTA partitions +# Name, Type, SubType, Offset, Size +nvs, data, nvs, 0x9000, 0x5000, +otadata, data, ota, 0xe000, 0x2000, +app0, app, ota_0, 0x10000, 0x1B0000, +app1, app, ota_1, 0x1C0000, 0x1B0000, +nvs_user, data, nvs, 0x370000, 0x50000, diff --git a/esp32s3/io/sdkconfig.defaults b/esp32s3/io/sdkconfig.defaults new file mode 100644 index 0000000..1263b2e --- /dev/null +++ b/esp32s3/io/sdkconfig.defaults @@ -0,0 +1,13 @@ +CONFIG_IDF_TARGET="esp32s3" +CONFIG_ESPTOOLPY_FLASHSIZE_4MB=y +CONFIG_FREERTOS_HZ=1000 +CONFIG_ESP_TASK_WDT_EN=y +CONFIG_ESP_TASK_WDT_TIMEOUT_S=5 +CONFIG_UART_ISR_IN_IRAM=y +CONFIG_ESP_CONSOLE_UART_DEFAULT=y +CONFIG_LOG_DEFAULT_LEVEL_INFO=y + +# OTA — bd-3gwo: dual OTA partitions + rollback +CONFIG_PARTITION_TABLE_CUSTOM=y +CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="partitions.csv" +CONFIG_BOOTLOADER_APP_ROLLBACK_ENABLE=y