Skip to content

Commit

Permalink
Merge branch 'project-chip:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
selissia authored May 4, 2022
2 parents 8530810 + 9aeecb3 commit 87a9581
Show file tree
Hide file tree
Showing 811 changed files with 95,656 additions and 39,494 deletions.
1 change: 1 addition & 0 deletions .github/.wordlist.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1422,6 +1422,7 @@ xFF
xFFF
xFFFF
xfffff
xFFFFFFEFFFFFFFFF
xtensa
xwayland
xyz
Expand Down
12 changes: 11 additions & 1 deletion .github/workflows/darwin-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,16 @@ jobs:
runs-on: macos-latest

steps:
- uses: Wandalen/[email protected]
name: Checkout
with:
action: actions/checkout@v3
with: |
token: ${{ github.token }}
attempt_limit: 3
attempt_delay: 2000
- name: Checkout submodules
run: scripts/checkout_submodules.py --shallow --platform darwin
run: scripts/checkout_submodules.py --shallow --platform darwin
- name: Setup Environment
# coreutils for stdbuf
run: brew install openssl pkg-config coreutils
Expand Down Expand Up @@ -80,6 +88,7 @@ jobs:
"./scripts/build/build_examples.py \
--target darwin-x64-chip-tool-darwin-${BUILD_VARIANT} \
--target darwin-x64-all-clusters-${BUILD_VARIANT} \
--target darwin-x64-lock-${BUILD_VARIANT} \
build \
--copy-artifacts-to objdir-clone \
"
Expand All @@ -93,6 +102,7 @@ jobs:
run \
--iterations 1 \
--all-clusters-app ./out/darwin-x64-all-clusters-${BUILD_VARIANT}/chip-all-clusters-app \
--lock-app ./out/darwin-x64-lock-${BUILD_VARIANT}/chip-lock-app \
"
- name: Uploading core files
uses: actions/upload-artifact@v2
Expand Down
21 changes: 21 additions & 0 deletions .github/workflows/examples-linux-imx.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -55,3 +55,24 @@ jobs:
run: |
./scripts/examples/imxlinux_example.sh \
examples/chip-tool examples/chip-tool/out/aarch64
- name: Build thermostat
timeout-minutes: 30
run: |
./scripts/run_in_build_env.sh \
"./scripts/build/build_examples.py \
--target imx-thermostat build \
"
- name: Build all-cluster
timeout-minutes: 30
run: |
./scripts/run_in_build_env.sh \
"./scripts/build/build_examples.py \
--target imx-all-clusters-app build \
"
- name: Build ota-provider-app
timeout-minutes: 30
run: |
./scripts/run_in_build_env.sh \
"./scripts/build/build_examples.py \
--target imx-ota-provider-app build
"
4 changes: 2 additions & 2 deletions .github/workflows/examples-nrfconnect.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ concurrency:
jobs:
nrfconnect:
name: nRF Connect SDK
timeout-minutes: 120
timeout-minutes: 125

