Skip to content

Commit

Permalink
Merge branch 'master' into lessci/esp32
Browse files Browse the repository at this point in the history
  • Loading branch information
andy31415 committed Feb 28, 2022
2 parents c4e0675 + fd915e5 commit 7ae8fcc
Show file tree
Hide file tree
Showing 93 changed files with 5,372 additions and 5,189 deletions.
4 changes: 2 additions & 2 deletions .clang-tidy
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
---
Checks: '-*,bugprone-use-after-move'
Checks: 'bugprone-*,-bugprone-not-null-terminated-result,-bugprone-suspicious-memory-comparison,-bugprone-argument-comment,-bugprone-unused-return-value,-bugprone-branch-clone,-bugprone-easily-swappable-parameters,-bugprone-reserved-identifier,-bugprone-macro-parentheses,-bugprone-forward-declaration-namespace,-bugprone-forwarding-reference-overload,-bugprone-undelegated-constructor,-bugprone-sizeof-expression,-bugprone-implicit-widening-of-multiplication-result,-bugprone-too-small-loop-variable,-bugprone-narrowing-conversions,-bugprone-misplaced-widening-cast,-bugprone-suspicious-include,-bugprone-signed-char-misuse,-bugprone-copy-constructor-init,-clang-analyzer-core.CallAndMessage,-clang-analyzer-core.UndefinedBinaryOperatorResult,-clang-analyzer-core.NullDereference,-clang-analyzer-optin.cplusplus.UninitializedObject,-clang-analyzer-core.uninitialized.Branch,-clang-analyzer-optin.performance,-clang-analyzer-deadcode.DeadStores,-clang-analyzer-cplusplus.Move,-clang-analyzer-optin.cplusplus.VirtualCall,-clang-analyzer-security.insecureAPI.strcpy,-clang-analyzer-nullability.NullablePassedToNonnull,-clang-analyzer-optin.performance.Padding,-clang-analyzer-security.insecureAPI.bzero,-clang-analyzer-unix.cstring.NullArg,-clang-analyzer-security.insecureAPI.rand,-clang-analyzer-core.NonNullParamChecker,-clang-analyzer-nullability.NullPassedToNonnull,-clang-analyzer-unix.Malloc,-clang-analyzer-valist.Unterminated,-clang-analyzer-cplusplus.NewDeleteLeaks,-clang-diagnostic-implicit-int-conversion'
WarningsAsErrors: '*'
HeaderFilterRegex: ''
HeaderFilterRegex: '(src|examples|zzz_generated|credentials)'
4 changes: 2 additions & 2 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ jobs:
case $BUILD_TYPE in
"fake") GN_ARGS='chip_device_platform="fake"';;
"gcc_release") GN_ARGS='is_debug=false';;
"clang") GN_ARGS='is_clang=true';;
"clang") GN_ARGS='is_clang=true pw_command_launcher="`pwd`/../scripts/helpers/clang-tidy-launcher.py"';;
"mbedtls") GN_ARGS='chip_crypto="mbedtls"';;
esac
Expand Down Expand Up @@ -317,7 +317,7 @@ jobs:
run: |
for BUILD_TYPE in clang python_lib; do
case $BUILD_TYPE in
"clang") GN_ARGS='is_clang=true target_os="all" is_asan=true';;
"clang") GN_ARGS='is_clang=true target_os="all" is_asan=true pw_command_launcher="`pwd`/../scripts/helpers/clang-tidy-launcher.py"';;
"python_lib") GN_ARGS='enable_rtti=true enable_pylib=true';;
esac
scripts/build/gn_gen.sh --args="$GN_ARGS"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,19 @@
# See the License for the specific language governing permissions and
# limitations under the License.

name: Android
name: Full builds - Android

on:
push:
pull_request:
workflow_dispatch:

