diff --git a/examples/lighting-app/esp32/sdkconfig_s3devkit.defaults b/examples/lighting-app/esp32/sdkconfig_s3devkit.defaults new file mode 100644 index 00000000000000..eec0f9e8d82a41 --- /dev/null +++ b/examples/lighting-app/esp32/sdkconfig_s3devkit.defaults @@ -0,0 +1,47 @@ +# +# Copyright (c) 2020 Project CHIP Authors +# Copyright (c) 2018 Nest Labs, Inc. +# 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: +# CI uses this to select the ESP32S3-DevKitM. +# +CONFIG_IDF_TARGET="esp32s3" + +# Default to 921600 baud when flashing and monitoring device +CONFIG_ESPTOOLPY_BAUD_921600B=y +CONFIG_ESPTOOLPY_BAUD=921600 +CONFIG_ESPTOOLPY_COMPRESSED=y +CONFIG_ESPTOOLPY_MONITOR_BAUD_115200B=y +CONFIG_ESPTOOLPY_MONITOR_BAUD=115200 + +#enable BT +CONFIG_BT_ENABLED=y +CONFIG_BT_NIMBLE_ENABLED=y + +#enable lwip ipv6 autoconfig +CONFIG_LWIP_IPV6_AUTOCONFIG=y + +# Use a custom partition table +CONFIG_PARTITION_TABLE_CUSTOM=y +CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="partitions.csv" + +#enable lwIP route hooks +CONFIG_LWIP_HOOK_IP6_ROUTE_DEFAULT=y +CONFIG_LWIP_HOOK_ND6_GET_GW_DEFAULT=y + +# Serial Flasher config +CONFIG_ESPTOOLPY_FLASHSIZE_4MB=y +CONFIG_ESPTOOLPY_FLASHSIZE="4MB" diff --git a/scripts/build/build/targets.py b/scripts/build/build/targets.py index e7d87bd84cfca4..d849111d0a7968 100644 --- a/scripts/build/build/targets.py +++ b/scripts/build/build/targets.py @@ -211,12 +211,14 @@ def Esp32Targets(): yield esp32_target.Extend('m5stack-all-clusters-rpc-ipv6only', board=Esp32Board.M5Stack, app=Esp32App.ALL_CLUSTERS, enable_rpcs=True, enable_ipv4=False) yield esp32_target.Extend('c3devkit-all-clusters', board=Esp32Board.C3DevKit, app=Esp32App.ALL_CLUSTERS) + yield esp32_target.Extend('s3devkit-light', board=Esp32Board.S3Devkit, app=Esp32App.LIGHT) devkitc = esp32_target.Extend('devkitc', board=Esp32Board.DevKitC) yield devkitc.Extend('all-clusters', app=Esp32App.ALL_CLUSTERS) yield devkitc.Extend('all-clusters-ipv6only', app=Esp32App.ALL_CLUSTERS, enable_ipv4=False) yield devkitc.Extend('shell', app=Esp32App.SHELL) + yield devkitc.Extend('light', app=Esp32App.LIGHT) yield devkitc.Extend('lock', app=Esp32App.LOCK) yield devkitc.Extend('bridge', app=Esp32App.BRIDGE) yield devkitc.Extend('temperature-measurement', app=Esp32App.TEMPERATURE_MEASUREMENT) diff --git a/scripts/build/builders/esp32.py b/scripts/build/builders/esp32.py index e99ab8e291b1b7..9cc2693d3b4dd7 100644 --- a/scripts/build/builders/esp32.py +++ b/scripts/build/builders/esp32.py @@ -25,11 +25,13 @@ class Esp32Board(Enum): DevKitC = auto() M5Stack = auto() C3DevKit = auto() + S3Devkit = auto() QEMU = auto() class Esp32App(Enum): ALL_CLUSTERS = auto() + LIGHT = auto() LOCK = auto() SHELL = auto() BRIDGE = auto() @@ -40,6 +42,8 @@ class Esp32App(Enum): def ExamplePath(self): if self == Esp32App.ALL_CLUSTERS: return 'examples/all-clusters-app' + elif self == Esp32App.LIGHT: + return 'examples/lighting-app' elif self == Esp32App.LOCK: return 'examples/lock-app' elif self == Esp32App.SHELL: @@ -57,6 +61,8 @@ def ExamplePath(self): def AppNamePrefix(self): if self == Esp32App.ALL_CLUSTERS: return 'chip-all-clusters-app' + elif self == Esp32App.LIGHT: + return 'chip-lighting-app' elif self == Esp32App.LOCK: return 'chip-lock-app' elif self == Esp32App.SHELL: @@ -84,6 +90,8 @@ def IsCompatible(self, board: Esp32Board): return self == Esp32App.ALL_CLUSTERS elif board == Esp32Board.C3DevKit: return self == Esp32App.ALL_CLUSTERS + elif board == Esp32Board.S3DevKit: + return self == Esp32App.LIGHT else: return (board == Esp32Board.DevKitC) and (self != Esp32App.TESTS) @@ -101,6 +109,8 @@ def DefaultsFileName(board: Esp32Board, app: Esp32App, enable_rpcs: bool): return 'sdkconfig_m5stack{}.defaults'.format(rpc) elif board == Esp32Board.C3DevKit: return 'sdkconfig_c3devkit{}.defaults'.format(rpc) + elif board == Esp32Board.S3DevKit: + return 'sdkconfig_s3devkit{}.defaults'.format(rpc) else: raise Exception('Unknown board type') diff --git a/scripts/build/testdata/all_targets_except_host.txt b/scripts/build/testdata/all_targets_except_host.txt index 49e67f381a020d..2562225e5588bc 100644 --- a/scripts/build/testdata/all_targets_except_host.txt +++ b/scripts/build/testdata/all_targets_except_host.txt @@ -60,9 +60,11 @@ efr32-brd4304a-lock (NOGLOB: only user requested) efr32-brd4304a-lock-rpc (NOGLOB: only user requested) efr32-brd4304a-unit-test (NOGLOB: only user requested) efr32-brd4304a-window-covering (NOGLOB: only user requested) +esp32-s3devkit-light esp32-c3devkit-all-clusters esp32-devkitc-all-clusters esp32-devkitc-all-clusters-ipv6only +esp32-devkitc-light esp32-devkitc-bridge esp32-devkitc-lock esp32-devkitc-shell diff --git a/scripts/build/testdata/build_all_except_host.txt b/scripts/build/testdata/build_all_except_host.txt index 349750e4921865..83e21a2f25eb7c 100644 --- a/scripts/build/testdata/build_all_except_host.txt +++ b/scripts/build/testdata/build_all_except_host.txt @@ -286,6 +286,17 @@ gn gen --check --fail-on-unused-args --export-compile-commands --root={root}/src # Generating efr32-brd4304a-window-covering gn gen --check --fail-on-unused-args --export-compile-commands --root={root}/examples/window-app/efr32 '--args=efr32_board="BRD4304A"' {out}/efr32-brd4304a-window-covering +# Generating esp32-s3devkit-light +mkdir -p {out}/esp32-s3devkit-light + +cp examples/lighting-app/esp32/sdkconfig_s3devkit.defaults {out}/esp32-s3devkit-light/sdkconfig.defaults + +rm -f examples/lighting-app/esp32/sdkconfig + +bash -c 'source $IDF_PATH/export.sh; source scripts/activate.sh; +export SDKCONFIG_DEFAULTS={out}/esp32-s3devkit-light/sdkconfig.defaults +idf.py -C examples/lighting-app/esp32 -B {out}/esp32-s3devkit-light reconfigure' + # Generating esp32-c3devkit-all-clusters mkdir -p {out}/esp32-c3devkit-all-clusters @@ -332,6 +343,17 @@ bash -c 'source $IDF_PATH/export.sh; source scripts/activate.sh; export SDKCONFIG_DEFAULTS={out}/esp32-devkitc-bridge/sdkconfig.defaults idf.py -C examples/bridge-app/esp32 -B {out}/esp32-devkitc-bridge reconfigure' +# Generating esp32-devkitc-light +mkdir -p {out}/esp32-devkitc-light + +cp examples/lighting-app/esp32/sdkconfig.defaults {out}/esp32-devkitc-light/sdkconfig.defaults + +rm -f examples/lighting-app/esp32/sdkconfig + +bash -c 'source $IDF_PATH/export.sh; source scripts/activate.sh; +export SDKCONFIG_DEFAULTS={out}/esp32-devkitc-light/sdkconfig.defaults +idf.py -C examples/lighting-app/esp32 -B {out}/esp32-devkitc-light reconfigure' + # Generating esp32-devkitc-lock mkdir -p {out}/esp32-devkitc-lock