Skip to content

Commit

Permalink
Merge branch 'master' into upstream-nrf-generic-switch
Browse files Browse the repository at this point in the history
  • Loading branch information
markus-becker-tridonic-com authored Jun 24, 2022
2 parents 0227f31 + 2d0c529 commit a5c6bb1
Show file tree
Hide file tree
Showing 270 changed files with 10,110 additions and 871 deletions.
19 changes: 0 additions & 19 deletions .github/workflows/examples-efr32.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,25 +50,6 @@ jobs:
- name: Checkout submodules
run: scripts/checkout_submodules.py --shallow --platform efr32

- name: Install git-lfs # Temporary measure untill docker container is updated
run:
"curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | bash; \
apt-get install git-lfs; \
git lfs install;"

- name: Create LFS file hash list
run: git -C third_party/silabs/gecko_sdk lfs ls-files -l | cut -d' ' -f1 | sort > .lfs-assets-id

- name: Restore gecko_sdk LFS cache
uses: actions/cache@v2
id: lfs-cache
with:
path: .git/modules/third_party/silabs/gecko_sdk/lfs
key: lfs-${{ hashFiles('.lfs-assets-id') }}

- name: Git LFS Pull
run: git -C third_party/silabs/gecko_sdk lfs pull

- name: Set up environment for size reports
if: ${{ !env.ACT }}
env:
Expand Down
16 changes: 16 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -93,3 +93,19 @@ jobs:
if: always()
run: |
scripts/tools/check_test_pics.py src/app/tests/suites/certification/ci-pics-values src/app/tests/suites/certification/PICS.yaml
# git grep exits with 0 if it finds a match, but we want
# to fail (exit nonzero) on match. And we wasnt to exclude this file,
# to avoid our grep regexp matching itself.
- name: Check for use of 0x%u and the like, which lead to misleading output.
if: always()
run: |
git grep -n '0x%[0-9l.-]*[^0-9lxX".-]' -- './*' ':(exclude).github/workflows/lint.yml' && exit 1 || exit 0
# git grep exits with 0 if it finds a match, but we want
# to fail (exit nonzero) on match. And we wasnt to exclude this file,
# to avoid our grep regexp matching itself.
- name: Check for use of '"0x" PRIu*' and the like, which lead to misleading output.
if: always()
run: |
git grep -n '0x%[0-9-]*" *PRI[^xX]' -- './*' ':(exclude).github/workflows/lint.yml' && exit 1 || exit 0
4 changes: 4 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,10 @@
url = https://github.com/bouffalolab/bl_iot_sdk_matter.git
branch = bl602_release
platforms = bl602
[submodule "third_party/nxp/mw320_sdk/repo"]
path = third_party/nxp/mw320_sdk/repo
url = https://github.com/nxptest/mw320_sdk
platforms = mw320
[submodule "third_party/nxp/libs/mbedtls/repo"]
path = third_party/nxp/libs/mbedtls/repo
url = https://github.com/NXPmicro/mbedtls.git
Expand Down
12 changes: 12 additions & 0 deletions BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,9 @@ if (current_toolchain != "${dir_pw_toolchain}/default:default") {

# Set this to true to enable bl602 builds by default.
enable_bl602_builds = false

# Set this to true to enable mw320 builds by default.
enable_mw320_builds = false
}

