Skip to content

Commit

Permalink
[Silabs] Add a low power build flag to the efr32 build script (projec…
Browse files Browse the repository at this point in the history
…t-chip#23324)

* Add low power flag

* Add variants to python builders

* update hardcoded text file

* Apply Restyler changes
  • Loading branch information
mkardous-silabs authored and zx-zx committed Oct 31, 2022
1 parent c4814da commit 6c3cef0
Show file tree
Hide file tree
Showing 113 changed files with 437 additions and 46 deletions.
3 changes: 0 additions & 3 deletions .gn
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,6 @@ default_args = {
pw_build_PIP_CONSTRAINTS = [ "//scripts/constraints.txt" ]
pw_build_PIP_REQUIREMENTS = [ "//scripts/requirements.txt" ]

# Use the new Python build and merged 'pigweed' Python package.
pw_build_USE_NEW_PYTHON_BUILD = true

# GN target to use for the default Python build venv.
pw_build_PYTHON_BUILD_VENV = "//:matter_build_venv"
}
6 changes: 3 additions & 3 deletions BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ if (current_toolchain != "${dir_pw_toolchain}/default:default") {
"$dir_pw_watch/py",
]

# Matter's in-tree pw_python_package or pw_create_python_source_tree targets.
# Matter's in-tree pw_python_package or pw_python_distribution targets.
_matter_python_packages = [
"//integrations/mobly:chip_mobly",
"//examples/chef",
Expand All @@ -119,7 +119,7 @@ if (current_toolchain != "${dir_pw_toolchain}/default:default") {
source_packages = _matter_python_packages + _pigweed_python_packages
}

pw_internal_pip_install("pip_install_matter_packages") {
pw_python_pip_install("pip_install_matter_packages") {
packages = [ "//examples/common/pigweed/rpc_console:chip_rpc_distribution" ]
}

Expand All @@ -133,7 +133,7 @@ if (current_toolchain != "${dir_pw_toolchain}/default:default") {
}

# These pw_python_package targets will be installed using 'pip install --editable'
pw_internal_pip_install("pip_install_editable_matter_packages") {
pw_python_pip_install("pip_install_editable_matter_packages") {
packages = [
"//integrations/mobly:chip_mobly",
"//examples/chef",
Expand Down
4 changes: 3 additions & 1 deletion build/config/compiler/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,6 @@ config("optimize_default") {
config("disabled_warnings") {
cflags = [
"-Wno-deprecated-declarations",
"-Wno-unknown-warning-option",
"-Wno-maybe-uninitialized",
"-Wno-missing-field-initializers",
"-Wno-unused-parameter",
Expand All @@ -203,6 +202,9 @@ config("disabled_warnings") {
# assert() causes unused variable warnings in release.
cflags += [ "-Wno-unused" ]
}
if (is_clang) {
cflags += [ "-Wno-unknown-warning-option" ]
}
if (!is_clang) {
cflags += [
"-Wno-psabi",
Expand Down
2 changes: 0 additions & 2 deletions config/ameba/args.gni
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
# options are used from examples/.

import("//build_overrides/pigweed.gni")
import("$dir_pw_span/polyfill.gni")

chip_device_platform = "ameba"

Expand All @@ -38,5 +37,4 @@ custom_toolchain = "//third_party/connectedhomeip/config/ameba/toolchain:ameba"

pw_build_PIP_CONSTRAINTS =
[ "//third_party/connectedhomeip/scripts/constraints.txt" ]
pw_span_ENABLE_STD_SPAN_POLYFILL = false
cpp_standard = "c++17"
1 change: 0 additions & 1 deletion config/bouffalolab/bl602/lib/pw_rpc/pw_rpc.gni
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ pw_log_BACKEND = "$dir_pw_log_basic"
pw_assert_BACKEND = "$dir_pw_assert_log"
pw_sys_io_BACKEND =
"${chip_root}/examples/platform/bouffalolab/bl602/pw_sys_io:pw_sys_io_bl602"
pw_span_ENABLE_STD_SPAN_POLYFILL = false

pw_string_CONFIG =
"${chip_root}/config/bouffalolab/bl602/lib/pw_rpc:pw_string_dep"
Expand Down
1 change: 0 additions & 1 deletion config/bouffalolab/bl702/lib/pw_rpc/pw_rpc.gni
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ pw_log_BACKEND = "$dir_pw_log_basic"
pw_assert_BACKEND = "$dir_pw_assert_log"
pw_sys_io_BACKEND =
"${chip_root}/examples/platform/bouffalolab/bl702/pw_sys_io:pw_sys_io_bl702"
pw_span_ENABLE_STD_SPAN_POLYFILL = false

pw_string_CONFIG =
"${chip_root}/config/bouffalolab/bl702/lib/pw_rpc:pw_string_dep"
Expand Down
1 change: 0 additions & 1 deletion config/efr32/lib/pw_rpc/pw_rpc.gni
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ pw_log_BACKEND = "$dir_pw_log_basic"
pw_assert_BACKEND = "$dir_pw_assert_log:check_backend"
pw_sys_io_BACKEND =
"${chip_root}/examples/platform/efr32/pw_sys_io:pw_sys_io_efr32"
pw_span_ENABLE_STD_SPAN_POLYFILL = false

pw_build_LINK_DEPS = [
"$dir_pw_assert:impl",
Expand Down
2 changes: 0 additions & 2 deletions config/esp32/args.gni
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
# Options from standalone-chip.mk that differ from configure defaults. These
# options are used from examples/.
import("//build_overrides/pigweed.gni")
import("$dir_pw_span/polyfill.gni")
chip_device_platform = "esp32"

chip_project_config_include = ""
Expand All @@ -39,4 +38,3 @@ custom_toolchain = "//third_party/connectedhomeip/config/esp32/toolchain:esp32"
# whatever pigweed ships with
pw_build_PIP_CONSTRAINTS =
[ "//third_party/connectedhomeip/scripts/constraints.txt" ]
pw_span_ENABLE_STD_SPAN_POLYFILL = false
1 change: 1 addition & 0 deletions config/mbed/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -410,6 +410,7 @@ target_include_directories(${APP_TARGET} PRIVATE
${PIGWEED_ROOT}/pw_function/public
${PIGWEED_ROOT}/pw_preprocessor/public
${PIGWEED_ROOT}/pw_rpc/system_server/public
${PIGWEED_ROOT}/third_party/fuchsia/repo/sdk
${CHIP_ROOT}/third_party/nanopb/repo

${CHIP_ROOT}/examples/common
Expand Down
1 change: 0 additions & 1 deletion config/mbed/chip-gn/lib/pw_rpc/pw_rpc.gni
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ pw_sys_io_BACKEND =
"${chip_root}/examples/platform/mbed/pw_sys_io:pw_sys_io_mbed"
pw_rpc_system_server_BACKEND =
"${chip_root}/examples/common/pigweed:system_rpc_server"
pw_span_ENABLE_STD_SPAN_POLYFILL = false

pw_build_LINK_DEPS = [
"$dir_pw_assert:impl",
Expand Down
1 change: 0 additions & 1 deletion config/qpg/lib/pw_rpc/pw_rpc.gni
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ import("//build_overrides/pigweed.gni")
pw_log_BACKEND = "$dir_pw_log_basic"
pw_assert_BACKEND = "$dir_pw_assert_log:check_backend"
pw_sys_io_BACKEND = "${chip_root}/examples/platform/qpg/pw_sys_io:pw_sys_io_qpg"
pw_span_ENABLE_STD_SPAN_POLYFILL = false

pw_build_LINK_DEPS = [
"$dir_pw_assert:impl",
Expand Down
1 change: 1 addition & 0 deletions examples/all-clusters-app/ameba/chip_main.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,7 @@ target_link_libraries(${chip_main} PUBLIC
pw_hdlc
pw_log
pw_rpc.server
pw_sys_io
pw_trace_tokenized
pw_trace_tokenized.trace_buffer
pw_trace_tokenized.rpc_service
Expand Down
5 changes: 5 additions & 0 deletions examples/all-clusters-app/cc13x2x7_26x2x7/.gn
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,10 @@ default_args = {
target_cpu = "arm"
target_os = "freertos"

pw_build_PIP_CONSTRAINTS =
[ "//third_party/connectedhomeip/scripts/constraints.txt" ]
pw_build_PIP_REQUIREMENTS =
[ "//third_party/connectedhomeip/scripts/requirements.txt" ]

import("//args.gni")
}
4 changes: 0 additions & 4 deletions examples/all-clusters-app/esp32/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,4 @@ add_subdirectory(third_party/connectedhomeip/third_party/pigweed/repo)
add_subdirectory(third_party/connectedhomeip/third_party/nanopb/repo)
add_subdirectory(third_party/connectedhomeip/examples/platform/esp32/pw_sys_io)

get_target_property(_target_cxx_flags pw_build.cpp17 INTERFACE_COMPILE_OPTIONS)
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)
1 change: 1 addition & 0 deletions examples/all-clusters-app/esp32/main/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,7 @@ target_link_libraries(${COMPONENT_LIB} PUBLIC
pw_hdlc
pw_log
pw_rpc.server
pw_sys_io
pw_trace_tokenized
pw_trace_tokenized.trace_buffer
pw_trace_tokenized.rpc_service
Expand Down
5 changes: 5 additions & 0 deletions examples/all-clusters-app/infineon/psoc6/.gn
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,10 @@ default_args = {
target_cpu = "arm"
target_os = "freertos"

pw_build_PIP_CONSTRAINTS =
[ "//third_party/connectedhomeip/scripts/constraints.txt" ]
pw_build_PIP_REQUIREMENTS =
[ "//third_party/connectedhomeip/scripts/requirements.txt" ]

import("//args.gni")
}
5 changes: 5 additions & 0 deletions examples/all-clusters-app/linux/.gn
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,10 @@ buildconfig = "${build_root}/config/BUILDCONFIG.gn"
check_system_includes = true

default_args = {
pw_build_PIP_CONSTRAINTS =
[ "//third_party/connectedhomeip/scripts/constraints.txt" ]
pw_build_PIP_REQUIREMENTS =
[ "//third_party/connectedhomeip/scripts/requirements.txt" ]

import("//args.gni")
}
5 changes: 5 additions & 0 deletions examples/all-clusters-app/nxp/mw320/.gn
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,10 @@ default_args = {
target_cpu = "arm"
target_os = "freertos"

pw_build_PIP_CONSTRAINTS =
[ "//third_party/connectedhomeip/scripts/constraints.txt" ]
pw_build_PIP_REQUIREMENTS =
[ "//third_party/connectedhomeip/scripts/requirements.txt" ]

import("//args.gni")
}
6 changes: 6 additions & 0 deletions examples/all-clusters-app/tizen/.gn
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,11 @@ check_system_includes = true

default_args = {
target_os = "tizen"

pw_build_PIP_CONSTRAINTS =
[ "//third_party/connectedhomeip/scripts/constraints.txt" ]
pw_build_PIP_REQUIREMENTS =
[ "//third_party/connectedhomeip/scripts/requirements.txt" ]

import("//args.gni")
}
5 changes: 5 additions & 0 deletions examples/all-clusters-minimal-app/cc13x2x7_26x2x7/.gn
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,10 @@ default_args = {
target_cpu = "arm"
target_os = "freertos"

pw_build_PIP_CONSTRAINTS =
[ "//third_party/connectedhomeip/scripts/constraints.txt" ]
pw_build_PIP_REQUIREMENTS =
[ "//third_party/connectedhomeip/scripts/requirements.txt" ]

import("//args.gni")
}
4 changes: 0 additions & 4 deletions examples/all-clusters-minimal-app/esp32/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,4 @@ add_subdirectory(third_party/connectedhomeip/third_party/pigweed/repo)
add_subdirectory(third_party/connectedhomeip/third_party/nanopb/repo)
add_subdirectory(third_party/connectedhomeip/examples/platform/esp32/pw_sys_io)

get_target_property(_target_cxx_flags pw_build.cpp17 INTERFACE_COMPILE_OPTIONS)
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)
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,7 @@ target_link_libraries(${COMPONENT_LIB} PUBLIC
pw_hdlc
pw_log
pw_rpc.server
pw_sys_io
pw_trace_tokenized
pw_trace_tokenized.trace_buffer
pw_trace_tokenized.rpc_service
Expand Down
5 changes: 5 additions & 0 deletions examples/all-clusters-minimal-app/infineon/psoc6/.gn
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,10 @@ default_args = {
target_cpu = "arm"
target_os = "freertos"

pw_build_PIP_CONSTRAINTS =
[ "//third_party/connectedhomeip/scripts/constraints.txt" ]
pw_build_PIP_REQUIREMENTS =
[ "//third_party/connectedhomeip/scripts/requirements.txt" ]

import("//args.gni")
}
5 changes: 5 additions & 0 deletions examples/all-clusters-minimal-app/linux/.gn
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,10 @@ buildconfig = "${build_root}/config/BUILDCONFIG.gn"
check_system_includes = true

default_args = {
pw_build_PIP_CONSTRAINTS =
[ "//third_party/connectedhomeip/scripts/constraints.txt" ]
pw_build_PIP_REQUIREMENTS =
[ "//third_party/connectedhomeip/scripts/requirements.txt" ]

import("//args.gni")
}
6 changes: 6 additions & 0 deletions examples/all-clusters-minimal-app/tizen/.gn
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,11 @@ check_system_includes = true

default_args = {
target_os = "tizen"

pw_build_PIP_CONSTRAINTS =
[ "//third_party/connectedhomeip/scripts/constraints.txt" ]
pw_build_PIP_REQUIREMENTS =
[ "//third_party/connectedhomeip/scripts/requirements.txt" ]

import("//args.gni")
}
5 changes: 5 additions & 0 deletions examples/bridge-app/linux/.gn
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,10 @@ buildconfig = "${build_root}/config/BUILDCONFIG.gn"
check_system_includes = true

default_args = {
pw_build_PIP_CONSTRAINTS =
[ "//third_party/connectedhomeip/scripts/constraints.txt" ]
pw_build_PIP_REQUIREMENTS =
[ "//third_party/connectedhomeip/scripts/requirements.txt" ]

import("//args.gni")
}
7 changes: 4 additions & 3 deletions examples/build_overrides/pigweed_environment.gni
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,11 @@ _bootstrap_root = "//third_party/connectedhomeip"
import("${_bootstrap_root}/build_overrides/pigweed_environment.gni")

# Rebase paths to our root.
dir_cipd_arm = get_path_info("${_bootstrap_root}/${dir_cipd_arm}", "abspath")
dir_cipd_arm =
get_path_info("${_bootstrap_root}/${pw_env_setup_CIPD_ARM}", "abspath")
dir_cipd_pigweed =
get_path_info("${_bootstrap_root}/${dir_cipd_pigweed}", "abspath")
get_path_info("${_bootstrap_root}/${pw_env_setup_CIPD_PIGWEED}", "abspath")
dir_cipd_python =
get_path_info("${_bootstrap_root}/${dir_cipd_python}", "abspath")
get_path_info("${_bootstrap_root}/${pw_env_setup_CIPD_PYTHON}", "abspath")
dir_virtual_env =
get_path_info("${_bootstrap_root}/${pw_env_setup_VIRTUAL_ENV}", "abspath")
6 changes: 6 additions & 0 deletions examples/chef/efr32/.gn
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,11 @@ default_args = {
target_cpu = "arm"
target_os = "freertos"
chip_openthread_ftd = true

pw_build_PIP_CONSTRAINTS =
[ "//third_party/connectedhomeip/scripts/constraints.txt" ]
pw_build_PIP_REQUIREMENTS =
[ "//third_party/connectedhomeip/scripts/requirements.txt" ]

import("//args.gni")
}
1 change: 1 addition & 0 deletions examples/chef/esp32/main/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,7 @@ target_link_libraries(${COMPONENT_LIB} PUBLIC
pw_hdlc
pw_log
pw_rpc.server
pw_sys_io
pw_trace_tokenized
pw_trace_tokenized.trace_buffer
pw_trace_tokenized.rpc_service
Expand Down
5 changes: 5 additions & 0 deletions examples/chef/linux/.gn
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,10 @@ buildconfig = "${build_root}/config/BUILDCONFIG.gn"
check_system_includes = true

default_args = {
pw_build_PIP_CONSTRAINTS =
[ "//third_party/connectedhomeip/scripts/constraints.txt" ]
pw_build_PIP_REQUIREMENTS =
[ "//third_party/connectedhomeip/scripts/requirements.txt" ]

import("//args.gni")
}
7 changes: 6 additions & 1 deletion examples/chef/linux/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,10 @@
# 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_root}/config/compiler/compiler.gni")
import("${chip_root}/build/chip/tools.gni")
import("${chip_root}/src/app/chip_data_model.gni")
import("${chip_root}/src/app/common_flags.gni")
Expand Down Expand Up @@ -92,7 +94,10 @@ executable("${sample_name}") {

deps += pw_build_LINK_DEPS

cflags = [ "-Wno-gnu-designator" ]
cflags = []
if (is_clang) {
cflags += [ "-Wno-gnu-designator" ]
}

include_dirs += [ "${chip_root}/examples/common" ]
} else {
Expand Down
1 change: 0 additions & 1 deletion examples/chef/linux/with_pw_rpc.gni
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ pw_rpc_system_server_BACKEND = "${chip_root}/config/linux/lib/pw_rpc:pw_rpc"
dir_pw_third_party_nanopb = "${chip_root}/third_party/nanopb/repo"
pw_chrono_SYSTEM_CLOCK_BACKEND = "$dir_pw_chrono_stl:system_clock"
pw_sync_MUTEX_BACKEND = "$dir_pw_sync_stl:mutex_backend"
pw_span_ENABLE_STD_SPAN_POLYFILL = false

pw_build_LINK_DEPS = [
"$dir_pw_assert:impl",
Expand Down
1 change: 1 addition & 0 deletions examples/chef/nrfconnect/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,7 @@ target_link_libraries(app PRIVATE
pw_hdlc
pw_log
pw_rpc.server
pw_sys_io
pw_trace_tokenized
pw_trace_tokenized.trace_buffer
pw_trace_tokenized.rpc_service
Expand Down
5 changes: 5 additions & 0 deletions examples/chip-tool/.gn
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,10 @@ buildconfig = "${build_root}/config/BUILDCONFIG.gn"
check_system_includes = true

default_args = {
pw_build_PIP_CONSTRAINTS =
[ "//third_party/connectedhomeip/scripts/constraints.txt" ]
pw_build_PIP_REQUIREMENTS =
[ "//third_party/connectedhomeip/scripts/requirements.txt" ]

import("//args.gni")
}
2 changes: 1 addition & 1 deletion examples/common/pigweed/RpcService.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ void Start(void (*RegisterServices)(pw::rpc::Server &), ::chip::rpc::Mutex * uar
std::array<std::byte, kMaxTransmissionUnit> input_buffer;

Logging::Log(Logging::kLogModule_NotSpecified, Logging::kLogCategory_Detail, "Starting pw_rpc server");
pw::hdlc::ReadAndProcessPackets(server, hdlc_channel_output, input_buffer);
pw::hdlc::ReadAndProcessPackets(server, input_buffer);
}

} // namespace rpc
Expand Down
2 changes: 1 addition & 1 deletion examples/common/pigweed/rpc_console/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ group("default") {
# in:
# out/obj/chip_rpc_distribution/ <- source files here
# out/obj/chip_rpc_distribution._build_wheel/chip_rpc-0.0.1-py3-none-any.whl
pw_create_python_source_tree("chip_rpc_distribution") {
pw_python_distribution("chip_rpc_distribution") {
packages = [ "py:chip_rpc" ]
generate_setup_cfg = {
common_config_file = "common_setup.cfg"
Expand Down
Loading

0 comments on commit 6c3cef0

Please sign in to comment.