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

Update local master #24

Merged
merged 27 commits into from
Feb 25, 2021
Merged
Changes from 1 commit
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
6d06bee
Separate dedicated bluez directory for linux BLE interfacing (#4846)
andy31415 Feb 19, 2021
9d9502f
[controller] Add temporary node id support (#4934)
erjiaqing Feb 19, 2021
2b58bdf
Do a mDNS advertisement on minmdns server startup (#4884)
andy31415 Feb 19, 2021
1a78a5f
[controller] Network commissioning support on Controller (#4622)
erjiaqing Feb 22, 2021
ff259e0
[cirque] Download `chip-cirque-device-base` from docker hub when avai…
erjiaqing Feb 22, 2021
f30f23c
Added documentation of features of CHIP device controller implementat…
markus-becker-tridonic-com Feb 22, 2021
9c31534
Integrate KVS with device session tables (#4952)
pan-apple Feb 23, 2021
35bf119
ESP32: M5Stack - Add provision for factory reset (#4955)
dhrishi Feb 23, 2021
ab1a0bf
Add Content Launch Cluster (#4953)
lazarkov Feb 23, 2021
5480b66
Revert "Integrate KVS with device session tables (#4952)" (#4970)
mspang Feb 23, 2021
536a33f
Fix use-after-free in UpdateAdditionalDataCharacteristic (#4966)
mspang Feb 23, 2021
9059556
[K32W] Update E-Lock demo app to the latest master (#4956)
doru91 Feb 23, 2021
7c09658
Remove Peer/local nodeid dependency for PASE (#4945)
andy31415 Feb 23, 2021
224cd32
[QPG6100] Add initial lighting app version (#4958)
jimlyall-q Feb 24, 2021
c486c91
Darwin base chip cluster (#4883)
vivien-apple Feb 24, 2021
cc5daa9
Allocate more stack for esp32 tests (#4987)
kpschoedel Feb 24, 2021
88328e4
[python] Add command for Thread provisioning (#4991)
Damian-Nordic Feb 24, 2021
45e8674
Join multicast groups for mDNS. (#4974)
andy31415 Feb 24, 2021
9a791a8
Integrate KVS with device session tables (#4976)
pan-apple Feb 24, 2021
c931932
Fix chip tool code generation does not work (#4971)
lazarkov Feb 24, 2021
d48bcf2
Optimize the temperature-measurement-app to use less RAM and Flash. (…
sweetymhaiske Feb 24, 2021
2891d6b
Fix TI simplelink in unified build (#4983)
mspang Feb 24, 2021
3eddc00
Fix Platform::New to return nullptr on failure (#5008)
kpschoedel Feb 25, 2021
ad27724
Fix write_buildconfig_header.py self-reference (#4999)
mspang Feb 25, 2021
5ca7308
Python based device scanning interfacing with native C++ code on linu…
andy31415 Feb 25, 2021
7e2a87a
Remove unnecessary checking and casting of sizeof when we need uint16…
bzbarsky-apple Feb 25, 2021
df5569f
Rename some IM MessageDef name in code (#5007)
yunhanw-google Feb 25, 2021
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
Prev Previous commit
Next Next commit
[QPG6100] Add initial lighting app version (project-chip#4958)
* Initial qpg6100 lighting app

* Initial qpg6100 lighting app
jimlyall-q authored Feb 24, 2021
commit 224cd3217c08fac00808eda08894e7359120449e
28 changes: 28 additions & 0 deletions examples/lighting-app/qpg6100/.gn
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# 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.

import("//build_overrides/build.gni")

# The location of the build configuration file.
buildconfig = "${build_root}/config/BUILDCONFIG.gn"

# CHIP uses angle bracket includes.
check_system_includes = true

default_args = {
target_cpu = "arm"
target_os = "freertos"

import("//args.gni")
}
93 changes: 93 additions & 0 deletions examples/lighting-app/qpg6100/BUILD.gn
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
# 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.

import("//build_overrides/build.gni")
import("//build_overrides/chip.gni")
import("//build_overrides/openthread.gni")
import("//build_overrides/qpg6100_sdk.gni")

import("${build_root}/config/defaults.gni")
import("${qpg6100_sdk_build_root}/qpg6100_executable.gni")
import("${qpg6100_sdk_build_root}/qpg6100_sdk.gni")

assert(current_os == "freertos")

qpg6100_project_dir = "${chip_root}/examples/lighting-app/qpg6100"
examples_plat_dir = "${chip_root}/examples/platform/qpg6100"

qpg6100_sdk("sdk") {
include_dirs = [
"${chip_root}/src/platform/qpg6100",
"${examples_plat_dir}/project_include",
]

sources = [
"${examples_plat_dir}/app/include/Service.h",
"${examples_plat_dir}/project_include/CHIPProjectConfig.h",
]

defines = []
if (is_debug) {
defines += [ "BUILD_RELEASE=0" ]
} else {
defines += [ "BUILD_RELEASE=1" ]
}
}

qpg6100_executable("lighting_app") {
include_dirs = []
defines = []
output_name = "chip-qpg6100-lighting-example.out"

public_deps = [
":sdk",
"${chip_root}/examples/lighting-app/lighting-common/",
"${chip_root}/src/lib",
"${chip_root}/src/setup_payload",
"${chip_root}/third_party/openthread/platforms:libopenthread-platform",
"${chip_root}/third_party/openthread/platforms:libopenthread-platform-utils",
"${chip_root}/third_party/openthread/repo:libopenthread-cli-ftd",
"${chip_root}/third_party/openthread/repo:libopenthread-ftd",
]

include_dirs += [
"${qpg6100_project_dir}/include/",
"${chip_root}/src/app/util",
"${chip_root}/src/app/server",
"${examples_plat_dir}",
"${examples_plat_dir}/app/include",
]

sources = [
"${examples_plat_dir}/app/Service.cpp",
"src/AppTask.cpp",
"src/LightingManager.cpp",
"src/ZclCallbacks.cpp",
"src/main.cpp",
]

output_dir = root_out_dir

ldscript = "${qpg6100_sdk_root}/qpg6100/ldscripts/chip-qpg6100-example.ld"

ldflags = [ "-T" + rebase_path(ldscript, root_build_dir) ]
}

group("qpg6100") {
deps = [ ":lighting_app" ]
}

group("default") {
deps = [ ":qpg6100" ]
}
136 changes: 136 additions & 0 deletions examples/lighting-app/qpg6100/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,136 @@
# CHIP QPG6100 Lighting Example Application

An example application showing the use
[CHIP](https://github.com/project-chip/connectedhomeip) on the Qorvo QPG6100.

---

- [CHIP QPG6100 Lighting Example Application](#chip-qpg6100-lighting-example-application)
- [Introduction](#introduction)
- [Building](#building)
- [Flashing the application](#flashing-the-application)
- [Viewing Logging Output](#viewing-logging-output)

---

## Introduction

![QPG6100 DK board](../../platform/qpg6100/doc/QPG6100_DK_Board.jpg)

The QPG6100 Light shows an implementation of a Lighting device, based on CHIP
and the Qorvo QPG6100 SDK. Intention of this example is to demonstrate a CHIP
device, with Thread connectivity, using BLE to perform CHIP provisioning.

The example will be implemented in a phased approach, enabling more features
with separate updates.

Current status of implementation:

- Button and LED control
- Initialization of the CHIP stack.
- CHIP Logging, PlatformManager and ConfigurationManager enabled.
- BLE: CHIPoBLE advertisement and connection available for provisioning
- CHIP ZCL cluster control for the On/Off mechanism through CHIP tool.
- CHIP ZCL cluster control for the Level mechanism through CHIP tool.

Pending:

- Thread: Linking QPG6100 OpenThread implementation to CHIP build

For more information on Qorvo and the platforms, please visit
[the Qorvo website](http://www.qorvo.com) or contact us on
[email protected].

## Building

### Preparation

- Download and install a suitable ARM gcc tool chain:
[GNU Arm Embedded Toolchain 9-2019-q4-update](https://developer.arm.com/tools-and-software/open-source-software/developer-tools/gnu-toolchain/gnu-rm/downloads)
(Direct download link:
[Linux](https://armkeil.blob.core.windows.net/developer/Files/downloads/gnu-rm/9-2019q4/gcc-arm-none-eabi-9-2019-q4-major-x86_64-linux.tar.bz2)
[Mac OS X](https://armkeil.blob.core.windows.net/developer/Files/downloads/gnu-rm/9-2019q4/gcc-arm-none-eabi-9-2019-q4-major-mac.tar.bz2))

- Install additional tools used by the CHIP build:

```
# Linux
sudo apt-get install git make libtool ccache ninja-build
```

```
# Mac OS X
brew install libtool ccache ninja
```

- Clone the [CHIP](https://github.com/project-chip/connectedhomeip) repo into
a local directory

```
cd ~
git clone https://github.com/project-chip/connectedhomeip.git
```

- The Qorvo CHIP SDK is added as a submodule in /third_party/qpg_sdk/repo. To
manually clone this repo you can clone it from
[CHIP SDK](https://github.com/Qorvo/qpg-connectedhomeip)

```
cd ~
git clone https://github.com/Qorvo/qpg-connectedhomeip
```

### Compilation

- Set the following environment variables before compilation:

```
export ARM_GCC_INSTALL_ROOT=${HOME}/tools/gcc-arm-none-eabi-9-2019-q4-major/bin
export PATH=$PATH:$ARM_GCC_INSTALL_ROOT
export QPG6100_SDK_ROOT=${HOME}/qpg-connectedhomeip
```

- All builds are GN/ninja based

```
cd ~/connectedhomeip/examples/lighting-app/qpg6100
source third_party/connectedhomeip/scripts/activate.sh
gn gen out/debug
ninja -C out/debug
```

## Flashing the application

The QPG6100 DK boards can be programmed using:

### CMSIS-DAP Drag and Drop

Drag/copy the hex-file generated to the mBED drive that appears when plugging in
the DK board.

### Segger JLink debugger

Connect the Segger J-Link to the programming header and use the Segger SW to
flash the .hex.

More detailed information to be included in SDK Documentation.

## Viewing Logging Output

- Launch a serial terminal with baudrate 115200.
- At startup you will see:

```
qvCHIP v0.0.0.0 (CL:155586) running
[P][-] Init CHIP Stack
[P][DL] BLEManagerImpl::Init() complete
[P][-] Starting Platform Manager Event Loop
[P][-] ============================
[P][-] Qorvo Lighting-app Launching
[P][-] ============================
[D][DL] CHIP task running
```

- Note! Logging is currently encapsulated by the Qorvo logging module. Output
will have additional header and footer bytes. This will be updated later
into a raw stream for any serial terminal to parse.
18 changes: 18 additions & 0 deletions examples/lighting-app/qpg6100/args.gni
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# 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.

import("//build_overrides/chip.gni")
import("${chip_root}/examples/platform/qpg6100/args.gni")

qpg6100_sdk_target = get_label_info(":sdk", "label_no_toolchain")
1 change: 1 addition & 0 deletions examples/lighting-app/qpg6100/build_overrides
33 changes: 33 additions & 0 deletions examples/lighting-app/qpg6100/include/AppConfig.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
/*
*
* Copyright (c) 2020 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.
*/

#ifndef APP_CONFIG_H
#define APP_CONFIG_H

// ---- Lighting Example App Config ----

#define APP_ON_OFF_BUTTON BTN_LOCK
#define APP_FUNCTION_BUTTON BTN_FUNCTION

#define SYSTEM_STATE_LED LED_GREEN

// ---- Thread Polling Config ----
#define THREAD_ACTIVE_POLLING_INTERVAL_MS 100
#define THREAD_INACTIVE_POLLING_INTERVAL_MS 1000

#endif // APP_CONFIG_H
58 changes: 58 additions & 0 deletions examples/lighting-app/qpg6100/include/AppEvent.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
/*
*
* Copyright (c) 2020 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.
*/

#ifndef APP_EVENT_H
#define APP_EVENT_H

struct AppEvent;
typedef void (*EventHandler)(AppEvent *);

struct AppEvent
{
enum AppEventTypes
{
kEventType_Button = 0,
kEventType_Timer,
kEventType_Level,
kEventType_Install,
};

uint16_t Type;

union
{
struct
{
uint8_t ButtonIdx;
uint8_t Action;
} ButtonEvent;
struct
{
void * Context;
} TimerEvent;
struct
{
uint8_t Action;
int32_t Color;
} LightingEvent;
};

EventHandler Handler;
};

#endif // APP_EVENT_H
Loading