Skip to content

Commit

Permalink
Merge branch 'project-chip:master' into refactor/spi-multiplex-rs91x-ncp
Browse files Browse the repository at this point in the history
  • Loading branch information
brosahay authored Oct 8, 2023
2 parents 2f31859 + f34b13c commit a31f8bd
Show file tree
Hide file tree
Showing 151 changed files with 4,999 additions and 3,001 deletions.
29 changes: 21 additions & 8 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -303,21 +303,34 @@ jobs:

- name: Setup Build, Run Build and Run Tests
run: |
scripts/build/gn_gen.sh --args="enable_rtti=true enable_pylib=true chip_config_memory_debug_checks=false chip_config_memory_debug_dmalloc=false"
scripts/build/gn_gen.sh --args="enable_rtti=true enable_pylib=true chip_config_memory_debug_checks=false chip_config_memory_debug_dmalloc=false chip_generate_link_map_file=false"
scripts/run_in_build_env.sh "ninja -C ./out"
scripts/tests/gn_tests.sh
- name: Run Python library specific unit tests
- name: Setup test python environment
shell: bash
run: |
scripts/run_in_build_env.sh 'pip3 install ./out/controller/python/chip_core-0.0-cp37-abi3-linux_x86_64.whl'
scripts/run_in_build_env.sh 'pip3 install ./out/controller/python/chip_clusters-0.0-py3-none-any.whl'
scripts/run_in_build_env.sh 'pip3 install ./out/controller/python/chip_repl-0.0-py3-none-any.whl'
scripts/run_in_build_env.sh '(cd src/controller/python/test/unit_tests/ && python3 -m unittest -v)'
scripts/run_in_build_env.sh 'virtualenv pyenv'
source pyenv/bin/activate
pip3 install ./out/controller/python/chip_core-0.0-cp37-abi3-linux_x86_64.whl
pip3 install ./out/controller/python/chip_clusters-0.0-py3-none-any.whl
pip3 install ./out/controller/python/chip_repl-0.0-py3-none-any.whl
- name: Run Python tests
shell: bash
run: |
source pyenv/bin/activate
cd src/controller/python/test/unit_tests/
python3 -m unittest -v
- name: Clean previous outputs
run: rm -rf out pyenv
- name: Run Python Setup Payload Generator Test
shell: bash
run: |
scripts/run_in_build_env.sh 'scripts/examples/gn_build_example.sh examples/chip-tool out/'
scripts/run_in_build_env.sh 'pip3 install -r src/setup_payload/python/requirements.txt'
scripts/run_in_build_env.sh 'python3 src/setup_payload/tests/run_python_setup_payload_gen_test.py out/chip-tool'
scripts/run_in_build_env.sh 'virtualenv pyenv'
source pyenv/bin/activate
pip3 install -r src/setup_payload/python/requirements.txt
python3 src/setup_payload/tests/run_python_setup_payload_gen_test.py out/chip-tool
build_darwin:
name: Build on Darwin (clang, python_lib, simulated)
Expand Down
32 changes: 16 additions & 16 deletions .github/workflows/examples-telink.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,18 @@ jobs:
with:
gh-context: ${{ toJson(github) }}

- name: Build example Telink (B92) Air Quality Sensor App
run: |
./scripts/run_in_build_env.sh \
"./scripts/build/build_examples.py --target 'telink-tlsr9528a-air-quality-sensor' build"
.environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \
telink tlsr9528a air-quality-sensor-app \
out/telink-tlsr9528a-air-quality-sensor/zephyr/zephyr.elf \
/tmp/bloat_reports/
- name: clean out build output
run: rm -rf ./out

- name: Build example Telink (B91) All Clusters App
run: |
./scripts/run_in_build_env.sh \
Expand Down Expand Up @@ -124,25 +136,13 @@ jobs:
- name: clean out build output (keep tools)
run: rm -rf ./out/telink*

- name: Build example Telink (B92) Lighting App with RPC, Shell and Factory Data
run: |
./scripts/run_in_build_env.sh \
"./scripts/build/build_examples.py --target 'telink-tlsr9528a-light-rpc-shell-factory-data' build"
.environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \
telink tlsr9528a lighting-app-rpc-shell-factory-data \
out/telink-tlsr9528a-light-rpc-shell-factory-data/zephyr/zephyr.elf \
/tmp/bloat_reports/
- name: clean out build output
run: rm -rf ./out

