Skip to content

Commit

Permalink
Merge branch 'master' into async-send-sigma3
Browse files Browse the repository at this point in the history
  • Loading branch information
mlepage-google committed Apr 27, 2023
2 parents b75e079 + c1108d7 commit 7fc0cd6
Show file tree
Hide file tree
Showing 221 changed files with 7,844 additions and 4,153 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/spell.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,4 +52,4 @@ jobs:
token: ${{ github.token }}
attempt_limit: 3
attempt_delay: 2000
- uses: igsekor/pyspelling-any@v0.0.2
- uses: igsekor/pyspelling-any@v1.0.4
8 changes: 8 additions & 0 deletions config/esp32/components/chip/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,14 @@ menu "CHIP Core"
help
Build CHIP test binaries.

config DISPATCH_EVENT_LONG_DISPATCH_TIME_WARNING_THRESHOLD_MS
int "Set threshold in ms"
default 700
help
Time threshold for events dispatching. By default set to 0 to
to disable event dispatching time measurement and suppress the
logs for Long dispatch time.

# TODO: add log level selection

endmenu # "General Options"
Expand Down
16 changes: 16 additions & 0 deletions config/openiotsdk/cmake/sdk.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,22 @@ FetchContent_Declare(
GIT_PROGRESS ON
)

# Apply a patch to TF-M to support GCC 12
FetchContent_Declare(
trusted-firmware-m
GIT_REPOSITORY https://git.trustedfirmware.org/TF-M/trusted-firmware-m.git
GIT_TAG d0c0a67f1b412e89d09b0987091c12998c4e4660
GIT_SHALLOW OFF
GIT_PROGRESS ON
# Note: This prevents FetchContent_MakeAvailable() from calling
# add_subdirectory() on the fetched repository. TF-M needs a
# standalone build because it relies on functions defined in its
# own toolchain files and contains paths that reference the
# top-level project instead of its own project.
SOURCE_SUBDIR NONE
PATCH_COMMAND git reset --hard --quiet && git clean --force -dx --quiet && git apply ${CMAKE_CURRENT_LIST_DIR}/tf-m.patch
)

