diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 9f30c2487dd1bd..2060d1a837b5de 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -13,7 +13,7 @@ "dockerfile": "Dockerfile", "args": { // "BUILD_VERSION": "$(cat integrations/docker/images/chip-build/version)" // trying to get this to work - "BUILD_VERSION": "0.4.6" + "BUILD_VERSION": "0.4.7" } }, "remoteUser": "vscode", diff --git a/.github/workflows/android.yaml b/.github/workflows/android.yaml index 56ae5353200cd0..af4ec22186c252 100644 --- a/.github/workflows/android.yaml +++ b/.github/workflows/android.yaml @@ -32,7 +32,7 @@ jobs: runs-on: ubuntu-latest container: - image: connectedhomeip/chip-build-android:0.4.6 + image: connectedhomeip/chip-build-android:0.4.7 volumes: - "/tmp/log_output:/tmp/test_logs" diff --git a/.github/workflows/bloat_check.yaml b/.github/workflows/bloat_check.yaml index 2de39904bc39cf..3ba34e216a7bd6 100644 --- a/.github/workflows/bloat_check.yaml +++ b/.github/workflows/bloat_check.yaml @@ -24,7 +24,7 @@ jobs: runs-on: ubuntu-latest container: - image: connectedhomeip/chip-build:0.4.6 + image: connectedhomeip/chip-build:0.4.7 steps: - name: Checkout diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 6834b2e45e16c0..05295b5feef27a 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -34,7 +34,7 @@ jobs: runs-on: ubuntu-latest container: - image: connectedhomeip/chip-build:0.4.6 + image: connectedhomeip/chip-build:0.4.7 volumes: - "/tmp/log_output:/tmp/test_logs" diff --git a/.github/workflows/examples-autotools.yaml b/.github/workflows/examples-autotools.yaml index 6a0c70b983de8f..c90f7a437c04d9 100644 --- a/.github/workflows/examples-autotools.yaml +++ b/.github/workflows/examples-autotools.yaml @@ -28,7 +28,7 @@ jobs: runs-on: ubuntu-latest container: - image: connectedhomeip/chip-build-esp32:0.4.6 + image: connectedhomeip/chip-build-esp32:0.4.7 volumes: - "/tmp/bloat_reports:/tmp/bloat_reports" - "/tmp/output_binaries:/tmp/output_binaries" diff --git a/.github/workflows/examples-gn.yml b/.github/workflows/examples-gn.yml index ecade4338c09f0..a6f319b925f729 100644 --- a/.github/workflows/examples-gn.yml +++ b/.github/workflows/examples-gn.yml @@ -28,7 +28,7 @@ jobs: runs-on: ubuntu-latest container: - image: connectedhomeip/chip-build-esp32:0.4.6 + image: connectedhomeip/chip-build-esp32:0.4.7 volumes: - "/tmp/bloat_reports:/tmp/bloat_reports" - "/tmp/output_binaries:/tmp/output_binaries" diff --git a/.github/workflows/examples.yaml b/.github/workflows/examples.yaml index 63da02a4a92a43..60135c9ba73042 100644 --- a/.github/workflows/examples.yaml +++ b/.github/workflows/examples.yaml @@ -31,7 +31,7 @@ jobs: runs-on: ubuntu-latest container: - image: connectedhomeip/chip-build-nrf-platform:0.4.1 + image: connectedhomeip/chip-build-nrf-platform:0.4.7 volumes: - "/tmp/bloat_reports:/tmp/bloat_reports" - "/tmp/output_binaries:/tmp/output_binaries" @@ -82,7 +82,7 @@ jobs: runs-on: ubuntu-latest container: - image: connectedhomeip/chip-build:0.4.6 + image: connectedhomeip/chip-build:0.4.7 volumes: - "/tmp/bloat_reports:/tmp/bloat_reports" - "/tmp/output_binaries:/tmp/output_binaries" @@ -130,7 +130,7 @@ jobs: runs-on: ubuntu-latest container: - image: connectedhomeip/chip-build-efr32:0.4.6 + image: connectedhomeip/chip-build-efr32:0.4.7 volumes: - "/tmp/bloat_reports:/tmp/bloat_reports" - "/tmp/output_binaries:/tmp/output_binaries" @@ -167,7 +167,7 @@ jobs: runs-on: ubuntu-latest container: - image: connectedhomeip/chip-build-nrf-platform:0.4.6 + image: connectedhomeip/chip-build-nrf-platform:0.4.7 volumes: - "/tmp/bloat_reports:/tmp/bloat_reports" - "/tmp/output_binaries:/tmp/output_binaries" diff --git a/.github/workflows/qemu.yaml b/.github/workflows/qemu.yaml index 07196a46ad861f..791c0c5eabb999 100644 --- a/.github/workflows/qemu.yaml +++ b/.github/workflows/qemu.yaml @@ -28,7 +28,7 @@ jobs: runs-on: ubuntu-latest container: - image: connectedhomeip/chip-build-esp32-qemu:0.4.6 + image: connectedhomeip/chip-build-esp32-qemu:0.4.7 volumes: - "/tmp/log_output:/tmp/test_logs" diff --git a/examples/wifi-echo/server/esp32/Makefile b/examples/wifi-echo/server/esp32/Makefile index e907f913e90bed..b56d5d6eee1c32 100644 --- a/examples/wifi-echo/server/esp32/Makefile +++ b/examples/wifi-echo/server/esp32/Makefile @@ -26,9 +26,9 @@ EXTRA_COMPONENT_DIRS += $(PROJECT_PATH)/third_party/connectedhomeip/config/esp32 $(PROJECT_PATH)/../../../common/QRCode \ $(PROJECT_PATH)/../../../common/screen-framework \ -CXXFLAGS += -std=c++11 -Os -CPPFLAGS += -Os -CFLAGS += -Os +CXXFLAGS += -std=c++11 -Os -DLWIP_IPV6_SCOPES=0 +CPPFLAGS += -Os -DLWIP_IPV6_SCOPES=0 +CFLAGS += -Os -DLWIP_IPV6_SCOPES=0 CHIP_BUILD_WITH_GN ?= "" diff --git a/examples/wifi-echo/server/esp32/README.md b/examples/wifi-echo/server/esp32/README.md index e65c66678bebb6..735d253879c508 100644 --- a/examples/wifi-echo/server/esp32/README.md +++ b/examples/wifi-echo/server/esp32/README.md @@ -33,13 +33,13 @@ Development Framework and the xtensa-esp32-elf toolchain. The VSCode devcontainer has these components pre-installed, so you can skip this step. To install these components manually, follow these steps: -- Clone the Expressif ESP-IDF and checkout version 4.0 +- Clone the Espressif ESP-IDF and checkout release tag v4.1 $ mkdir ${HOME}/tools $ cd ${HOME}/tools $ git clone https://github.com/espressif/esp-idf.git $ cd esp-idf - $ git checkout release/v4.0 + $ git checkout tags/v4.1 $ git submodule update --init $ export IDF_PATH=${HOME}/tools/esp-idf $ ./install.sh diff --git a/examples/wifi-echo/server/esp32/main/EchoClient.cpp b/examples/wifi-echo/server/esp32/main/EchoClient.cpp index 67a0f46626eba7..bd949567e73e1e 100644 --- a/examples/wifi-echo/server/esp32/main/EchoClient.cpp +++ b/examples/wifi-echo/server/esp32/main/EchoClient.cpp @@ -24,7 +24,6 @@ #include "freertos/FreeRTOS.h" #include "freertos/task.h" #include "nvs_flash.h" -#include "tcpip_adapter.h" #include #include diff --git a/examples/wifi-echo/server/esp32/main/EchoDeviceCallbacks.cpp b/examples/wifi-echo/server/esp32/main/EchoDeviceCallbacks.cpp index c4ce75fa3e011f..ffca57d69f686c 100644 --- a/examples/wifi-echo/server/esp32/main/EchoDeviceCallbacks.cpp +++ b/examples/wifi-echo/server/esp32/main/EchoDeviceCallbacks.cpp @@ -27,6 +27,7 @@ #include "RendezvousSession.h" #include "esp_heap_caps.h" #include "esp_log.h" +#include "esp_netif.h" #include #include @@ -56,11 +57,11 @@ void EchoDeviceCallbacks::DeviceEventCallback(const ChipDeviceEvent * event, int ESP_LOGI(TAG, "Current free heap: %d\n", heap_caps_get_free_size(MALLOC_CAP_8BIT)); if (event->InternetConnectivityChange.IPv4 == kConnectivity_Established) { - tcpip_adapter_ip_info_t ipInfo; - if (tcpip_adapter_get_ip_info(TCPIP_ADAPTER_IF_STA, &ipInfo) == ESP_OK) + esp_netif_ip_info_t ipInfo; + if (esp_netif_get_ip_info(esp_netif_get_handle_from_ifkey("WIFI_STA_DEF"), &ipInfo) == ESP_OK) { char ipAddrStr[INET_ADDRSTRLEN]; - IPAddress::FromIPv4(ipInfo.ip).ToString(ipAddrStr, sizeof(ipAddrStr)); + esp_ip4addr_ntoa(&ipInfo.ip, ipAddrStr, sizeof(ipAddrStr)); ESP_LOGI(TAG, "Server ready at: %s:%d", ipAddrStr, CHIP_PORT); // Since the commissioner device does not yet have a mechanism to discover the IP address diff --git a/examples/wifi-echo/server/esp32/main/EchoServer.cpp b/examples/wifi-echo/server/esp32/main/EchoServer.cpp index 5c3eec97a4cc50..aca6bcabe63108 100644 --- a/examples/wifi-echo/server/esp32/main/EchoServer.cpp +++ b/examples/wifi-echo/server/esp32/main/EchoServer.cpp @@ -22,7 +22,6 @@ #include "freertos/FreeRTOS.h" #include "freertos/task.h" #include "nvs_flash.h" -#include "tcpip_adapter.h" #include #include @@ -254,12 +253,9 @@ void PairingComplete(Optional peerNodeId, uint16_t peerKeyId, uint16_t l // The echo server assumes the platform's networking has been setup already void startServer() { - CHIP_ERROR err = CHIP_NO_ERROR; - struct netif * ipV6NetIf = NULL; - tcpip_adapter_get_netif(TCPIP_ADAPTER_IF_AP, (void **) &ipV6NetIf); - - err = sessions.Init(kLocalNodeId, &DeviceLayer::SystemLayer, - UdpListenParameters(&DeviceLayer::InetLayer).SetAddressType(kIPAddressType_IPv6).SetInterfaceId(ipV6NetIf), + CHIP_ERROR err = CHIP_NO_ERROR; + err = sessions.Init(kLocalNodeId, &DeviceLayer::SystemLayer, + UdpListenParameters(&DeviceLayer::InetLayer).SetAddressType(kIPAddressType_IPv6).SetInterfaceId(NULL), UdpListenParameters(&DeviceLayer::InetLayer).SetAddressType(kIPAddressType_IPv4)); SuccessOrExit(err); diff --git a/examples/wifi-echo/server/esp32/main/wifi-echo.cpp b/examples/wifi-echo/server/esp32/main/wifi-echo.cpp index b33ca6a93cebb5..1c5ca71a4428f6 100644 --- a/examples/wifi-echo/server/esp32/main/wifi-echo.cpp +++ b/examples/wifi-echo/server/esp32/main/wifi-echo.cpp @@ -27,9 +27,9 @@ #include "RendezvousSession.h" #include "ScreenManager.h" #include "WiFiWidget.h" -#include "esp_event_loop.h" #include "esp_heap_caps_init.h" #include "esp_log.h" +#include "esp_netif.h" #include "esp_spi_flash.h" #include "esp_system.h" #include "esp_wifi.h" @@ -37,8 +37,6 @@ #include "freertos/task.h" #include "nvs_flash.h" -#include "tcpip_adapter.h" - #include #include #include @@ -348,10 +346,10 @@ void SetupPretendDevices() void GetGatewayIP(char * ip_buf, size_t ip_len) { - tcpip_adapter_ip_info_t ip; - tcpip_adapter_get_ip_info(TCPIP_ADAPTER_IF_AP, &ip); - IPAddress::FromIPv4(ip.ip).ToString(ip_buf, ip_len); - ESP_LOGE(TAG, "Got gateway ip %s", ip_buf); + esp_netif_ip_info_t ipInfo; + esp_netif_get_ip_info(esp_netif_get_handle_from_ifkey("WIFI_AP_DEF"), &ipInfo); + esp_ip4addr_ntoa(&ipInfo.ip, ip_buf, ip_len); + ESP_LOGI(TAG, "Got gateway ip %s", ip_buf); } bool isRendezvousBLE() diff --git a/integrations/docker/images/build-all.sh b/integrations/docker/images/build-all.sh index e2de228f3d84c2..36ceb7ec1e623b 100755 --- a/integrations/docker/images/build-all.sh +++ b/integrations/docker/images/build-all.sh @@ -20,7 +20,7 @@ # temporary wrapper build script until we can build something better # https://github.com/project-chip/connectedhomeip/issues/710 # - +set -e find . -name Dockerfile | while read -r dockerfile; do dir=${dockerfile%/*} (cd "$dir" && ./build.sh "$@") || exit $? diff --git a/integrations/docker/images/chip-build-esp32/Dockerfile b/integrations/docker/images/chip-build-esp32/Dockerfile index 44de9a7bdfca9b..a8b82c205ee2f1 100644 --- a/integrations/docker/images/chip-build-esp32/Dockerfile +++ b/integrations/docker/images/chip-build-esp32/Dockerfile @@ -7,7 +7,7 @@ RUN set -x \ && DEBIAN_FRONTEND=noninteractive apt-get install -y python \ && mkdir -p /opt/expressif \ && cd /opt/expressif \ - && git clone --progress -b release/v4.0 https://github.com/espressif/esp-idf.git \ + && git clone --progress -b v4.1 https://github.com/espressif/esp-idf.git \ && cd esp-idf \ && git submodule update --init --progress \ && IDF_TOOLS_PATH=/opt/expressif/tools ./install.sh \ diff --git a/integrations/docker/images/chip-build/version b/integrations/docker/images/chip-build/version index ef52a648073dd3..f9056827095537 100644 --- a/integrations/docker/images/chip-build/version +++ b/integrations/docker/images/chip-build/version @@ -1 +1 @@ -0.4.6 +0.4.7 diff --git a/scripts/tools/build_esp32_flash_image.sh b/scripts/tools/build_esp32_flash_image.sh index e4f244b29dea4e..db8a6e3559985c 100755 --- a/scripts/tools/build_esp32_flash_image.sh +++ b/scripts/tools/build_esp32_flash_image.sh @@ -28,7 +28,7 @@ here=$(cd "$(dirname "$0")" && pwd) build_dir="$(dirname "$1")" -bootload_file="$build_dir"/bootloader/bootloader.bin -partitions_file="$build_dir"/partitions_singleapp.bin +bootload_file="$build_dir"/bootloader.bin +partitions_file="$build_dir"/partitions.bin "$here"/flash_image_builder.sh 0x400000 "$2" 0x1000="$bootload_file" 0x8000="$partitions_file" 0x10000="$1" diff --git a/scripts/tools/esp32_qemu_run.sh b/scripts/tools/esp32_qemu_run.sh index 145e81bc302e62..fb4e1e092a99d0 100755 --- a/scripts/tools/esp32_qemu_run.sh +++ b/scripts/tools/esp32_qemu_run.sh @@ -38,6 +38,31 @@ die() { exit 1 } +realpath() { + path=$1 # input + + [[ -z $path ]] && return 0 + + # trim trailing slashes + while [[ ${#path} -gt 1 && $path = */ ]]; do + path=${path%/} + done + + # if we're at root we're done + if [[ $path = / ]]; then + echo "$path" + return 0 + fi + + [[ $path != /* ]] && path=$PWD/$path + + if [[ -d $path ]]; then + (cd "$path" && pwd) + else + echo "$(realpath "${path%/*}")/${path##*/}" + fi +} + [[ $# -eq 1 ]] || usage "Incorrect number of arguments" [[ -n $QEMU_ESP32 ]] || die "Environment variable QEMU_ESP32 is undefined." diff --git a/scripts/tools/flash_image_builder.sh b/scripts/tools/flash_image_builder.sh index 8a801b2652b297..74d6da0c635bd9 100755 --- a/scripts/tools/flash_image_builder.sh +++ b/scripts/tools/flash_image_builder.sh @@ -22,6 +22,8 @@ # source binaries at specific offset in the image # +set -e + usage() { exitcode=0 if [[ -n "$1" ]]; then @@ -54,8 +56,8 @@ for item in "${@:3}"; do [[ -r $file ]] || usage "Cannot read file $file" [[ $written -le $offset ]] || usage "Writing $file at $offset will overwrite previous segment" - filesize=$(stat -c%s "$file") - written=$((written + filesize)) + read -r _perms _ _user _group filesize _rest < <(ls -l "$file") + ((written += filesize)) [[ $written -lt $image_size ]] || usage "Writing $file at $offset will overflow image" dd if="$file" of="$2" conv=notrunc bs="$offset" seek=1 diff --git a/src/lib/support/CHIPArgParser.cpp b/src/lib/support/CHIPArgParser.cpp index e7bf5698571f1f..ab597880d6729a 100644 --- a/src/lib/support/CHIPArgParser.cpp +++ b/src/lib/support/CHIPArgParser.cpp @@ -1007,10 +1007,10 @@ bool ParseSubnetId(const char * str, uint16_t & subnetId) */ bool ParseHexString(const char * hexStr, uint32_t strLen, uint8_t * outBuf, uint32_t outBufSize, uint32_t & outDataLen) { - bool isFirstNibble = true; - uint8_t firstNibbleVal; - const char * p = hexStr; - uint32_t dataLen = 0; + bool isFirstNibble = true; + uint8_t firstNibbleVal = 0; + const char * p = hexStr; + uint32_t dataLen = 0; outDataLen = 0; diff --git a/src/platform/ESP32/CHIPDevicePlatformEvent.h b/src/platform/ESP32/CHIPDevicePlatformEvent.h index ec58c744e7b0ef..a75e4ba036ca48 100644 --- a/src/platform/ESP32/CHIPDevicePlatformEvent.h +++ b/src/platform/ESP32/CHIPDevicePlatformEvent.h @@ -52,7 +52,26 @@ struct ChipDevicePlatformEvent final { union { - system_event_t ESPSystemEvent; + struct + { + esp_event_base_t Base; + int32_t Id; + union + { + ip_event_got_ip_t IpGotIp; + ip_event_got_ip6_t IpGotIp6; + ip_event_ap_staipassigned_t IpApStaIpAssigned; + wifi_event_sta_scan_done_t WifiStaScanDone; + wifi_event_sta_connected_t WifiStaConnected; + wifi_event_sta_disconnected_t WifiStaDisconnected; + wifi_event_sta_authmode_change_t WifiStaAuthModeChange; + wifi_event_sta_wps_er_pin_t WifiStaWpsErPin; + wifi_event_sta_wps_fail_reason_t WifiStaWpsErFailed; + wifi_event_ap_staconnected_t WifiApStaConnected; + wifi_event_ap_stadisconnected_t WifiApStaDisconnected; + wifi_event_ap_probe_req_rx_t WifiApProbeReqRecved; + } Data; + } ESPSystemEvent; }; }; diff --git a/src/platform/ESP32/ConnectivityManagerImpl.cpp b/src/platform/ESP32/ConnectivityManagerImpl.cpp index 665315143c7917..fd7ca8ddcb8dc1 100644 --- a/src/platform/ESP32/ConnectivityManagerImpl.cpp +++ b/src/platform/ESP32/ConnectivityManagerImpl.cpp @@ -30,6 +30,7 @@ #include #include "esp_event.h" +#include "esp_netif.h" #include "esp_wifi.h" #include @@ -454,60 +455,72 @@ void ConnectivityManagerImpl::_OnPlatformEvent(const ChipDeviceEvent * event) // Handle ESP system events... if (event->Type == DeviceEventType::kESPSystemEvent) { - switch (event->Platform.ESPSystemEvent.event_id) + if (event->Platform.ESPSystemEvent.Base == WIFI_EVENT) { - case SYSTEM_EVENT_STA_START: - ChipLogProgress(DeviceLayer, "SYSTEM_EVENT_STA_START"); - DriveStationState(); - break; - case SYSTEM_EVENT_STA_CONNECTED: - ChipLogProgress(DeviceLayer, "SYSTEM_EVENT_STA_CONNECTED"); - if (mWiFiStationState == kWiFiStationState_Connecting) + switch (event->Platform.ESPSystemEvent.Id) { - ChangeWiFiStationState(kWiFiStationState_Connecting_Succeeded); + case WIFI_EVENT_STA_START: + ChipLogProgress(DeviceLayer, "WIFI_EVENT_STA_START"); + DriveStationState(); + break; + case WIFI_EVENT_STA_CONNECTED: + ChipLogProgress(DeviceLayer, "WIFI_EVENT_STA_CONNECTED"); + if (mWiFiStationState == kWiFiStationState_Connecting) + { + ChangeWiFiStationState(kWiFiStationState_Connecting_Succeeded); + } + DriveStationState(); + break; + case WIFI_EVENT_STA_DISCONNECTED: + ChipLogProgress(DeviceLayer, "WIFI_EVENT_STA_DISCONNECTED"); + if (mWiFiStationState == kWiFiStationState_Connecting) + { + ChangeWiFiStationState(kWiFiStationState_Connecting_Failed); + } + DriveStationState(); + break; + case WIFI_EVENT_STA_STOP: + ChipLogProgress(DeviceLayer, "WIFI_EVENT_STA_STOP"); + DriveStationState(); + break; + case WIFI_EVENT_AP_START: + ChipLogProgress(DeviceLayer, "WIFI_EVENT_AP_START"); + ChangeWiFiAPState(kWiFiAPState_Active); + DriveAPState(); + break; + case WIFI_EVENT_AP_STOP: + ChipLogProgress(DeviceLayer, "WIFI_EVENT_AP_STOP"); + ChangeWiFiAPState(kWiFiAPState_NotActive); + DriveAPState(); + break; + case WIFI_EVENT_AP_STACONNECTED: + ChipLogProgress(DeviceLayer, "WIFI_EVENT_AP_STACONNECTED"); + MaintainOnDemandWiFiAP(); + break; + default: + break; } - DriveStationState(); - break; - case SYSTEM_EVENT_STA_DISCONNECTED: - ChipLogProgress(DeviceLayer, "SYSTEM_EVENT_STA_DISCONNECTED"); - if (mWiFiStationState == kWiFiStationState_Connecting) + } + + if (event->Platform.ESPSystemEvent.Base == IP_EVENT) + { + switch (event->Platform.ESPSystemEvent.Id) { - ChangeWiFiStationState(kWiFiStationState_Connecting_Failed); + case IP_EVENT_STA_GOT_IP: + ChipLogProgress(DeviceLayer, "IP_EVENT_STA_GOT_IP"); + OnStationIPv4AddressAvailable(event->Platform.ESPSystemEvent.Data.IpGotIp); + break; + case IP_EVENT_STA_LOST_IP: + ChipLogProgress(DeviceLayer, "IP_EVENT_STA_LOST_IP"); + OnStationIPv4AddressLost(); + break; + case IP_EVENT_GOT_IP6: + ChipLogProgress(DeviceLayer, "IP_EVENT_GOT_IP6"); + OnIPv6AddressAvailable(event->Platform.ESPSystemEvent.Data.IpGotIp6); + break; + default: + break; } - DriveStationState(); - break; - case SYSTEM_EVENT_STA_STOP: - ChipLogProgress(DeviceLayer, "SYSTEM_EVENT_STA_STOP"); - DriveStationState(); - break; - case SYSTEM_EVENT_STA_GOT_IP: - ChipLogProgress(DeviceLayer, "SYSTEM_EVENT_STA_GOT_IP"); - OnStationIPv4AddressAvailable(event->Platform.ESPSystemEvent.event_info.got_ip); - break; - case SYSTEM_EVENT_STA_LOST_IP: - ChipLogProgress(DeviceLayer, "SYSTEM_EVENT_STA_LOST_IP"); - OnStationIPv4AddressLost(); - break; - case SYSTEM_EVENT_GOT_IP6: - ChipLogProgress(DeviceLayer, "SYSTEM_EVENT_GOT_IP6"); - OnIPv6AddressAvailable(event->Platform.ESPSystemEvent.event_info.got_ip6); - break; - case SYSTEM_EVENT_AP_START: - ChipLogProgress(DeviceLayer, "SYSTEM_EVENT_AP_START"); - ChangeWiFiAPState(kWiFiAPState_Active); - DriveAPState(); - break; - case SYSTEM_EVENT_AP_STOP: - ChipLogProgress(DeviceLayer, "SYSTEM_EVENT_AP_STOP"); - ChangeWiFiAPState(kWiFiAPState_NotActive); - DriveAPState(); - break; - case SYSTEM_EVENT_AP_STACONNECTED: - ChipLogProgress(DeviceLayer, "SYSTEM_EVENT_AP_STACONNECTED"); - MaintainOnDemandWiFiAP(); - break; - default: - break; } } } @@ -653,10 +666,10 @@ void ConnectivityManagerImpl::OnStationConnected() CHIP_ERROR err; // Assign an IPv6 link local address to the station interface. - err = tcpip_adapter_create_ip6_linklocal(TCPIP_ADAPTER_IF_STA); + err = esp_netif_create_ip6_linklocal(esp_netif_get_handle_from_ifkey("WIFI_STA_DEF")); if (err != ESP_OK) { - ChipLogError(DeviceLayer, "tcpip_adapter_create_ip6_linklocal(TCPIP_ADAPTER_IF_STA) failed: %s", chip::ErrorStr(err)); + ChipLogError(DeviceLayer, "esp_netif_create_ip6_linklocal() failed for WIFI_STA_DEF interface: %s", chip::ErrorStr(err)); } // TODO Invoke WARM to perform actions that occur when the WiFi station interface comes up. @@ -818,13 +831,13 @@ void ConnectivityManagerImpl::DriveAPState() // If AP is active, but the interface doesn't have an IPv6 link-local // address, assign one now. - if (mWiFiAPState == kWiFiAPState_Active && Internal::ESP32Utils::IsInterfaceUp(TCPIP_ADAPTER_IF_AP) && - !Internal::ESP32Utils::HasIPv6LinkLocalAddress(TCPIP_ADAPTER_IF_AP)) + if (mWiFiAPState == kWiFiAPState_Active && Internal::ESP32Utils::IsInterfaceUp("WIFI_AP_DEF") && + !Internal::ESP32Utils::HasIPv6LinkLocalAddress("WIFI_AP_DEF")) { - err = tcpip_adapter_create_ip6_linklocal(TCPIP_ADAPTER_IF_AP); + err = esp_netif_create_ip6_linklocal(esp_netif_get_handle_from_ifkey("WIFI_AP_DEF")); if (err != ESP_OK) { - ChipLogError(DeviceLayer, "tcpip_adapter_create_ip6_linklocal(TCPIP_ADAPTER_IF_AP) failed: %s", chip::ErrorStr(err)); + ChipLogError(DeviceLayer, "esp_netif_create_ip6_linklocal() failed for WIFI_AP_DEF interface: %s", chip::ErrorStr(err)); } SuccessOrExit(err); } @@ -953,16 +966,13 @@ void ConnectivityManagerImpl::UpdateInternetConnectivityState(void) } } -void ConnectivityManagerImpl::OnStationIPv4AddressAvailable(const system_event_sta_got_ip_t & got_ip) +void ConnectivityManagerImpl::OnStationIPv4AddressAvailable(const ip_event_got_ip_t & got_ip) { #if CHIP_PROGRESS_LOGGING { - char ipAddrStr[INET_ADDRSTRLEN], netMaskStr[INET_ADDRSTRLEN], gatewayStr[INET_ADDRSTRLEN]; - IPAddress::FromIPv4(got_ip.ip_info.ip).ToString(ipAddrStr, sizeof(ipAddrStr)); - IPAddress::FromIPv4(got_ip.ip_info.netmask).ToString(netMaskStr, sizeof(netMaskStr)); - IPAddress::FromIPv4(got_ip.ip_info.gw).ToString(gatewayStr, sizeof(gatewayStr)); - ChipLogProgress(DeviceLayer, "IPv4 address %s on WiFi station interface: %s/%s gateway %s", - (got_ip.ip_changed) ? "changed" : "ready", ipAddrStr, netMaskStr, gatewayStr); + ChipLogProgress(DeviceLayer, "IPv4 address %s on WiFi station interface: " IPSTR "/" IPSTR " gateway " IPSTR, + (got_ip.ip_changed) ? "changed" : "ready", IP2STR(&got_ip.ip_info.ip), IP2STR(&got_ip.ip_info.netmask), + IP2STR(&got_ip.ip_info.gw)); } #endif // CHIP_PROGRESS_LOGGING @@ -980,15 +990,12 @@ void ConnectivityManagerImpl::OnStationIPv4AddressLost(void) UpdateInternetConnectivityState(); } -void ConnectivityManagerImpl::OnIPv6AddressAvailable(const system_event_got_ip6_t & got_ip) +void ConnectivityManagerImpl::OnIPv6AddressAvailable(const ip_event_got_ip6_t & got_ip) { #if CHIP_PROGRESS_LOGGING { - IPAddress ipAddr = IPAddress::FromIPv6(got_ip.ip6_info.ip); - char ipAddrStr[INET6_ADDRSTRLEN]; - ipAddr.ToString(ipAddrStr, sizeof(ipAddrStr)); - ChipLogProgress(DeviceLayer, "IPv6 addr available. Ready on %s interface: %s", - Internal::ESP32Utils::InterfaceIdToName(got_ip.if_index), ipAddrStr); + ChipLogProgress(DeviceLayer, "IPv6 addr available. Ready on %s interface: " IPV6STR, esp_netif_get_ifkey(got_ip.esp_netif), + IPV62STR(got_ip.ip6_info.ip)); } #endif // CHIP_PROGRESS_LOGGING diff --git a/src/platform/ESP32/ConnectivityManagerImpl.h b/src/platform/ESP32/ConnectivityManagerImpl.h index 059e940d00d36c..f2b270565a5ce8 100644 --- a/src/platform/ESP32/ConnectivityManagerImpl.h +++ b/src/platform/ESP32/ConnectivityManagerImpl.h @@ -155,9 +155,9 @@ class ConnectivityManagerImpl final : public ConnectivityManager, static void DriveAPState(::chip::System::Layer * aLayer, void * aAppState, ::chip::System::Error aError); void UpdateInternetConnectivityState(void); - void OnStationIPv4AddressAvailable(const system_event_sta_got_ip_t & got_ip); + void OnStationIPv4AddressAvailable(const ip_event_got_ip_t & got_ip); void OnStationIPv4AddressLost(void); - void OnIPv6AddressAvailable(const system_event_got_ip6_t & got_ip); + void OnIPv6AddressAvailable(const ip_event_got_ip6_t & got_ip); static const char * WiFiStationStateToStr(WiFiStationState state); static const char * WiFiAPStateToStr(WiFiAPState state); diff --git a/src/platform/ESP32/ESP32Utils.cpp b/src/platform/ESP32/ESP32Utils.cpp index 38179caeed8ae4..9d7042cdf8d474 100644 --- a/src/platform/ESP32/ESP32Utils.cpp +++ b/src/platform/ESP32/ESP32Utils.cpp @@ -30,6 +30,8 @@ #include #include "esp_event.h" +#include "esp_netif.h" +#include "esp_netif_net_stack.h" #include "esp_wifi.h" using namespace ::chip::DeviceLayer::Internal; @@ -203,40 +205,28 @@ const char * ESP32Utils::WiFiModeToStr(wifi_mode_t wifiMode) struct netif * ESP32Utils::GetStationNetif(void) { - return GetNetif(TCPIP_ADAPTER_IF_STA); + return GetNetif("WIFI_STA_DEF"); } -struct netif * ESP32Utils::GetNetif(tcpip_adapter_if_t intfId) +struct netif * ESP32Utils::GetNetif(const char * ifKey) { - struct netif * netif; - return (tcpip_adapter_get_netif(intfId, (void **) &netif) == ESP_OK) ? netif : NULL; + struct netif * netif = NULL; + esp_netif_t * netif_handle = NULL; + netif_handle = esp_netif_get_handle_from_ifkey(ifKey); + netif = (struct netif *) esp_netif_get_netif_impl(netif_handle); + return netif; } -bool ESP32Utils::IsInterfaceUp(tcpip_adapter_if_t intfId) +bool ESP32Utils::IsInterfaceUp(const char * ifKey) { - struct netif * netif = GetNetif(intfId); + struct netif * netif = GetNetif(ifKey); return netif != NULL && netif_is_up(netif); } -const char * ESP32Utils::InterfaceIdToName(tcpip_adapter_if_t intfId) +bool ESP32Utils::HasIPv6LinkLocalAddress(const char * ifKey) { - switch (intfId) - { - case TCPIP_ADAPTER_IF_STA: - return "WiFi station"; - case TCPIP_ADAPTER_IF_AP: - return "WiFi AP"; - case TCPIP_ADAPTER_IF_ETH: - return "Ethernet"; - default: - return "(unknown)"; - } -} - -bool ESP32Utils::HasIPv6LinkLocalAddress(tcpip_adapter_if_t intfId) -{ - ip6_addr_t unused; - return tcpip_adapter_get_ip6_linklocal(intfId, &unused) == ESP_OK; + struct esp_ip6_addr if_ip6_unused; + return esp_netif_get_ip6_linklocal(esp_netif_get_handle_from_ifkey(ifKey), &if_ip6_unused) == ESP_OK; } CHIP_ERROR ESP32Utils::GetWiFiStationProvision(Internal::DeviceNetworkInfo & netInfo, bool includeCredentials) diff --git a/src/platform/ESP32/ESP32Utils.h b/src/platform/ESP32/ESP32Utils.h index f263b24be37be7..c498dc55fcb3bf 100644 --- a/src/platform/ESP32/ESP32Utils.h +++ b/src/platform/ESP32/ESP32Utils.h @@ -38,11 +38,10 @@ class ESP32Utils static CHIP_ERROR SetAPMode(bool enabled); static int OrderScanResultsByRSSI(const void * _res1, const void * _res2); static const char * WiFiModeToStr(wifi_mode_t wifiMode); - static struct netif * GetNetif(tcpip_adapter_if_t intfId); + static struct netif * GetNetif(const char * ifKey); static struct netif * GetStationNetif(void); - static bool IsInterfaceUp(tcpip_adapter_if_t intfId); - static const char * InterfaceIdToName(tcpip_adapter_if_t intfId); - static bool HasIPv6LinkLocalAddress(tcpip_adapter_if_t intfId); + static bool IsInterfaceUp(const char * ifKey); + static bool HasIPv6LinkLocalAddress(const char * ifKey); static CHIP_ERROR GetWiFiStationProvision(Internal::DeviceNetworkInfo & netInfo, bool includeCredentials); static CHIP_ERROR SetWiFiStationProvision(const Internal::DeviceNetworkInfo & netInfo); diff --git a/src/platform/ESP32/PlatformManagerImpl.cpp b/src/platform/ESP32/PlatformManagerImpl.cpp index 4c82fe17cc2bdc..9a66b5bb0bfd98 100644 --- a/src/platform/ESP32/PlatformManagerImpl.cpp +++ b/src/platform/ESP32/PlatformManagerImpl.cpp @@ -29,9 +29,10 @@ #include #include -#include "esp_event_loop.h" +#include "esp_event.h" #include "esp_heap_caps_init.h" #include "esp_log.h" +#include "esp_netif.h" #include "esp_spi_flash.h" #include "esp_system.h" #include "esp_wifi.h" @@ -61,11 +62,19 @@ CHIP_ERROR PlatformManagerImpl::_InitChipStack(void) err = Internal::InitLwIPCoreLock(); SuccessOrExit(err); - // Initialize the ESP tcpip adapter. - tcpip_adapter_init(); + err = esp_netif_init(); + SuccessOrExit(err); // Arrange for the ESP event loop to deliver events into the CHIP Device layer. - err = esp_event_loop_init(PlatformManagerImpl::HandleESPSystemEvent, NULL); + err = esp_event_loop_create_default(); + SuccessOrExit(err); + + esp_netif_create_default_wifi_ap(); + esp_netif_create_default_wifi_sta(); + + esp_event_handler_register(WIFI_EVENT, ESP_EVENT_ANY_ID, PlatformManagerImpl::HandleESPSystemEvent, NULL); + SuccessOrExit(err); + esp_event_handler_register(IP_EVENT, ESP_EVENT_ANY_ID, PlatformManagerImpl::HandleESPSystemEvent, NULL); SuccessOrExit(err); // Initialize the ESP WiFi layer. @@ -90,15 +99,77 @@ CHIP_ERROR PlatformManagerImpl::InitLwIPCoreLock(void) return Internal::InitLwIPCoreLock(); } -esp_err_t PlatformManagerImpl::HandleESPSystemEvent(void * ctx, system_event_t * espEvent) +void PlatformManagerImpl::HandleESPSystemEvent(void * arg, esp_event_base_t eventBase, int32_t eventId, void * eventData) { ChipDeviceEvent event; - event.Type = DeviceEventType::kESPSystemEvent; - event.Platform.ESPSystemEvent = *espEvent; + memset(&event, 0, sizeof(event)); + event.Type = DeviceEventType::kESPSystemEvent; + event.Platform.ESPSystemEvent.Base = eventBase; + event.Platform.ESPSystemEvent.Id = eventId; + if (eventBase == IP_EVENT) + { + switch (eventId) + { + case IP_EVENT_STA_GOT_IP: + memcpy(&event.Platform.ESPSystemEvent.Data.IpGotIp, eventData, sizeof(event.Platform.ESPSystemEvent.Data.IpGotIp)); + break; + case IP_EVENT_GOT_IP6: + memcpy(&event.Platform.ESPSystemEvent.Data.IpGotIp6, eventData, sizeof(event.Platform.ESPSystemEvent.Data.IpGotIp6)); + break; + case IP_EVENT_AP_STAIPASSIGNED: + memcpy(&event.Platform.ESPSystemEvent.Data.IpApStaIpAssigned, eventData, + sizeof(event.Platform.ESPSystemEvent.Data.IpApStaIpAssigned)); + break; + default: + break; + } + } + else if (eventBase == WIFI_EVENT) + { + switch (eventId) + { + case WIFI_EVENT_SCAN_DONE: + memcpy(&event.Platform.ESPSystemEvent.Data.WifiStaScanDone, eventData, + sizeof(event.Platform.ESPSystemEvent.Data.WifiStaScanDone)); + break; + case WIFI_EVENT_STA_CONNECTED: + memcpy(&event.Platform.ESPSystemEvent.Data.WifiStaConnected, eventData, + sizeof(event.Platform.ESPSystemEvent.Data.WifiStaConnected)); + break; + case WIFI_EVENT_STA_DISCONNECTED: + memcpy(&event.Platform.ESPSystemEvent.Data.WifiStaDisconnected, eventData, + sizeof(event.Platform.ESPSystemEvent.Data.WifiStaDisconnected)); + break; + case WIFI_EVENT_STA_AUTHMODE_CHANGE: + memcpy(&event.Platform.ESPSystemEvent.Data.WifiStaAuthModeChange, eventData, + sizeof(event.Platform.ESPSystemEvent.Data.WifiStaAuthModeChange)); + break; + case WIFI_EVENT_STA_WPS_ER_PIN: + memcpy(&event.Platform.ESPSystemEvent.Data.WifiStaWpsErPin, eventData, + sizeof(event.Platform.ESPSystemEvent.Data.WifiStaWpsErPin)); + break; + case WIFI_EVENT_STA_WPS_ER_FAILED: + memcpy(&event.Platform.ESPSystemEvent.Data.WifiStaWpsErFailed, eventData, + sizeof(event.Platform.ESPSystemEvent.Data.WifiStaWpsErFailed)); + break; + case WIFI_EVENT_AP_STACONNECTED: + memcpy(&event.Platform.ESPSystemEvent.Data.WifiApStaConnected, eventData, + sizeof(event.Platform.ESPSystemEvent.Data.WifiApStaConnected)); + break; + case WIFI_EVENT_AP_STADISCONNECTED: + memcpy(&event.Platform.ESPSystemEvent.Data.WifiApStaDisconnected, eventData, + sizeof(event.Platform.ESPSystemEvent.Data.WifiApStaDisconnected)); + break; + case WIFI_EVENT_AP_PROBEREQRECVED: + memcpy(&event.Platform.ESPSystemEvent.Data.WifiApProbeReqRecved, eventData, + sizeof(event.Platform.ESPSystemEvent.Data.WifiApProbeReqRecved)); + break; + default: + break; + } + } sInstance.PostEvent(&event); - - return ESP_OK; } } // namespace DeviceLayer diff --git a/src/platform/ESP32/PlatformManagerImpl.h b/src/platform/ESP32/PlatformManagerImpl.h index 6118132b2b4bae..59aa0589951beb 100644 --- a/src/platform/ESP32/PlatformManagerImpl.h +++ b/src/platform/ESP32/PlatformManagerImpl.h @@ -48,7 +48,7 @@ class PlatformManagerImpl final : public PlatformManager, public Internal::Gener // ===== Platform-specific members that may be accessed directly by the application. CHIP_ERROR InitLwIPCoreLock(void); - static esp_err_t HandleESPSystemEvent(void * ctx, system_event_t * event); + static void HandleESPSystemEvent(void * arg, esp_event_base_t eventBase, int32_t eventId, void * eventData); private: // ===== Methods that implement the PlatformManager abstract interface. diff --git a/src/test_driver/esp32/Makefile b/src/test_driver/esp32/Makefile index 4f38d70f9b218a..492561fcbd81f5 100644 --- a/src/test_driver/esp32/Makefile +++ b/src/test_driver/esp32/Makefile @@ -7,6 +7,10 @@ PROJECT_NAME := chip-tests CXXFLAGS += -DCHIP_SUPPORT_FOREIGN_TEST_DRIVERS -DCHIP_TARGET_STYLE_EMBEDDED -Wno-deprecated-declarations +CXXFLAGS += -DLWIP_IPV6_SCOPES=0 +CPPFLAGS += -DLWIP_IPV6_SCOPES=0 +CFLAGS += -DLWIP_IPV6_SCOPES=0 + EXTRA_COMPONENT_DIRS += $(PROJECT_PATH)/third_party/connectedhomeip/config/esp32/components include $(IDF_PATH)/make/project.mk @@ -17,7 +21,7 @@ esp32_elf_builder: all -lnlunit-test $(LDFLAGS) -lnlfaultinjection -o $(PROJECT_PATH)/build/chip-tests.elf -Wl,-Map=$(APP_MAP) > build/chip/esp32_elf_builder.sh echo $(ESPTOOLPY) elf2image $(ESPTOOL_FLASH_OPTIONS) $(ESPTOOL_ELF2IMAGE_OPTIONS) \ -o $(PROJECT_PATH)/build/chip/chip-tests.bin $(PROJECT_PATH)/build/chip-tests.elf >> build/chip/esp32_elf_builder.sh - ln -sf $(PROJECT_PATH)/build/partitions_singleapp.bin $(PROJECT_PATH)/build/chip/partitions_singleapp.bin + ln -sf $(PROJECT_PATH)/build/partitions.bin $(PROJECT_PATH)/build/chip/partitions.bin mkdir -p build/chip/bootloader - ln -sf $(PROJECT_PATH)/build/bootloader/bootloader.bin $(PROJECT_PATH)/build/chip/bootloader/bootloader.bin + ln -sf $(PROJECT_PATH)/build/bootloader/bootloader.bin $(PROJECT_PATH)/build/chip/bootloader.bin ln -sf $(PROJECT_PATH)/idf.sh $(PROJECT_PATH)/build/chip/env.sh diff --git a/src/test_driver/esp32/README.md b/src/test_driver/esp32/README.md index 2f28e7461d74bf..58c9299d9b1541 100644 --- a/src/test_driver/esp32/README.md +++ b/src/test_driver/esp32/README.md @@ -29,13 +29,13 @@ The `chip-build` Docker container and VSCode devcontainer has these components pre-installed, so you can skip this step. To install these components manually, follow these steps: -- Clone the Expressif ESP-IDF and checkout version 4.0 +- Clone the Espressif ESP-IDF and checkout release tag v4.1 $ mkdir -p ${HOME}/tools $ cd ${HOME}/tools $ git clone https://github.com/espressif/esp-idf.git $ cd esp-idf - $ git checkout release/v4.0 + $ git checkout tags/v4.1 $ git submodule update --init $ export IDF_PATH=${HOME}/tools/esp-idf $ ./install.sh diff --git a/src/test_driver/esp32/idf.sh b/src/test_driver/esp32/idf.sh old mode 100644 new mode 100755 diff --git a/src/test_driver/esp32/main/main_app.cpp b/src/test_driver/esp32/main/main_app.cpp index 1f4df72f7b7b69..ea54197fee6874 100644 --- a/src/test_driver/esp32/main/main_app.cpp +++ b/src/test_driver/esp32/main/main_app.cpp @@ -15,16 +15,17 @@ * limitations under the License. */ -#include "esp_event_loop.h" +#include "esp_event.h" #include "esp_heap_caps_init.h" #include "esp_log.h" +#include "esp_netif.h" #include "esp_spi_flash.h" #include "esp_system.h" +#include "esp_wifi.h" #include "freertos/FreeRTOS.h" #include "freertos/task.h" #include "nvs_flash.h" -#include "tcpip_adapter.h" #include #include @@ -89,14 +90,33 @@ extern "C" void app_main() exit(err); } - // Initialize the ESP tcpip adapter. - tcpip_adapter_init(); + err = esp_netif_init(); + if (err != CHIP_NO_ERROR) + { + ESP_LOGE(TAG, "esp_netif_init() failed: %s", ErrorStr(err)); + exit(err); + } // Arrange for the ESP event loop to deliver events into the CHIP Device layer. - err = esp_event_loop_init(PlatformManagerImpl::HandleESPSystemEvent, NULL); + err = esp_event_loop_create_default(); + if (err != CHIP_NO_ERROR) + { + ESP_LOGE(TAG, "esp_event_loop_create_default() failed: %s", ErrorStr(err)); + exit(err); + } + esp_netif_create_default_wifi_ap(); + esp_netif_create_default_wifi_sta(); + + err = esp_event_handler_register(WIFI_EVENT, ESP_EVENT_ANY_ID, PlatformManagerImpl::HandleESPSystemEvent, NULL); + if (err != CHIP_NO_ERROR) + { + ESP_LOGE(TAG, "esp_event_handler_register() failed for WIFI_EVENT: %s", ErrorStr(err)); + exit(err); + } + err = esp_event_handler_register(IP_EVENT, ESP_EVENT_ANY_ID, PlatformManagerImpl::HandleESPSystemEvent, NULL); if (err != CHIP_NO_ERROR) { - ESP_LOGE(TAG, "esp_event_loop_init() failed: %s", ErrorStr(err)); + ESP_LOGE(TAG, "esp_event_handler_register() failed for IP_EVENT: %s", ErrorStr(err)); exit(err); } diff --git a/src/test_driver/esp32/partitions.csv b/src/test_driver/esp32/partitions.csv new file mode 100644 index 00000000000000..bc29369a86ba1f --- /dev/null +++ b/src/test_driver/esp32/partitions.csv @@ -0,0 +1,25 @@ +# +# Copyright (c) 2020 Project CHIP Authors +# All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Description: +# Some useful defaults for the demo app configuration. +# + +# ESP-IDF Partition Table +# Name, Type, SubType, Offset, Size, Flags +nvs, data, nvs, 0x9000, 0x6000, +phy_init, data, phy, 0xf000, 0x1000, +factory, app, factory, 0x10000, 1984K, diff --git a/src/test_driver/esp32/qemu_setup.sh b/src/test_driver/esp32/qemu_setup.sh index d7eff4967d598b..fac58a636271d7 100755 --- a/src/test_driver/esp32/qemu_setup.sh +++ b/src/test_driver/esp32/qemu_setup.sh @@ -37,4 +37,4 @@ cd "$here" || die 'ack!, where am I?!?' source idf.sh rm -f ./build/sdkconfig SDKCONFIG=./build/sdkconfig SDKCONFIG_DEFAULTS=sdkconfig_qemu.defaults idf make defconfig -SDKCONFIG=./build/sdkconfig idf make esp32_elf_builder +SDKCONFIG=./build/sdkconfig idf make -j8 esp32_elf_builder diff --git a/src/test_driver/esp32/sdkconfig_qemu.defaults b/src/test_driver/esp32/sdkconfig_qemu.defaults index 95fc3a69ad41e2..cfce44fe4d4d2b 100644 --- a/src/test_driver/esp32/sdkconfig_qemu.defaults +++ b/src/test_driver/esp32/sdkconfig_qemu.defaults @@ -34,5 +34,9 @@ CONFIG_ESP_MAIN_TASK_STACK_SIZE=32768 CONFIG_ESP32_PANIC_PRINT_REBOOT=y CONFIG_ESP32_PANIC_PRINT_HALT=n -#enable BT +# enable BT CONFIG_BT_ENABLED=y + +# Use a custom partition table +CONFIG_PARTITION_TABLE_CUSTOM=y +CONFIG_PARTITION_TABLE_FILENAME="partitions.csv"