Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into dac_fixup_for_pid…
Browse files Browse the repository at this point in the history
…_vid_change
  • Loading branch information
cecille committed Feb 8, 2022
2 parents 541c924 + 52d0b42 commit 689bcfa
Show file tree
Hide file tree
Showing 287 changed files with 18,904 additions and 25,466 deletions.
10 changes: 10 additions & 0 deletions .github/.wordlist.txt
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ argv
armeabi
ARMmbed
armv
ASAN
asdk
AssertionError
ASYNC
Expand Down Expand Up @@ -143,6 +144,7 @@ capacitive
CatalogVendorId
CBB
cbd
ccf
CCMP
CCS
CCSTUDIO
Expand Down Expand Up @@ -302,6 +304,7 @@ DevKitC
DevKitM
df
dfu
DgDxsfHx
dhclient
DHCP
DHCPC
Expand Down Expand Up @@ -413,6 +416,7 @@ ffeebaefa
FFF
fffe
fffff
fHtcwcAAAAAAAAAwQAAAAAAXPMlAAAAAAA
Fi
filepath
fini
Expand All @@ -429,6 +433,7 @@ fstab
fsync
ftd
fullclean
fuzzer
gbl
gcloud
GDB
Expand Down Expand Up @@ -571,6 +576,7 @@ libdbus
LIBDIR
libegl
libffi
libfuzzer
libgirepository
libglib
libical
Expand Down Expand Up @@ -1134,7 +1140,9 @@ WSTK
xa
xab
xaver
xb
xbef
xc
xcd
Xcode
xcodeproj
Expand All @@ -1143,6 +1151,7 @@ xd
xdeadbeefcafe
xds
xdsdfu
xed
xef
xF
xFFFF
Expand All @@ -1155,6 +1164,7 @@ XXXX
XXXXXXXX
xyz
xz
xzvf
yaml
yearday
yml
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -168,11 +168,11 @@ jobs:
LSAN_OPTIONS: detect_leaks=0
run: |
# for BUILD_TYPE in asan msan tsan ubsan; do
for BUILD_TYPE in asan ubsan; do
for BUILD_TYPE in asan tsan ubsan; do
case $BUILD_TYPE in
"asan") GN_ARGS='is_clang=true is_asan=true';;
"msan") GN_ARGS='is_clang=true is_msan=true';;
"tsan") GN_ARGS='is_clang=true is_tsan=true';;
"tsan") GN_ARGS='is_clang=true is_tsan=true chip_enable_wifi=false';;
"ubsan") GN_ARGS='is_clang=true is_ubsan=true';;
esac
Expand Down
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -184,3 +184,6 @@
[submodule "third_party/mbed-mcu-boot/repo"]
path = third_party/mbed-mcu-boot/repo
url = https://github.com/ATmobica/mcuboot.git
[submodule "perfetto"]
path = third_party/perfetto/repo
url = https://github.com/google/perfetto
12 changes: 12 additions & 0 deletions config/esp32/components/chip/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ if(NOT CHIP_ROOT)
get_filename_component(CHIP_ROOT ${CMAKE_CURRENT_SOURCE_DIR}/../../../.. REALPATH)
endif()

include(${CMAKE_CURRENT_LIST_DIR}/ota-image.cmake)

set(CHIP_REQURIE_COMPONENTS freertos lwip bt mdns mbedtls fatfs app_update console openthread)

if (NOT CMAKE_BUILD_EARLY_EXPANSION)
Expand Down Expand Up @@ -246,3 +248,13 @@ if(CONFIG_ENABLE_PW_RPC)
set(WRAP_FUNCTIONS esp_log_write)
target_link_libraries(${COMPONENT_LIB} INTERFACE "-Wl,--wrap=${WRAP_FUNCTIONS}")
endif()

# Build Matter OTA image
if (CONFIG_CHIP_OTA_IMAGE_BUILD)
chip_ota_image(chip-ota-image
INPUT_FILES ${BUILD_DIR}/${CMAKE_PROJECT_NAME}.bin
OUTPUT_FILE ${BUILD_DIR}/${CMAKE_PROJECT_NAME}-ota.bin
)
# Adding dependecy as app target so that this runs after images are ready
add_dependencies(chip-ota-image app)
endif()
18 changes: 17 additions & 1 deletion config/esp32/components/chip/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ menu "CHIP Device Layer"

config DEVICE_SOFTWARE_VERSION
string "Device Software Version String"
default ""
default "v1.0"
help
A string identifying the software version running on the device.

Expand Down Expand Up @@ -768,4 +768,20 @@ menu "CHIP Device Layer"

endmenu

menu "Matter OTA Image"

config CHIP_OTA_IMAGE_BUILD
bool "Generate Matter OTA image"
help
Enable building OTA (Over-the-air update) image which includes Matter OTA header.

config CHIP_OTA_IMAGE_EXTRA_ARGS
string "OTA image creator extra arguments"
depends on CHIP_OTA_IMAGE_BUILD
help
This option allows one to pass optional arguments to the ota_image_tool.py script,
used for building OTA image with Matter OTA header.

endmenu

endmenu
65 changes: 65 additions & 0 deletions config/esp32/components/chip/ota-image.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
#
# Copyright (c) 2022 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.
#

find_package(Python3 REQUIRED)

#
# Create CMake target for building Matter OTA (Over-the-air update) image.
# Required arguments:
# INPUT_FILES file1, [file2...] - binary files which Matter OTA image will be composed of
# OUTPUT_FILE file - where to store newly created Matter OTA image
#
function(chip_ota_image TARGET_NAME)
cmake_parse_arguments(ARG "" "OUTPUT_FILE" "INPUT_FILES" ${ARGN})

