Skip to content

Commit

Permalink
Add CI for CC13x4 Platforms (#26730)
Browse files Browse the repository at this point in the history
* Update CC13x4 CI

* Update scripts based on PR feedback

* Apply Linting updates

* Apply code review comments: Simplify CI for CC13x2x7 and CC13x4 platforms. Resolve Lock app pathing failure

* Update TI Build version

* Restyled by clang-format

* Restyled by autopep8

* Restyled by isort

* Update CI Targets

---------

Co-authored-by: Restyled.io <[email protected]>
  • Loading branch information
adabreuti and restyled-commits authored May 25, 2023
1 parent bc0d422 commit 7ea1978
Show file tree
Hide file tree
Showing 11 changed files with 352 additions and 25 deletions.
93 changes: 90 additions & 3 deletions .github/workflows/examples-cc13x2x7_26x2x7.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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:
Expand Down Expand Up @@ -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/
2 changes: 2 additions & 0 deletions examples/lock-app/cc13x2x7_26x2x7/src/LockManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -640,6 +640,8 @@ const char * LockManager::lockStateToString(DlLockState lockState) const
return "Unlocked";
case DlLockState::kUnknownEnumValue:
break;
default:
break;
}

return "Unknown";
Expand Down
2 changes: 2 additions & 0 deletions examples/lock-app/cc13x4_26x4/src/LockManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -640,6 +640,8 @@ const char * LockManager::lockStateToString(DlLockState lockState) const
return "Unlocked";
case DlLockState::kUnknownEnumValue:
break;
default:
break;
}

return "Unknown";
Expand Down
12 changes: 10 additions & 2 deletions integrations/cloudbuild/build-all.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
51 changes: 37 additions & 14 deletions scripts/build/build/targets.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -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),
Expand Down Expand Up @@ -608,8 +630,9 @@ def BuildOpenIotSdkTargets():
BuildASRTarget(),
BuildAndroidTarget(),
BuildBouffalolabTarget(),
Buildcc13x2x7_26x2x7Target(),
Buildcc32xxTarget(),
BuildCC13x2x7Target(),
BuildCC13x4Target(),
BuildCyw30739Target(),
BuildEfr32Target(),
BuildEsp32Target(),
Expand Down
140 changes: 140 additions & 0 deletions scripts/build/builders/ti.py
Original file line number Diff line number Diff line change
@@ -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
3 changes: 2 additions & 1 deletion scripts/build/testdata/all_targets_linux_x64.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
Loading

0 comments on commit 7ea1978

Please sign in to comment.