Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add TI CC32XX to Github CI #24806

Merged
merged 49 commits into from
Feb 7, 2023
Merged
Show file tree
Hide file tree
Changes from 46 commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
16f9244
add TI CC32xx CI
abiradarti Aug 18, 2022
35c4cbd
Update README.md
abiradarti Aug 18, 2022
8782f6c
Update README.md
abiradarti Aug 18, 2022
6e27e1e
Update README.md
abiradarti Aug 18, 2022
b357592
update lock-app readme sysconfig version
abiradarti Aug 18, 2022
fc9dbe3
Merge branch 'ci' of github.com:abiradarti/connectedhomeip into ci
abiradarti Aug 18, 2022
3b54b07
Merge branch 'project-chip:master' into ci
abiradarti Aug 24, 2022
25e7428
fixed lock app example path in cc32xx.py
abiradarti Aug 24, 2022
88b7d46
wrap dmm source set with cc13xx family check
abiradarti Aug 24, 2022
13f7e87
added cc32xx as a platform for freertos submodule, added path to dnssd.h
abiradarti Aug 25, 2022
427d0c0
trying again to add dnssd.h path
abiradarti Aug 25, 2022
3bac382
adding path to public deps
abiradarti Aug 26, 2022
c5dbce3
adding src to include path and taking out public dependency
abiradarti Aug 29, 2022
618ceaf
trying to add dnssd lib as a dependency
abiradarti Aug 30, 2022
18b7c9a
saved from August
abiradarti Nov 28, 2022
ab5511f
moved DNSSD Start Server call and CommonDeviceCallbacks into examples…
abiradarti Jan 18, 2023
73f4cb4
removed dnssd.h file include from connectivitymanagerimpl.cpp
abiradarti Jan 19, 2023
e960252
moved commondevicecallbacks and chipdevicemanager into example src fi…
abiradarti Jan 20, 2023
63347f1
added implementation for deviceeventcallback
abiradarti Jan 24, 2023
40fcba6
removed DeviceCallbacks.cpp and .h and renamed CommonDeviceCallbacks.…
abiradarti Jan 24, 2023
72dcbb9
merge conflcit fix
abiradarti Jan 24, 2023
fb4fdff
Merge branch 'project-chip-master' into ci
abiradarti Jan 24, 2023
11db66b
merge conflict resolution on targets.py
abiradarti Jan 25, 2023
b8ec351
fixed build command for lock-app
abiradarti Jan 25, 2023
fd50e94
added missing header in CC32XXConfig.cpp and corrected header in AppT…
abiradarti Jan 25, 2023
49fee84
updated cc32xx yaml file to have the correct docker img version
abiradarti Jan 25, 2023
e64f4a1
removed StartEventLoop Task so that CHIPDeviceManager can start it
abiradarti Jan 26, 2023
07c24d1
added CC32xx DAC certs and code cleanup
abiradarti Jan 27, 2023
6e6ec48
removed CHIP-tool modification section in lock-app readme, not needed…
abiradarti Jan 30, 2023
5539c81
more code cleanup
abiradarti Feb 1, 2023
b6190b2
forgot to add platform BUILD.gn to prev commit
abiradarti Feb 1, 2023
549a483
added DAC instructions in lock-app readme
abiradarti Feb 2, 2023
70b7eb5
Merge branch 'master' into ci
abiradarti Feb 2, 2023
6b78fcb
Restyled by whitespace
restyled-commits Feb 2, 2023
819e6e6
Restyled by clang-format
restyled-commits Feb 2, 2023
4b1d46c
Restyled by gn
restyled-commits Feb 2, 2023
68126c3
Restyled by prettier-markdown
restyled-commits Feb 2, 2023
9953cb8
Restyled by autopep8
restyled-commits Feb 2, 2023
659e8aa
Merge branch 'ci' of github.com:abiradarti/connectedhomeip into ci
abiradarti Feb 2, 2023
cff3164
misspell correction
abiradarti Feb 2, 2023
b36feab
correcting merge conflict resolution mistake and adding Accessors.h b…
abiradarti Feb 2, 2023
3f2a7ee
corrected contents of testdata folder
abiradarti Feb 2, 2023
e3e3526
code cleanup from PR feedback
abiradarti Feb 3, 2023
07adb63
removed brackets from lock in all_targets_linux_x64.txt
abiradarti Feb 3, 2023
44cf63f
Merge branch 'master' into ci
abiradarti Feb 3, 2023
c05f81d
empty commit
abiradarti Feb 3, 2023
43032b1
increased job timeout limit
abiradarti Feb 6, 2023
ed1c812
Merge branch 'master' into ci
abiradarti Feb 6, 2023
43550ba
Merge branch 'master' into ci
abiradarti Feb 6, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
89 changes: 89 additions & 0 deletions .github/workflows/examples-cc32xx.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
# 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 CC32XX

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:
cc32xx:
name: cc32xx
timeout-minutes: 60
abiradarti marked this conversation as resolved.
Show resolved Hide resolved

