From be04ba2a38e3597d4df32f411af5e12eb901ec73 Mon Sep 17 00:00:00 2001 From: Yogesh Mantri Date: Mon, 16 Sep 2024 10:09:05 +0800 Subject: [PATCH] fix(sdkconfig) : 1. Always enable NVS for wifi 2. lower iram loading for esp32 3. partition table for esp32 4. correct esp32-s2 pins used in Kconfig --- Kconfig | 2 +- slave/main/Kconfig.projbuild | 2 +- slave/partitions.esp32.csv | 7 +++++++ slave/sdkconfig.defaults | 2 -- slave/sdkconfig.defaults.esp32 | 11 +++++++---- slave/sdkconfig.defaults.esp32c2 | 7 +------ slave/sdkconfig.defaults.esp32c3 | 7 +------ slave/sdkconfig.defaults.esp32c6 | 3 +-- slave/sdkconfig.defaults.esp32s3 | 7 +------ 9 files changed, 20 insertions(+), 28 deletions(-) create mode 100644 slave/partitions.esp32.csv diff --git a/Kconfig b/Kconfig index 267267bc42..f56aebbb5c 100644 --- a/Kconfig +++ b/Kconfig @@ -274,7 +274,7 @@ menu "ESP-Hosted config" int "GPIO pin for handshake" default 16 if IDF_TARGET_ESP32P4 && SLAVE_CHIPSET_ESP32C6 default 3 if IDF_TARGET_ESP32C2 || IDF_TARGET_ESP32C3 || IDF_TARGET_ESP32C6 - default 17 if IDF_TARGET_ESP32S3 + default 17 if IDF_TARGET_ESP32S3 || IDF_TARGET_ESP32S2 default 26 help GPIO pin to use for handshake with other spi controller diff --git a/slave/main/Kconfig.projbuild b/slave/main/Kconfig.projbuild index 9161438cd7..4a91796ce8 100644 --- a/slave/main/Kconfig.projbuild +++ b/slave/main/Kconfig.projbuild @@ -192,7 +192,7 @@ menu "Example Configuration" int "Slave GPIO pin for handshake" default 22 if ESP_HOST_DEV_BOARD_P4_FUNC_BOARD default 3 if IDF_TARGET_ESP32C2 || IDF_TARGET_ESP32C3 || IDF_TARGET_ESP32C6 - default 17 if IDF_TARGET_ESP32S3 + default 17 if IDF_TARGET_ESP32S3 || IDF_TARGET_ESP32S2 default 26 help Slave GPIO pin to use for handshake with other spi controller diff --git a/slave/partitions.esp32.csv b/slave/partitions.esp32.csv new file mode 100644 index 0000000000..674558e547 --- /dev/null +++ b/slave/partitions.esp32.csv @@ -0,0 +1,7 @@ +# ESP-IDF Partition Table +# Name, Type, SubType, Offset, Size, Flags +nvs,data,nvs,0x9000,16K, +otadata,data,ota,0xd000,8K, +phy_init,data,phy,0xf000,4K, +ota_0,app,ota_0,0x10000,1792K, +ota_1,app,ota_1,0x1D0000,1792K, diff --git a/slave/sdkconfig.defaults b/slave/sdkconfig.defaults index 1acd00d104..9313e28e15 100644 --- a/slave/sdkconfig.defaults +++ b/slave/sdkconfig.defaults @@ -2,8 +2,6 @@ CONFIG_BT_ENABLED=y CONFIG_BT_CONTROLLER_ONLY=y -CONFIG_ESP32_WIFI_NVS_ENABLED= - # OTA CONFIG_ESPTOOLPY_FLASHSIZE_4MB=y CONFIG_PARTITION_TABLE_TWO_OTA=y diff --git a/slave/sdkconfig.defaults.esp32 b/slave/sdkconfig.defaults.esp32 index aed5aab135..644bc57032 100644 --- a/slave/sdkconfig.defaults.esp32 +++ b/slave/sdkconfig.defaults.esp32 @@ -9,8 +9,8 @@ CONFIG_BT_BLUEDROID_ENABLED= CONFIG_BTDM_CONTROLLER_MODE_BTDM=y CONFIG_BTDM_CONTROLLER_HCI_MODE_VHCI=y CONFIG_BTDM_CTRL_AUTO_LATENCY=y - -CONFIG_ESP32_WIFI_NVS_ENABLED= +CONFIG_BTDM_CONTROLLER_MODEM_SLEEP=y +CONFIG_BTDM_CTRL_MODEM_SLEEP=y # BT over UART #CONFIG_BTDM_CONTROLLER_HCI_MODE_UART_H4=y @@ -32,5 +32,8 @@ CONFIG_ESP32_WIFI_DYNAMIC_TX_BUFFER=y CONFIG_ESP32_WIFI_DYNAMIC_TX_BUFFER_NUM=64 # OTA -CONFIG_ESPTOOLPY_FLASHSIZE_4MB=y -CONFIG_PARTITION_TABLE_TWO_OTA=y +CONFIG_PARTITION_TABLE_CUSTOM=y +CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="partitions.esp32.csv" + +# iram text saving +CONFIG_FREERTOS_PLACE_FUNCTIONS_INTO_FLASH=y diff --git a/slave/sdkconfig.defaults.esp32c2 b/slave/sdkconfig.defaults.esp32c2 index 3f71ac229d..d116f3f483 100644 --- a/slave/sdkconfig.defaults.esp32c2 +++ b/slave/sdkconfig.defaults.esp32c2 @@ -7,10 +7,7 @@ CONFIG_SDIO_DAT2_DISABLED= CONFIG_BT_ENABLED=n ## temporary disable CONFIG_BT_CONTROLLER_ONLY=y CONFIG_BT_BLUEDROID_ENABLED= -CONFIG_BTDM_CTRL_MODE_BLE_ONLY=y -CONFIG_BTDM_CTRL_MODE_BR_EDR_ONLY=n -CONFIG_BTDM_CTRL_MODE_BTDM=n -CONFIG_BTDM_CTRL_HCI_MODE_VHCI=y +CONFIG_BT_LE_SLEEP_ENABLE=y #UART pins, Enable below config, delete sdkconfig and rebuild #CONFIG_BT_LE_HCI_INTERFACE_USE_UART=y @@ -18,8 +15,6 @@ CONFIG_BTDM_CTRL_HCI_MODE_VHCI=y #CONFIG_BT_LE_HCI_UART_TX_PIN=5 #CONFIG_BT_LE_HCI_UART_RX_PIN=18 -CONFIG_ESP32_WIFI_NVS_ENABLED= - CONFIG_ESPTOOLPY_FLASHSIZE_4MB=n CONFIG_ESPTOOLPY_FLASHSIZE_2MB=y CONFIG_PARTITION_TABLE_TWO_OTA=y diff --git a/slave/sdkconfig.defaults.esp32c3 b/slave/sdkconfig.defaults.esp32c3 index 351dc63dee..3f8bab9aa2 100644 --- a/slave/sdkconfig.defaults.esp32c3 +++ b/slave/sdkconfig.defaults.esp32c3 @@ -7,9 +7,4 @@ CONFIG_SDIO_DAT2_DISABLED= CONFIG_BT_ENABLED=y CONFIG_BT_CONTROLLER_ONLY=y CONFIG_BT_BLUEDROID_ENABLED= -CONFIG_BTDM_CTRL_MODE_BLE_ONLY=y -CONFIG_BTDM_CTRL_MODE_BR_EDR_ONLY=n -CONFIG_BTDM_CTRL_MODE_BTDM=n -CONFIG_BTDM_CTRL_HCI_MODE_VHCI=y - -CONFIG_ESP32_WIFI_NVS_ENABLED= +CONFIG_BT_LE_SLEEP_ENABLE=y diff --git a/slave/sdkconfig.defaults.esp32c6 b/slave/sdkconfig.defaults.esp32c6 index 9d5e6f0769..d67e40de91 100644 --- a/slave/sdkconfig.defaults.esp32c6 +++ b/slave/sdkconfig.defaults.esp32c6 @@ -4,6 +4,7 @@ CONFIG_ESP_DEFAULT_CPU_FREQ_MHZ_160=y CONFIG_BT_ENABLED=y CONFIG_BT_CONTROLLER_ONLY=y CONFIG_BT_BLUEDROID_ENABLED= +CONFIG_BT_LE_SLEEP_ENABLE=y # SPI/SDIO only CONFIG_BT_LE_HCI_INTERFACE_USE_RAM=y @@ -18,8 +19,6 @@ CONFIG_BT_LE_HCI_INTERFACE_USE_RAM=y # #CONFIG_BT_LE_HCI_UART_RTS_PIN=9 # #CONFIG_BT_LE_HCI_UART_CTS_PIN=13 -CONFIG_ESP_WIFI_NVS_ENABLED= - CONFIG_ESP_CACHE_MALLOC=n CONFIG_PARTITION_TABLE_CUSTOM=y diff --git a/slave/sdkconfig.defaults.esp32s3 b/slave/sdkconfig.defaults.esp32s3 index 7697e5ac2a..e137797c5c 100644 --- a/slave/sdkconfig.defaults.esp32s3 +++ b/slave/sdkconfig.defaults.esp32s3 @@ -6,9 +6,4 @@ CONFIG_ESP32_DEFAULT_CPU_FREQ_MHZ=240 CONFIG_BT_ENABLED=y CONFIG_BT_CONTROLLER_ONLY=y CONFIG_BT_BLUEDROID_ENABLED= -CONFIG_BTDM_CTRL_MODE_BLE_ONLY=y -CONFIG_BTDM_CTRL_MODE_BR_EDR_ONLY=n -CONFIG_BTDM_CTRL_MODE_BTDM=n -CONFIG_BTDM_CTRL_HCI_MODE_VHCI=y - -CONFIG_ESP32_WIFI_NVS_ENABLED= +CONFIG_BT_LE_SLEEP_ENABLE=y