declare_args() {
Expand Down Expand Up @@ -291,6 +294,9 @@ if (current_toolchain != "${dir_pw_toolchain}/default:default") {
# Build the bl602 lighting app example.
enable_bl602_lighting_app_build = enable_bl602_builds

# Build the mw320 shell app example.
enable_mw320_shell_build = enable_mw320_builds

enable_fake_tests = enable_default_builds && host_os == "linux"

enable_tizen_lighting_app = enable_tizen_builds
Expand Down Expand Up @@ -484,6 +490,12 @@ if (current_toolchain != "${dir_pw_toolchain}/default:default") {
}
}

if (enable_mw320_shell_build) {
group("mw320_shell") {
deps = [ "${chip_root}/examples/shell/mw320(${chip_root}/config/mw320/toolchain:mw320_shell)" ]
}
}

group("default") {
deps = []
if (enable_host_clang_build) {
Expand Down
3 changes: 1 addition & 2 deletions build/config/BUILDCONFIG.gn
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,7 @@ if (_chip_defaults.custom_toolchain != "") {
"${_build_overrides.build_root}/toolchain/tizen:tizen_${target_cpu}"
} else if (target_os == "webos") {
if (target_cpu == "arm" || target_cpu == "arm64") {
_default_toolchain =
"${_build_overrides.build_root}/toolchain/webos"
_default_toolchain = "${_build_overrides.build_root}/toolchain/webos"
} else {
assert(false,
"Unsupported target_cpu: ${current_cpu}. Shall be arm for webOS")
Expand Down
18 changes: 18 additions & 0 deletions build_overrides/mw320_sdk.gni
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"
}
7 changes: 7 additions & 0 deletions config/nrfconnect/chip-module/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,13 @@ chip_gn_arg_bool ("chip_detail_logging" CONFIG_MATTER_LOG_LE
chip_gn_arg_bool ("chip_automation_logging" "false")
chip_gn_arg_bool ("chip_malloc_sys_heap" CONFIG_CHIP_MALLOC_SYS_HEAP)

if (CONFIG_CHIP_FACTORY_DATA)
chip_gn_arg_bool ("chip_use_transitional_commissionable_data_provider" "false")
chip_gn_arg_bool ("chip_enable_factory_data" "true")
elseif (CONFIG_CHIP_FACTORY_DATA_CUSTOM_BACKEND)
chip_gn_arg_bool ("chip_use_transitional_commissionable_data_provider" "false")
endif()

if (CONFIG_CHIP_ROTATING_DEVICE_ID)
chip_gn_arg_bool("chip_enable_rotating_device_id" "true")
chip_gn_arg_bool("chip_enable_additional_data_advertising" "true")
Expand Down
32 changes: 31 additions & 1 deletion config/nrfconnect/chip-module/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@

rsource "../../zephyr/Kconfig"

if CHIP

config CHIP_NFC_COMMISSIONING
bool "Enable NFC commissioning support"
default n
Expand Down Expand Up @@ -73,6 +75,22 @@ config CHIP_DEBUG_SYMBOLS
help
Build the application with debug symbols.

config CHIP_FACTORY_DATA
bool "Enable Factory Data support"
select ZCBOR
help
Enables support for reading factory data from flash memory partition.
It requires factory_data partition to exist in the partition manager
configuration file pm_static.yml.

config CHIP_FACTORY_DATA_CUSTOM_BACKEND
bool "Enable Factory Data custom backend"
depends on !CHIP_FACTORY_DATA
help
Enables user custom factory data implementation. It cannot be used
with the CHIP_FACTORY_DATA that enabled default nRF Connect factory data
implementation.

config CHIP_FACTORY_DATA_BUILD
bool "Enable Factory Data build"
default n
Expand All @@ -82,10 +100,20 @@ config CHIP_FACTORY_DATA_BUILD
configuration file pm_static.yml.
As a result a new output file factory_data.hex will be created.

config CHIP_FACTORY_DATA_VERSION
int
default 1
help
The Factory data version contains a current version of a factory data
parameter set that the user cannot change.
After moving to the next version of the factory data set, change the default value.
This config is used to validate the version of a factory data set on a device-side
with the version of factory data saved in the Flash memory.

if CHIP_FACTORY_DATA_BUILD

# Factory data definitions
config CHIP_MERGE_FACTORY_DATA_WITH_FIRMWARE
config CHIP_FACTORY_DATA_MERGE_WITH_FIRMWARE
bool "Enable merging generated factory data with the build target .hex file"
default y
help
Expand Down Expand Up @@ -224,3 +252,5 @@ config CHIP_DEVICE_ROTATING_DEVICE_UID
help
A device rotating id unique id which will be generated if
this config is not set in prj.conf file.

endif
4 changes: 2 additions & 2 deletions config/nrfconnect/chip-module/generate_factory_data.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
# Created JSON file can be checked using JSON SCHEMA file if it is provided.
#
# This script can be manipulated using following kConfigs:
# - To merge generated factory data with final zephyr.hex file set kConfig CONFIG_CHIP_MERGE_FACTORY_DATA_WITH_FIRMWARE=y
# - To merge generated factory data with final zephyr.hex file set kConfig CONFIG_CHIP_FACTORY_DATA_MERGE_WITH_FIRMWARE=y
# - To use default certification paths set CONFIG_CHIP_FACTORY_DATA_USE_DEFAULTS_CERTS_PATH=y
#
# During generation process a some file will be created in zephyr's build directory:
Expand Down Expand Up @@ -187,7 +187,7 @@ nrfconnect_create_factory_data_hex_file(factory_data
${OUTPUT_FILE_PATH}
factory_data_hex)

if(CONFIG_CHIP_MERGE_FACTORY_DATA_WITH_FIRMWARE)
if(CONFIG_CHIP_FACTORY_DATA_MERGE_WITH_FIRMWARE)
# set custom target for merging factory_data hex file
add_custom_target(factory_data_merge
DEPENDS ${factory_data_hex}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1193,7 +1193,9 @@ server cluster SoftwareDiagnostics = 52 {
}

info event SoftwareFault = 0 {
SoftwareFaultStruct softwareFault = 0;
INT64U id = 0;
optional CHAR_STRING name = 1;
optional OCTET_STRING faultRecording = 2;
}

readonly attribute ThreadMetrics threadMetrics[] = 0;
Expand Down
10 changes: 5 additions & 5 deletions examples/all-clusters-app/linux/main-common.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,17 +67,17 @@ void HandleSoftwareFaultEvent(intptr_t arg)
if (!IsClusterPresentOnAnyEndpoint(Clusters::SoftwareDiagnostics::Id))
return;

Clusters::SoftwareDiagnostics::Structs::SoftwareFaultStruct::Type softwareFault;
Clusters::SoftwareDiagnostics::Events::SoftwareFault::Type softwareFault;
char threadName[kMaxThreadNameLength + 1];

softwareFault.id = static_cast<uint64_t>(getpid());
Platform::CopyString(threadName, std::to_string(softwareFault.id).c_str());

softwareFault.name = CharSpan::fromCharString(threadName);
softwareFault.name.SetValue(CharSpan::fromCharString(threadName));

std::time_t result = std::time(nullptr);
char * asctime = std::asctime(std::localtime(&result));
softwareFault.faultRecording = ByteSpan(Uint8::from_const_char(asctime), strlen(asctime));
std::time_t result = std::time(nullptr);
char * asctime = std::asctime(std::localtime(&result));
softwareFault.faultRecording.SetValue(ByteSpan(Uint8::from_const_char(asctime), strlen(asctime)));

Clusters::SoftwareDiagnosticsServer::Instance().OnSoftwareFaultDetect(softwareFault);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,32 +7,36 @@ mcuboot_pad:
size: 0x200
app:
address: 0x7200
size: 0xf4e00
size: 0xf3e00
mcuboot_primary:
orig_span: &id001
- mcuboot_pad
- app
span: *id001
address: 0x7000
size: 0xf5000
size: 0xf4000
region: flash_primary
mcuboot_primary_app:
orig_span: &id002
- app
span: *id002
address: 0x7200
size: 0xf4e00
size: 0xf3e00
factory_data:
address: 0xfb000
size: 0x1000
region: flash_primary
settings_storage:
address: 0xfc000
size: 0x4000
region: flash_primary
mcuboot_secondary:
address: 0x0
size: 0xf5000
size: 0xf4000
device: MX25R64
region: external_flash
external_flash:
address: 0xf5000
size: 0x70b000
address: 0xf4000
size: 0x70c000
device: MX25R64
region: external_flash
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,25 @@ mcuboot_pad:
size: 0x200
app:
address: 0xC200
size: 0xefe00
size: 0xeee00
mcuboot_primary:
orig_span: &id001
- mcuboot_pad
- app
span: *id001
address: 0xC000
size: 0xf0000
size: 0xef000
region: flash_primary
mcuboot_primary_app:
orig_span: &id002
- app
span: *id002
address: 0xC200
size: 0xefe00
size: 0xeee00
factory_data:
address: 0xfb000
size: 0x1000
region: flash_primary
settings_storage:
address: 0xfc000
size: 0x4000
Expand All @@ -33,17 +37,17 @@ mcuboot_primary_1:
region: ram_flash
mcuboot_secondary:
address: 0x0
size: 0xf0000
size: 0xef000
device: MX25R64
region: external_flash
mcuboot_secondary_1:
address: 0xf0000
address: 0xef000
size: 0x40000
device: MX25R64
region: external_flash
external_flash:
address: 0x130000
size: 0x6D0000
address: 0x12f000
size: 0x6D1000
device: MX25R64
region: external_flash
pcd_sram:
Expand Down
7 changes: 7 additions & 0 deletions examples/all-clusters-app/nrfconnect/main/AppTask.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,14 @@ CHIP_ERROR AppTask::Init()
k_timer_user_data_set(&sFunctionTimer, this);

// Initialize CHIP server
#if CONFIG_CHIP_FACTORY_DATA
ReturnErrorOnFailure(mFactoryDataProvider.Init());
SetDeviceInstanceInfoProvider(&mFactoryDataProvider);
SetDeviceAttestationCredentialsProvider(&mFactoryDataProvider);
SetCommissionableDataProvider(&mFactoryDataProvider);
#else
SetDeviceAttestationCredentialsProvider(Examples::GetExampleDACProvider());
#endif

static CommonCaseDeviceServerInitParams initParams;
static OTATestEventTriggerDelegate testEventTriggerDelegate{ ByteSpan(kTestEventTriggerEnableKey) };
Expand Down
8 changes: 8 additions & 0 deletions examples/all-clusters-app/nrfconnect/main/include/AppTask.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@

#include <platform/CHIPDeviceLayer.h>

#if CONFIG_CHIP_FACTORY_DATA
#include <platform/nrfconnect/FactoryDataProvider.h>
#endif

struct k_timer;
class AppEvent;
class LEDWidget;
Expand Down Expand Up @@ -63,4 +67,8 @@ class AppTask
bool mIsThreadProvisioned{ false };
bool mIsThreadEnabled{ false };
bool mHaveBLEConnections{ false };

#if CONFIG_CHIP_FACTORY_DATA
chip::DeviceLayer::FactoryDataProvider<chip::DeviceLayer::InternalFlashFactoryData> mFactoryDataProvider;
#endif
};
Loading

0 comments on commit a5c6bb1

Please sign in to comment.