Skip to content

Commit

Permalink
Implement all clusters cc13x2x7 (project-chip#17265)
Browse files Browse the repository at this point in the history
* Initial All clusters implementation

* Update README

* Add TI all clusters app to CI

* Decrease Large heap size

* Resolve missing script dependency

* Resolve CI, Add proper Metric print

* Fix GN Formatting

* Update CI All targets ordering

* CI Build update

* Apply Restyle manually
  • Loading branch information
adabreuti authored Apr 14, 2022
1 parent 2b62065 commit 376ce66
Show file tree
Hide file tree
Showing 27 changed files with 1,812 additions and 0 deletions.
7 changes: 7 additions & 0 deletions .github/workflows/examples-cc13x2x7_26x2x7.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,13 @@ jobs:
cc13x2_26x2 LP_CC2652R7 pump-controller-app \
out/artifacts/cc13x2x7_26x2x7-pump-controller/chip-LP_CC2652R7-pump-controller-example.out \
/tmp/bloat_reports/
- name: Get All Clusters App size stats
timeout-minutes: 5
run: |
.environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \
cc13x2_26x2 LP_CC2652R7 all-clusters-app \
out/artifacts/cc13x2x7_26x2x7-all-clusters/chip-LP_CC2652R7-all-clusters-example.out \
/tmp/bloat_reports/
- name: Uploading Size Reports
uses: actions/upload-artifact@v2
if: ${{ !env.ACT }}
Expand Down
12 changes: 12 additions & 0 deletions BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,9 @@ if (current_toolchain != "${dir_pw_toolchain}/default:default") {
# Build the cc13x2x7_26x2x7 lock app example.
enable_cc13x2x7_26x2x7_lock_app_build = enable_ti_simplelink_builds

# Build the cc13x2x7_26x2x7 all-clusters app example.
enable_cc13x2x7_26x2x7_all_clusters_app_build = enable_ti_simplelink_builds

# Build the efr32 lock app example.
enable_efr32_lock_app_build = enable_efr32_builds

Expand Down Expand Up @@ -353,6 +356,12 @@ if (current_toolchain != "${dir_pw_toolchain}/default:default") {
}
}

if (enable_cc13x2x7_26x2x7_all_clusters_app_build) {
group("cc13x2x7_26x2x7_all_clusters_app") {
deps = [ "${chip_root}/examples/all-clusters-app/cc13x2x7_26x2x7(${chip_root}/config/cc13x2_26x2/toolchain:cc13x2x7_26x2x7_all_clusters_app)" ]
}
}

if (enable_standalone_shell_build) {
group("standalone_shell") {
deps =
Expand Down Expand Up @@ -539,6 +548,9 @@ if (current_toolchain != "${dir_pw_toolchain}/default:default") {
if (enable_cc13x2x7_26x2x7_lock_app_build) {
deps += [ ":cc13x2x7_26x2x7_lock_app" ]
}
if (enable_cc13x2x7_26x2x7_all_clusters_app_build) {
deps += [ ":cc13x2x7_26x2x7_all_clusters_app" ]
}
}

group("check") {
Expand Down
6 changes: 6 additions & 0 deletions config/cc13x2_26x2/toolchain/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,10 @@ arm_toolchain("cc13x2x7_26x2x7_lock_app") {
current_os = "freertos"
import("${chip_root}/examples/lock-app/cc13x2x7_26x2x7/args.gni")
}
arm_toolchain("cc13x2x7_26x2x7_all_clusters_app") {
toolchain_args = {
current_os = "freertos"
import("${chip_root}/examples/all-clusters-app/cc13x2x7_26x2x7/args.gni")
}
}
}
28 changes: 28 additions & 0 deletions examples/all-clusters-app/cc13x2x7_26x2x7/.gn
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Copyright (c) 2020 Project CHIP Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

import("//build_overrides/build.gni")

# The location of the build configuration file.
buildconfig = "${build_root}/config/BUILDCONFIG.gn"

# CHIP uses angle bracket includes.
check_system_includes = true

default_args = {
target_cpu = "arm"
target_os = "freertos"

import("//args.gni")
}
127 changes: 127 additions & 0 deletions examples/all-clusters-app/cc13x2x7_26x2x7/BUILD.gn
Original file line number Diff line number Diff line change
@@ -0,0 +1,127 @@
# Copyright (c) 2020 Project CHIP Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# 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_overrides/openthread.gni")
import("//build_overrides/ti_simplelink_sdk.gni")

import("${build_root}/config/defaults.gni")

import("${chip_root}/src/platform/device.gni")

import("${ti_simplelink_sdk_build_root}/ti_simplelink_executable.gni")
import("${ti_simplelink_sdk_build_root}/ti_simplelink_sdk.gni")

assert(current_os == "freertos")

project_dir = "${chip_root}/examples/all-clusters-app/cc13x2x7_26x2x7"

ti_simplelink_sdk("sdk") {
include_dirs = [ "${project_dir}/main/include" ]

defines = []
if (is_debug) {
defines += [ "BUILD_RELEASE=0" ]
} else {
defines += [ "BUILD_RELEASE=1" ]
}
}

ti_sysconfig("sysconfig") {
sources = [ "${project_dir}/chip.syscfg" ]

outputs = [
"ti_radio_config.c",
"ti_radio_config.h",
"ti_drivers_config.c",
"ti_drivers_config.h",
"ti_ble_config.c",
"ti_ble_config.h",
"ti_dmm_application_policy.c",
"ti_dmm_application_policy.h",

# disabled until upstream generation is aligned
#"tiop_config.h",
#"tiop_config.c",

# not traditional source files
#"ti_utils_build_linker.cmd.genlibs",
#"syscfg_c.rov.xs",
#"ti_utils_runtime_model.gv",
#"ti_utils_runtime_Makefile",
#"ti_ble_app_config.opt",
#"ti_build_config.opt",
]

public_configs = [ ":sdk_dmm_config" ]

cflags = [
"-Wno-comment",
"@" + rebase_path("${target_gen_dir}/sysconfig/ti_ble_app_config.opt",
root_build_dir),
"@" + rebase_path("${target_gen_dir}/sysconfig/ti_build_config.opt",
root_build_dir),
]
}

ti_simplelink_executable("all-clusters-app") {
output_name = "chip-${ti_simplelink_board}-all-clusters-example.out"

sources = [
"${chip_root}/examples/all-clusters-app/all-clusters-common/src/binding-handler.cpp",
"${chip_root}/examples/all-clusters-app/all-clusters-common/src/bridged-actions-stub.cpp",
"${chip_root}/examples/all-clusters-app/all-clusters-common/src/static-supported-modes-manager.cpp",
"${project_dir}/main/AppTask.cpp",
"${project_dir}/main/ClusterManager.cpp",
"${project_dir}/main/Globals.cpp",
"${project_dir}/main/ZclCallbacks.cpp",
"${project_dir}/main/main.cpp",
]

deps = [
":sdk",
":sysconfig",
"${chip_root}/examples/all-clusters-app/all-clusters-common",
"${chip_root}/src/lib",
]

if (chip_openthread_ftd) {
deps += [ "${chip_root}/third_party/openthread/repo:libopenthread-ftd" ]
} else {
deps += [ "${chip_root}/third_party/openthread/repo:libopenthread-mtd" ]
}

include_dirs = [
"${project_dir}",
"${project_dir}/main",
"${chip_root}/examples/all-clusters-app/all-clusters-common/include",
]

cflags = [
"-Wno-implicit-fallthrough",
"-Wno-sign-compare",
"-Wconversion",
]

output_dir = root_out_dir
}

group("cc13x2x7_26x2x7") {
deps = [ ":all-clusters-app" ]
}

group("default") {
deps = [ ":cc13x2x7_26x2x7" ]
}
Loading

0 comments on commit 376ce66

Please sign in to comment.