Skip to content

Commit

Permalink
Merge branch 'master' into android/fix_subtype
Browse files Browse the repository at this point in the history
  • Loading branch information
jeonghwan7 authored Apr 21, 2023
2 parents fbc45b2 + f3f7ecd commit 7935b8d
Show file tree
Hide file tree
Showing 162 changed files with 6,180 additions and 1,510 deletions.
14 changes: 11 additions & 3 deletions .github/workflows/examples-infineon.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,8 @@ jobs:
"./scripts/build/build_examples.py \
--target cyw30739-cyw930739m2evb_01-light \
--target cyw30739-cyw930739m2evb_01-lock \
--target cyw30739-cyw930739m2evb_01-ota-requestor-no-progress-logging \
--target cyw30739-cyw930739m2evb_01-ota-requestor \
--target cyw30739-cyw930739m2evb_01-switch \
build \
--copy-artifacts-to out/artifacts \
"
Expand All @@ -163,8 +164,15 @@ jobs:
timeout-minutes: 5
run: |
.environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \
cyw30739 cyw930739m2evb_01 ota-requestor-no-progress-logging \
out/artifacts/cyw30739-cyw930739m2evb_01-ota-requestor-no-progress-logging/chip-cyw30739-ota-requestor-example.elf \
cyw30739 cyw930739m2evb_01 ota-requestor \
out/artifacts/cyw30739-cyw930739m2evb_01-ota-requestor/chip-cyw30739-ota-requestor-example.elf \
/tmp/bloat_reports/
- name: Get switch size stats
timeout-minutes: 5
run: |
.environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \
cyw30739 cyw930739m2evb_01 switch \
out/artifacts/cyw30739-cyw930739m2evb_01-switch/chip-cyw30739-light-switch-example.elf \
/tmp/bloat_reports/
- name: Uploading Size Reports
uses: actions/upload-artifact@v3
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/qemu.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,6 @@ jobs:
run: |
./scripts/run_in_build_env.sh \
"./scripts/build/build_examples.py \
--target tizen-arm-tests-no-ble \
--target tizen-arm-tests-no-ble-no-thread \
build
"
3 changes: 2 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -168,5 +168,6 @@
"files.trimFinalNewlines": true,
"C_Cpp.default.cppStandard": "gnu++14",
"C_Cpp.default.cStandard": "gnu11",
"cmake.configureOnOpen": false
"cmake.configureOnOpen": false,
"search.followSymlinks": false
}
23 changes: 23 additions & 0 deletions config/nrfconnect/chip-module/Kconfig.features
Original file line number Diff line number Diff line change
Expand Up @@ -171,4 +171,27 @@ config CHIP_WIFI_CONNECTION_RECOVERY_JITTER
a random jitter interval is added to it to avoid periodicity. The random jitter is selected
within range [-JITTER; +JITTER].

config CHIP_ICD_SUBSCRIPTION_HANDLING
bool "Enables platform specific handling of ICD subscriptions"
help
Enables platform specific implementation that handles ICD subscription requests
and selects subscription report interval value considering maximum interval preferred
by the publisher.

if CHIP_ICD_SUBSCRIPTION_HANDLING

config CHIP_MAX_PREFERRED_SUBSCRIPTION_REPORT_INTERVAL
int "Maximum preferred interval of sending subscription reports (s)"
default 60
help
Provides maximum preferred interval to be used by a publisher for negotiation
of the final maximum subscription report interval, after receiving a subscription
request from the initiator. This value should be selected as a compromise between
keeping the power consumption low due to not sending reports too often, and allowing
the initiator device to detect the publisher absence reasonably fast due to not sending
the reports too rarely. The current algorithm is to select bigger value from the one
requested by the initiator and the one preferred by the publisher.

endif # CHIP_ICD_SUBSCRIPTION_HANDLING

endif # CHIP
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}
8 changes: 3 additions & 5 deletions config/telink/app/zephyr.conf
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,15 @@ CONFIG_SERIAL=y
CONFIG_LOG=y
CONFIG_LOG_MODE_MINIMAL=y
CONFIG_PRINTK=y
CONFIG_ASSERT=y
# CONFIG_ASSERT=y
CONFIG_CBPRINTF_LIBC_SUBSTS=y

# Set the maximum log level (DEBUG)
CONFIG_LOG_DEFAULT_LEVEL=4
CONFIG_MATTER_LOG_LEVEL_DBG=y
CONFIG_MCUBOOT_BOOTUTIL_LIB=y
CONFIG_MCUBOOT_UTIL_LOG_LEVEL_DBG=y
CONFIG_NET_LOG=y
CONFIG_IEEE802154_DRIVER_LOG_LEVEL_DBG=y
CONFIG_NVS_LOG_LEVEL_DBG=y
CONFIG_OPENTHREAD_LOG_LEVEL_DEBG=y
Expand Down Expand Up @@ -125,10 +127,6 @@ CONFIG_TELINK_B91_REBOOT_ON_FAULT=y