# Open IoT SDK configuration
set(IOTSDK_FETCH_LIST
mcu-driver-reference-platforms-for-arm
Expand Down
12 changes: 12 additions & 0 deletions config/openiotsdk/cmake/tf-m.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
diff --git a/toolchain_GNUARM.cmake b/toolchain_GNUARM.cmake
index d044ed4a5..3d8f64d17 100644
--- a/toolchain_GNUARM.cmake
+++ b/toolchain_GNUARM.cmake
@@ -71,7 +71,6 @@ macro(tfm_toolchain_reset_linker_flags)
--entry=Reset_Handler
--specs=nano.specs
LINKER:-check-sections
- LINKER:-fatal-warnings
LINKER:--gc-sections
LINKER:--no-wchar-size-warning
${MEMORY_USAGE_FLAG}
16 changes: 8 additions & 8 deletions docs/guides/esp32/setup_idf_chip.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,27 +13,27 @@ step.

### Install Prerequisites

- [Linux](https://docs.espressif.com/projects/esp-idf/en/v4.4.3/esp32/get-started/linux-setup.html)
- [macOS](https://docs.espressif.com/projects/esp-idf/en/v4.4.3/esp32/get-started/macos-setup.html)
- [Linux](https://docs.espressif.com/projects/esp-idf/en/v4.4.4/esp32/get-started/linux-setup.html)
- [macOS](https://docs.espressif.com/projects/esp-idf/en/v4.4.4/esp32/get-started/macos-setup.html)

### Get IDF v4.4.3
### Get IDF v4.4.4

- Clone ESP-IDF
[v4.4.3 release](https://github.com/espressif/esp-idf/releases/tag/v4.4.3)
[v4.4.4 release](https://github.com/espressif/esp-idf/releases/tag/v4.4.4)

```
$ git clone -b v4.4.3 --recursive https://github.com/espressif/esp-idf.git
$ git clone -b v4.4.4 --recursive https://github.com/espressif/esp-idf.git
$ cd esp-idf
$ ./install.sh
```
- To update an existing esp-idf toolchain to v4.4.3:
- To update an existing esp-idf toolchain to v4.4.4:
```
$ cd path/to/esp-idf
$ git fetch origin
$ git checkout v4.4.3
$ git reset --hard origin/v4.4.3
$ git checkout v4.4.4
$ git reset --hard origin/v4.4.4
$ git submodule update --recursive --init
$ git clean -fdx
$ ./install.sh
Expand Down
2 changes: 1 addition & 1 deletion docs/guides/nrfconnect_examples_cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ available options for the given command.
are accessible from the shell, but they must preceded by `ot`. For example:

```shell
uart:~$ ot masterkey
uart:~$ ot networkkey
00112233445566778899aabbccddeeff
Done
```
Expand Down
1 change: 1 addition & 0 deletions examples/all-clusters-app/nrfconnect/main/AppTask.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,7 @@ CHIP_ERROR AppTask::Init()
memset(sTestEventTriggerEnableKey, 0, sizeof(sTestEventTriggerEnableKey));
}
#else
SetDeviceInstanceInfoProvider(&DeviceInstanceInfoProviderMgrImpl());
SetDeviceAttestationCredentialsProvider(Examples::GetExampleDACProvider());
#endif

Expand Down
2 changes: 2 additions & 0 deletions examples/all-clusters-app/nrfconnect/main/include/AppTask.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@

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

#ifdef CONFIG_MCUMGR_SMP_BT
Expand Down
7 changes: 6 additions & 1 deletion examples/all-clusters-app/nxp/mw320/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@ mw320_executable("shell_mw320") {
"${chip_root}/src/setup_payload",
]

deps = [ "${chip_root}/src/platform:syscalls_stub" ]

include_dirs = [
"${chip_root}/src/platform/nxp/mw320",
"${examples_plat_dir}/app/project_include",
Expand All @@ -84,7 +86,10 @@ mw320_executable("shell_mw320") {

ldscript = "${examples_plat_dir}/app/ldscripts/88MW320_xx_xxxx_flash.ld"

ldflags = [ "-T" + rebase_path(ldscript, root_build_dir) ]
ldflags = [
"-T" + rebase_path(ldscript, root_build_dir),
"-Wl,--no-warn-rwx-segment",
]
defines = [
"MW320_SHELL_STREAMER",
"SHELL_STREAMER_APP_SPECIFIC",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ CHIP_ERROR AppTask::Init()
SetDeviceAttestationCredentialsProvider(&mFactoryDataProvider);
SetCommissionableDataProvider(&mFactoryDataProvider);
#else
SetDeviceInstanceInfoProvider(&DeviceInstanceInfoProviderMgrImpl());
SetDeviceAttestationCredentialsProvider(Examples::GetExampleDACProvider());
#endif

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@

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

#ifdef CONFIG_MCUMGR_SMP_BT
Expand Down
3 changes: 3 additions & 0 deletions examples/bridge-app/esp32/main/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
#include <app/ConcreteAttributePath.h>
#include <app/clusters/identify-server/identify-server.h>
#include <app/reporting/reporting.h>
#include <app/server/OnboardingCodesUtil.h>
#include <app/util/attribute-storage.h>
#include <common/Esp32AppServer.h>
#include <credentials/DeviceAttestationCredsProvider.h>
Expand Down Expand Up @@ -361,6 +362,8 @@ const EmberAfDeviceType gBridgedOnOffDeviceTypes[] = { { DEVICE_TYPE_LO_ON_OFF_L

static void InitServer(intptr_t context)
{
PrintOnboardingCodes(chip::RendezvousInformationFlags(CONFIG_RENDEZVOUS_MODE));

Esp32AppServer::Init(); // Init ZCL Data Model and CHIP App Server AND Initialize device attestation config

// Set starting endpoint id where dynamic endpoints will be assigned, which
Expand Down
5 changes: 3 additions & 2 deletions examples/chef/chef.py
Original file line number Diff line number Diff line change
Expand Up @@ -615,10 +615,11 @@ def main() -> int:
f"\"{truncated_sw_ver_string}\" due to 64 bytes limitation")
sw_ver_string = truncated_sw_ver_string

flush_print("Building...")

flush_print(f"Software Version String: \"{sw_ver_string}\"")
flush_print(
f"Product ID 0x{options.pid:02X} / Vendor ID 0x{options.vid:02X}")
flush_print("Building...")

shell.run_cmd(f"cd {_CHEF_SCRIPT_PATH}")

if (options.build_target == "esp32") or (options.build_target == "nrfconnect") or (options.build_target == "ameba"):
Expand Down
2 changes: 2 additions & 0 deletions examples/chef/devices/rootnode_lightsensor_lZQycTFcJK.matter
Original file line number Diff line number Diff line change
Expand Up @@ -1229,6 +1229,7 @@ server cluster IlluminanceMeasurement = 1024 {
readonly attribute nullable int16u measuredValue = 0;
readonly attribute nullable int16u minMeasuredValue = 1;
readonly attribute nullable int16u maxMeasuredValue = 2;
readonly attribute nullable enum8 lightSensorType = 4;
readonly attribute command_id generatedCommandList[] = 65528;
readonly attribute command_id acceptedCommandList[] = 65529;
readonly attribute event_id eventList[] = 65530;
Expand Down Expand Up @@ -1440,6 +1441,7 @@ endpoint 1 {
ram attribute measuredValue default = 0xC351;
ram attribute minMeasuredValue default = 1;
ram attribute maxMeasuredValue default = 0xfffe;
ram attribute lightSensorType default = 1;
callback attribute generatedCommandList default = 0;
callback attribute acceptedCommandList default = 0;
callback attribute attributeList default = 0;
Expand Down
11 changes: 6 additions & 5 deletions examples/chef/devices/rootnode_lightsensor_lZQycTFcJK.zap
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"featureLevel": 92,
"featureLevel": 96,
"creator": "zap",
"keyValuePairs": [
{
Expand Down Expand Up @@ -6141,11 +6141,11 @@
"mfgCode": null,
"side": "server",
"type": "enum8",
"included": 0,
"included": 1,
"storageOption": "RAM",
"singleton": 0,
"bounded": 0,
"defaultValue": "0xFF",
"defaultValue": "1",
"reportable": 1,
"minInterval": 1,
"maxInterval": 65534,
Expand Down Expand Up @@ -6255,5 +6255,6 @@
"endpointVersion": 1,
"deviceIdentifier": 262
}
]
}
],
"log": []
}
8 changes: 1 addition & 7 deletions examples/chef/efr32/src/AppTask.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,7 @@
#include "AppConfig.h"
#include "AppEvent.h"

#ifdef ENABLE_WSTK_LEDS
#include "LEDWidget.h"
#include "sl_simple_led_instances.h"
#endif // ENABLE_WSTK_LEDS

#ifdef DISPLAY_ENABLED
#include "lcd.h"
Expand All @@ -51,10 +48,7 @@

#include <platform/CHIPDeviceLayer.h>

#ifdef ENABLE_WSTK_LEDS
#define SYSTEM_STATE_LED &sl_led_led0
#endif // ENABLE_WSTK_LEDS

#define SYSTEM_STATE_LED 0
#define APP_FUNCTION_BUTTON &sl_button_btn0

using namespace chip;
Expand Down
2 changes: 2 additions & 0 deletions examples/chef/esp32/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,10 @@ idf_build_set_property(COMPILE_OPTIONS "-DCHIP_DEVICE_CONFIG_DEVICE_PRODUCT_ID=$
if(NOT ${CONFIG_DEVICE_PRODUCT_NAME} STREQUAL "")
idf_build_set_property(COMPILE_OPTIONS "-DCHIP_DEVICE_CONFIG_DEVICE_PRODUCT_NAME=\"${CONFIG_DEVICE_PRODUCT_NAME}\"" APPEND)
endif()
# Forwarding the customized software version string to the ESP32 firmware image
if(NOT ${CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION_STRING} STREQUAL "")
idf_build_set_property(COMPILE_OPTIONS "-DCHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION_STRING=\"${CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION_STRING}\"" APPEND)
set(PROJECT_VER ${CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION_STRING})
endif()
idf_build_set_property(COMPILE_OPTIONS "-DCHIP_PLATFORM_ESP32=1" APPEND)

Expand Down
62 changes: 13 additions & 49 deletions examples/chip-tool/templates/ComplexArgumentParser-src.zapt
Original file line number Diff line number Diff line change
Expand Up @@ -2,52 +2,16 @@

#include <commands/clusters/ComplexArgument.h>

{{#structs_with_clusters groupByStructName=1}}
CHIP_ERROR ComplexArgumentParser::Setup(const char * label, chip::app::Clusters::{{#unless (is_number_greater_than structClusterCount 1)}}{{as_camel_cased clusterName false}}{{else}}detail{{/unless}}::Structs::{{name}}::Type & request, Json::Value & value)
{
VerifyOrReturnError(value.isObject(), CHIP_ERROR_INVALID_ARGUMENT);

// Copy to track which members we already processed.
Json::Value valueCopy(value);

{{#zcl_struct_items}}
{{#unless isOptional}}
{{~! Fabric index fields are not sent on writes, so don't force people to
provide them. ~}}
{{#unless (is_num_equal fieldIdentifier 254)}}
ReturnErrorOnFailure(ComplexArgumentParser::EnsureMemberExist("{{parent.name}}.{{asLowerCamelCase label}}", "{{asLowerCamelCase label}}", value.isMember("{{asLowerCamelCase label}}")));
{{/unless}}
{{/unless}}
{{/zcl_struct_items}}

char labelWithMember[kMaxLabelLength];
{{#zcl_struct_items}}
{{#if isOptional}}
if (value.isMember("{{asLowerCamelCase label}}"))
{
{{else if (is_num_equal fieldIdentifier 254)}}
if (value.isMember("{{asLowerCamelCase label}}"))
{
{{/if}}
snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "{{asLowerCamelCase label}}");
ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.{{asLowerCamelCase label}}, value["{{asLowerCamelCase label}}"]));
{{#if isOptional}}
}
{{else if (is_num_equal fieldIdentifier 254)}}
}
{{/if}}
valueCopy.removeMember("{{asLowerCamelCase label}}");

{{/zcl_struct_items}}

return ComplexArgumentParser::EnsureNoMembersRemaining(label, valueCopy);
}

void ComplexArgumentParser::Finalize(chip::app::Clusters::{{#unless (is_number_greater_than structClusterCount 1)}}{{as_camel_cased clusterName false}}{{else}}detail{{/unless}}::Structs::{{name}}::Type & request)
{
{{#zcl_struct_items}}
ComplexArgumentParser::Finalize(request.{{asLowerCamelCase label}});
{{/zcl_struct_items}}
}
{{/structs_with_clusters}}

{{#zcl_structs}}
{{#if has_more_than_one_cluster}}
{{> struct_parser_impl namespace="detail"}}
{{/if}}
{{/zcl_structs}}

{{#zcl_clusters}}
{{#zcl_structs}}
{{#unless has_more_than_one_cluster}}
{{> struct_parser_impl namespace=(as_camel_cased ../name false)}}
{{/unless}}
{{/zcl_structs}}
{{/zcl_clusters}}
16 changes: 12 additions & 4 deletions examples/chip-tool/templates/ComplexArgumentParser.zapt
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,16 @@
#include <lib/core/CHIPError.h>
#include <app-common/zap-generated/cluster-objects.h>

{{#structs_with_clusters groupByStructName=1}}
static CHIP_ERROR Setup(const char * label, chip::app::Clusters::{{#unless (is_number_greater_than structClusterCount 1)}}{{as_camel_cased clusterName false}}{{else}}detail{{/unless}}::Structs::{{name}}::Type & request, Json::Value & value);
{{#zcl_structs}}
{{#if has_more_than_one_cluster}}
{{> struct_parser_decl namespace="detail"}}
{{/if}}
{{/zcl_structs}}

static void Finalize(chip::app::Clusters::{{#unless (is_number_greater_than structClusterCount 1)}}{{as_camel_cased clusterName false}}{{else}}detail{{/unless}}::Structs::{{name}}::Type & request);
{{/structs_with_clusters}}
{{#zcl_clusters}}
{{#zcl_structs}}
{{#unless has_more_than_one_cluster}}
{{> struct_parser_decl namespace=(as_camel_cased ../name false)}}
{{/unless}}
{{/zcl_structs}}
{{/zcl_clusters}}
30 changes: 12 additions & 18 deletions examples/chip-tool/templates/logging/DataModelLogger-src.zapt
Original file line number Diff line number Diff line change
Expand Up @@ -4,25 +4,19 @@

using namespace chip::app::Clusters;

{{#structs_with_clusters groupByStructName=1}}
CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, const chip::app::Clusters::{{#unless (is_number_greater_than structClusterCount 1)}}{{as_camel_cased clusterName false}}{{else}}detail{{/unless}}::Structs::{{name}}::DecodableType & value)
{
DataModelLogger::LogString(label, indent, "{");
{{#zcl_struct_items}}
{
CHIP_ERROR err = LogValue("{{asUpperCamelCase label}}", indent + 1, value.{{asLowerCamelCase label}});
if (err != CHIP_NO_ERROR)
{
DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for '{{asUpperCamelCase label}}'");
return err;
}
}
{{/zcl_struct_items}}
DataModelLogger::LogString(indent, "}");
{{#zcl_structs}}
{{#if has_more_than_one_cluster}}
{{> struct_logger_impl namespace="detail"}}
{{/if}}
{{/zcl_structs}}

return CHIP_NO_ERROR;
}
{{/structs_with_clusters}}
{{#zcl_clusters}}
{{#zcl_structs}}
{{#unless has_more_than_one_cluster}}
{{> struct_logger_impl namespace=(as_camel_cased ../name false)}}
{{/unless}}
{{/zcl_structs}}
{{/zcl_clusters}}

{{#zcl_clusters}}
{{#zcl_events}}
Expand Down
Loading

0 comments on commit 7fc0cd6

Please sign in to comment.