concurrency:
group: ${{ github.ref }}-${{ github.workflow }}-${{ (github.event_name == 'pull_request' && github.event.number) || (github.event_name == 'workflow_dispatch' && github.run_number) || github.sha }}
group: full-${{ 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:
android:
name: Build Android
name: Run
timeout-minutes: 75

env:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,24 +12,22 @@
# See the License for the specific language governing permissions and
# limitations under the License.

name: Build example - Mbed OS
name: Full builds - Mbed OS

on:
push:
pull_request:
workflow_dispatch:

concurrency:
group: ${{ github.ref }}-${{ github.workflow }}-${{ (github.event_name == 'pull_request' && github.event.number) || (github.event_name == 'workflow_dispatch' && github.run_number) || github.sha }}
group: full-${{ 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:
mbedos:
name: Mbed OS examples building
name: Run
timeout-minutes: 200

env:
BUILD_TYPE: mbedos
APP_PROFILE: release
APP_TARGET: CY8CPROTO_062_4343W

Expand Down Expand Up @@ -119,7 +117,7 @@ jobs:
mbed $APP_TARGET+$APP_PROFILE shell \
examples/ota-requestor-app/mbed/build-CY8CPROTO_062_4343W/release/chip-mbed-ota-requestor-app-example.elf \
/tmp/bloat_reports/
- name: Build unit tests
timeout-minutes: 20
run: scripts/tests/mbed/mbed_unit_tests.sh -b=$APP_TARGET -p=$APP_PROFILE
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,20 +16,16 @@ name: Build example - nRF Connect SDK

on:
push:
pull_request:
workflow_dispatch:

concurrency:
group: ${{ github.ref }}-${{ github.workflow }}-${{ (github.event_name == 'pull_request' && github.event.number) || (github.event_name == 'workflow_dispatch' && github.run_number) || github.sha }}
group: full-${{ 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:
nrfconnect:
name: nRF Connect SDK
timeout-minutes: 120

env:
BUILD_TYPE: nrfconnect

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

Expand Down
64 changes: 64 additions & 0 deletions .github/workflows/smoketest-android.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
# 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.

name: Smoke test - Android

on:
pull_request:
workflow_dispatch:

concurrency:
group: smoke-${{ 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:
android:
name: Run
timeout-minutes: 60

env:
JAVA_HOME: /usr/lib/jvm/java-8-openjdk-amd64/

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

container:
image: connectedhomeip/chip-build-android:0.5.56
volumes:
- "/tmp/log_output:/tmp/test_logs"

steps:
- name: Checkout
uses: actions/checkout@v2
with:
submodules: true
- name: Bootstrap
timeout-minutes: 10
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 Android CHIPTool and CHIPTest (ARM64)
run: |
./scripts/run_in_build_env.sh \
"./scripts/build/build_examples.py --no-log-timestamps --target android-arm64-chip-tool build"
- name: Run Android build rule tests
run: |
./scripts/run_in_build_env.sh \
"ninja -C out/android-arm64-chip-tool build/chip/java/tests:java_build_test.tests"
77 changes: 77 additions & 0 deletions .github/workflows/smoketest-mbed.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
# 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: Smoke test - Mbed OS

on:
pull_request:
workflow_dispatch:

concurrency:
group: smoke-${{ 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:
mbedos:
name: Run
timeout-minutes: 30
runs-on: ubuntu-latest
if: github.actor != 'restyled-io[bot]'

container:
image: connectedhomeip/chip-build-mbed-os:0.5.56
volumes:
- "/tmp/bloat_reports:/tmp/bloat_reports"

steps:
- name: Checkout
uses: actions/checkout@v2
with:
submodules: true

- 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: 10
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 lock-app example
timeout-minutes: 20
run: |
scripts/examples/mbed_example.sh -a=lock-app -b=CY8CPROTO_062_4343W -p=release
.environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \
mbed CY8CPROTO_062_4343W+release lock-app \
examples/lock-app/mbed/build-CY8CPROTO_062_4343W/release/chip-mbed-lock-app-example.elf \
/tmp/bloat_reports/
- name: Uploading Size Reports
uses: actions/upload-artifact@v2
if: ${{ !env.ACT }}
with:
name: Size,Mbed-Examples,${{ env.GH_EVENT_PR }},${{ env.GH_EVENT_HASH }},${{ env.GH_EVENT_PARENT }},${{ github.event_name }}
path: |
/tmp/bloat_reports/
77 changes: 77 additions & 0 deletions .github/workflows/smoketest-nrfconnect.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
# 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.

name: Smoke test - nRF Connect SDK

on:
pull_request:
workflow_dispatch:

concurrency:
group: smoke-${{ 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:
nrfconnect:
name: Run
timeout-minutes: 30
runs-on: ubuntu-latest
if: github.actor != 'restyled-io[bot]'

container:
image: connectedhomeip/chip-build-nrf-platform:0.5.56
volumes:
- "/tmp/bloat_reports:/tmp/bloat_reports"

steps:
- name: Checkout
uses: actions/checkout@v2
with:
submodules: true

- 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: Update nRF Connect SDK revision to the currently recommended.
timeout-minutes: 10
run: scripts/run_in_build_env.sh "python3 scripts/setup/nrfconnect/update_ncs.py --update --shallow"
- name: Build example nRF Connect SDK Lock App on nRF52840 DK
timeout-minutes: 10
run: |
scripts/examples/nrfconnect_example.sh all-clusters-app nrf52840dk_nrf52840 -DBUILD_WITH_DFU=1
.environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \
nrfconnect nrf52840dk_nrf52840 all-clusters-app \
examples/all-clusters-app/nrfconnect/build/zephyr/zephyr.elf \
/tmp/bloat_reports/
- name: Uploading Size Reports
uses: actions/upload-artifact@v2
if: ${{ !env.ACT }}
with:
name: Size,nRFConnect-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 BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ if (current_toolchain != "${dir_pw_toolchain}/default:default") {
declare_args() {
chip_enable_python_modules =
(current_os == "mac" || current_os == "linux") &&
(host_cpu == "x64" || host_cpu == "arm64")
(host_cpu == "x64" || host_cpu == "arm64" || host_cpu == "arm")
enable_pylib = false
}

Expand Down
28 changes: 25 additions & 3 deletions config/nrfconnect/chip-module/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ if (CONFIG_CHIP)
include(ExternalProject)
include(../../zephyr/ota-image.cmake)
include(../../zephyr/zephyr-util.cmake)
include(ota-content-header.cmake)

# ==============================================================================
# Declare configuration variables and define constants
Expand Down Expand Up @@ -308,11 +309,32 @@ add_dependencies(chip chip-gn)
# ==============================================================================

if (CONFIG_CHIP_OTA_IMAGE_BUILD)
if (CONFIG_CHIP_OTA_IMAGE_INCLUDE_MCUBOOT)
list(APPEND CHIP_IMAGE_TYPES "mcuboot")
list(APPEND CHIP_IMAGE_PATHS "${APPLICATION_BINARY_DIR}/mcuboot/zephyr/zephyr.bin")
endif()

list(APPEND CHIP_IMAGE_TYPES "app_mcuboot")
list(APPEND CHIP_IMAGE_PATHS "${PROJECT_BINARY_DIR}/app_update.bin")

if (CONFIG_NRF53_UPGRADE_NETWORK_CORE)
list(APPEND CHIP_IMAGE_TYPES "net_mcuboot")
list(APPEND CHIP_IMAGE_PATHS "${PROJECT_BINARY_DIR}/net_core_app_update.bin")
endif()

chip_ota_content_header(chip-ota-content-header
FILE_TYPES ${CHIP_IMAGE_TYPES}
FILE_PATHS ${CHIP_IMAGE_PATHS}
OUTPUT_FILE ${PROJECT_BINARY_DIR}/${CONFIG_CHIP_OTA_IMAGE_FILE_NAME}.content
)

chip_ota_image(chip-ota-image
INPUT_FILES ${PROJECT_BINARY_DIR}/app_update.bin
OUTPUT_FILE ${PROJECT_BINARY_DIR}/matter_ota.bin
INPUT_FILES ${PROJECT_BINARY_DIR}/${CONFIG_CHIP_OTA_IMAGE_FILE_NAME}.content ${CHIP_IMAGE_PATHS}
OUTPUT_FILE ${PROJECT_BINARY_DIR}/${CONFIG_CHIP_OTA_IMAGE_FILE_NAME}
)
add_dependencies(chip-ota-image mcuboot_sign_target)

add_dependencies(chip-ota-content-header mcuboot_sign_target)
add_dependencies(chip-ota-image chip-ota-content-header)
endif()

endif() # CONFIG_CHIP
Loading

0 comments on commit 7ae8fcc

Please sign in to comment.