# Shell settings
CONFIG_SHELL=n
CONFIG_SHELL_BACKEND_SERIAL_RX_RING_BUFFER_SIZE=255

# Legacy
CONFIG_LEGACY_INCLUDE_PATH=y

# BLE MAC address
CONFIG_B91_BLE_CTRL_MAC_FLASH_ADDR=0x1FE000
10 changes: 7 additions & 3 deletions config/telink/chip-module/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -152,20 +152,20 @@ config CHIP_LOG_SIZE_OPTIMIZATION

config CHIP_BUTTON_MANAGER_IRQ_MODE
bool "Use GPIO in an IRQ mode instead of polling the GPIO"
default n
default PM
help
Use GPIO in an IRQ mode to avoid button polling loop and extend the battery lifetime by waking up by GPIO event.
GPIO events are working only with GPIO IRQ. This option changes button matrix configuration.

config CHIP_ENABLE_APPLICATION_STATUS_LED
bool "Enable application status LED"
default y
default !(PM)
help
Enable application status LED.

config CHIP_ENABLE_PM_DURING_BLE
bool "Enable PM during BLE operation"
default y
default PM
help
Enable PM during BLE operation.

Expand All @@ -175,3 +175,7 @@ config CHIP_OPENTHREAD_TX_POWER
default 0
help
OpenThread Transmission power in dBm.

config SHELL_BACKEND_SERIAL_RX_RING_BUFFER_SIZE
int
default 255 if SHELL_BACKEND_SERIAL
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
10 changes: 0 additions & 10 deletions examples/all-clusters-app/telink/prj.conf
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,7 @@ CONFIG_PWM=y

# OpenThread configs
CONFIG_OPENTHREAD_MTD=y
CONFIG_OPENTHREAD_FTD=n
CONFIG_CHIP_ENABLE_SLEEPY_END_DEVICE_SUPPORT=n
CONFIG_CHIP_SED_IDLE_INTERVAL=200
CONFIG_CHIP_THREAD_SSED=n

# Default OpenThread network settings
Expand Down Expand Up @@ -63,13 +61,5 @@ CONFIG_CHIP_FACTORY_DATA=n
CONFIG_CHIP_FACTORY_DATA_BUILD=n
CONFIG_CHIP_FACTORY_DATA_MERGE_WITH_FIRMWARE=n

# Enable Button IRQ mode. The poling mode is used by default.
CONFIG_CHIP_BUTTON_MANAGER_IRQ_MODE=n

# Disable Status LED.
CONFIG_CHIP_ENABLE_APPLICATION_STATUS_LED=y

# Enable Power Management
CONFIG_PM=n
CONFIG_PM_DEVICE=n
CONFIG_CHIP_ENABLE_PM_DURING_BLE=n
11 changes: 3 additions & 8 deletions examples/all-clusters-minimal-app/telink/prj.conf
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ CONFIG_GPIO=y

# OpenThread configs
CONFIG_OPENTHREAD_MTD=y
CONFIG_OPENTHREAD_FTD=n
CONFIG_CHIP_ENABLE_SLEEPY_END_DEVICE_SUPPORT=n
CONFIG_CHIP_THREAD_SSED=n

# Default OpenThread network settings
CONFIG_OPENTHREAD_PANID=4660
Expand Down Expand Up @@ -52,14 +53,8 @@ CONFIG_CHIP_ENABLE_PAIRING_AUTOSTART=y
# CHIP shell
CONFIG_CHIP_LIB_SHELL=n

# Disable factory data support.
# Disable factory data support.
CONFIG_CHIP_FACTORY_DATA=n
CONFIG_CHIP_FACTORY_DATA_BUILD=n
CONFIG_CHIP_FACTORY_DATA_MERGE_WITH_FIRMWARE=n
CONFIG_CHIP_CERTIFICATION_DECLARATION_STORAGE=n

# Enable Button IRQ mode. The poling mode is used by default.
CONFIG_CHIP_BUTTON_MANAGER_IRQ_MODE=n

# Disable Status LED.
CONFIG_CHIP_ENABLE_APPLICATION_STATUS_LED=y
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
9 changes: 0 additions & 9 deletions examples/bridge-app/telink/prj.conf
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,7 @@ CONFIG_PWM=y

# OpenThread configs
CONFIG_OPENTHREAD_MTD=n
CONFIG_OPENTHREAD_FTD=y
CONFIG_CHIP_ENABLE_SLEEPY_END_DEVICE_SUPPORT=n
CONFIG_CHIP_SED_IDLE_INTERVAL=200
CONFIG_CHIP_THREAD_SSED=n

# Default OpenThread network settings
Expand Down Expand Up @@ -64,15 +62,8 @@ CONFIG_CHIP_FACTORY_DATA_BUILD=n
CONFIG_CHIP_FACTORY_DATA_MERGE_WITH_FIRMWARE=n
CONFIG_CHIP_CERTIFICATION_DECLARATION_STORAGE=n

