Skip to content

Commit cb07513

Browse files
Add initial framework to build TI Matter applications against prebuilt OT Libs (#32857)
* Add initial framework to build matter applications against prebuild Openthread library * Fix Comment * Restyled by whitespace * Restyled by clang-format * Restyled by gn * Restyled by autopep8 * Restyled by isort * Reference checked in libraries in lieu of wget/unzip * Update library reference --------- Co-authored-by: Restyled.io <commits@restyled.io>
1 parent bdf3e6e commit cb07513

File tree

27 files changed

+228
-524
lines changed

27 files changed

+228
-524
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
# Configuring Openthread libraries on TI CC13x4 Platforms
2+
3+
## Overview
4+
5+
TI Matter example applications provide configuration option for how Thread code
6+
is included in the build. Thread code can be included in as (1) full source or
7+
(2) as optimized for matter thread certified library. The library builds have
8+
been optimized for matter to disable features such as Thread Joiner capability
9+
in order to save on Flash/RAM usage.
10+
11+
Build arguments have been added to enable Matter applications to link against
12+
certified Openthread FTD/MTD libraries or custom user libraries.
13+
14+
## Platform Code Changes
15+
16+
To configure a TI example to utilize either an Openthread source or library
17+
build, open up the `args.gni` file of the example:
18+
19+
To configure the device as an FTD or MTD, set following parameter to either true
20+
or false respectively.
21+
22+
```
23+
chip_openthread_ftd = true
24+
```
25+
26+
- **Openthread Library From Source**:
27+
28+
1. `ot_ti_lib_dir` Is set to an empty string
29+
30+
```
31+
ot_ti_lib_dir=""
32+
```
33+
34+
2. `chip_openthread_target` Is set to an empty string
35+
36+
```
37+
chip_openthread_target = ""
38+
```
39+
40+
3. `openthread_external_platform` Points to the Openthread build dependency
41+
```
42+
openthread_external_platform="${chip_root}/third_party/openthread/platforms/ti:libopenthread-ti"
43+
```
44+
45+
- **TI Certified Openthread Library**:
46+
47+
1. `ot_ti_lib_dir` Is set to an empty string
48+
49+
```
50+
ot_ti_lib_dir=""
51+
```
52+
53+
2. `chip_openthread_target` Points to the TI certified library dependency
54+
55+
```
56+
chip_openthread_target = "${chip_root}/third_party/openthread/platforms/ti:ot-ti-cert"
57+
```
58+
59+
3. `openthread_external_platform` Points to the Openthread build dependency
60+
```
61+
`openthread_external_platform="${chip_root}/third_party/openthread/platforms/ti:libopenthread-ti"`
62+
```
63+
64+
- **Custom Openthread Library**:
65+
66+
1. `ot_ti_lib_dir` Points to a library directory containing a custom
67+
`libopenthread-ftd/mtd` variant
68+
69+
```
70+
ot_ti_lib_dir="${chip_root}/CUSTOM_LIB_DIR_PATH/"
71+
```
72+
73+
2. `chip_openthread_target` Is set to an empty string
74+
75+
```
76+
chip_openthread_target = ""
77+
```
78+
79+
3. `openthread_external_platform` Points to the Openthread build dependency
80+
81+
```
82+
openthread_external_platform="${chip_root}/third_party/openthread/platforms/ti:libopenthread-ti"
83+
```
84+
85+
The TI Openthread certified library for the MTD/FTD configurations is based on
86+
the following header file:
87+
88+
- `third_party/openthread/ot-ti/src/openthread-core-cc13xx_cc26xx-config-matter.h`
89+
90+
In order to update the Openthread configuration when building from source or a
91+
custom library, users may adjust features via the following configuration header
92+
file:
93+
94+
- `${chip_root}/examples/platform/cc13x4_26x4/project_include/OpenThreadConfig.h`
95+
96+
Please refer to TI's standalone Openthread Application build process for
97+
instructions on acquiring FTD/MTD libraries as they are automatically built when
98+
generating the standalone applications.
99+
100+
- `third_party/openthread/ot-ti/README.md`

docs/guides/ti/ti_platform_overview.md

+27
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,33 @@ CC2674P10 or the CC2674R10, please refer to the guide linked below.
126126

127127
<hr>
128128

129+
## Factory Data Programming Tool
130+
131+
For instructions on how to program custom factory data on TI devices, please
132+
refer to the guide linked below.
133+
134+
- [TI Factory Data User Guide](./ti_factory_data_user_guide.md)
135+
136+
<hr>
137+
138+
## Intermittently Connected Devices
139+
140+
For instructions on how to use Matters' ICD feature on TI devices, please refer
141+
to the guide linked below.
142+
143+
- [Enabling ICD On TI Devices](./enabling_icd_on_ti_devices.md)
144+
145+
<hr>
146+
147+
## Matter Openthread Library Configuration
148+
149+
For instructions on how to configure the Openthread build configuration for a
150+
Matter application, please refer to the guide linked below.
151+
152+
- [Openthread Library Configuration](./ti_openthread_library_usage.md)
153+
154+
<hr>
155+
129156
### TI Support
130157

131158
For technical support, please consider creating a post on TI's [E2E forum][e2e].

examples/all-clusters-app/cc13x4_26x4/BUILD.gn

+1-24
Original file line numberDiff line numberDiff line change
@@ -45,22 +45,6 @@ ti_sysconfig("sysconfig") {
4545
"ti_ble_config.h",
4646
"ti_dmm_application_policy.c",
4747
"ti_dmm_application_policy.h",
48-
49-
# CCFG generation disabled for OTA-able application
50-
#"ti_devices_config.c",
51-
#"ti_devices_config.h",
52-
53-
# disabled until upstream generation is aligned
54-
#"tiop_config.h",
55-
#"tiop_config.c",
56-
57-
# not traditional source files
58-
#"ti_utils_build_linker.cmd.genlibs",
59-
#"syscfg_c.rov.xs",
60-
#"ti_utils_runtime_model.gv",
61-
#"ti_utils_runtime_Makefile",
62-
#"ti_ble_app_config.opt",
63-
#"ti_build_config.opt",
6448
]
6549

6650
public_configs = [ ":sdk_cc13x4_26x4_dmm_config" ]
@@ -107,16 +91,9 @@ ti_simplelink_executable("all-clusters-app") {
10791
"${chip_root}/examples/all-clusters-app/all-clusters-common",
10892
"${chip_root}/examples/platform/cc13x4_26x4:cc13x4_26x4-attestation-credentials",
10993
"${chip_root}/src/lib",
94+
"${chip_root}/third_party/openthread:openthread",
11095
]
111-
112-
if (chip_openthread_ftd) {
113-
deps += [ "${chip_root}/third_party/openthread/repo:libopenthread-ftd" ]
114-
} else {
115-
deps += [ "${chip_root}/third_party/openthread/repo:libopenthread-mtd" ]
116-
}
117-
11896
defines = []
119-
12097
if (custom_factory_data) {
12198
defines += [ "CC13XX_26XX_FACTORY_DATA" ]
12299
}

examples/all-clusters-app/cc13x4_26x4/args.gni

+4-3
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,14 @@ lwip_debug = false
3030

3131
chip_enable_ota_requestor = true
3232

33-
openthread_external_platform = "${chip_root}/third_party/openthread/platforms/cc13x4_26x4:libopenthread-cc13x4_cc26x4"
33+
openthread_external_platform =
34+
"${chip_root}/third_party/openthread/platforms/ti:libopenthread-ti"
35+
chip_openthread_target = ""
36+
3437
chip_openthread_ftd = true
3538

3639
# Disable CHIP Logging
3740
#chip_progress_logging = false
38-
39-
# Disable verbose logs for all-clusters app to save Flash
4041
#chip_detail_logging = false
4142
#chip_automation_logging = false
4243

examples/all-clusters-app/cc13x4_26x4/main/include/OpenThreadConfig.h

-29
This file was deleted.

examples/lighting-app/cc13x4_26x4/BUILD.gn

+1-20
Original file line numberDiff line numberDiff line change
@@ -49,18 +49,6 @@ ti_sysconfig("sysconfig") {
4949
# CCFG generation disabled for OTA-able application
5050
#"ti_devices_config.c",
5151
#"ti_devices_config.h",
52-
53-
# disabled until upstream generation is aligned
54-
#"tiop_config.h",
55-
#"tiop_config.c",
56-
57-
# not traditional source files
58-
#"ti_utils_build_linker.cmd.genlibs",
59-
#"syscfg_c.rov.xs",
60-
#"ti_utils_runtime_model.gv",
61-
#"ti_utils_runtime_Makefile",
62-
#"ti_ble_app_config.opt",
63-
#"ti_build_config.opt",
6452
]
6553

6654
public_configs = [ ":sdk_cc13x4_26x4_dmm_config" ]
@@ -89,16 +77,9 @@ ti_simplelink_executable("lighting_app") {
8977
"${chip_root}/examples/lighting-app/lighting-common",
9078
"${chip_root}/examples/platform/cc13x4_26x4:cc13x4_26x4-attestation-credentials",
9179
"${chip_root}/src/lib",
80+
"${chip_root}/third_party/openthread:openthread",
9281
]
93-
94-
if (chip_openthread_ftd) {
95-
deps += [ "${chip_root}/third_party/openthread/repo:libopenthread-ftd" ]
96-
} else {
97-
deps += [ "${chip_root}/third_party/openthread/repo:libopenthread-mtd" ]
98-
}
99-
10082
defines = []
101-
10283
if (custom_factory_data) {
10384
defines += [ "CC13XX_26XX_FACTORY_DATA" ]
10485
}

examples/lighting-app/cc13x4_26x4/args.gni

+7-2
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,13 @@ lwip_debug = false
3030

3131
chip_enable_ota_requestor = true
3232

33-
chip_openthread_ftd = false
34-
openthread_external_platform = "${chip_root}/third_party/openthread/platforms/cc13x4_26x4:libopenthread-cc13x4_cc26x4"
33+
chip_openthread_ftd = true
34+
35+
ot_ti_lib_dir = ""
36+
openthread_external_platform =
37+
"${chip_root}/third_party/openthread/platforms/ti:libopenthread-ti"
38+
39+
chip_openthread_target = ""
3540

3641
# Disable CHIP Logging
3742
chip_progress_logging = true

examples/lock-app/cc13x4_26x4/BUILD.gn

+1-16
Original file line numberDiff line numberDiff line change
@@ -49,14 +49,6 @@ ti_sysconfig("sysconfig") {
4949
# CCFG generation disabled for OTA-able application
5050
#"ti_devices_config.c",
5151
#"ti_devices_config.h",
52-
53-
# not traditional source files
54-
#"ti_utils_build_linker.cmd.genlibs",
55-
#"syscfg_c.rov.xs",
56-
#"ti_utils_runtime_model.gv",
57-
#"ti_utils_runtime_Makefile",
58-
#"ti_ble_app_config.opt",
59-
#"ti_build_config.opt",
6052
]
6153

6254
public_configs = [ ":sdk_cc13x4_26x4_dmm_config" ]
@@ -93,16 +85,9 @@ ti_simplelink_executable("lock_app") {
9385
"${chip_root}/examples/lock-app/lock-common",
9486
"${chip_root}/examples/platform/cc13x4_26x4:cc13x4_26x4-attestation-credentials",
9587
"${chip_root}/src/lib",
88+
"${chip_root}/third_party/openthread:openthread",
9689
]
97-
98-
if (chip_openthread_ftd) {
99-
deps += [ "${chip_root}/third_party/openthread/repo:libopenthread-ftd" ]
100-
} else {
101-
deps += [ "${chip_root}/third_party/openthread/repo:libopenthread-mtd" ]
102-
}
103-
10490
defines = []
105-
10691
if (custom_factory_data) {
10792
defines += [ "CC13XX_26XX_FACTORY_DATA" ]
10893
}

examples/lock-app/cc13x4_26x4/args.gni

+4-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,10 @@ lwip_debug = false
3131
chip_enable_ota_requestor = true
3232

3333
chip_openthread_ftd = true
34-
openthread_external_platform = "${chip_root}/third_party/openthread/platforms/cc13x4_26x4:libopenthread-cc13x4_cc26x4"
34+
ot_ti_lib_dir = ""
35+
openthread_external_platform =
36+
"${chip_root}/third_party/openthread/platforms/ti:libopenthread-ti"
37+
chip_openthread_target = ""
3538

3639
# Disable CHIP Logging
3740
chip_progress_logging = true

0 commit comments

Comments
 (0)