- name: Build example Telink (B91) Light Switch App
- name: Build example Telink (B92) Light Switch App with RPC, Shell and Factory Data
run: |
./scripts/run_in_build_env.sh \
"./scripts/build/build_examples.py --target 'telink-tlsr9518adk80d-light-switch' build"
"./scripts/build/build_examples.py --target 'telink-tlsr9528a-light-switch-rpc-shell-factory-data' build"
.environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \
telink tlsr9518adk80d light-switch-app \
out/telink-tlsr9518adk80d-light-switch/zephyr/zephyr.elf \
telink tlsr9528a light-switch-app-rpc-shell-factory-data \
out/telink-tlsr9528a-light-switch-rpc-shell-factory-data/zephyr/zephyr.elf \
/tmp/bloat_reports/
- name: clean out build output
Expand Down
9 changes: 3 additions & 6 deletions .github/workflows/full-android.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -62,13 +62,10 @@ jobs:
- name: Cleanup pigweed CIPD packages
# This should not generally be needed, however android CI runs out of space
# We do not need pigweed cross compile here because we use android NDK
# compilers, so removing rust and arm compilers saves 2.5GB
# compilers. Removing this package saves a significant amount of space.
run: |
du -sh .environment/cipd/packages/pigweed/rust \
.environment/cipd/packages/arm
rm -rf .environment/cipd/packages/pigweed/rust \
.environment/cipd/packages/arm
du -sh .environment/cipd/packages/arm
rm -rf .environment/cipd/packages/arm
- name: Build Android arm-chip-tool
run: |
./scripts/run_in_build_env.sh \
Expand Down
20 changes: 15 additions & 5 deletions .github/workflows/recent_fail_summary.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
name: Recent Fail Summary
on:
schedule:
- cron: "0 0 * * *"
- cron: "10 0 * * *"
workflow_dispatch:

concurrency:
Expand All @@ -25,24 +25,34 @@ jobs:
list_workflows:
name: Summarize Recent Workflow Failures
runs-on: ubuntu-latest
permissions: write-all
steps:
- uses: actions/checkout@v4
- run: pip install pandas python-slugify
- run: pip install pandas python-slugify pyyaml tabulate
- name: Run Summarization Script
run: python scripts/tools/summarize_fail.py
env:
GH_TOKEN: ${{ github.token }}
- name: Update Docs
uses: test-room-7/action-update-file@v1
with:
file-path: docs/daily_pass_percentage.md
commit-msg: Update daily pass percentage
github-token: ${{ secrets.GITHUB_TOKEN }}
branch: daily_pass_percentage
- name: Upload Logs
uses: actions/upload-artifact@v3
with:
name: workflow-fail-summary
path: |
run_list.json
fail_run_list.json
all_run_list.json
recent_fails.csv
recent_fails_frequency.csv
failure_cause_summary.csv
workflow_fail_rate.csv
workflow_pass_rate.csv
workflow_pass_rate.sqlite3
recent_fails_logs
workflow_fail_rate
workflow_pass_rate
retention-days: 5

9 changes: 3 additions & 6 deletions .github/workflows/smoketest-android.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,10 @@ jobs:
- name: Cleanup pigweed CIPD packages
# This should not generally be needed, however android CI runs out of space
# We do not need pigweed cross compile here because we use android NDK
# compilers, so removing rust and arm compilers saves 2.5GB
# compilers. Removing this package save significant amount of space.
run: |
du -sh .environment/cipd/packages/pigweed/rust \
.environment/cipd/packages/arm
rm -rf .environment/cipd/packages/pigweed/rust \
.environment/cipd/packages/arm
du -sh .environment/cipd/packages/arm
rm -rf .environment/cipd/packages/arm
- name: Build Android CHIPTool and CHIPTest (ARM64)
run: |
Expand Down
1 change: 1 addition & 0 deletions .restyled.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ exclude:
- "src/controller/java/zap-generated/**/*" # not formatted: generated files
- "scripts/setup/bootstrap.sh" # tries to quote loop variable
- "integrations/docker/build-all.sh" # tries to quote loop variable
- "pigweed.json" # TODO(#29547). This file is temporary copy from pigweed repo that has minor edits. No restyle help in diff.

changed_paths:
maximum: 100000
Expand Down
1 change: 1 addition & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -663,6 +663,7 @@
"openiotsdk-lock",
"openiotsdk-shell",
"qpg-qpg6100-lock",
"telink-tlsr9518adk80d-air-quality-sensor",
"telink-tlsr9518adk80d-all-clusters",
"telink-tlsr9518adk80d-all-clusters-minimal",
"telink-tlsr9518adk80d-bridge",
Expand Down
13 changes: 13 additions & 0 deletions build/config/compiler/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,19 @@ config("strict_warnings") {
cflags += [ "-Wconversion" ]
}