if (NOT ARG_INPUT_FILES OR NOT ARG_OUTPUT_FILE)
message(FATAL_ERROR "Both INPUT_FILES and OUTPUT_FILE arguments must be specified")
endif()

# Prepare ota_image_tool.py argument list
set(OTA_ARGS
"--vendor-id"
${CONFIG_DEVICE_VENDOR_ID}
"--product-id"
${CONFIG_DEVICE_PRODUCT_ID}
"--version"
${CONFIG_DEVICE_SOFTWARE_VERSION_NUMBER}
"--version-str"
${CONFIG_DEVICE_SOFTWARE_VERSION}
"--digest-algorithm"
"sha256"
)

separate_arguments(OTA_EXTRA_ARGS NATIVE_COMMAND "${CHIP_OTA_IMAGE_EXTRA_ARGS}")

list(APPEND OTA_ARGS ${OTA_EXTRA_ARGS})
list(APPEND OTA_ARGS ${ARG_INPUT_FILES})
list(APPEND OTA_ARGS ${ARG_OUTPUT_FILE})

# Convert the argument list to multi-line string
string(REPLACE ";" "\n" OTA_ARGS "${OTA_ARGS}")

# Pass the argument list via file to avoid hitting Windows command-line length limit
file(GENERATE
OUTPUT ${BUILD_DIR}/args-ota-image.tmp
CONTENT ${OTA_ARGS}
)

add_custom_target(${TARGET_NAME} ALL
COMMAND ${Python3_EXECUTABLE} ${CHIP_ROOT}/src/app/ota_image_tool.py create @${BUILD_DIR}/args-ota-image.tmp
COMMAND ${CMAKE_COMMAND} -E remove ${BUILD_DIR}/args-ota-image.tmp
)
endfunction()
47 changes: 47 additions & 0 deletions config/qpg/lib/pw_rpc/BUILD.gn
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# 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("//build_overrides/chip.gni")
import("//build_overrides/pigweed.gni")
import("$dir_pw_build/target_types.gni")

config("cpp17") {
cflags_cc = [ "-std=gnu++17" ]
cflags_c = [ "-std=gnu11" ]
cflags_objc = [ "-std=gnu11" ]
cflags_objcc = [ "-std=gnu++17" ]
}

config("std_cpp17") {
configs = [ ":cpp17" ]
}

static_library("pw_rpc") {
output_name = "libPwRpc"

public_configs = [ "${dir_pigweed}/pw_hdlc:default_config" ]

public_deps = [
"$dir_pw_rpc:server",
"$dir_pw_rpc/nanopb:echo_service",
"${chip_root}/examples/platform/qpg/pw_sys_io:pw_sys_io_qpg",
"${dir_pigweed}/pw_hdlc:pw_rpc",
dir_pw_assert,
dir_pw_checksum,
dir_pw_hdlc,
dir_pw_log,
]

output_dir = "${root_out_dir}/lib"
}
27 changes: 27 additions & 0 deletions config/qpg/lib/pw_rpc/pw_rpc.gni
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# 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("//build_overrides/chip.gni")
import("//build_overrides/pigweed.gni")

pw_log_BACKEND = "$dir_pw_log_basic"
pw_assert_BACKEND = "$dir_pw_assert_log"
pw_sys_io_BACKEND = "${chip_root}/examples/platform/qpg/pw_sys_io:pw_sys_io_qpg"

pw_build_LINK_DEPS = [
"$dir_pw_assert:impl",
"$dir_pw_log:impl",
]

dir_pw_third_party_nanopb = "${chip_root}/third_party/nanopb/repo"
7 changes: 7 additions & 0 deletions config/qpg/toolchain/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,10 @@ arm_toolchain("qpg_lighting_app") {
import("${chip_root}/examples/lighting-app/qpg/args.gni")
}
}

arm_toolchain("qpg_shell_app") {
toolchain_args = {
current_os = "freertos"
import("${chip_root}/examples/shell-app/qpg/args.gni")
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -235,24 +235,15 @@ server cluster BinaryInputBasic = 15 {
}

server cluster Binding = 30 {
readonly global attribute int16u clusterRevision = 65533;

request struct BindRequest {
struct BindingEntry {
NODE_ID nodeId = 0;
GROUP_ID groupId = 1;
ENDPOINT_NO endpointId = 2;
CLUSTER_ID clusterId = 3;
}

request struct UnbindRequest {
NODE_ID nodeId = 0;
GROUP_ID groupId = 1;
ENDPOINT_NO endpointId = 2;
CLUSTER_ID clusterId = 3;
}

command Bind(BindRequest): DefaultSuccess = 0;
command Unbind(UnbindRequest): DefaultSuccess = 1;
attribute BindingEntry bindingList[] = 0;
readonly global attribute int16u clusterRevision = 65533;
}

server cluster BooleanState = 69 {
Expand Down Expand Up @@ -1457,8 +1448,8 @@ server cluster GeneralDiagnostics = 51 {
struct NetworkInterfaceType {
CHAR_STRING<32> name = 0;
BOOLEAN fabricConnected = 1;
BOOLEAN offPremiseServicesReachableIPv4 = 2;
BOOLEAN offPremiseServicesReachableIPv6 = 3;
nullable BOOLEAN offPremiseServicesReachableIPv4 = 2;
nullable BOOLEAN offPremiseServicesReachableIPv6 = 3;
OCTET_STRING<8> hardwareAddress = 4;
InterfaceType type = 5;
}
Expand Down
Loading

0 comments on commit 689bcfa

Please sign in to comment.