1 # Copyright (c) 2021 Project CHIP Authors
3 # Licensed under the Apache License, Version 2.0 (the "License");
4 # you may not use this file except in compliance with the License.
5 # You may obtain a copy of the License at
7 # http://www.apache.org/licenses/LICENSE-2.0
9 # Unless required by applicable law or agreed to in writing, software
10 # distributed under the License is distributed on an "AS IS" BASIS,
11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 # See the License for the specific language governing permissions and
13 # limitations under the License.
15 import("//build_overrides/build.gni")
16 import("//build_overrides/chip.gni")
17 import("//build_overrides/efr32_sdk.gni")
18 import("//build_overrides/pigweed.gni")
19 import("${build_root}/config/defaults.gni")
21 import("${chip_root}/config/efr32/lib/pw_rpc/pw_rpc.gni")
22 import("${efr32_sdk_build_root}/efr32_executable.gni")
23 import("${efr32_sdk_build_root}/efr32_sdk.gni")
25 assert(current_os == "freertos")
27 efr32_project_dir = "${chip_root}/examples/pigweed-app/efr32"
28 examples_plat_dir = "${chip_root}/examples/platform/efr32"
32 "${chip_root}/src/platform/EFR32",
33 "${efr32_project_dir}/include",
34 "${examples_plat_dir}",
35 "${examples_plat_dir}/${efr32_family}/${efr32_board}",
39 "${efr32_project_dir}/include/CHIPProjectConfig.h",
40 "${efr32_project_dir}/include/FreeRTOSConfig.h",
44 "BOARD_ID=${efr32_board}",
46 "EFR32_LOG_ENABLED=1",
48 "SL_HEAP_SIZE=(10 * 1024)",
52 efr32_executable("pigweed_app") {
55 output_name = "chip-efr32-pigweed-example.out"
61 "${chip_root}/config/efr32/lib/pw_rpc:pw_rpc",
62 "${chip_root}/examples/common/pigweed:system_rpc_server",
63 "${chip_root}/src/lib",
64 "${examples_plat_dir}/pw_sys_io:pw_sys_io_efr32",
67 include_dirs += [ "${chip_root}/examples/common/pigweed/efr32" ]
70 "${chip_root}/examples/common/pigweed/RpcService.cpp",
71 "${chip_root}/examples/common/pigweed/efr32/PigweedLoggerMutex.cpp",
72 "${examples_plat_dir}/LEDWidget.cpp",
73 "${examples_plat_dir}/PigweedLogger.cpp",
74 "${examples_plat_dir}/init_efrPlatform.cpp",
75 "${examples_plat_dir}/uart.c",
79 output_dir = root_out_dir
81 if (efr32_family == "efr32mg12") {
82 ldscript = "${examples_plat_dir}/ldscripts/efr32-MG12P.ld"
83 } else if (efr32_family == "efr32mg21") {
84 ldscript = "${examples_plat_dir}/ldscripts/efr32-MG21.ld"
87 ldflags = [ "-T" + rebase_path(ldscript, root_build_dir) ]
91 deps = [ ":pigweed_app" ]