diff --git a/.github/workflows/examples-cc13x2x7_26x2x7.yaml b/.github/workflows/examples-cc13x2x7_26x2x7.yaml index f3703f38b85f69..f48b3264f32957 100644 --- a/.github/workflows/examples-cc13x2x7_26x2x7.yaml +++ b/.github/workflows/examples-cc13x2x7_26x2x7.yaml @@ -22,7 +22,6 @@ on: concurrency: group: ${{ github.ref }}-${{ github.workflow }}-${{ (github.event_name == 'pull_request' && github.event.number) || (github.event_name == 'workflow_dispatch' && github.run_number) || github.sha }} cancel-in-progress: true - env: CHIP_NO_LOG_TIMESTAMPS: true # XXX: Workaround for https://github.com/actions/cache/issues/1141 @@ -40,7 +39,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: connectedhomeip/chip-build-ti:0.7.3 + image: connectedhomeip/chip-build-ti:0.7.14 volumes: - "/tmp/bloat_reports:/tmp/bloat_reports" steps: @@ -79,5 +78,93 @@ jobs: path: | .environment/gn_out/.ninja_log .environment/pigweed-venv/*.log - + - name: Build examples + timeout-minutes: 100 + run: | + scripts/run_in_build_env.sh "\ + ./scripts/build/build_examples.py \ + --target ti-cc13x2x7_26x2x7-lock-mtd \ + --target ti-cc13x2x7_26x2x7-pump-mtd \ + --target ti-cc13x2x7_26x2x7-lighting \ + --target ti-cc13x2x7_26x2x7-pump-controller-mtd \ + --target ti-cc13x4_26x4-lighting \ + --target ti-cc13x4_26x4-lock-ftd \ + --target ti-cc13x4_26x4-lock-mtd \ + --target ti-cc13x4_26x4-pump-mtd \ + --target ti-cc13x4_26x4-pump-ftd \ + --target ti-cc13x4_26x4-pump-controller-mtd \ + --target ti-cc13x4_26x4-pump-controller-ftd \ + build \ + --copy-artifacts-to out/artifacts \ + " + - name: Get lock MTD size stats + timeout-minutes: 5 + run: | + .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ + cc13x2_26x2 LP_CC2652R7 lock-mtd \ + out/artifacts/ti-cc13x2x7_26x2x7-lock-mtd/chip-LP_CC2652R7-lock-example.out \ + /tmp/bloat_reports/ + - name: Get Pump App size stats + timeout-minutes: 5 + run: | + .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ + cc13x2_26x2 LP_CC2652R7 pump-app \ + out/artifacts/ti-cc13x2x7_26x2x7-pump-mtd/chip-LP_CC2652R7-pump-example.out \ + /tmp/bloat_reports/ + - name: Get Pump Controller App size stats + timeout-minutes: 5 + run: | + .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ + cc13x2_26x2 LP_CC2652R7 pump-controller-app \ + out/artifacts/ti-cc13x2x7_26x2x7-pump-controller-mtd/chip-LP_CC2652R7-pump-controller-example.out \ + /tmp/bloat_reports/ + - name: Get lock FTD size stats + timeout-minutes: 5 + run: | + .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ + cc13x4_26x4 LP_EM_CC1354P10_6 lock-ftd \ + out/artifacts/ti-cc13x4_26x4-lock-ftd/chip-LP_EM_CC1354P10_6-lock-example.out \ + /tmp/bloat_reports/ + - name: Get lock MTD size stats + timeout-minutes: 5 + run: | + .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ + cc13x4_26x4 LP_EM_CC1354P10_6 lock-mtd \ + out/artifacts/ti-cc13x4_26x4-lock-mtd/chip-LP_EM_CC1354P10_6-lock-example.out \ + /tmp/bloat_reports/ + - name: Get Pump App size stats + timeout-minutes: 5 + run: | + .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ + cc13x4_26x4 LP_EM_CC1354P10_6 pump-app \ + out/artifacts/ti-cc13x4_26x4-pump-mtd/chip-LP_EM_CC1354P10_6-pump-example.out \ + /tmp/bloat_reports/ + - name: Get Pump Controller App size stats + timeout-minutes: 5 + run: | + .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ + cc13x4_26x4 LP_EM_CC1354P10_6 pump-controller-app \ + out/artifacts/ti-cc13x4_26x4-pump-controller-mtd/chip-LP_EM_CC1354P10_6-pump-controller-example.out \ + /tmp/bloat_reports/ + - name: Get Lighting App size stats + timeout-minutes: 5 + run: | + .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ + cc13x4_26x4 LP_EM_CC1354P10_6 lighting-app \ + out/artifacts/ti-cc13x4_26x4-lighting/chip-LP_EM_CC1354P10_6-lighting-example.out \ + /tmp/bloat_reports/ + - name: Uploading Size Reports + uses: actions/upload-artifact@v2 + if: ${{ !env.ACT }} + with: + name: Size,cc13x2x7_26x2x7-Examples,${{ env.GH_EVENT_PR }},${{ env.GH_EVENT_HASH }},${{ env.GH_EVENT_PARENT }},${{ github.event_name }} + path: | + /tmp/bloat_reports/ + - name: Uploading Size Reports + uses: actions/upload-artifact@v2 + if: ${{ !env.ACT }} + with: + name: Size,cc13x4_26x4-Examples,${{ env.GH_EVENT_PR }},${{ env.GH_EVENT_HASH }},${{ env.GH_EVENT_PARENT }},${{ github.event_name }} + path: | + /tmp/bloat_reports/ diff --git a/examples/lock-app/cc13x2x7_26x2x7/src/LockManager.cpp b/examples/lock-app/cc13x2x7_26x2x7/src/LockManager.cpp index acd9c00b41c4d5..57cd1964dd92a1 100644 --- a/examples/lock-app/cc13x2x7_26x2x7/src/LockManager.cpp +++ b/examples/lock-app/cc13x2x7_26x2x7/src/LockManager.cpp @@ -640,6 +640,8 @@ const char * LockManager::lockStateToString(DlLockState lockState) const return "Unlocked"; case DlLockState::kUnknownEnumValue: break; + default: + break; } return "Unknown"; diff --git a/examples/lock-app/cc13x4_26x4/src/LockManager.cpp b/examples/lock-app/cc13x4_26x4/src/LockManager.cpp index acd9c00b41c4d5..57cd1964dd92a1 100644 --- a/examples/lock-app/cc13x4_26x4/src/LockManager.cpp +++ b/examples/lock-app/cc13x4_26x4/src/LockManager.cpp @@ -640,6 +640,8 @@ const char * LockManager::lockStateToString(DlLockState lockState) const return "Unlocked"; case DlLockState::kUnknownEnumValue: break; + default: + break; } return "Unknown"; diff --git a/integrations/cloudbuild/build-all.yaml b/integrations/cloudbuild/build-all.yaml index 55162c7260f86d..fdc77e8a58aae1 100644 --- a/integrations/cloudbuild/build-all.yaml +++ b/integrations/cloudbuild/build-all.yaml @@ -36,9 +36,17 @@ steps: --target android-x64-chip-tool --target bouffalolab-bl602-iot-matter-v1-light --target bouffalolab-xt-zb6-devkit-light-rpc - --target cc13x2x7_26x2x7-lock-ftd + --target cc13x2x7_26x2x7-lighting --target cc13x2x7_26x2x7-lock-mtd - --target cc13x2x7_26x2x7-shell + --target cc13x2x7_26x2x7-pump-mtd + --target cc13x2x7_26x2x7-pump-controller-mtd + --target cc13x4_26x4-lighting + --target cc13x4_26x4-lock-ftd + --target cc13x4_26x4-pump-ftd + --target cc13x4_26x4-pump-controller-ftd + --target cc13x4_26x4-lock-mtd + --target cc13x4_26x4-pump-mtd + --target cc13x4_26x4-pump-controller-mtd --target cyw30739-cyw930739m2evb_01-ota-requestor --target efr32-brd4161a-light-rpc --target efr32-brd4161a-lock diff --git a/scripts/build/build/targets.py b/scripts/build/build/targets.py index 56d672539288d1..5104ced2d0fff7 100755 --- a/scripts/build/build/targets.py +++ b/scripts/build/build/targets.py @@ -16,7 +16,6 @@ from builders.android import AndroidApp, AndroidBoard, AndroidBuilder, AndroidProfile from builders.asr import ASRApp, ASRBoard, ASRBuilder from builders.bouffalolab import BouffalolabApp, BouffalolabBoard, BouffalolabBuilder -from builders.cc13x2x7_26x2x7 import cc13x2x7_26x2x7App, cc13x2x7_26x2x7Builder from builders.cc32xx import cc32xxApp, cc32xxBuilder from builders.cyw30739 import Cyw30739App, Cyw30739Board, Cyw30739Builder from builders.efr32 import Efr32App, Efr32Board, Efr32Builder @@ -32,6 +31,7 @@ from builders.openiotsdk import OpenIotSdkApp, OpenIotSdkBuilder from builders.qpg import QpgApp, QpgBoard, QpgBuilder from builders.telink import TelinkApp, TelinkBoard, TelinkBuilder +from builders.ti import TIApp, TIBoard, TIBuilder from builders.tizen import TizenApp, TizenBoard, TizenBuilder from .target import BuildTarget, TargetPart @@ -416,21 +416,43 @@ def BuildK32WTarget(): return target -def Buildcc13x2x7_26x2x7Target(): - target = BuildTarget('cc13x2x7_26x2x7', cc13x2x7_26x2x7Builder) +def BuildCC13x2x7Target(): + target = BuildTarget('ti', TIBuilder) - # apps + # board target.AppendFixedTargets([ - TargetPart('all-clusters', app=cc13x2x7_26x2x7App.ALL_CLUSTERS), - TargetPart('all-clusters-minimal', app=cc13x2x7_26x2x7App.ALL_CLUSTERS_MINIMAL), - TargetPart('lock', app=cc13x2x7_26x2x7App.LOCK), - TargetPart('pump', app=cc13x2x7_26x2x7App.PUMP), - TargetPart('pump-controller', app=cc13x2x7_26x2x7App.PUMP_CONTROLLER), - TargetPart('shell', app=cc13x2x7_26x2x7App.SHELL), + TargetPart('cc13x2x7_26x2x7', board=TIBoard.LP_CC2652R7), ]) - target.AppendModifier(name="ftd", openthread_ftd=True).ExceptIfRe("-mtd") - target.AppendModifier(name="mtd", openthread_ftd=False).ExceptIfRe("-ftd") + target.AppendFixedTargets([ + TargetPart('lighting', app=TIApp.LIGHTING), + TargetPart('lock', app=TIApp.LOCK), + TargetPart('pump', app=TIApp.PUMP), + TargetPart('pump-controller', app=TIApp.PUMP_CONTROLLER), + ]) + target.AppendModifier(name="mtd", openthread_ftd=False) + + return target + + +def BuildCC13x4Target(): + target = BuildTarget('ti', TIBuilder) + + # board + target.AppendFixedTargets([ + TargetPart('cc13x4_26x4', board=TIBoard.LP_EM_CC1354P10_6) + ]) + + target.AppendFixedTargets([ + TargetPart('all-clusters', app=TIApp.ALL_CLUSTERS), + TargetPart('lighting', app=TIApp.LIGHTING), + TargetPart('lock', app=TIApp.LOCK, openthread_ftd=True), + TargetPart('pump', app=TIApp.PUMP, openthread_ftd=False), + TargetPart('pump-controller', app=TIApp.PUMP_CONTROLLER, openthread_ftd=False), + ]) + + target.AppendModifier(name="mtd", openthread_ftd=False) + target.AppendModifier(name="ftd", openthread_ftd=True) return target @@ -473,7 +495,7 @@ def BuildQorvoTarget(): TargetPart('qpg6105', board=QpgBoard.QPG6105), ]) - # apps + # apps target.AppendFixedTargets([ TargetPart('lock', app=QpgApp.LOCK), TargetPart('light', app=QpgApp.LIGHT), @@ -608,8 +630,9 @@ def BuildOpenIotSdkTargets(): BuildASRTarget(), BuildAndroidTarget(), BuildBouffalolabTarget(), - Buildcc13x2x7_26x2x7Target(), Buildcc32xxTarget(), + BuildCC13x2x7Target(), + BuildCC13x4Target(), BuildCyw30739Target(), BuildEfr32Target(), BuildEsp32Target(), diff --git a/scripts/build/builders/ti.py b/scripts/build/builders/ti.py new file mode 100644 index 00000000000000..0f49cd44d06a90 --- /dev/null +++ b/scripts/build/builders/ti.py @@ -0,0 +1,140 @@ +# Copyright (c) 2021 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 os +from enum import Enum, auto +from typing import Optional + +from .gn import GnBuilder + + +class TIApp(Enum): + LOCK = auto() + PUMP = auto() + PUMP_CONTROLLER = auto() + ALL_CLUSTERS = auto() + ALL_CLUSTERS_MINIMAL = auto() + LIGHTING = auto() + SHELL = auto() + + def ExampleName(self): + if self == TIApp.LOCK: + return 'lock-app' + elif self == TIApp.PUMP: + return 'pump-app' + elif self == TIApp.PUMP_CONTROLLER: + return 'pump-controller-app' + elif self == TIApp.ALL_CLUSTERS: + return 'all-clusters-app' + elif self == TIApp.ALL_CLUSTERS_MINIMAL: + return 'all-clusters-minimal-app' + elif self == TIApp.LIGHTING: + return 'lighting-app' + elif self == TIApp.SHELL: + return 'shell' + else: + raise Exception('Unknown app type: %r' % self) + + def AppNamePrefix(self, board): + if self == TIApp.LOCK: + return f'chip-{board.BoardName()}-lock-example' + elif self == TIApp.PUMP: + return f'chip-{board.BoardName()}-pump-example' + elif self == TIApp.PUMP_CONTROLLER: + return f'chip-{board.BoardName()}-pump-controller-example' + elif self == TIApp.ALL_CLUSTERS: + return f'chip-{board.BoardName()}-all-clusters-example' + elif self == TIApp.ALL_CLUSTERS_MINIMAL: + return f'chip-{board.BoardName()}-all-clusters-minimal-example' + elif self == TIApp.LIGHTING: + return f'chip-{board.BoardName()}-lighting-example' + elif self == TIApp.SHELL: + return f'chip-{board.BoardName()}-shell-example' + else: + raise Exception('Unknown app type: %r' % self) + + def BuildRoot(self, root, board): + return os.path.join(root, 'examples', self.ExampleName(), board.FamilyName()) + + +class TIBoard(Enum): + LP_CC2652R7 = auto() + LP_EM_CC1354P10_6 = auto() + + def BoardName(self): + if self == TIBoard.LP_CC2652R7: + return 'LP_CC2652R7' + elif self == TIBoard.LP_EM_CC1354P10_6: + return 'LP_EM_CC1354P10_6' + else: + raise Exception('Unknown board type: %r' % self) + + def FamilyName(self): + if self == TIBoard.LP_CC2652R7: + return 'cc13x2x7_26x2x7' + elif self == TIBoard.LP_EM_CC1354P10_6: + return 'cc13x4_26x4' + else: + raise Exception('Unknown board type: %r' % self) + + +class TIBuilder(GnBuilder): + + def __init__(self, + root, + runner, + board=TIBoard.LP_CC2652R7, + app: TIApp = TIApp.LOCK, + openthread_ftd: Optional[bool] = None): + super(TIBuilder, self).__init__( + root=app.BuildRoot(root, board), + runner=runner) + self.code_root = root + self.app = app + self.board = board + self.openthread_ftd = openthread_ftd + + def GnBuildArgs(self): + args = [ + 'ti_sysconfig_root="%s"' % os.environ['TI_SYSCONFIG_ROOT'], + 'ti_simplelink_board="%s"' % self.board.BoardName(), + ] + + if self.openthread_ftd: + args.append('chip_openthread_ftd=true') + args.append('chip_progress_logging=false') + elif self.openthread_ftd is not None: + args.append('chip_openthread_ftd=false') + + return args + + def build_outputs(self): + items = {} + if (self.board == TIBoard.LP_CC2652R7): + if (self.app == TIApp.LOCK + or self.app == TIApp.PUMP + or self.app == TIApp.PUMP_CONTROLLER): + extensions = [".out", ".bin", ".out.map", "-bim.hex"] + + else: + extensions = [".out", ".out.map"] + + else: + extensions = [".out", ".out.map"] + + for extension in extensions: + name = '%s%s' % (self.app.AppNamePrefix(self.board), extension) + items[name] = os.path.join(self.output_dir, name) + + return items diff --git a/scripts/build/testdata/all_targets_linux_x64.txt b/scripts/build/testdata/all_targets_linux_x64.txt index bfe1d1a2118a3a..5d462bfad9b35d 100644 --- a/scripts/build/testdata/all_targets_linux_x64.txt +++ b/scripts/build/testdata/all_targets_linux_x64.txt @@ -2,8 +2,9 @@ ameba-amebad-{all-clusters,all-clusters-minimal,light,light-switch,pigweed} asr-{asr582x,asr595x}-lighting[-ota][-shell][-no_logging] android-{arm,arm64,x86,x64,androidstudio-arm,androidstudio-arm64,androidstudio-x86,androidstudio-x64}-{chip-tool,chip-test,tv-server,tv-casting-app,java-matter-controller}[-no-debug] bouffalolab-{bl602-iot-matter-v1,bl602-iot-dvk-3s,bl602-night-light,xt-zb6-devkit,bl706-iot-dvk,bl706-night-light}-light[-shell][-115200][-rpc][-cdc] -cc13x2x7_26x2x7-{all-clusters,all-clusters-minimal,lock,pump,pump-controller,shell}[-ftd][-mtd] cc32xx-lock +ti-cc13x2x7_26x2x7-{lighting,lock,pump,pump-controller}[-mtd] +ti-cc13x4_26x4-{all-clusters,lighting,lock,pump,pump-controller}[-mtd][-ftd] cyw30739-cyw930739m2evb_01-{light,lock,ota-requestor,switch} efr32-{brd4161a,brd4187c,brd4186c,brd4163a,brd4164a,brd4166a,brd4170a,brd4186a,brd4187a,brd4304a}-{window-covering,switch,unit-test,light,lock,thermostat}[-rpc][-with-ota-requestor][-sed][-low-power][-shell][-no_logging][-openthread_mtd][-enable_heap_monitoring][-no_openthread_cli][-show_qr_code][-wifi][-rs911x][-wf200][-wifi_ipv4][-additional_data_advertising][-use_ot_lib][-use_ot_coap_lib][-no-version] esp32-{m5stack,c3devkit,devkitc,qemu}-{all-clusters,all-clusters-minimal,ota-provider,ota-requestor,shell,light,lock,bridge,temperature-measurement,ota-requestor,tests}[-rpc][-ipv6only] diff --git a/scripts/tools/memory/platform/cc13x4_26x4.cfg b/scripts/tools/memory/platform/cc13x4_26x4.cfg new file mode 100644 index 00000000000000..ab9a4ba741394b --- /dev/null +++ b/scripts/tools/memory/platform/cc13x4_26x4.cfg @@ -0,0 +1,60 @@ +# Copyright (c) 2021 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. + +# Memory tools default configuation for TI CC13x2/CC26x2 + +{ + 'section': { + # By default, only these sections will be included + # when operating by sections. + 'default': ['.text', '.rodata', '.data', '.bss'] + }, + 'symbol': { + 'free': { + # These symbols mark the start or end of areas where memory that + # does not belong to any symbol is considered unused (rather than + # a gap that may be in use for some non-symbol purpose, e.g. string + # constants or alignment). + 'start': ['_stack'], + 'end': ['_stack_end', '__stack_end'], + } + }, + 'region': { + # Regions are sets of sections that can be used for aggregate reports. + 'sections': { + 'FLASH': [ + '.text', + '.rodata', + '.resetVecs', + '.ccfg', + '.ARM.exidx', + ], + 'RAM': [ + '.bss', + '.data', + '.heap', + '.nvs', + '.stack', + 'vtable_ram', + ], + } + }, + 'collect': { + # Strip these prefixes from compilation unit paths. + 'prefix': [ + r'C:\\.conan\\1233bc\\1\\source\\ti\\', + ], + 'prefix-file': True, + }, +} diff --git a/src/platform/cc13xx_26xx/cc13x2_26x2/BUILD.gn b/src/platform/cc13xx_26xx/cc13x2_26x2/BUILD.gn index d46bd18544af15..84c3ae9981e40b 100644 --- a/src/platform/cc13xx_26xx/cc13x2_26x2/BUILD.gn +++ b/src/platform/cc13xx_26xx/cc13x2_26x2/BUILD.gn @@ -99,9 +99,9 @@ static_library("cc13x2_26x2") { if (chip_mdns == "platform") { sources += [ - "../OpenThread/DnssdImpl.cpp", - "../OpenThread/OpenThreadDnssdImpl.cpp", - "../OpenThread/OpenThreadDnssdImpl.h", + "../../OpenThread/DnssdImpl.cpp", + "../../OpenThread/OpenThreadDnssdImpl.cpp", + "../../OpenThread/OpenThreadDnssdImpl.h", ] deps += [ "${chip_root}/src/lib/dnssd:platform_header" ] } diff --git a/src/platform/cc13xx_26xx/cc13x4_26x4/BUILD.gn b/src/platform/cc13xx_26xx/cc13x4_26x4/BUILD.gn index 8c2cac58e4abd0..ad8a73782a086c 100644 --- a/src/platform/cc13xx_26xx/cc13x4_26x4/BUILD.gn +++ b/src/platform/cc13xx_26xx/cc13x4_26x4/BUILD.gn @@ -98,8 +98,12 @@ static_library("cc13x4_26x4") { ] if (chip_mdns == "platform") { - sources += [ "../../OpenThread/DnssdImpl.cpp" ] deps += [ "${chip_root}/src/lib/dnssd:platform_header" ] + sources += [ + "../../OpenThread/DnssdImpl.cpp", + "../../OpenThread/OpenThreadDnssdImpl.cpp", + "../../OpenThread/OpenThreadDnssdImpl.h", + ] } } } diff --git a/third_party/ti_simplelink_sdk/repo_cc13xx_cc26xx b/third_party/ti_simplelink_sdk/repo_cc13xx_cc26xx index cac6a455adffdc..5d4cc6d8331df7 160000 --- a/third_party/ti_simplelink_sdk/repo_cc13xx_cc26xx +++ b/third_party/ti_simplelink_sdk/repo_cc13xx_cc26xx @@ -1 +1 @@ -Subproject commit cac6a455adffdcbc2e6c9499a0068c3d8c44b994 +Subproject commit 5d4cc6d8331df7b4a0880b52db53e54887f0b4f3