# Enable Button IRQ mode. The poling mode is used by default.
CONFIG_CHIP_BUTTON_MANAGER_IRQ_MODE=n

# Disable Status LED.
CONFIG_CHIP_ENABLE_APPLICATION_STATUS_LED=y

# Enable Power Management
CONFIG_PM=n
CONFIG_PM_DEVICE=n

# Custom RF power values
CONFIG_B91_BLE_CTRL_RF_POWER_P9P11DBM=y
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/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
4 changes: 3 additions & 1 deletion examples/chip-tool/commands/common/DeviceScanner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ void DeviceScanner::OnNodeDiscovered(const DiscoveredNodeData & nodeData)
}

#if CHIP_TOOL_DEVICE_SCANNER_USE_BLE
void DeviceScanner::OnBleScanResult(BLE_CONNECTION_OBJECT connObj, const ChipBLEDeviceIdentificationInfo & info)
void DeviceScanner::OnBleScanAdd(BLE_CONNECTION_OBJECT connObj, const ChipBLEDeviceIdentificationInfo & info)
{
auto discriminator = info.GetDeviceDiscriminator();
auto vendorId = static_cast<VendorId>(info.GetVendorId());
Expand All @@ -85,6 +85,8 @@ void DeviceScanner::OnBleScanResult(BLE_CONNECTION_OBJECT connObj, const ChipBLE
DeviceScannerResult result = { params, vendorId, productId, discriminator };
mDiscoveredResults.push_back(result);
}

void DeviceScanner::OnBleScanRemove(BLE_CONNECTION_OBJECT connObj) {}
#endif // CHIP_TOOL_DEVICE_SCANNER_USE_BLE

CHIP_ERROR DeviceScanner::Get(uint16_t index, RendezvousParameters & params)
Expand Down
3 changes: 2 additions & 1 deletion examples/chip-tool/commands/common/DeviceScanner.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,8 @@ class DeviceScanner : public chip::Dnssd::CommissioningResolveDelegate

#if CHIP_TOOL_DEVICE_SCANNER_USE_BLE
/////////// BleScannerDelegate Interface /////////
void OnBleScanResult(BLE_CONNECTION_OBJECT connObj, const chip::Ble::ChipBLEDeviceIdentificationInfo & info) override;
void OnBleScanAdd(BLE_CONNECTION_OBJECT connObj, const chip::Ble::ChipBLEDeviceIdentificationInfo & info) override;
void OnBleScanRemove(BLE_CONNECTION_OBJECT connObj) override;
#endif // CHIP_TOOL_DEVICE_SCANNER_USE_BLE

private:
Expand Down
2 changes: 1 addition & 1 deletion examples/common/pigweed/telink/PigweedLoggerMutex.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

#include "PigweedLogger.h"
#include "pigweed/RpcService.h"
#include <zephyr/zephyr.h>
#include <zephyr/kernel.h>

namespace chip {
namespace rpc {
Expand Down
16 changes: 3 additions & 13 deletions examples/contact-sensor-app/telink/prj.conf
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,8 @@ CONFIG_PWM=y

# OpenThread configs
CONFIG_OPENTHREAD_MTD=y
CONFIG_OPENTHREAD_FTD=n
CONFIG_CHIP_ENABLE_SLEEPY_END_DEVICE_SUPPORT=n
CONFIG_CHIP_SED_IDLE_INTERVAL=200
CONFIG_CHIP_THREAD_SSED=n
CONFIG_CHIP_ENABLE_SLEEPY_END_DEVICE_SUPPORT=y
CONFIG_CHIP_THREAD_SSED=n

# Default OpenThread network settings
CONFIG_OPENTHREAD_PANID=4660
Expand Down Expand Up @@ -63,13 +61,5 @@ CONFIG_CHIP_FACTORY_DATA=n
CONFIG_CHIP_FACTORY_DATA_BUILD=n
CONFIG_CHIP_FACTORY_DATA_MERGE_WITH_FIRMWARE=n

# Enable Button IRQ mode. The poling mode is used by default.
CONFIG_CHIP_BUTTON_MANAGER_IRQ_MODE=n

# Disable Status LED.
CONFIG_CHIP_ENABLE_APPLICATION_STATUS_LED=y

# Enable Power Management
CONFIG_PM=n
CONFIG_PM_DEVICE=n
CONFIG_CHIP_ENABLE_PM_DURING_BLE=n
CONFIG_PM=y
2 changes: 1 addition & 1 deletion examples/contact-sensor-app/telink/src/AppTask.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@

#include <app-common/zap-generated/attributes/Accessors.h>

#include <zephyr/kernel.h>
#include <zephyr/logging/log.h>
#include <zephyr/zephyr.h>

LOG_MODULE_DECLARE(app, CONFIG_CHIP_APP_LOG_LEVEL);

Expand Down
Loading

0 comments on commit 7935b8d

Please sign in to comment.