# For now we can't enable -Wundef across the board. Enable it where
# we can. Ideally this would be checking chip_device_platform or so
# to be more fine-grained than current_os, but it's not clear that
# we can access that here.
if (current_os != "freertos" && current_os != "mbed" &&
current_os != "zephyr" &&
# cmsis-rtos is OpenIOT
current_os != "cmsis-rtos" &&
# cyw30739 is one of the Infineon builds
current_os != "cyw30739") {
cflags += [ "-Wundef" ]
}

if (matter_enable_java_compilation) {
cflags -= [ "-Wshadow" ]
}
Expand Down
10 changes: 10 additions & 0 deletions build/toolchain/gcc_toolchain.gni
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,14 @@
import("//build_overrides/pigweed.gni")
import("$dir_pw_toolchain/generate_toolchain.gni")

declare_args() {
# Generate Linker map files. Can skip since they can
# be quite large.
#
# Note that toolchains can individually override this
chip_generate_link_map_file = true
}

template("gcc_toolchain") {
invoker_toolchain_args = invoker.toolchain_args

Expand Down Expand Up @@ -42,6 +50,8 @@ template("gcc_toolchain") {

if (defined(invoker.link_generate_map_file)) {
link_generate_map_file = invoker.link_generate_map_file
} else {
link_generate_map_file = chip_generate_link_map_file
}

is_host_toolchain = invoker_toolchain_args.current_os == host_os
Expand Down
6 changes: 5 additions & 1 deletion config/esp32/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,17 @@ import("//build_overrides/build.gni")
import("//build_overrides/chip.gni")

import("${chip_root}/build/chip/tests.gni")
import("${chip_root}/src/tracing/tracing_args.gni")

declare_args() {
chip_build_pw_rpc_lib = false
}

group("esp32") {
deps = [ "${chip_root}/src/lib" ]
deps = [
"${chip_root}/src/lib",
matter_trace_config,
]

if (chip_build_pw_rpc_lib) {
deps += [ "//lib/pw_rpc" ]
Expand Down
17 changes: 11 additions & 6 deletions config/esp32/components/chip/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -261,13 +261,18 @@ if (CONFIG_SEC_CERT_DAC_PROVIDER)
endif()

if (CONFIG_ENABLE_ESP_INSIGHTS_TRACE)
chip_gn_arg_append("matter_enable_esp_insights_trace" "true")
chip_gn_arg_bool("matter_enable_tracing_support" "true")
chip_gn_arg_append("matter_trace_config" "\"${CHIP_ROOT}/src/tracing/esp32_trace:esp32_trace_tracing\"")
endif()

if (CONFIG_USE_ESP32_ECDSA_PERIPHERAL)
chip_gn_arg_append("chip_use_esp32_ecdsa_peripheral" "true")
endif()

if (CONFIG_ENABLE_ESP_INSIGHTS_TRACE)
target_include_directories(${COMPONENT_LIB} INTERFACE "${CHIP_ROOT}/src/tracing/esp32_trace/include")
endif()

set(args_gn_input "${CMAKE_CURRENT_BINARY_DIR}/args.gn.in")
file(GENERATE OUTPUT "${args_gn_input}" CONTENT "${chip_gn_args}")

Expand Down Expand Up @@ -318,7 +323,11 @@ set(GN_ROOT_TARGET ${CHIP_ROOT}/config/esp32)
set(chip_libraries "${CMAKE_CURRENT_BINARY_DIR}/lib/libCHIP.a")

if(CONFIG_ENABLE_PW_RPC)
list(APPEND chip_libraries "${CMAKE_CURRENT_BINARY_DIR}/lib/libPwRpc.a")
list(APPEND chip_libraries "${CMAKE_CURRENT_BINARY_DIR}/lib/libPwRpc.a")
endif()

if (CONFIG_ENABLE_ESP_INSIGHTS_TRACE)
list(APPEND chip_libraries "${CMAKE_CURRENT_BINARY_DIR}/lib/libEsp32TracingBackend.a")
endif()

# When using the pregenerated files, there is a edge case where an error appears for
Expand Down Expand Up @@ -371,10 +380,6 @@ target_include_directories(${COMPONENT_LIB} INTERFACE
"${CHIP_ROOT}/config/esp32/${CONFIG_CHIP_EXTERNAL_PLATFORM_DIR}/../../"
)

if (CONFIG_ENABLE_ESP_INSIGHTS_TRACE)
target_include_directories(${COMPONENT_LIB} INTERFACE "${CHIP_ROOT}/src/tracing/esp32_trace/include")
endif()

idf_component_get_property(mbedtls_lib mbedtls COMPONENT_LIB)

idf_build_get_property(idf_target IDF_TARGET)
Expand Down
1 change: 1 addition & 0 deletions examples/air-quality-sensor-app/telink/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/build/
86 changes: 86 additions & 0 deletions examples/air-quality-sensor-app/telink/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
#
# Copyright (c) 2023 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.
#
cmake_minimum_required(VERSION 3.13.1)

get_filename_component(CHIP_ROOT ${CMAKE_CURRENT_SOURCE_DIR}/third_party/connectedhomeip REALPATH)
get_filename_component(TELINK_COMMON ${CHIP_ROOT}/examples/platform/telink REALPATH)
get_filename_component(GEN_DIR ${CHIP_ROOT}/zzz_generated/ REALPATH)

if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/boards/${BOARD}.overlay")
set(LOCAL_DTC_OVERLAY_FILE "${CMAKE_CURRENT_SOURCE_DIR}/boards/${BOARD}.overlay")
else()
unset(LOCAL_DTC_OVERLAY_FILE)
endif()

if(EXISTS "${CHIP_ROOT}/src/platform/telink/${BOARD}.overlay")
set(GLOBAL_DTC_OVERLAY_FILE "${CHIP_ROOT}/src/platform/telink/${BOARD}.overlay")
else()
unset(GLOBAL_DTC_OVERLAY_FILE)
endif()

if(DTC_OVERLAY_FILE)
set(DTC_OVERLAY_FILE
"${DTC_OVERLAY_FILE} ${GLOBAL_DTC_OVERLAY_FILE} ${LOCAL_DTC_OVERLAY_FILE}"
CACHE STRING "" FORCE
)
else()
set(DTC_OVERLAY_FILE ${GLOBAL_DTC_OVERLAY_FILE} ${LOCAL_DTC_OVERLAY_FILE})
endif()

set(CONF_FILE prj.conf)

# Load NCS/Zephyr build system
list(APPEND ZEPHYR_EXTRA_MODULES ${CHIP_ROOT}/config/telink/chip-module)
find_package(Zephyr HINTS $ENV{ZEPHYR_BASE})

project(chip-telink-air-quality-sensor-example)

include(${CHIP_ROOT}/config/telink/app/enable-gnu-std.cmake)
include(${CHIP_ROOT}/src/app/chip_data_model.cmake)

target_compile_options(app PRIVATE -fpermissive)

target_include_directories(app PRIVATE
include
${GEN_DIR}/app-common
${GEN_DIR}/air-quality-sensor-app
${TELINK_COMMON}/common/include
${TELINK_COMMON}/util/include
${CHIP_ROOT}/examples/air-quality-sensor-app/air-quality-sensor-common/include)

add_definitions(
"-DCHIP_ADDRESS_RESOLVE_IMPL_INCLUDE_HEADER=<lib/address_resolve/AddressResolve_DefaultImpl.h>"
)

target_sources(app PRIVATE
src/AppTask.cpp
src/ZclCallbacks.cpp
${TELINK_COMMON}/common/src/mainCommon.cpp
${TELINK_COMMON}/common/src/AppTaskCommon.cpp
${TELINK_COMMON}/util/src/LEDWidget.cpp
${TELINK_COMMON}/util/src/ButtonManager.cpp
${TELINK_COMMON}/util/src/ThreadUtil.cpp
${TELINK_COMMON}/util/src/PWMDevice.cpp
${CHIP_ROOT}/examples/air-quality-sensor-app/air-quality-sensor-common/src/air-quality-sensor-manager.cpp)

chip_configure_data_model(app
INCLUDE_SERVER
ZAP_FILE ${CMAKE_CURRENT_SOURCE_DIR}/../air-quality-sensor-common/air-quality-sensor-app.zap
)

if(CONFIG_CHIP_OTA_REQUESTOR)
target_sources(app PRIVATE ${TELINK_COMMON}/util/src/OTAUtil.cpp)
endif()
Loading

0 comments on commit a31f8bd

Please sign in to comment.