Skip to content

Commit beeb408

Browse files
[SL-ONLY] Silabs Platform App (#557)
Co-authored-by: Michael Duggan <[email protected]>
1 parent c64bd54 commit beeb408

24 files changed

+12445
-1
lines changed

.github/silabs-builds-mg24.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,5 +20,15 @@
2020
"boards": ["BRD4187C"],
2121
"arguments": ["--docker", "--release"]
2222
}
23+
],
24+
"base-platform-app":
25+
[
26+
{
27+
"boards": ["BRD4187C"],
28+
"arguments": [
29+
"--docker",
30+
"--lit-icd-internal-use-only"
31+
]
32+
}
2333
]
2434
}

.github/workflows/silabs-build-examples.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,3 +80,10 @@ jobs:
8080
with:
8181
example-app: "refrigerator-app"
8282
output-directory: "./out/refrigerator-app"
83+
84+
build-platform-app:
85+
name: Build Platform-App variations
86+
uses: ./.github/workflows/silabs-common-build.yaml
87+
with:
88+
example-app: "base-platform-app"
89+
output-directory: "./out/platform-app"

docs/examples/discussion/PID_allocation_for_example_apps.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,3 +39,4 @@ app is assigned a PID from the list below:
3939
| TV | `0x800F` |
4040
| Window | `0x8010` |
4141
| Network Infrastructure Manager | `0x8013` |
42+
| Platform | `0x8014` |
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# Copyright (c) 2020 Project CHIP Authors
2+
#
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
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
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.
14+
15+
import("//build_overrides/build.gni")
16+
17+
# The location of the build configuration file.
18+
buildconfig = "${build_root}/config/BUILDCONFIG.gn"
19+
20+
# CHIP uses angle bracket includes.
21+
check_system_includes = true
22+
23+
default_args = {
24+
target_cpu = "arm"
25+
target_os = "freertos"
26+
chip_openthread_ftd = true
27+
28+
import("//openthread.gni")
29+
}
Lines changed: 156 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,156 @@
1+
# Copyright (c) 2020 Project CHIP Authors
2+
#
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
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
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.
14+
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+
20+
import("${build_root}/config/defaults.gni")
21+
import("${silabs_sdk_build_root}/silabs_executable.gni")
22+
23+
import("${chip_root}/src/platform/device.gni")
24+
import("${chip_root}/third_party/silabs/silabs_board.gni")
25+
26+
assert(current_os == "freertos")
27+
28+
silabs_project_dir = "${chip_root}/examples/base-platform-app/silabs"
29+
examples_common_plat_dir = "${chip_root}/examples/platform/silabs"
30+
31+
if (wifi_soc) {
32+
import("${chip_root}/third_party/silabs/SiWx917_sdk.gni")
33+
examples_plat_dir = "${chip_root}/examples/platform/silabs/SiWx917"
34+
} else {
35+
import("${silabs_sdk_build_root}/efr32_sdk.gni")
36+
examples_plat_dir = "${chip_root}/examples/platform/silabs/efr32"
37+
}
38+
39+
import("${examples_common_plat_dir}/args.gni")
40+
41+
declare_args() {
42+
# Dump memory usage at link time.
43+
chip_print_memory_usage = false
44+
}
45+
46+
if (slc_generate) {
47+
# Generate Project Specific config (Board, hardware used etc..)
48+
print(exec_script("${chip_root}/third_party/silabs/slc_gen/run_slc.py",
49+
[
50+
rebase_path(chip_root),
51+
"${silabs_board}",
52+
"${disable_lcd}",
53+
"${use_wstk_buttons}",
54+
"${use_wstk_leds}",
55+
"${use_external_flash}",
56+
"${silabs_mcu}",
57+
rebase_path(slc_gen_path),
58+
],
59+
"list lines"))
60+
}
61+
62+
common_sources = [
63+
"${examples_common_plat_dir}/FreeRTOSConfig.h",
64+
"${silabs_project_dir}/include/CHIPProjectConfig.h",
65+
]
66+
67+
common_include_dirs = [
68+
"${silabs_project_dir}/include",
69+
"${examples_plat_dir}",
70+
"${chip_root}/src/lib",
71+
"${examples_common_plat_dir}",
72+
]
73+
74+
common_defines = []
75+
if (wifi_soc) {
76+
siwx917_sdk("sdk") {
77+
sources = common_sources
78+
include_dirs =
79+
[ "${chip_root}/src/platform/silabs/SiWx917" ] + common_include_dirs
80+
defines = common_defines
81+
}
82+
} else {
83+
efr32_sdk("sdk") {
84+
sources = common_sources
85+
include_dirs =
86+
[ "${chip_root}/src/platform/silabs/efr32" ] + common_include_dirs
87+
88+
if (use_wf200) {
89+
include_dirs += [ "${examples_plat_dir}/wf200" ]
90+
}
91+
if (chip_enable_ble_rs911x) {
92+
include_dirs += [
93+
"${examples_plat_dir}/rs911x",
94+
"${examples_plat_dir}/rs911x/hal",
95+
]
96+
}
97+
defines = common_defines
98+
}
99+
}
100+
silabs_executable("platform_app") {
101+
output_name = "matter-silabs-platform-example.out"
102+
include_dirs = [ "include" ]
103+
defines = []
104+
105+
if (silabs_board == "BRD2704A") {
106+
defines += [ "SL_STATUS_LED=0" ]
107+
}
108+
109+
sources = [
110+
"${examples_common_plat_dir}/main.cpp",
111+
"src/AppTask.cpp",
112+
]
113+
114+
deps = [
115+
":sdk",
116+
"${chip_root}/src/platform/logging:default",
117+
app_data_model,
118+
]
119+
120+
if (wifi_soc) {
121+
deps += [ "${examples_plat_dir}:siwx917-common" ]
122+
} else {
123+
deps += [ "${examples_plat_dir}:efr32-common" ]
124+
}
125+
126+
ldscript = "${examples_common_plat_dir}/ldscripts/${silabs_family}.ld"
127+
128+
inputs = [ ldscript ]
129+
130+
ldflags = [ "-T" + rebase_path(ldscript, root_build_dir) ]
131+
132+
if (chip_print_memory_usage) {
133+
ldflags += [
134+
"-Wl,--print-memory-usage",
135+
"-fstack-usage",
136+
]
137+
}
138+
139+
# WiFi Settings
140+
if (chip_enable_wifi) {
141+
ldflags += [
142+
"-Wl,--defsym",
143+
"-Wl,SILABS_WIFI=1",
144+
]
145+
}
146+
147+
output_dir = root_out_dir
148+
}
149+
150+
group("silabs") {
151+
deps = [ ":platform_app" ]
152+
}
153+
154+
group("default") {
155+
deps = [ ":silabs" ]
156+
}

0 commit comments

Comments
 (0)