Skip to content

Commit

Permalink
Add esp32 flash script generation on more apps, update example_build (#…
Browse files Browse the repository at this point in the history
…8813)

* Add flash script to esp32 lock app

* Add C3devkit for esp32 boars compilation targets, added shell and flash bundle for esp32 shell

* Add bridge app compilation, fix filename in shell app for esp32 builds

* Add gitignore for esp32 bridgeapp - SDK config is modified at build time

* Add newline at end  of cmake files

* Add build to gitignore
  • Loading branch information
andy31415 authored and pull[bot] committed Aug 31, 2021
1 parent a610c33 commit 5610149
Show file tree
Hide file tree
Showing 7 changed files with 35 additions and 0 deletions.
3 changes: 3 additions & 0 deletions examples/bridge-app/esp32/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
/build/
/sdkconfig
/sdkconfig.old
4 changes: 4 additions & 0 deletions examples/bridge-app/esp32/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

cmake_minimum_required(VERSION 3.5)
include($ENV{IDF_PATH}/tools/cmake/project.cmake)
include(${CMAKE_CURRENT_LIST_DIR}/../../common/cmake/idf_flashing.cmake)

set(EXTRA_COMPONENT_DIRS
"${CMAKE_CURRENT_LIST_DIR}/third_party/connectedhomeip/config/esp32/components"
Expand All @@ -25,3 +26,6 @@ set(EXTRA_COMPONENT_DIRS
project(chip-bridge-app)
idf_build_set_property(CXX_COMPILE_OPTIONS "-std=gnu++14;-Os;-DLWIP_IPV6_SCOPES=0;-DCHIP_HAVE_CONFIG_H;-DDYNAMIC_ENDPOINT_COUNT=16" APPEND)
idf_build_set_property(C_COMPILE_OPTIONS "-Os;-DLWIP_IPV6_SCOPES=0" APPEND)

flashing_script()

4 changes: 4 additions & 0 deletions examples/lock-app/esp32/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
# CMakeLists in this exact order for cmake to work correctly
cmake_minimum_required(VERSION 3.5)
include($ENV{IDF_PATH}/tools/cmake/project.cmake)
include(${CMAKE_CURRENT_LIST_DIR}/../../common/cmake/idf_flashing.cmake)

set(EXTRA_COMPONENT_DIRS
"${CMAKE_CURRENT_LIST_DIR}/third_party/connectedhomeip/config/esp32/components"
Expand Down Expand Up @@ -45,3 +46,6 @@ list(REMOVE_ITEM _target_cxx_flags $<$<COMPILE_LANGUAGE:CXX>:-std=c++17>)
list(APPEND _target_cxx_flags $<$<COMPILE_LANGUAGE:CXX>:-std=gnu++17>)
set_target_properties(pw_build.cpp17 PROPERTIES INTERFACE_COMPILE_OPTIONS "${_target_cxx_flags}")
endif(CONFIG_ENABLE_PW_RPC)

flashing_script()

4 changes: 4 additions & 0 deletions examples/shell/esp32/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
# CMakeLists in this exact order for cmake to work correctly
cmake_minimum_required(VERSION 3.5)
include($ENV{IDF_PATH}/tools/cmake/project.cmake)
include(${CMAKE_CURRENT_LIST_DIR}/../../common/cmake/idf_flashing.cmake)

set(EXTRA_COMPONENT_DIRS
${CMAKE_CURRENT_LIST_DIR}/third_party/connectedhomeip/config/esp32/components
Expand All @@ -26,3 +27,6 @@ set(EXTRA_COMPONENT_DIRS
project(chip-shell)
idf_build_set_property(CXX_COMPILE_OPTIONS "-std=gnu++14;-Os;-DLWIP_IPV6_SCOPES=0;-DCHIP_HAVE_CONFIG_H" APPEND)
idf_build_set_property(C_COMPILE_OPTIONS "-Os;-DLWIP_IPV6_SCOPES=0" APPEND)

flashing_script()

5 changes: 5 additions & 0 deletions scripts/build/build/factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,10 +94,15 @@ def Create(self, runner, __board_key: Board, __app_key: Application,

_MATCHERS[Platform.ESP32].AcceptBoard(Board.DEVKITC, board=Esp32Board.DevKitC)
_MATCHERS[Platform.ESP32].AcceptBoard(Board.M5STACK, board=Esp32Board.M5Stack)
_MATCHERS[Platform.ESP32].AcceptBoard(Board.C3DEVKIT, board=Esp32Board.C3DevKit)
_MATCHERS[Platform.ESP32].AcceptApplication(
Application.ALL_CLUSTERS, app=Esp32App.ALL_CLUSTERS)
_MATCHERS[Platform.ESP32].AcceptApplicationForBoard(
Application.SHELL, Board.DEVKITC, app=Esp32App.SHELL)
_MATCHERS[Platform.ESP32].AcceptApplicationForBoard(
Application.LOCK, Board.DEVKITC, app=Esp32App.LOCK)
_MATCHERS[Platform.ESP32].AcceptApplicationForBoard(
Application.BRIDGE, Board.DEVKITC, app=Esp32App.BRIDGE)

_MATCHERS[Platform.QPG].AcceptApplication(Application.LOCK)
_MATCHERS[Platform.QPG].AcceptBoard(Board.QPG6100)
Expand Down
2 changes: 2 additions & 0 deletions scripts/build/build/targets.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ class Board(IntEnum):
# ESP32 platform
M5STACK = auto()
DEVKITC = auto()
C3DEVKIT = auto()

# EFR32 platform
BRD4161A = auto()
Expand Down Expand Up @@ -78,6 +79,7 @@ class Application(IntEnum):
WINDOW_COVERING = auto()
SHELL = auto()
CHIP_TOOL = auto()
BRIDGE = auto()

@property
def ArgName(self):
Expand Down
13 changes: 13 additions & 0 deletions scripts/build/builders/esp32.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,18 +24,25 @@
class Esp32Board(Enum):
DevKitC = auto()
M5Stack = auto()
C3DevKit = auto()


class Esp32App(Enum):
ALL_CLUSTERS = auto()
LOCK = auto()
SHELL = auto()
BRIDGE = auto()

@property
def ExampleName(self):
if self == Esp32App.ALL_CLUSTERS:
return 'all-clusters-app'
elif self == Esp32App.LOCK:
return 'lock-app'
elif self == Esp32App.SHELL:
return 'shell'
elif self == Esp32App.BRIDGE:
return 'bridge-app'
else:
raise Exception('Unknown app type: %r' % self)

Expand All @@ -45,6 +52,10 @@ def AppNamePrefix(self):
return 'chip-all-clusters-app'
elif self == Esp32App.LOCK:
return 'chip-lock-app'
elif self == Esp32App.SHELL:
return 'chip-shell'
elif self == Esp32App.BRIDGE:
return 'chip-bridge-app'
else:
raise Exception('Unknown app type: %r' % self)

Expand All @@ -58,6 +69,8 @@ def DefaultsFileName(board: Esp32Board, app: Esp32App):
return 'sdkconfig.defaults'
elif board == Esp32Board.M5Stack:
return 'sdkconfig_m5stack.defaults'
elif board == Esp32Board.C3DevKit:
return 'sdkconfig_c3devkit.defaults'
else:
raise Exception('Unknown board type')

Expand Down

0 comments on commit 5610149

Please sign in to comment.