-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added MW320 to all-clusters-app. (#19302)
* Added MW320 to all-clusters-app. Signed-off-by: David Lin <yu-hao.lin@nxp.com> * Added draft README for MW320 all clusters app. Removed some unused files. Signed-off-by: David Lin <yu-hao.lin@nxp.com> * Update README.md Added basic and building information. * Updated MW320 SDK to commit 3d93e61. Signed-off-by: David Lin <yu-hao.lin@nxp.com> * Added image file for README. Image used to show bring up messages of MW320. * Update README.md Added flashing information. * Update README.md * Update README.md Added "$" for commands. * Update README.md * Add the private emberAfExternalAttributeReadCallback() to fix the read commission_info error in pairing Signed-off-by: Chin-Ran Lo <chin-ran.lo@nxp.com> * Update README.md * Enable Matter console messages on mw320 * Add binding function to mw320 * Update README.md * Fixed compile error. Functin prototype is changed. Signed-off-by: David Lin <yu-hao.lin@nxp.com> * Fixed misspelling. Changed default SSID too. Signed-off-by: David Lin <yu-hao.lin@nxp.com> * Restyled by whitespace * Restyled by clang-format * Restyled by gn * Restyled by prettier-markdown * Added platform "mw320" for MW320 SDK submodule. Signed-off-by: David Lin <yu-hao.lin@nxp.com> * - Enhance the parameter checking - Change to return the correct value in the exception condition - Add the comment for casting the data type Signed-off-by: Chin-Ran Lo <chin-ran.lo@nxp.com> * Added mw320 to ALL_PLATFORMS. Signed-off-by: David Lin <yu-hao.lin@nxp.com> * Fixed issue on KeyValueStoreManagerImpl::_Get. Signed-off-by: David Lin <yu-hao.lin@nxp.com> * Removed unused code. Signed-off-by: David Lin <yu-hao.lin@nxp.com> * Fixed remaining issue on KeyValueStoreManagerImpl::_Get. Signed-off-by: David Lin <yu-hao.lin@nxp.com> * Restyled by clang-format * Removed unused image. Signed-off-by: David Lin <yu-hao.lin@nxp.com> * Fixed checking error by Lint Action. Signed-off-by: David Lin <yu-hao.lin@nxp.com> * Removed unused code. Signed-off-by: David Lin <yu-hao.lin@nxp.com> * Fixed merge error. Signed-off-by: David Lin <yu-hao.lin@nxp.com> Co-authored-by: Chin-Ran Lo <chin-ran.lo@nxp.com> Co-authored-by: Restyled.io <commits@restyled.io>
- Loading branch information
Showing
68 changed files
with
7,077 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. | ||
|
||
declare_args() { | ||
# Root directory for MW320 SDK. | ||
mw320_sdk_build_root = "//third_party/mw320_sdk" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# 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. | ||
|
||
# The location of the build configuration file. | ||
buildconfig = "//build/config/BUILDCONFIG.gn" | ||
|
||
# CHIP uses angle bracket includes. | ||
check_system_includes = true | ||
|
||
default_args = { | ||
target_cpu = "arm" | ||
target_os = "freertos" | ||
|
||
import("//args.gni") | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,97 @@ | ||
# 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/lwip.gni") | ||
import("//build_overrides/mw320_sdk.gni") | ||
|
||
import("${mw320_sdk_build_root}/mw320_executable.gni") | ||
import("${mw320_sdk_build_root}/mw320_sdk.gni") | ||
|
||
assert(current_os == "freertos") | ||
|
||
examples_plat_dir = "${chip_root}/examples/platform/nxp/mw320" | ||
|
||
mw320_sdk("sdk") { | ||
include_dirs = [ | ||
"${chip_root}/src/platform/nxp/mw320", | ||
"${examples_plat_dir}/app/project_include", | ||
"${chip_root}/src/app/util", | ||
"${chip_root}/examples/all-clusters-app/nxp/mw320/include", | ||
] | ||
|
||
sources = [ | ||
"include/CHIPProjectConfig.h", | ||
"include/FreeRTOSConfig.h", | ||
] | ||
|
||
defines = [] | ||
|
||
if (is_debug) { | ||
defines += [ "BUILD_RELEASE=0" ] | ||
} else { | ||
defines += [ "BUILD_RELEASE=1" ] | ||
} | ||
} | ||
|
||
mw320_executable("shell_mw320") { | ||
include_dirs = [] | ||
defines = [] | ||
output_name = "all-cluster-mw320.out" | ||
|
||
public_deps = [ | ||
":sdk", | ||
"${chip_root}/examples/all-clusters-app/all-clusters-common", | ||
"${chip_root}/examples/shell/shell_common:shell_common", | ||
"${chip_root}/src/lib", | ||
"${chip_root}/src/lib/shell", | ||
"${chip_root}/src/setup_payload", | ||
] | ||
|
||
include_dirs = [ | ||
"${chip_root}/src/platform/nxp/mw320", | ||
"${examples_plat_dir}/app/project_include", | ||
"${chip_root}/src/app/util", | ||
"${chip_root}/examples/all-clusters-app/all-clusters-common/include", | ||
"${chip_root}/examples/all-clusters-app/nxp/mw320/include", | ||
] | ||
sources = [ | ||
"${chip_root}/examples/all-clusters-app/all-clusters-common/src/bridged-actions-stub.cpp", | ||
"${chip_root}/examples/all-clusters-app/all-clusters-common/src/static-supported-modes-manager.cpp", | ||
"${chip_root}/src/lib/shell/streamer_mw320.cpp", | ||
"binding-handler.cpp", | ||
"include/CHIPProjectConfig.h", | ||
"include/FreeRTOSConfig.h", | ||
"main.cpp", | ||
] | ||
|
||
output_dir = root_out_dir | ||
|
||
ldscript = "${examples_plat_dir}/app/ldscripts/88MW320_xx_xxxx_flash.ld" | ||
|
||
ldflags = [ "-T" + rebase_path(ldscript, root_build_dir) ] | ||
defines = [ | ||
"MW320_SHELL_STREAMER", | ||
"SHELL_STREAMER_APP_SPECIFIC", | ||
] | ||
} | ||
|
||
group("mw320") { | ||
deps = [ ":shell_mw320" ] | ||
} | ||
|
||
group("default") { | ||
deps = [ ":mw320" ] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
# Matter MW320 All Clusters Example Application | ||
|
||
The example is based on | ||
[Matter](https://github.com/project-chip/connectedhomeip) and the NXP MW320 SDK | ||
to demonstrates device commissioning and cluster control over a low-power, WiFi | ||
802.11n network. | ||
|
||
<hr> | ||
|
||
- [Matter MW320 All Clusters Example Application](#matter-mw320-all-clusters-example-application) | ||
- [Introduction](#introduction) | ||
- [Building](#building) | ||
- [Flashing](#flashing) | ||
- [Testing the example](#testing-the-example) | ||
|
||
<hr> | ||
|
||
<a name="intro"></a> | ||
|
||
## Introduction | ||
|
||
![MW320](../../../platform/nxp/mw320/doc/images/mw320.jpg) | ||
|
||
The example targets the | ||
[NXP MW320 WiFi Micro controller Soc](https://www.nxp.com/products/wireless/wi-fi-plus-bluetooth/88mw32x-802-11n-wi-fi-microcontroller-soc:88MW32X) | ||
development kit. | ||
|
||
<a name="building"></a> | ||
|
||
## Building | ||
|
||
Building the example application is quite straightforward. It can be done via | ||
following commands: | ||
|
||
``` | ||
$ git submodule update --init | ||
$ source third_party/connectedhomeip/scripts/activate.sh | ||
$ gn gen out/debug | ||
$ ninja -v -C out/debug | ||
``` | ||
|
||
Example application binary file "all-cluster-mw320.bin" will be generated under | ||
directory "out/debug". | ||
|
||
Note: | ||
|
||
1. "git submodule update --init" only needs to be issued for the first time in | ||
order to download MW320 SDK for Matter. | ||
2. "source third_party/connectedhomeip/scripts/activate.sh" can be omitted if | ||
your environment is already setup without issues. | ||
|
||
<a name="flashdebug"></a> | ||
|
||
## Flashing | ||
|
||
Connect MW320 to Ubuntu USB port and open Linux text-based serial port | ||
communications program at second USB interface (/dev/ttyUSB1): | ||
|
||
``` | ||
$ TERM=linux minicom -D /dev/ttyUSB1 -b 115200 | ||
``` | ||
|
||
Prepare MW320 download firmware image: | ||
|
||
``` | ||
$ ln -sf third_party/connectedhomeip/third_party/nxp/mw320_sdk/repo mw320_sdk | ||
$ mw320_sdk/tools/mw_img_conv/bin/mw_img_conv mcufw out/debug/all-cluster-mw320.bin out/debug/all-cluster-mw320.mcufw.bin 0x1F010000 | ||
$ cp out/debug/all-cluster-mw320.mcufw.bin mw320_sdk/mw320_matter_flash/Matter/. | ||
``` | ||
|
||
Install OpenOCD (Open On-Chip Debugger): | ||
|
||
``` | ||
$ sudo apt-get install openocd | ||
``` | ||
|
||
Flashing firmware image to MW320: | ||
|
||
``` | ||
$ cd mw320_sdk/mw320_matter_flash | ||
$ sudo python2 flashprog.py -l Matter/layout-4m.txt --boot2 Matter/boot2.bin --wififw Matter/mw32x_uapsta_W14.88.36.p172.bin --mcufw Matter/all-cluster-mw320.mcufw.bin -r | ||
``` | ||
|
||
After MW320 is reset, console will allow you to enter commands: | ||
|
||
![MW320_CONSOLE](../../../platform/nxp/mw320/doc/images/mw320_console.jpg) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# 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/nxp/mw320/args.gni") | ||
|
||
mw320_sdk_target = get_label_info(":sdk", "label_no_toolchain") | ||
|
||
declare_args() { | ||
chip_enable_ota_requestor = true | ||
} |
Oops, something went wrong.