diff --git a/.github/workflows/examples-cc13x2x7_26x2x7.yaml b/.github/workflows/examples-cc13x2x7_26x2x7.yaml index f3703f38b85f69..517a038ee82cb3 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 @@ -79,5 +78,102 @@ 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-lock-ftd \ + --target ti-cc13x4_26x4-lock-mtd \ + --target ti-cc13x4_26x4-pump-mtd \ + --target ti-cc13x4_26x4-pump-ftd \ + --target ti-cc13x4_26x4-all-clusters \ + --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 All-clusters App size stats + timeout-minutes: 5 + run: | + .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ + cc13x4_26x4 LP_EM_CC1354P10_6 all-clusters-app \ + out/artifacts/ti-cc13x4_26x4-all-clusters/chip-LP_EM_CC1354P10_6-all-clusters-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/integrations/docker/images/chip-build-ti/Dockerfile b/integrations/docker/images/chip-build-ti/Dockerfile index 20eb5889c16f36..649c8a4fc831b6 100644 --- a/integrations/docker/images/chip-build-ti/Dockerfile +++ b/integrations/docker/images/chip-build-ti/Dockerfile @@ -11,9 +11,9 @@ RUN set -x \ # Install Sysconfig RUN set -x \ - && wget https://dr-download.ti.com/software-development/ide-configuration-compiler-or-debugger/MD-nsUM6f7Vvb/1.13.0.2553/sysconfig-1.13.0_2553-setup.run \ - && chmod +x sysconfig-1.13.0_2553-setup.run \ - && ./sysconfig-1.13.0_2553-setup.run --mode unattended \ + && wget https://dr-download.ti.com/software-development/ide-configuration-compiler-or-debugger/MD-nsUM6f7Vvb/1.15.0.2826/sysconfig-1.15.0_2826-setup.run \ + && chmod +x sysconfig-1.15.0_2826-setup.run \ + && ./sysconfig-1.15.0_2826-setup.run --mode unattended \ && : # last line -ENV TI_SYSCONFIG_ROOT=/opt/ti/sysconfig_1.13.0 +ENV TI_SYSCONFIG_ROOT=/opt/ti/sysconfig_1.15.0 diff --git a/integrations/docker/images/chip-build-vscode/Dockerfile b/integrations/docker/images/chip-build-vscode/Dockerfile index 276c5959f8e812..b6c4f2747f7963 100644 --- a/integrations/docker/images/chip-build-vscode/Dockerfile +++ b/integrations/docker/images/chip-build-vscode/Dockerfile @@ -48,7 +48,7 @@ COPY --from=k32w /opt/sdk /opt/k32w_sdk COPY --from=imx /opt/fsl-imx-xwayland /opt/fsl-imx-xwayland -COPY --from=ti /opt/ti/sysconfig_1.13.0 /opt/ti/sysconfig_1.13.0 +COPY --from=ti /opt/ti/sysconfig_1.15.0 /opt/ti/sysconfig_1.15.0 COPY --from=openiotsdk /opt/FVP_Corstone_SSE-300/ /opt/FVP_Corstone_SSE-300/ diff --git a/scripts/build/build/targets.py b/scripts/build/build/targets.py index 49a6d74cbd2f43..ce7b2f45f58160 100755 --- a/scripts/build/build/targets.py +++ b/scripts/build/build/targets.py @@ -15,7 +15,6 @@ from builders.ameba import AmebaApp, AmebaBoard, AmebaBuilder from builders.android import AndroidApp, AndroidBoard, AndroidBuilder, AndroidProfile 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 @@ -31,6 +30,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 @@ -393,21 +393,25 @@ def BuildK32WTarget(): return target -def Buildcc13x2x7_26x2x7Target(): - target = BuildTarget('cc13x2x7_26x2x7', cc13x2x7_26x2x7Builder) +def BuildTITargets(): + 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), + TargetPart('cc13x4_26x4', board=TIBoard.LP_EM_CC1354P10_6) ]) - target.AppendModifier(name="ftd", openthread_ftd=True).ExceptIfRe("-mtd") - target.AppendModifier(name="mtd", openthread_ftd=False).ExceptIfRe("-ftd") + target.AppendFixedTargets([ + TargetPart('all-clusters', app=TIApp.ALL_CLUSTERS).OnlyIfRe("-(cc13x4_26x4)-"), + TargetPart('lighting', app=TIApp.LIGHTING), + TargetPart('lock-ftd', app=TIApp.LOCK, openthread_ftd=True).OnlyIfRe("-(cc13x4_26x4)-"), + TargetPart('lock-mtd', app=TIApp.LOCK, openthread_ftd=False), + TargetPart('pump-ftd', app=TIApp.PUMP, openthread_ftd=True).OnlyIfRe("-(cc13x4_26x4)-"), + TargetPart('pump-mtd', app=TIApp.PUMP, openthread_ftd=False), + TargetPart('pump-controller-ftd', app=TIApp.PUMP_CONTROLLER, openthread_ftd=True).OnlyIfRe("-(cc13x4_26x4)-"), + TargetPart('pump-controller-mtd', app=TIApp.PUMP_CONTROLLER, openthread_ftd=False), + ]) return target @@ -450,7 +454,7 @@ def BuildQorvoTarget(): TargetPart('qpg6105', board=QpgBoard.QPG6105), ]) - # apps + # apps target.AppendFixedTargets([ TargetPart('lock', app=QpgApp.LOCK), TargetPart('light', app=QpgApp.LIGHT), @@ -583,8 +587,8 @@ def BuildOpenIotSdkTargets(): BuildAmebaTarget(), BuildAndroidTarget(), BuildBouffalolabTarget(), - Buildcc13x2x7_26x2x7Target(), Buildcc32xxTarget(), + BuildTITargets(), BuildCyw30739Target(), BuildEfr32Target(), BuildEsp32Target(), diff --git a/scripts/build/builders/ti.py b/scripts/build/builders/ti.py new file mode 100644 index 00000000000000..cd81ca56ec915e --- /dev/null +++ b/scripts/build/builders/ti.py @@ -0,0 +1,141 @@ +# 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 .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: 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 is None: + pass + elif self.openthread_ftd: + args.append('chip_openthread_ftd=true') + args.append('chip_progress_logging=false') + else: + 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 63ad58f917a54a..e4e45f5fbf9fba 100644 --- a/scripts/build/testdata/all_targets_linux_x64.txt +++ b/scripts/build/testdata/all_targets_linux_x64.txt @@ -1,8 +1,8 @@ ameba-amebad-{all-clusters,all-clusters-minimal,light,light-switch,pigweed} 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,cc13x4_26x4}-{all-clusters,lighting,lock-ftd,lock-mtd,pump-ftd,pump-mtd,pump-controller-ftd,pump-controller-mtd} 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/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