env:
BUILD_TYPE: gn_cc32xx

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

container:
image: connectedhomeip/chip-build-ti:0.6.34
volumes:
- "/tmp/bloat_reports:/tmp/bloat_reports"
steps:
- uses: Wandalen/[email protected]
name: Checkout
with:
action: actions/checkout@v3
with: |
token: ${{ github.token }}
attempt_limit: 3
attempt_delay: 2000
- name: Checkout submodules
run: scripts/checkout_submodules.py --shallow --platform cc32xx
- 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: 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: 60
run: |
scripts/run_in_build_env.sh "\
./scripts/build/build_examples.py \
--target cc32xx-lock build \
--copy-artifacts-to out/artifacts \
"
- name: Get lock app size stats
timeout-minutes: 5
run: |
.environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \
cc32xx CC3235SF_LAUNCHXL lock \
out/artifacts/cc32xx-lock/chip-CC3235SF_LAUNCHXL-lock-example.out \
/tmp/bloat_reports/

- name: Uploading Size Reports
uses: actions/upload-artifact@v2
if: ${{ !env.ACT }}
with:
name: Size,cc32xx-Examples,${{ env.GH_EVENT_PR }},${{ env.GH_EVENT_HASH }},${{ env.GH_EVENT_PARENT }},${{ github.event_name }}
path: |
/tmp/bloat_reports/
2 changes: 1 addition & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
path = third_party/freertos/repo
url = https://github.com/FreeRTOS/FreeRTOS-Kernel.git
branch = V10.3.1-kernel-only
platforms = ameba,cc13x2_26x2,bouffalolab,efr32,esp32,k32w0,infineon,qpg
platforms = ameba,cc13x2_26x2,bouffalolab,efr32,esp32,k32w0,infineon,qpg,cc32xx
[submodule "simw-top-mini"]
path = third_party/simw-top-mini/repo
url = https://github.com/NXP/plug-and-trust.git
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
[![Examples - nRF Connect SDK](https://github.com/project-chip/connectedhomeip/workflows/Build%20example%20-%20nRF%20Connect%20SDK/badge.svg)](https://github.com/project-chip/connectedhomeip/actions/workflows/examples-nrfconnect.yaml)
[![Examples - QPG](https://github.com/project-chip/connectedhomeip/workflows/Build%20example%20-%20QPG/badge.svg)](https://github.com/project-chip/connectedhomeip/actions/workflows/examples-qpg.yaml)
[![Examples - TI CC26X2X7](https://github.com/project-chip/connectedhomeip/workflows/Build%20example%20-%20TI%20CC26X2X7/badge.svg)](https://github.com/project-chip/connectedhomeip/actions/workflows/examples-cc13x2x7_26x2x7.yaml)
[![Examples - TI CC32XX](https://github.com/project-chip/connectedhomeip/workflows/Build%20example%20-%20TI%20CC32XX/badge.svg)](https://github.com/project-chip/connectedhomeip/actions/workflows/examples-cc32xx.yaml)
[![Build example - Infineon](https://github.com/project-chip/connectedhomeip/actions/workflows/examples-infineon.yaml/badge.svg)](https://github.com/project-chip/connectedhomeip/actions/workflows/examples-infineon.yaml)
[![Build example - BouffaloLab](https://github.com/project-chip/connectedhomeip/workflows/Build%20example%20-%20BouffaloLab/badge.svg)](https://github.com/project-chip/connectedhomeip/actions/workflows/examples-bouffalolab.yaml)

Expand Down
4 changes: 4 additions & 0 deletions examples/lock-app/cc32xx/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ source_set("lock_app_sdk") {
"${project_dir}/main",
"${project_dir}/main/ifmod/",
"${chip_root}/src/platform/cc32xx",
"${chip_root}/examples/platform/cc32xx",
]

deps = [
Expand All @@ -83,7 +84,9 @@ ti_simplelink_executable("lock_app") {
sources = [
"${project_dir}/main/AppTask.cpp",
"${project_dir}/main/BoltLockManager.cpp",
"${project_dir}/main/CHIPDeviceManager.cpp",
"${project_dir}/main/CXXExceptionStubs.cpp",
"${project_dir}/main/DeviceCallbacks.cpp",
"${project_dir}/main/ZclCallbacks.cpp",
]

Expand All @@ -92,6 +95,7 @@ ti_simplelink_executable("lock_app") {
":sdk",
":sysconfig",
"${chip_root}/examples/lock-app/lock-common",
"${chip_root}/examples/platform/cc32xx:cc32xx-attestation-credentials",
"${chip_root}/src/lib",
"${chip_root}/src/setup_payload",
]
Expand Down
22 changes: 11 additions & 11 deletions examples/lock-app/cc32xx/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,9 @@ guide assumes that the environment is linux based, and recommends Ubuntu 20.04.

```
$ cd ~
$ wget https://software-dl.ti.com/ccs/esd/sysconfig/sysconfig-1.12.1_2446-setup.run
$ chmod +x sysconfig-1.12.1_2446-setup.run
$ ./sysconfig-1.12.1_2446-setup.run
$ wget https://software-dl.ti.com/ccs/esd/sysconfig/sysconfig-1.13.0_2553-setup.run
$ chmod +x sysconfig-1.13.0_2553-setup.run
$ ./sysconfig-1.13.0_2553-setup.run
```

- Run the bootstrap script to setup the build environment.
Expand All @@ -85,17 +85,23 @@ Ninja to build the executable.
- Run the build to produce a default executable. By default on Linux the
Sysconfig is located in a `ti` folder in the user's home directory, and you
must provide the absolute path for it. For example
`/home/username/ti/sysconfig_1.12.1`. On Windows the default directory is
`/home/username/ti/sysconfig_1.13.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/cc32xx
$ gn gen out/debug --args="ti_sysconfig_root=\"$HOME/ti/sysconfig_1.12.1\""
$ gn gen out/debug --args="ti_sysconfig_root=\"$HOME/ti/sysconfig_1.13.0\""
$ ninja -C out/debug
```

## Adding DAC Certificates

To add custom DAC Certificates, the `CC32XXDeviceAttestationCreds.cpp` file in
`examples/platform/cc32xx` can be modified. The private key, public key, DAC
cert and PAI cert arrays all need to be replaced.

## Programming

Loading the built image onto a LaunchPad is supported through Code Composer
Expand Down Expand Up @@ -160,12 +166,6 @@ the device is connected to the local AP, commissioning can be triggered using

BLE provisioning is not supported currently.

### CHIP tool changes needed for Wi-Fi example

The timeout for the CHIP tool needs to be increased from 10 to 15 seconds. This
can be done in `chip::System::Clock::Timeout GetWaitDuration` in
`connectedhomeip/examples/chip-tool/commands/clusters/ModelCommand.h`

## TI Support

For technical support, please consider creating a post on TI's [E2E forum][e2e].
Expand Down
32 changes: 23 additions & 9 deletions examples/lock-app/cc32xx/main/AppTask.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,20 @@
#include "AppTask.h"
#include "AppConfig.h"
#include "AppEvent.h"

#include <app-common/zap-generated/attributes/Accessors.h>
#include <app-common/zap-generated/ids/ClusterIds.h>
#include <app-common/zap-generated/ids/Clusters.h>
#include <app/server/Server.h>
#include <app/util/attribute-storage.h>

#include "FreeRTOS.h"

#include <credentials/DeviceAttestationCredsProvider.h>
#include <credentials/examples/DeviceAttestationCredsExample.h>
#include <examples/platform/cc32xx/CC32XXDeviceAttestationCreds.h>

#include <CHIPDeviceManager.h>
#include <DeviceCallbacks.h>
#include <lib/support/CHIPMem.h>
#include <lib/support/CHIPPlatformMemory.h>
#include <platform/CHIPDeviceLayer.h>
Expand Down Expand Up @@ -59,6 +63,7 @@ using namespace ::chip::System;

using namespace ::chip::Credentials;
using namespace ::chip::DeviceLayer;
using namespace ::chip::DeviceManager;

static TaskHandle_t sAppTaskHandle;
static QueueHandle_t sAppEventQueue;
Expand All @@ -68,6 +73,8 @@ static Button_Handle gButtonRightHandle;

AppTask AppTask::sAppTask;

static DeviceCallbacks EchoCallbacks;

int AppTask::StartAppTask()
{
int ret = 0;
Expand Down Expand Up @@ -139,14 +146,6 @@ int AppTask::Init()
while (true)
;
}
PLAT_LOG("Start Event Loop Task");
ret = PlatformMgr().StartEventLoopTask();
if (ret != CHIP_NO_ERROR)
{
PLAT_LOG("PlatformMgr().StartEventLoopTask() failed");
while (true)
;
}

// Init ZCL Data Model and start server
PLAT_LOG("Initialize Server");
Expand All @@ -156,7 +155,12 @@ int AppTask::Init()

// Initialize device attestation config
PLAT_LOG("Initialize device attestation config");
#ifdef CC32XX_ATTESTATION_CREDENTIALS
SetDeviceAttestationCredentialsProvider(CC32XX::GetCC32XXDacProvider());
#else

SetDeviceAttestationCredentialsProvider(Examples::GetExampleDACProvider());
#endif

// Initialize BoltLock module
PLAT_LOG("Initialize BoltLock");
Expand All @@ -170,6 +174,16 @@ int AppTask::Init()
PLAT_LOG("Print Onboarding Codes");
PrintOnboardingCodes(chip::RendezvousInformationFlags(chip::RendezvousInformationFlag::kOnNetwork));

PLAT_LOG("Start CHIPDeviceManager and Start Event Loop Task");
CHIPDeviceManager & deviceMgr = CHIPDeviceManager::GetInstance();
ret = deviceMgr.Init(&EchoCallbacks);
if (ret != CHIP_NO_ERROR)
{
PLAT_LOG("CHIPDeviceManager::Init() failed: %s", ErrorStr(ret));
while (1)
;
}

return 0;
}

Expand Down
63 changes: 63 additions & 0 deletions examples/lock-app/cc32xx/main/CHIPDeviceManager.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
/*
*
* Copyright (c) 2020 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.
*/

/**
* @file
* This file implements the CHIP Device Interface that is used by
* applications to interact with the CHIP stack
*
*/

#include <stdlib.h>

#include "CHIPDeviceManager.h"

using namespace ::chip;

namespace chip {

namespace DeviceManager {

using namespace ::chip::DeviceLayer;

void CHIPDeviceManager::DeviceEventHandler(const ChipDeviceEvent * event, intptr_t arg)
{
CHIPDeviceManagerCallbacks * cb = reinterpret_cast<CHIPDeviceManagerCallbacks *>(arg);
if (cb != nullptr)
{
cb->DeviceEventCallback(event, reinterpret_cast<intptr_t>(cb));
}
}

CHIP_ERROR CHIPDeviceManager::Init(CHIPDeviceManagerCallbacks * cb)
{
mCB = cb;

// Register a function to receive events from the CHIP device layer. Note that calls to
// this function will happen on the CHIP event loop thread, not the app_main thread.
PlatformMgr().AddEventHandler(CHIPDeviceManager::DeviceEventHandler, reinterpret_cast<intptr_t>(cb));

// Start a task to run the CHIP Device event loop.
return PlatformMgr().StartEventLoopTask();
}

void CHIPDeviceManagerCallbacks::DeviceEventCallback(const chip::DeviceLayer::ChipDeviceEvent * event, intptr_t arg) {}

CHIPDeviceManagerCallbacks::~CHIPDeviceManagerCallbacks() {}

} // namespace DeviceManager
} // namespace chip
45 changes: 45 additions & 0 deletions examples/lock-app/cc32xx/main/DeviceCallbacks.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
/*
*
* Copyright (c) 2022 Project CHIP Authors
* All rights reserved.
*
* 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.
*/

#include "DeviceCallbacks.h"
#include <app/server/Dnssd.h>

using namespace chip;
using namespace chip::DeviceLayer;
using namespace chip::System;

DeviceCallbacksDelegate * appDelegate = nullptr;
extern "C" void cc32xxLog(const char * aFormat, ...);

void DeviceCallbacks::DeviceEventCallback(const ChipDeviceEvent * event, intptr_t arg)
{
switch (event->Type)
{
case DeviceEventType::kInterfaceIpAddressChanged:
if ((event->InterfaceIpAddressChanged.Type == InterfaceIpChangeType::kIpV4_Assigned) ||
(event->InterfaceIpAddressChanged.Type == InterfaceIpChangeType::kIpV6_Assigned))
{
// MDNS server restart on any ip assignment: if link local ipv6 is configured, that
// will not trigger a 'internet connectivity change' as there is no internet
// connectivity. MDNS still wants to refresh its listening interfaces to include the
// newly selected address.
cc32xxLog("DeviceEventCallback:Start DNS Server");
chip::app::DnssdServer::Instance().StartServer();
}
}
}
Loading