Skip to content

Commit

Permalink
Update CI to support CC13x4
Browse files Browse the repository at this point in the history
  • Loading branch information
adabreuti committed May 22, 2023
1 parent 876229d commit 7b86ecc
Show file tree
Hide file tree
Showing 8 changed files with 324 additions and 23 deletions.
100 changes: 98 additions & 2 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 Down Expand Up @@ -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/
8 changes: 4 additions & 4 deletions integrations/docker/images/chip-build-ti/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion integrations/docker/images/chip-build-vscode/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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/

Expand Down
32 changes: 18 additions & 14 deletions scripts/build/build/targets.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -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),
Expand Down Expand Up @@ -583,8 +587,8 @@ def BuildOpenIotSdkTargets():
BuildAmebaTarget(),
BuildAndroidTarget(),
BuildBouffalolabTarget(),
Buildcc13x2x7_26x2x7Target(),
Buildcc32xxTarget(),
BuildTITargets(),
BuildCyw30739Target(),
BuildEfr32Target(),
BuildEsp32Target(),
Expand Down
141 changes: 141 additions & 0 deletions scripts/build/builders/ti.py
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion scripts/build/testdata/all_targets_linux_x64.txt
Original file line number Diff line number Diff line change
@@ -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]
Expand Down
Loading

0 comments on commit 7b86ecc

Please sign in to comment.