forked from project-chip/connectedhomeip
-
Notifications
You must be signed in to change notification settings - Fork 46
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Pull request project-chip#175: Cherry-Pick lite-light example from si…
…labs to silabs_1.0 Merge in WMN_TOOLS/matter from cherry-pick/lite-light to silabs_1.0 Squashed commit of the following: commit 563d97e2849488266acb2d9414ed79d2a2fe415c Author: Rehan Rasool <rehan.rasool@silabs.com> Date: Mon Oct 10 13:34:14 2022 -0400 Add old bluetooth header to fix lighting-lite-app compilation -- same header is used in other examples on 1.0 branch commit 04204a07beef3dde113aa8b8e012898ad5c6c17a Author: Rehan Rasool <rehan.rasool@silabs.com> Date: Mon Oct 10 13:18:17 2022 -0400 Apply changes from c84abce to lighting-lite-app: update build.gn of silabs_examples to keep up with upstream changes commit 7abb556e4d5ccf471b13c49974a399bf632a8062 Author: Mathieu Kardous <Mathieu.Kardous@silabs.com> Date: Fri Oct 7 19:36:19 2022 +0000 Pull request project-chip#166: Add lite light to Jenkinsfile Merge in WMN_TOOLS/matter from feature/add_lite_light to silabs Squashed commit of the following: commit 5f440ac92c3df57dbbb115ad8f49e1f4b0bd3b58 Author: Mathieu Kardous <mathieu.kardous@silabs.com> Date: Fri Oct 7 14:04:53 2022 -0400 Remove old ble header commit af7adb6fcc9962973d44e9382229b52206a19f31 Author: Mathieu Kardous <mathieu.kardous@silabs.com> Date: Fri Oct 7 13:10:55 2022 -0400 Fix lite light commit 966e3ce925c1993869c8b3f69e6c0ff205040759 Author: Mathieu Kardous <mathieu.kardous@silabs.com> Date: Fri Oct 7 12:26:32 2022 -0400 Add lite light to Jenkinsfile ... and 1 more commit
- Loading branch information
Showing
36 changed files
with
17,591 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# Copyright (c) 2020 Project CHIP Authors | ||
# | ||
# 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. | ||
|
||
import("//build_overrides/build.gni") | ||
|
||
# The location of the build configuration file. | ||
buildconfig = "${build_root}/config/BUILDCONFIG.gn" | ||
|
||
# CHIP uses angle bracket includes. | ||
check_system_includes = true | ||
|
||
default_args = { | ||
target_cpu = "arm" | ||
target_os = "freertos" | ||
import("//args.gni") | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,365 @@ | ||
# Copyright (c) 2020 Project CHIP Authors | ||
# | ||
# 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. | ||
|
||
import("//build_overrides/build.gni") | ||
import("//build_overrides/chip.gni") | ||
import("//build_overrides/efr32_sdk.gni") | ||
import("//build_overrides/pigweed.gni") | ||
|
||
import("${build_root}/config/defaults.gni") | ||
import("${efr32_sdk_build_root}/efr32_executable.gni") | ||
import("${efr32_sdk_build_root}/efr32_sdk.gni") | ||
|
||
import("${chip_root}/examples/common/pigweed/pigweed_rpcs.gni") | ||
import("${chip_root}/src/platform/device.gni") | ||
|
||
if (chip_enable_pw_rpc) { | ||
import("//build_overrides/pigweed.gni") | ||
import("$dir_pw_build/target_types.gni") | ||
} | ||
|
||
assert(current_os == "freertos") | ||
|
||
efr32_project_dir = "${chip_root}/silabs_examples/lighting-lite-app/efr32" | ||
examples_plat_dir = "${chip_root}/examples/platform/efr32" | ||
|
||
declare_args() { | ||
# Dump memory usage at link time. | ||
chip_print_memory_usage = false | ||
|
||
# Monitor & log memory usage at runtime. | ||
enable_heap_monitoring = false | ||
|
||
# Enable Sleepy end device | ||
enable_sleepy_device = false | ||
|
||
# OTA timeout in seconds | ||
OTA_periodic_query_timeout = 86400 | ||
|
||
# Wifi related stuff - they are overridden by gn -args="use_wf200=true" | ||
use_wf200 = false | ||
use_rs911x = false | ||
use_rs911x_sockets = false | ||
sl_wfx_config_softap = false | ||
sl_wfx_config_scan = true | ||
|
||
# Disable LCD on supported devices | ||
disable_lcd = false | ||
|
||
# Argument to Disable IPv4 for wifi(rs911) | ||
chip_enable_wifi_ipv4 = false | ||
|
||
# Argument to force enable WPA3 security on rs91x | ||
rs91x_wpa3_only = false | ||
|
||
} | ||
|
||
declare_args() { | ||
# Enables LCD Qr Code on supported devices | ||
show_qr_code = !disable_lcd | ||
} | ||
|
||
# qr code cannot be true if lcd is disabled | ||
assert(!(disable_lcd && show_qr_code)) | ||
|
||
# Sanity check | ||
assert(!(chip_enable_wifi && chip_enable_openthread)) | ||
assert(!(use_rs911x && chip_enable_openthread)) | ||
assert(!(use_wf200 && chip_enable_openthread)) | ||
if (chip_enable_wifi) { | ||
assert(use_rs911x || use_wf200) | ||
enable_openthread_cli = false | ||
} | ||
|
||
# ThunderBoards, Explorer Kit and MGM240L do not support LCD (No LCD) | ||
if (silabs_board == "BRD4166A" || silabs_board == "BRD2601B" || | ||
silabs_board == "BRD2703A" || silabs_board == "BRD4319A") { | ||
show_qr_code = false | ||
disable_lcd = true | ||
} | ||
|
||
# WiFi settings | ||
if (chip_enable_wifi) { | ||
# disabling LCD for MG24 for wifi | ||
if (silabs_board == "BRD4186A" || silabs_board == "BRD4187A") { | ||
show_qr_code = false | ||
disable_lcd = true | ||
} | ||
wifi_sdk_dir = "${chip_root}/src/platform/EFR32/wifi" | ||
efr32_lwip_defs = [ "LWIP_NETIF_API=1" ] | ||
efr32_lwip_defs += [ | ||
"LWIP_IPV4=1", | ||
"LWIP_ARP=1", | ||
"LWIP_ICMP=1", | ||
"LWIP_DHCP=1", | ||
"LWIP_IPV6_ND=1", | ||
"LWIP_IGMP=1", | ||
] | ||
|
||
if (use_rs911x) { | ||
wiseconnect_sdk_root = | ||
"${chip_root}/third_party/silabs/wiseconnect-wifi-bt-sdk" | ||
import("${examples_plat_dir}/rs911x/rs911x.gni") | ||
} else { | ||
import("${examples_plat_dir}/wf200/wf200.gni") | ||
} | ||
} | ||
|
||
efr32_sdk("sdk") { | ||
sources = [ | ||
"${efr32_project_dir}/include/CHIPProjectConfig.h", | ||
"${examples_plat_dir}/FreeRTOSConfig.h", | ||
] | ||
|
||
include_dirs = [ | ||
"${chip_root}/src/platform/EFR32", | ||
"${efr32_project_dir}/include", | ||
"${examples_plat_dir}", | ||
"${chip_root}/src/lib", | ||
] | ||
|
||
defines = [ | ||
"BOARD_ID=${silabs_board}", | ||
"OTA_PERIODIC_TIMEOUT=${OTA_periodic_query_timeout}", | ||
] | ||
|
||
if (chip_enable_pw_rpc) { | ||
defines += [ | ||
"HAL_VCOM_ENABLE=1", | ||
"PW_RPC_ENABLED", | ||
] | ||
} | ||
|
||
# WiFi Settings | ||
if (chip_enable_wifi) { | ||
if (use_rs911x) { | ||
defines += rs911x_defs | ||
include_dirs += rs911x_plat_incs | ||
} else if (use_wf200) { | ||
defines += wf200_defs | ||
include_dirs += wf200_plat_incs | ||
} | ||
|
||
if (use_rs911x_sockets) { | ||
include_dirs += [ "${examples_plat_dir}/wifi/rsi-sockets" ] | ||
defines += rs911x_sock_defs | ||
} else { | ||
# Using LWIP instead of the native TCP/IP stack | ||
defines += efr32_lwip_defs | ||
} | ||
|
||
if (sl_wfx_config_softap) { | ||
defines += [ "SL_WFX_CONFIG_SOFTAP" ] | ||
} | ||
if (sl_wfx_config_scan) { | ||
defines += [ "SL_WFX_CONFIG_SCAN" ] | ||
} | ||
} | ||
} | ||
|
||
efr32_executable("lighting-lite_app") { | ||
output_name = "chip-efr32-lighting-lite-example.out" | ||
include_dirs = [ "include" ] | ||
defines = [] | ||
|
||
sources = [ | ||
"${examples_plat_dir}/BaseApplication.cpp", | ||
"${examples_plat_dir}/efr32_utils.cpp", | ||
"${examples_plat_dir}/heap_4_silabs.c", | ||
"${examples_plat_dir}/init_efrPlatform.cpp", | ||
"${examples_plat_dir}/matter_config.cpp", | ||
"src/AppTask.cpp", | ||
"src/LightingManager.cpp", | ||
"src/ZclCallbacks.cpp", | ||
"src/main.cpp", | ||
] | ||
|
||
if (use_wstk_leds) { | ||
sources += [ "${examples_plat_dir}/LEDWidget.cpp" ] | ||
} | ||
|
||
if (chip_enable_pw_rpc || chip_build_libshell || enable_openthread_cli || | ||
use_wf200 || use_rs911x) { | ||
sources += [ "${examples_plat_dir}/uart.cpp" ] | ||
} | ||
|
||
deps = [ | ||
":sdk", | ||
"${chip_root}/silabs_examples/lighting-lite-app/lighting-lite-common", | ||
"${chip_root}/examples/providers:device_info_provider", | ||
"${chip_root}/src/lib", | ||
"${chip_root}/src/setup_payload", | ||
] | ||
|
||
# OpenThread Settings | ||
if (chip_enable_openthread) { | ||
deps += [ | ||
"${chip_root}/third_party/openthread:openthread", | ||
"${chip_root}/third_party/openthread:openthread-platform", | ||
"${examples_plat_dir}:efr-matter-shell", | ||
] | ||
} | ||
|
||
if (chip_enable_ota_requestor) { | ||
defines += [ "EFR32_OTA_ENABLED" ] | ||
sources += [ "${examples_plat_dir}/OTAConfig.cpp" ] | ||
} | ||
|
||
# WiFi Settings | ||
if (chip_enable_wifi) { | ||
if (use_rs911x) { | ||
sources += rs911x_src_plat | ||
|
||
# All the stuff from wiseconnect | ||
sources += rs911x_src_sapi | ||
|
||
# Apparently - the rsi library needs this (though we may not use use it) | ||
sources += rs911x_src_sock | ||
include_dirs += rs911x_inc_plat | ||
|
||
if (use_rs911x_sockets) { | ||
# | ||
# Using native sockets inside RS911x | ||
# | ||
include_dirs += rs911x_sock_inc | ||
} else { | ||
# | ||
# We use LWIP - not built-in sockets | ||
# | ||
sources += rs911x_src_lwip | ||
} | ||
} else if (use_wf200) { | ||
sources += wf200_plat_src | ||
include_dirs += wf200_plat_incs | ||
} | ||
|
||
if (chip_enable_wifi_ipv4) { | ||
defines += [ "CHIP_DEVICE_CONFIG_ENABLE_IPV4" ] | ||
} | ||
|
||
if (rs91x_wpa3_only) { | ||
# TODO: Change this macro once WF200 support is provided | ||
defines += [ "WIFI_ENABLE_SECURITY_WPA3=1" ] | ||
} | ||
} | ||
|
||
if (!disable_lcd) { | ||
sources += [ | ||
"${examples_plat_dir}/display/demo-ui.c", | ||
"${examples_plat_dir}/display/lcd.cpp", | ||
] | ||
|
||
include_dirs += [ "${examples_plat_dir}/display" ] | ||
defines += [ | ||
"DISPLAY_ENABLED", | ||
"IS_DEMO_LIGHT=1", | ||
] | ||
if (show_qr_code) { | ||
defines += [ "QR_CODE_ENABLED" ] | ||
|
||
deps += [ "${chip_root}/examples/common/QRCode" ] | ||
} | ||
} | ||
|
||
if (chip_enable_pw_rpc) { | ||
defines += [ | ||
"PW_RPC_ENABLED", | ||
"PW_RPC_ATTRIBUTE_SERVICE=1", | ||
"PW_RPC_BUTTON_SERVICE=1", | ||
"PW_RPC_DESCRIPTOR_SERVICE=1", | ||
"PW_RPC_DEVICE_SERVICE=1", | ||
"PW_RPC_LIGHTING_SERVICE=1", | ||
"PW_RPC_OTCLI_SERVICE=1", | ||
"PW_RPC_THREAD_SERVICE=1", | ||
"PW_RPC_TRACING_SERVICE=1", | ||
] | ||
|
||
sources += [ | ||
"${chip_root}/examples/common/pigweed/RpcService.cpp", | ||
"${chip_root}/examples/common/pigweed/efr32/PigweedLoggerMutex.cpp", | ||
"${examples_plat_dir}/PigweedLogger.cpp", | ||
"${examples_plat_dir}/Rpc.cpp", | ||
] | ||
|
||
deps += [ | ||
"$dir_pw_hdlc:rpc_channel_output", | ||
"$dir_pw_stream:sys_io_stream", | ||
"$dir_pw_trace", | ||
"$dir_pw_trace_tokenized", | ||
"$dir_pw_trace_tokenized:trace_rpc_service", | ||
"${chip_root}/config/efr32/lib/pw_rpc:pw_rpc", | ||
"${chip_root}/examples/common/pigweed:attributes_service.nanopb_rpc", | ||
"${chip_root}/examples/common/pigweed:button_service.nanopb_rpc", | ||
"${chip_root}/examples/common/pigweed:descriptor_service.nanopb_rpc", | ||
"${chip_root}/examples/common/pigweed:device_service.nanopb_rpc", | ||
"${chip_root}/examples/common/pigweed:lighting_service.nanopb_rpc", | ||
"${chip_root}/examples/common/pigweed:ot_cli_service.nanopb_rpc", | ||
"${chip_root}/examples/common/pigweed:thread_service.nanopb_rpc", | ||
"${examples_plat_dir}/pw_sys_io:pw_sys_io_efr32", | ||
] | ||
|
||
deps += pw_build_LINK_DEPS | ||
|
||
include_dirs += [ | ||
"${chip_root}/examples/common", | ||
"${chip_root}/examples/common/pigweed/efr32", | ||
] | ||
} | ||
|
||
if (enable_heap_monitoring) { | ||
sources += [ "${examples_plat_dir}/MemMonitoring.cpp" ] | ||
defines += [ "HEAP_MONITORING" ] | ||
} | ||
|
||
ldscript = "${examples_plat_dir}/ldscripts/${silabs_family}.ld" | ||
|
||
inputs = [ ldscript ] | ||
|
||
ldflags = [ "-T" + rebase_path(ldscript, root_build_dir) ] | ||
|
||
if (chip_print_memory_usage) { | ||
ldflags += [ | ||
"-Wl,--print-memory-usage", | ||
"-fstack-usage", | ||
] | ||
} | ||
|
||
# WiFi Settings | ||
if (chip_enable_wifi) { | ||
ldflags += [ | ||
"-Wl,--defsym", | ||
"-Wl,SILABS_WIFI=1", | ||
] | ||
} | ||
|
||
# Attestation Credentials | ||
if (chip_build_platform_attestation_credentials_provider) { | ||
deps += [ "${examples_plat_dir}:efr32-attestation-credentials" ] | ||
} | ||
|
||
# Factory Data Provider | ||
if (use_efr32_factory_data_provider) { | ||
deps += [ "${examples_plat_dir}:efr32-factory-data-provider" ] | ||
} | ||
|
||
output_dir = root_out_dir | ||
} | ||
|
||
group("efr32") { | ||
deps = [ ":lighting-lite_app" ] | ||
} | ||
|
||
group("default") { | ||
deps = [ ":efr32" ] | ||
} |
Oops, something went wrong.