env:
BUILD_TYPE: nrfconnect
Expand Down Expand Up @@ -174,7 +174,7 @@ jobs:
examples/pump-controller-app/nrfconnect/build/zephyr/zephyr.elf \
/tmp/bloat_reports/
- name: Build example nRF Connect SDK All Clusters App on nRF52840 DK
timeout-minutes: 10
timeout-minutes: 15
run: |
scripts/examples/nrfconnect_example.sh all-clusters-app nrf52840dk_nrf52840 -DCONF_FILE=prj_dfu.conf
.environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \
Expand Down
3 changes: 0 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -225,9 +225,6 @@
path = third_party/mbed-mcu-boot/repo
url = https://github.com/ATmobica/mcuboot.git
platforms = mbed
[submodule "perfetto"]
path = third_party/perfetto/repo
url = https://github.com/google/perfetto
[submodule "p6/serial-flash"]
path = third_party/p6/p6_sdk/libs/serial-flash
url = https://github.com/Infineon/serial-flash
Expand Down
9 changes: 8 additions & 1 deletion build/config/BUILDCONFIG.gn
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,15 @@ if (_chip_defaults.custom_toolchain != "") {
} else if (target_os == host_os && target_cpu == host_cpu) {
_default_toolchain = host_toolchain
} else if (target_os == "freertos") {
if (_chip_defaults.is_clang) {
_target_compiler = "clang"
} else {
_target_compiler = "gcc"
}

if (target_cpu == "arm") {
_default_toolchain = "${_build_overrides.build_root}/toolchain/arm_gcc"
_default_toolchain =
"${_build_overrides.build_root}/toolchain/arm_${_target_compiler}"
} else if (target_cpu == "riscv") {
_default_toolchain = "${_build_overrides.build_root}/toolchain/riscv_gcc"
} else {
Expand Down
22 changes: 10 additions & 12 deletions build/config/compiler/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,6 @@ if (current_os == "mac") {
import("${build_root}/config/mac/mac_sdk.gni")
}

if (current_os == "webos") {
import("${build_root}/config/webos/webos_sdk.gni")
target_defines += []
target_cflags += [ "--sysroot=" + sysroot_webos ]
target_cflags_cc += []
target_cflags_c += []
target_ldflags += [ "--sysroot=" + sysroot_webos ]
}

declare_args() {
# Enable -Werror. This can be disabled if using a different compiler
# with unfixed or unsupported wanings.
Expand Down Expand Up @@ -330,10 +321,17 @@ config("runtime_default") {
"rt",
]
}

cflags = []
ldflags = []

if (sysroot != "") {
cflags = [ "--sysroot=${sysroot}" ]
ldflags = [ "--sysroot=${sysroot}" ]
cflags += [ "--sysroot=${sysroot}" ]
ldflags += [ "--sysroot=${sysroot}" ]
}

cflags += runtime_library_cflags
ldflags += runtime_library_ldflags
}

# To use different sanitizer options, use `gn args .` in the out folder and
Expand Down Expand Up @@ -528,7 +526,7 @@ config("aliasing_default") {
}

config("specs_default") {
if (current_cpu == "arm" && current_os == "freertos") {
if (current_cpu == "arm" && current_os == "freertos" && !is_clang) {
cflags = [
"--specs=nosys.specs",
"--specs=nano.specs",
Expand Down
43 changes: 43 additions & 0 deletions build/config/sysroot.gni
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,49 @@
# See the License for the specific language governing permissions and
# limitations under the License.

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

import("${build_root}/config/compiler/compiler.gni")

declare_args() {
# Build file to import for sysroot defaults.
sysroot_platform_config = ""
}

if (sysroot_platform_config == "") {
if (current_os == "webos") {
sysroot_platform_config = "${build_root}/config/webos/webos_sysroot.gni"
} else if (is_clang && current_cpu == "arm" && current_os == "freertos") {
sysroot_platform_config = "${build_root}/toolchain/arm/arm_sysroot.gni"
}
}

# Allow platforms to override how sysroot flags are chosen by
# providing a file to import.
if (sysroot_platform_config != "") {
_platform_defaults = {
import(sysroot_platform_config)
}
}

_defaults = {
sysroot = ""
runtime_library_cflags = []
runtime_library_ldflags = []

# Update defaults with platform values, if any.
if (sysroot_platform_config != "") {
forward_variables_from(_platform_defaults, "*")
}
}

declare_args() {
# Logical root directory for system headers and libraries.
sysroot = _defaults.sysroot

# Extra cflags for runtime library.
runtime_library_cflags = _defaults.runtime_library_cflags

# Extra ldflags for runtime library.
runtime_library_ldflags = _defaults.runtime_library_ldflags
}
17 changes: 17 additions & 0 deletions build/config/webos/webos_sysroot.gni
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# 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.

import("${build_root}/config/webos/webos_sdk.gni")

sysroot = webos_sysroot
57 changes: 57 additions & 0 deletions build/toolchain/arm/arm_sysroot.gni
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# 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.

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

import("${build_root}/config/arm.gni")

assert(arm_arch != "", "Must specify arm_arch to configure clang for ARM")

_script_flags = [
"--gn-scope",
"--cflags",
"--ldflags",
"--",
]

if (arm_arch != "") {
_script_flags += [ "-march=${arm_arch}" ]
}
if (arm_cpu != "") {
_script_flags += [ "-mcpu=${arm_cpu}" ]
}
if (arm_tune != "") {
_script_flags += [ "-mtune=${arm_tune}" ]
}
if (arm_abi != "") {
_script_flags += [ "-mabi=${arm_abi}" ]
}
if (arm_fpu != "") {
_script_flags += [ "-mfpu=${arm_fpu}" ]
}
if (arm_float_abi != "") {
_script_flags += [ "-mfloat-abi=${arm_float_abi}" ]
}
if (arm_use_thumb) {
_script_flags += [ "-mthumb" ]
}

_arm_flags =
exec_script("$dir_pw_toolchain/py/pw_toolchain/clang_arm_toolchain.py",
_script_flags,
"scope")

runtime_library_cflags = _arm_flags.cflags
runtime_library_ldflags = _arm_flags.cflags + _arm_flags.ldflags
20 changes: 20 additions & 0 deletions build/toolchain/arm_clang/BUILD.gn
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# 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.

import("arm_clang_toolchain.gni")

arm_clang_toolchain("arm_clang") {
toolchain_args = {
}
}
31 changes: 31 additions & 0 deletions build/toolchain/arm_clang/arm_clang_toolchain.gni
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# 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.

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

import("${build_root}/toolchain/gcc_toolchain.gni")

template("arm_clang_toolchain") {
gcc_toolchain(target_name) {
ar = "llvm-ar"

toolchain_args = {
current_cpu = "arm"
current_os = invoker.current_os
is_clang = true

forward_variables_from(invoker.toolchain_args, "*")
}
}
}
10 changes: 10 additions & 0 deletions config/tizen/chip-gn/platform/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,12 @@ if (chip_enable_ble) {
pkg_config("capi-network-bluetooth") {
packages = [ "capi-network-bluetooth" ]
}

if (chip_enable_openthread) {
pkg_config("capi-network-thread") {
packages = [ "capi-network-thread" ]
}
}
}

source_set("tizen") {
Expand All @@ -77,4 +83,8 @@ source_set("tizen") {
if (chip_enable_ble) {
public_configs += [ ":capi-network-bluetooth" ]
}

if (chip_enable_openthread) {
public_configs += [ ":capi-network-thread" ]
}
}
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
-----BEGIN CERTIFICATE-----
MIIB2zCCAYGgAwIBAgIIdPS0Rry9ddswCgYIKoZIzj0EAwIwRjEYMBYGA1UEAwwP
TWF0dGVyIFRlc3QgUEFJMRQwEgYKKwYBBAGConwCAQwERkZGMTEUMBIGCisGAQQB
gqJ8AgIMBDAwQjEwIBcNMjIwNDI2MDAwMDAwWhgPOTk5OTEyMzEyMzU5NTlaMD0x
OzA5BgNVBAMMMkFDTUUgTWF0dGVyIERldmVsIERBQyA1Q0RBOTg5OSBNdmlkOkZG
RjEgTXBpZDowMEIxMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEz6yTm/3VzzhP
RWlPINrL/jB871vqTEwIqz+OYdTL2ooD63jfPEVAygfRHAmrXH7rRPCvNfysZR9u
fQ3qq3cwUaNgMF4wDAYDVR0TAQH/BAIwADAOBgNVHQ8BAf8EBAMCB4AwHQYDVR0O
BBYEFLwuBooXut+fsp4K0MyphSCJToF/MB8GA1UdIwQYMBaAFHvphboKFu4Zbaob
Axwjc2WrfPXyMAoGCCqGSM49BAMCA0gAMEUCIQCArZaLxQ6DSosIDYSAmcIQtGL7
zQvLfGtphlF2ECu33QIgI5enn/l7sthJhzCRs2MVsj9S5zJ+Qljr/iHcjyNzb7o=
-----END CERTIFICATE-----
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
-----BEGIN EC PRIVATE KEY-----
MHcCAQEEIFCtNcGAyI7EYRMnheNNLlQi3FmLSawTR/2NB/kHU0oToAoGCCqGSM49
AwEHoUQDQgAEz6yTm/3VzzhPRWlPINrL/jB871vqTEwIqz+OYdTL2ooD63jfPEVA
ygfRHAmrXH7rRPCvNfysZR9ufQ3qq3cwUQ==
-----END EC PRIVATE KEY-----
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
-----BEGIN CERTIFICATE-----
MIIB0zCCAXqgAwIBAgIIWFA9L+I3H8IwCgYIKoZIzj0EAwIwMDEYMBYGA1UEAwwP
TWF0dGVyIFRlc3QgUEFBMRQwEgYKKwYBBAGConwCAQwERkZGMTAgFw0yMjA0MjYw
MDAwMDBaGA85OTk5MTIzMTIzNTk1OVowRjEYMBYGA1UEAwwPTWF0dGVyIFRlc3Qg
UEFJMRQwEgYKKwYBBAGConwCAQwERkZGMTEUMBIGCisGAQQBgqJ8AgIMBDAwQjEw
WTATBgcqhkjOPQIBBggqhkjOPQMBBwNCAATml2V56K3F9tcyE5qim22p/JoHVN3m
yprbSKBM4flsZflC38DNkw0QcUaJHGq7TKXyBq/Zm/fM67Z9WOfMDF6uo2YwZDAS
BgNVHRMBAf8ECDAGAQH/AgEBMA4GA1UdDwEB/wQEAwIBBjAdBgNVHQ4EFgQUe+mF
ugoW7hltqhsDHCNzZat89fIwHwYDVR0jBBgwFoAUav0idx9RH+y/FkGXZxDc3DGh
cX4wCgYIKoZIzj0EAwIDRwAwRAIgeUArz/4QljTj6t5P6gENjs7RLMB7SNehG0vq
HHeSmCQCIE+Sl7CggWu/WmtzTx72zB14e0oUqL59IxN1TqDtjn43
-----END CERTIFICATE-----
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
-----BEGIN EC PRIVATE KEY-----
MHcCAQEEIBG2VwT0hHszwy3xi8EXAmF28ch3/ZHT1u7ZCz7f31mmoAoGCCqGSM49
AwEHoUQDQgAE5pdleeitxfbXMhOaopttqfyaB1Td5sqa20igTOH5bGX5Qt/AzZMN
EHFGiRxqu0yl8gav2Zv3zOu2fVjnzAxerg==
-----END EC PRIVATE KEY-----
Loading

0 comments on commit 87a9581

Please sign in to comment.