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")
20 import("${build_root}/config/defaults.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/persistent-storage/efr32"
28 examples_plat_dir = "${chip_root}/examples/platform/efr32"
32 "${chip_root}/src/platform/EFR32",
33 "${efr32_project_dir}/include",
34 "${efr32_project_dir}/src",
35 "${examples_plat_dir}",
36 "${examples_plat_dir}/${efr32_family}/${efr32_board}",
40 "${efr32_project_dir}/include/CHIPProjectConfig.h",
41 "${efr32_project_dir}/include/FreeRTOSConfig.h",
45 "BOARD_ID=${efr32_board}",
46 "SL_HEAP_SIZE=(10 * 1024)",
50 efr32_executable("persistent_storage") {
51 include_dirs = [ "${efr32_project_dir}/.." ]
53 output_name = "chip-efr32-persistent_storage-example.out"
55 deps = [ "$dir_pw_kvs:crc16" ]
59 "${chip_root}/src/lib",
63 "${efr32_project_dir}/include",
64 "${chip_root}/src/app/util",
65 "${examples_plat_dir}",
66 "${examples_plat_dir}/${efr32_family}/${efr32_board}",
70 "${efr32_project_dir}/../KeyValueStorageTest.cpp",
71 "${examples_plat_dir}/init_efrPlatform.cpp",
72 "${examples_plat_dir}/uart.c",
76 output_dir = root_out_dir
78 if (efr32_family == "efr32mg12") {
79 ldscript = "${examples_plat_dir}/ldscripts/efr32-MG12P.ld"
80 } else if (efr32_family == "efr32mg21") {
81 ldscript = "${examples_plat_dir}/ldscripts/efr32-MG21.ld"
84 ldflags = [ "-T" + rebase_path(ldscript, root_build_dir) ]
88 deps = [ ":persistent_storage" ]