Skip to content

Commit

Permalink
Add CC13X2_26X2 to github C/I (#16638)
Browse files Browse the repository at this point in the history
* add TI SimpleLink github repo

* add cc13x2x7_26x2x7 github workflow

* add docker image for sysconfig

* fix unit test data and unified build documentation

* address PR fixes

Set the reabes_path for necessary flags based on the root bulid directory.

* back out docker image change

* fix lock names for bloat check

* changes from restyled
  • Loading branch information
srickardti authored Mar 30, 2022
1 parent df68705 commit bbbf7ce
Show file tree
Hide file tree
Showing 24 changed files with 357 additions and 188 deletions.
1 change: 1 addition & 0 deletions .github/workflows/docker_img.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ jobs:
- "-mbed-os"
- "-nrf-platform"
- "-telink"
- "-ti"
- "-tizen"
# NOTE: vscode image consumes ~52 GB disk space but GitHub-hosted runners provide ~10 GB free disk space(https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners#supported-runners-and-hardware-resources)
#- "-vscode"
Expand Down
114 changes: 114 additions & 0 deletions .github/workflows/examples-cc13x2x7_26x2x7.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
# 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.

name: Build example - TI CC26X2X7

on:
push:
pull_request:

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

jobs:
cc26x2x7:
name: cc26x2x7
timeout-minutes: 60

env:
BUILD_TYPE: gn_cc26x2x7
TI_SYSCONFIG_ROOT: /opt/ti/sysconfig_1.11.0

runs-on: ubuntu-latest
if: github.actor != 'restyled-io[bot]'

container:
image: connectedhomeip/chip-build:latest
volumes:
- "/tmp/bloat_reports:/tmp/bloat_reports"
steps:
- uses: Wandalen/[email protected]
name: Checkout
with:
action: actions/checkout@v3
with: |
submodules: true
token: ${{ github.token }}
attempt_limit: 3
attempt_delay: 2000
- name: Set up environment for size reports
if: ${{ !env.ACT }}
env:
GH_CONTEXT: ${{ toJson(github) }}
run: scripts/tools/memory/gh_sizes_environment.py "${GH_CONTEXT}"
- name: Install SysConfig
timeout-minutes: 30
run: |
wget https://software-dl.ti.com/ccs/esd/sysconfig/sysconfig-1.11.0_2225-setup.run
chmod +x sysconfig-1.11.0_2225-setup.run
./sysconfig-1.11.0_2225-setup.run --mode unattended
- name: Bootstrap
timeout-minutes: 25
run: scripts/build/gn_bootstrap.sh
- name: Uploading bootstrap logs
uses: actions/upload-artifact@v2
if: ${{ always() }} && ${{ !env.ACT }}
with:
name: bootstrap-logs
path: |
.environment/gn_out/.ninja_log
.environment/pigweed-venv/*.log
- name: Build examples
timeout-minutes: 30
run: |
scripts/run_in_build_env.sh "\
./scripts/build/build_examples.py --target-glob cc13x2x7_26x2x7* build \
--copy-artifacts-to out/artifacts \
"
- name: Get lock FTD size stats
timeout-minutes: 5
run: |
.environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \
cc13x2_26x2 LP_CC2652R7 lock-ftd \
out/artifacts/cc13x2x7_26x2x7-lock-ftd/chip-LP_CC2652R7-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 \
cc13x2_26x2 LP_CC2652R7 lock-mtd \
out/artifacts/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/cc13x2x7_26x2x7-pump/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/cc13x2x7_26x2x7-pump-controller/chip-LP_CC2652R7-pump-controller-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/
4 changes: 4 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -196,3 +196,7 @@
[submodule "third_party/telink_sdk/repo"]
path = third_party/telink_sdk/repo
url = https://github.com/rikorsev/telink_b91_ble_sdk
[submodule "ti_simplelink_sdk"]
path = third_party/ti_simplelink_sdk/repo_cc13xx_cc26xx
url = https://github.com/TexasInstruments/cc13xx_cc26xx_sdk.git
branch = main
11 changes: 6 additions & 5 deletions docs/guides/BUILDING.md
Original file line number Diff line number Diff line change
Expand Up @@ -281,13 +281,14 @@ gn desc out/unified '//src/controller(//build/toolchain/host:linux_x64_clang)'
```

Note: Some platforms that can be built as part of the unified build require
downloading additional SDKs. To add these to the build, the location of the SDK
installation must be provided as a build argument. For example, to add the
Simplelink cc13x2_26x2 examples to the unified build, install the
[SDK](https://ti.com/chip_sdk) and add the following build arguments:
downloading additional tools. To add these to the build, the location must be
provided as a build argument. For example, to add the Simplelink cc13x2_26x2
examples to the unified build, install
[SysConfig](https://www.ti.com/tool/SYSCONFIG) and add the following build
arguments:

```
gn gen out/unified --args="target_os=\"all\" enable_ti_simplelink_builds=true ti_simplelink_sdk_root=\"/path/to/sdk\" ti_sysconfig_root=\"/path/to/sysconfig\""
gn gen out/unified --args="target_os=\"all\" enable_ti_simplelink_builds=true ti_sysconfig_root=\"/path/to/sysconfig\""
```

## Getting help
Expand Down
104 changes: 25 additions & 79 deletions examples/lock-app/cc13x2x7_26x2x7/README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Matter CC1352 CC2652 Lock Example Application

An example application showing the use of [Matter][matter] on the Texas
Instruments CC13X2_26X2 family of Wireless MCUs.
Instruments CC13XX_26XX family of Wireless MCUs.

---

Expand All @@ -28,14 +28,11 @@ Instruments CC13X2_26X2 family of Wireless MCUs.

![CC1352R1_LAUNCHXL](doc/images/cc1352r1_launchxl.jpg)

The CC13X2_26X2 lock example application provides a working demonstration of a
The CC13XX_26XX lock example application provides a working demonstration of a
connected door lock device. This uses the open-source Matter implementation and
the Texas Instruments SimpleLink™ CC13x2 and CC26x2 software development kit.
the Texas Instruments SimpleLink™ CC13XX and CC26XX software development kit.

This example is enabled to build for CC2652R7 devices. This upcoming devices are
currently not yet in full production. For more information on device
availability or early access to an engineering build of our Matter-enabled SDK,
please reach out [here][ti_cc13x2_26x2_r7_matter_request].
This example is enabled to build for CC2652R7 devices.

The lock example is intended to serve both as a means to explore the workings of
Matter, as well as a template for creating real products based on the Texas
Expand Down Expand Up @@ -65,69 +62,17 @@ Some initial setup is necessary for preparing the build environment. This
section will need to be done when migrating to new versions of the SDK. This
guide assumes that the environment is linux based, and recommends Ubuntu 20.04.

- An engineering SDK from TI is required. Please request access for it
[here][ti_cc13x2_26x2_r7_matter_request].

- Follow the default installation instructions when executing the
installer.

- The version of OpenThread used in this repository is newer than the one
packaged with the TI SDK. Check the following section for a list of
changes needed.

- Download and install [SysConfig][sysconfig] ([recommended
version][sysconfig_recommended])

- This may have already been installed with your SimpleLink SDK install.

- If you have installed different versions, the build defaults will need to be
changed to reflect this in
`${chip_root}/examples/build_overrides/ti_simplelink_sdk.gni`.

- Install Python 3.8 for the GN build system:
version][sysconfig_recommended]). This can be done simply with the following
commands.

```
# Linux
$ sudo apt-get install python3.8 python3.8-distutils python3.8-dev python3.8-venv
# Distutils listed due to a package manager error on Ubuntu 18.04
$ cd ~
$ wget https://software-dl.ti.com/ccs/esd/sysconfig/sysconfig-1.11.0_2225-setup.run
$ chmod +x sysconfig-1.11.0_2225-setup.run
$ ./sysconfig-1.11.0_2225-setup.run
```
- You will have to ensure that the default version of Python 3 is Python
3.8.
- Check python3 version:
```
$ python3 --version
Python 3.8.0
```
- If it is not Python 3.8:
```
$ sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.8 1
```
- This may affect your environment in other ways if there was a
specific dependency on the prior python3 version (e.g. apt).
After completing the build process for this example, you can
revert the python3 version, for instance:
```
$ sudo update-alternatives --config python3
There are 2 choices for the alternative python3 (providing /usr/bin/python3).
Selection Path Priority Status
-------------------------------------------------------------
0 /usr/bin/python3.8 1 auto mode
1 /usr/bin/python3.6 1 manual mode
* 2 /usr/bin/python3.8 1 manual mode
Press <enter> to keep the current choice[*], or type selection number: 1
update-alternatives: using /usr/bin/python3.6 to provide /usr/bin/python3 (python3) in manual mode
```
- Run the bootstrap script to setup the build environment.
```
Expand All @@ -152,16 +97,13 @@ Ninja to build the executable.
- Run the build to produce a default executable. By default on Linux both the
TI SimpleLink SDK and Sysconfig are located in a `ti` folder in the user's
home directory, and you must provide the absolute path to them. For example
`/home/username/ti/simplelink_cc13xx_cc26xx_sdk_5_30_03_01_eng` and
`/home/username/ti/sysconfig_1.10.0`. On Windows the default directory is
`/home/username/ti/sysconfig_1.11.0`. On Windows the default directory is
`C:\ti`. Take note of this install path, as it will be used in the next
step.
```
$ cd ~/connectedhomeip/examples/lock-app/cc13x2x7_26x2x7
$ export TI_SIMPLELINK_SDK_ROOT=$HOME/ti/simplelink_cc13xx_cc26xx_sdk_5_30_03_01_eng
$ export TI_SYSCONFIG_ROOT=$HOME/ti/sysconfig_1.10.0
$ gn gen out/debug --args="ti_simplelink_sdk_root=\"${TI_SIMPLELINK_SDK_ROOT}\" ti_sysconfig_root=\"${TI_SYSCONFIG_ROOT}\""
$ gn gen out/debug --args="ti_sysconfig_root=\"$HOME/ti/sysconfig_1.11.0\""
$ ninja -C out/debug
```
Expand Down Expand Up @@ -250,11 +192,13 @@ an existing Thread network. The following sections assume that a Thread network
is already active, and has at least one [OpenThread Border
Router][ot_border_router_setup].
For insight into what other components are needed to run this example, please
refer to our [Matter Getting Started Guide][matter-e2e-faq].
### Provisioning
The first step to bring the Matter device onto the network is to provision it.
Our example accomplishes this with Bluetooth Low Energy (BLE) and the
[CHIPTool](../../../src/android/CHIPTool/README.md) mobile app.
Interacting with the application begins by enabling BLE advertisements and then
pairing the device into a Thread network.
#### Bluetooth LE Advertising
Expand All @@ -265,10 +209,11 @@ fully provisioned, BLE advertising will stop.
#### Bluetooth LE Rendezvous
To commission and control this application within a Matter-enabled Thread
network, consult the [CHIPTool README](../../../src/android/CHIPTool/README.md)
for information on the Android smartphone application. Reference the Device
Configuration information printed in the Logging Output of this application.
Pairing this application with `ble-thread` can be done with any of the enabled
[CHIP Controller](../../../src/controller/README.md) applications. Use the
information printed on the console to aide in pairing the device. The controller
application can also be used to control the example app with the cluster
commands.
## TI Support
Expand All @@ -287,11 +232,12 @@ Additionally, we welcome any feedback.
https://software-dl.ti.com/ccs/esd/documents/users_guide/ccs_debug-main.html?configuration#manual-method
[cc1352r1_launchxl]: https://www.ti.com/tool/LAUNCHXL-CC1352R1
[e2e]: https://e2e.ti.com/support/wireless-connectivity/zigbee-and-thread
[matter-e2e-faq]:
https://e2e.ti.com/support/wireless-connectivity/zigbee-thread-group/zigbee-and-thread/f/zigbee-thread-forum/1082428/faq-cc2652r7-matter----getting-started-guide
[sysconfig]: https://www.ti.com/tool/SYSCONFIG
[sysconfig_recommended]:
https://software-dl.ti.com/ccs/esd/sysconfig/sysconfig-1.10.0_2163-setup.run
https://software-dl.ti.com/ccs/esd/sysconfig/sysconfig-1.11.0_2225-setup.run
[ti_thread_dnd]:
https://www.ti.com/wireless-connectivity/thread/design-development.html
[ti_cc13x2_26x2_r7_matter_request]: https://ti.com/chip_sdk
[ot_border_router_setup]: https://openthread.io/guides/border-router/build
[uniflash]: https://www.ti.com/tool/download/UNIFLASH
Loading

0 comments on commit bbbf7ce

Please sign in to comment.