Skip to content

Commit

Permalink
Merge branch 'master' into add_libnl_to_dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
andy31415 authored Aug 23, 2022
2 parents 1ac53a1 + 65d9ccf commit 9ac1290
Show file tree
Hide file tree
Showing 61 changed files with 538 additions and 170 deletions.
7 changes: 6 additions & 1 deletion .github/workflows/docker_img.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,12 @@ jobs:
- "-esp32"
- "-esp32-qemu"
- "-infineon"
- "-imx"
# NOTE: imx image requires too much space for GitHub-hosted runners. It fails with:
# ```
# ....
# ApplyLayer exit status 1 stdout: stderr: write /opt/fsl-imx-xwayland/5.15-kirkstone/sysroots/armv8a-poky-linux/opt/ltp/testcases/bin/fanotify15: no space left on device
# ```
# - "-imx"
- "-k32w"
- "-mbed-os"
- "-nrf-platform"
Expand Down
54 changes: 27 additions & 27 deletions .github/workflows/examples-nrfconnect.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -95,15 +95,6 @@ jobs:
nrfconnect nrf52840dk_nrf52840 lock-app \
examples/lock-app/nrfconnect/build/zephyr/zephyr.elf \
/tmp/bloat_reports/
- name: Build example nRF Connect SDK Lighting App on nRF52840 DK
if: github.event_name == 'push' || steps.changed_paths.outputs.nrfconnect == 'true'
timeout-minutes: 15
run: |
scripts/examples/nrfconnect_example.sh lighting-app nrf52840dk_nrf52840
.environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \
nrfconnect nrf52840dk_nrf52840 lighting-app \
examples/lighting-app/nrfconnect/build/zephyr/zephyr.elf \
/tmp/bloat_reports/
- name: Build example nRF Connect SDK Lighting App on nRF52840 Dongle
if: github.event_name == 'push' || steps.changed_paths.outputs.nrfconnect == 'true'
timeout-minutes: 15
Expand All @@ -122,6 +113,15 @@ jobs:
nrfconnect nrf52840dk_nrf52840+rpc lighting-app \
examples/lighting-app/nrfconnect/build/zephyr/zephyr.elf \
/tmp/bloat_reports/
- name: Build example nRF Connect SDK Light Switch App on nRF52840 DK
if: github.event_name == 'push' || steps.changed_paths.outputs.nrfconnect == 'true'
timeout-minutes: 15
run: |
scripts/examples/nrfconnect_example.sh light-switch-app nrf52840dk_nrf52840
.environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \
nrfconnect nrf52840dk_nrf52840 light-switch-app \
examples/light-switch-app/nrfconnect/build/zephyr/zephyr.elf \
/tmp/bloat_reports/
- name: Build example nRF Connect SDK Shell on nRF52840 DK
if: github.event_name == 'push' || steps.changed_paths.outputs.shell == 'true'
timeout-minutes: 15
Expand All @@ -140,24 +140,6 @@ jobs:
nrfconnect nrf52840dk_nrf52840 pigweed-app \
examples/pigweed-app/nrfconnect/build/zephyr/zephyr.elf \
/tmp/bloat_reports/
- name: Build example nRF Connect SDK Lock App on nRF5340 DK
if: github.event_name == 'push' || steps.changed_paths.outputs.nrfconnect == 'true'
timeout-minutes: 15
run: |
scripts/examples/nrfconnect_example.sh lock-app nrf5340dk_nrf5340_cpuapp
.environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \
nrfconnect nrf5340dk_nrf5340_cpuapp lock-app \
examples/lock-app/nrfconnect/build/zephyr/zephyr.elf \
/tmp/bloat_reports/
- name: Build example nRF Connect SDK Lighting App on nRF5340 DK
if: github.event_name == 'push' || steps.changed_paths.outputs.nrfconnect == 'true'
timeout-minutes: 15
run: |
scripts/examples/nrfconnect_example.sh lighting-app nrf5340dk_nrf5340_cpuapp
.environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \
nrfconnect nrf5340dk_nrf5340_cpuapp lighting-app \
examples/lighting-app/nrfconnect/build/zephyr/zephyr.elf \
/tmp/bloat_reports/
- name: Build example nRF Connect SDK Pump App on nRF52840 DK
if: github.event_name == 'push' || steps.changed_paths.outputs.nrfconnect == 'true'
timeout-minutes: 15
Expand Down Expand Up @@ -192,6 +174,24 @@ jobs:
nrfconnect nrf52840dk_nrf52840 all-clusters-minimal-app \
examples/all-clusters-minimal-app/nrfconnect/build/zephyr/zephyr.elf \
/tmp/bloat_reports/
- name: Build example nRF Connect SDK Lock App on nRF5340 DK
if: github.event_name == 'push' || steps.changed_paths.outputs.nrfconnect == 'true'
timeout-minutes: 15
run: |
scripts/examples/nrfconnect_example.sh lock-app nrf5340dk_nrf5340_cpuapp
.environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \
nrfconnect nrf5340dk_nrf5340_cpuapp lock-app \
examples/lock-app/nrfconnect/build/zephyr/zephyr.elf \
/tmp/bloat_reports/
- name: Build example nRF Connect SDK Lighting App on nRF5340 DK
if: github.event_name == 'push' || steps.changed_paths.outputs.nrfconnect == 'true'
timeout-minutes: 15
run: |
scripts/examples/nrfconnect_example.sh lighting-app nrf5340dk_nrf5340_cpuapp
.environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \
nrfconnect nrf5340dk_nrf5340_cpuapp lighting-app \
examples/lighting-app/nrfconnect/build/zephyr/zephyr.elf \
/tmp/bloat_reports/
- name: Run unit tests for Zephyr native_posix_64 platform
if: github.event_name == 'push' || steps.changed_paths.outputs.tests == 'true'
timeout-minutes: 15
Expand Down
1 change: 1 addition & 0 deletions config/esp32/components/chip/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -387,6 +387,7 @@ menu "CHIP Device Layer"
menu "WiFi AP Options"

config ENABLE_WIFI_AP
depends on ESP_WIFI_SOFTAP_SUPPORT
bool "Enable CHIP WIFI AP"
default y
help
Expand Down
7 changes: 3 additions & 4 deletions docs/guides/BUILDING.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Tested on:

- macOS 10.15
- Debian 11
- Ubuntu 20.04 LTS
- Ubuntu 22.04 LTS

Build system features:

Expand Down Expand Up @@ -81,9 +81,8 @@ dependency.

### Installing prerequisites on Raspberry Pi 4

Using `rpi-imager`, install the Ubuntu _21.04_ 64-bit _server_ OS for arm64
architectures on a micro SD card. This release will have bluez 5.55 or newer
which is required for BLE functionality.
Using `rpi-imager`, install the Ubuntu _22.04_ 64-bit _server_ OS for arm64
architectures on a micro SD card.

Boot the SD card, login with the default user account "ubuntu" and password
"ubuntu", then proceed with
Expand Down
2 changes: 2 additions & 0 deletions examples/all-clusters-app/esp32/main/Kconfig.projbuild
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,15 @@ menu "Demo"

config RENDEZVOUS_MODE_SOFTAP
bool "Soft-AP"
select ESP_WIFI_SOFTAP_SUPPORT
config RENDEZVOUS_MODE_BLE
bool "BLE"
depends on BT_ENABLED
config RENDEZVOUS_MODE_ON_NETWORK
bool "On-Network"
config RENDEZVOUS_MODE_SOFTAP_ON_NETWORK
bool "Soft-AP / On-Network"
select ESP_WIFI_SOFTAP_SUPPORT
config RENDEZVOUS_MODE_BLE_ON_NETWORK
bool "BLE / On-Network"
endchoice
Expand Down
3 changes: 3 additions & 0 deletions examples/all-clusters-app/esp32/sdkconfig.defaults
Original file line number Diff line number Diff line change
Expand Up @@ -53,3 +53,6 @@ CONFIG_LWIP_HOOK_ND6_GET_GW_DEFAULT=y
# Serial Flasher config
CONFIG_ESPTOOLPY_FLASHSIZE_4MB=y
CONFIG_ESPTOOLPY_FLASHSIZE="4MB"

# Disable softap support by default
CONFIG_ESP_WIFI_SOFTAP_SUPPORT=n
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,15 @@ menu "Demo"

config RENDEZVOUS_MODE_SOFTAP
bool "Soft-AP"
select ESP_WIFI_SOFTAP_SUPPORT
config RENDEZVOUS_MODE_BLE
bool "BLE"
depends on BT_ENABLED
config RENDEZVOUS_MODE_ON_NETWORK
bool "On-Network"
config RENDEZVOUS_MODE_SOFTAP_ON_NETWORK
bool "Soft-AP / On-Network"
select ESP_WIFI_SOFTAP_SUPPORT
config RENDEZVOUS_MODE_BLE_ON_NETWORK
bool "BLE / On-Network"
endchoice
Expand Down
3 changes: 3 additions & 0 deletions examples/all-clusters-minimal-app/esp32/sdkconfig.defaults
Original file line number Diff line number Diff line change
Expand Up @@ -53,3 +53,6 @@ CONFIG_LWIP_HOOK_ND6_GET_GW_DEFAULT=y
# Serial Flasher config
CONFIG_ESPTOOLPY_FLASHSIZE_4MB=y
CONFIG_ESPTOOLPY_FLASHSIZE="4MB"

# Disable softap support by default
CONFIG_ESP_WIFI_SOFTAP_SUPPORT=n
3 changes: 3 additions & 0 deletions examples/bridge-app/esp32/sdkconfig.defaults
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,6 @@ CONFIG_PARTITION_TABLE_FILENAME="partitions.csv"

CONFIG_LWIP_HOOK_IP6_ROUTE_DEFAULT=y
CONFIG_LWIP_HOOK_ND6_GET_GW_DEFAULT=y

# Disable softap support by default
CONFIG_ESP_WIFI_SOFTAP_SUPPORT=n
1 change: 1 addition & 0 deletions examples/chef/efr32/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,7 @@ efr32_executable("chef_app") {
if (chip_enable_openthread) {
deps += [
"${chip_root}/third_party/openthread:openthread",
"${chip_root}/third_party/openthread:openthread-platform",
"${examples_plat_dir}:efr-matter-shell",
]
}
Expand Down
2 changes: 2 additions & 0 deletions examples/chef/esp32/main/Kconfig.projbuild
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,15 @@ menu "Demo"
bool "Bypass"
config RENDEZVOUS_MODE_SOFTAP
bool "Soft-AP"
select ESP_WIFI_SOFTAP_SUPPORT
config RENDEZVOUS_MODE_BLE
bool "BLE"
depends on BT_ENABLED
config RENDEZVOUS_MODE_ON_NETWORK
bool "On-Network"
config RENDEZVOUS_MODE_SOFTAP_ON_NETWORK
bool "Soft-AP / On-Network"
select ESP_WIFI_SOFTAP_SUPPORT
config RENDEZVOUS_MODE_BLE_ON_NETWORK
bool "BLE / On-Network"
endchoice
Expand Down
3 changes: 3 additions & 0 deletions examples/chef/esp32/sdkconfig.defaults
Original file line number Diff line number Diff line change
Expand Up @@ -47,3 +47,6 @@ CONFIG_STACK_CHECK=y
# Serial Flasher config
CONFIG_ESPTOOLPY_FLASHSIZE_4MB=y
CONFIG_ESPTOOLPY_FLASHSIZE="4MB"

# Disable softap support by default
CONFIG_ESP_WIFI_SOFTAP_SUPPORT=n
1 change: 1 addition & 0 deletions examples/common/pigweed/protos/device_service.options
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ chip.rpc.PairingInfo.qr_code max_size:256
chip.rpc.PairingInfo.qr_code_url max_size:256
chip.rpc.SpakeInfo.verifier max_size:97 // kSpake2p_VerifierSerialized_Length
chip.rpc.SpakeInfo.salt max_size:32 // kSpake2p_Max_PBKDF_Salt_Length
chip.rpc.MetadataForProvider.tlv max_size:512 // length defined in chip spec 11.20.6.7
5 changes: 5 additions & 0 deletions examples/common/pigweed/protos/device_service.proto
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,15 @@ message PairingState {
bool pairing_enabled = 1;
}

message MetadataForProvider {
bytes tlv = 1;
}

service Device {
rpc FactoryReset(pw.protobuf.Empty) returns (pw.protobuf.Empty){}
rpc Reboot(pw.protobuf.Empty) returns (pw.protobuf.Empty){}
rpc TriggerOta(pw.protobuf.Empty) returns (pw.protobuf.Empty){}
rpc SetOtaMetadataForProvider(MetadataForProvider) returns (pw.protobuf.Empty){}
rpc GetDeviceInfo(pw.protobuf.Empty) returns (DeviceInfo){}
rpc GetDeviceState(pw.protobuf.Empty) returns (DeviceState){}
rpc SetPairingState(PairingState) returns (pw.protobuf.Empty){}
Expand Down
33 changes: 30 additions & 3 deletions examples/common/pigweed/rpc_services/Device.h
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ class Device : public pw_rpc::nanopb::Device::Service<Device>

virtual pw::Status TriggerOta(const pw_protobuf_Empty & request, pw_protobuf_Empty & response)
{
#if CONFIG_CHIP_OTA_REQUESTOR
#if CHIP_DEVICE_CONFIG_ENABLE_OTA_REQUESTOR
chip::DeviceLayer::PlatformMgr().ScheduleWork(
[](intptr_t) {
chip::OTARequestorInterface * requestor = chip::GetRequestorInstance();
Expand All @@ -238,10 +238,33 @@ class Device : public pw_rpc::nanopb::Device::Service<Device>
},
reinterpret_cast<intptr_t>(nullptr));
return pw::OkStatus();
#else
#else // CHIP_DEVICE_CONFIG_ENABLE_OTA_REQUESTOR
ChipLogError(AppServer, "Trigger OTA requested, but OTA requestor not compiled in.");
return pw::Status::Unimplemented();
#endif
#endif // CHIP_DEVICE_CONFIG_ENABLE_OTA_REQUESTOR
}

virtual pw::Status SetOtaMetadataForProvider(const chip_rpc_MetadataForProvider & request, pw_protobuf_Empty & response)
{
#if CHIP_DEVICE_CONFIG_ENABLE_OTA_REQUESTOR
chip::OTARequestorInterface * requestor = chip::GetRequestorInstance();
if (requestor == nullptr)
{
ChipLogError(SoftwareUpdate, "Can't get the CASESessionManager");
return pw::Status::Unavailable();
}
else if (sizeof(metadataForProviderBuffer) < request.tlv.size)
{
return pw::Status::ResourceExhausted();
}
memcpy(metadataForProviderBuffer, request.tlv.bytes, request.tlv.size);
DeviceLayer::StackLock lock;
requestor->SetMetadataForProvider(chip::ByteSpan(metadataForProviderBuffer, request.tlv.size));
return pw::OkStatus();
#else // CHIP_DEVICE_CONFIG_ENABLE_OTA_REQUESTOR
ChipLogError(AppServer, "OTA set metadata for provider requested, but OTA requestor not compiled in.");
return pw::Status::Unimplemented();
#endif // CHIP_DEVICE_CONFIG_ENABLE_OTA_REQUESTOR
}

virtual pw::Status SetPairingState(const chip_rpc_PairingState & request, pw_protobuf_Empty & response)
Expand Down Expand Up @@ -415,6 +438,10 @@ class Device : public pw_rpc::nanopb::Device::Service<Device>
}

private:
#if CHIP_DEVICE_CONFIG_ENABLE_OTA_REQUESTOR
static constexpr size_t kMaxMetadataForProviderLength = 512; // length defined in chip spec 11.20.6.7
uint8_t metadataForProviderBuffer[kMaxMetadataForProviderLength];
#endif // CHIP_DEVICE_CONFIG_ENABLE_OTA_REQUESTOR
Internal::CommissionableDataProviderRpcWrapper mCommissionableDataProvider;
};

Expand Down
1 change: 1 addition & 0 deletions examples/light-switch-app/efr32/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,7 @@ efr32_executable("light_switch_app") {
if (chip_enable_openthread) {
deps += [
"${chip_root}/third_party/openthread:openthread",
"${chip_root}/third_party/openthread:openthread-platform",
"${examples_plat_dir}:efr-matter-shell",
]
}
Expand Down
5 changes: 4 additions & 1 deletion examples/light-switch-app/esp32/sdkconfig.defaults
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,7 @@ CONFIG_ESPTOOLPY_FLASHSIZE_4MB=y
CONFIG_ESPTOOLPY_FLASHSIZE="4MB"

#enable debug shell
CONFIG_ENABLE_CHIP_SHELL=y
CONFIG_ENABLE_CHIP_SHELL=y

# Disable softap support by default
CONFIG_ESP_WIFI_SOFTAP_SUPPORT=n
2 changes: 1 addition & 1 deletion examples/light-switch-app/nrfconnect/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ target_sources(app PRIVATE
main/BindingHandler.cpp
${GEN_DIR}/light-switch-app/zap-generated/callback-stub.cpp
${GEN_DIR}/light-switch-app/zap-generated/IMClusterCommandHandler.cpp
${NRFCONNECT_COMMON}/util/LEDWidget.cpp
${NRFCONNECT_COMMON}/util/LEDWidget.cpp)


if(CONFIG_CHIP_OTA_REQUESTOR)
Expand Down
1 change: 1 addition & 0 deletions examples/lighting-app/efr32/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,7 @@ efr32_executable("lighting_app") {
if (chip_enable_openthread) {
deps += [
"${chip_root}/third_party/openthread:openthread",
"${chip_root}/third_party/openthread:openthread-platform",
"${examples_plat_dir}:efr-matter-shell",
]
}
Expand Down
3 changes: 3 additions & 0 deletions examples/lighting-app/esp32/sdkconfig.defaults
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,6 @@ CONFIG_LWIP_HOOK_ND6_GET_GW_DEFAULT=y
# Serial Flasher config
CONFIG_ESPTOOLPY_FLASHSIZE_4MB=y
CONFIG_ESPTOOLPY_FLASHSIZE="4MB"

# Disable softap support by default
CONFIG_ESP_WIFI_SOFTAP_SUPPORT=n
1 change: 1 addition & 0 deletions examples/lock-app/efr32/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,7 @@ efr32_executable("lock_app") {
if (chip_enable_openthread) {
deps += [
"${chip_root}/third_party/openthread:openthread",
"${chip_root}/third_party/openthread:openthread-platform",
"${examples_plat_dir}:efr-matter-shell",
]
}
Expand Down
3 changes: 3 additions & 0 deletions examples/lock-app/esp32/sdkconfig.defaults
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,6 @@ CONFIG_LWIP_HOOK_ND6_GET_GW_DEFAULT=y

#Lock app PID
CONFIG_DEVICE_PRODUCT_ID=0x8006

# Disable softap support by default
CONFIG_ESP_WIFI_SOFTAP_SUPPORT=n
3 changes: 3 additions & 0 deletions examples/ota-provider-app/esp32/sdkconfig.defaults
Original file line number Diff line number Diff line change
Expand Up @@ -58,3 +58,6 @@ CONFIG_USE_TEST_SETUP_DISCRIMINATOR=0xF01

# Enable chip shell
CONFIG_ENABLE_CHIP_SHELL=y

# Disable softap support by default
CONFIG_ESP_WIFI_SOFTAP_SUPPORT=n
3 changes: 3 additions & 0 deletions examples/ota-requestor-app/esp32/sdkconfig.defaults
Original file line number Diff line number Diff line change
Expand Up @@ -59,3 +59,6 @@ CONFIG_DEVICE_SOFTWARE_VERSION_NUMBER=2

# Enable Chip Shell
CONFIG_ENABLE_CHIP_SHELL=y

# Disable softap support by default
CONFIG_ESP_WIFI_SOFTAP_SUPPORT=n
3 changes: 2 additions & 1 deletion examples/platform/efr32/init_efrPlatform.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,8 @@ void init_efrPlatform(void)
#endif

#if CHIP_ENABLE_OPENTHREAD
sl_ot_sys_init();
efr32RadioInit();
efr32AlarmInit();
#endif // CHIP_ENABLE_OPENTHREAD
}

Expand Down
15 changes: 4 additions & 11 deletions examples/shell/shell_common/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -52,17 +52,10 @@ static_library("shell_common") {

if (chip_enable_openthread &&
(current_os == "freertos" || current_os == "zephyr")) {
if (chip_openthread_ftd) {
public_deps += [
"${chip_root}/third_party/openthread/repo:libopenthread-cli-ftd",
"${chip_root}/third_party/openthread/repo:libopenthread-ftd",
]
} else {
public_deps += [
"${chip_root}/third_party/openthread/repo:libopenthread-cli-mtd",
"${chip_root}/third_party/openthread/repo:libopenthread-mtd",
]
}
public_deps += [
"${chip_root}/third_party/openthread:openthread",
"${chip_root}/third_party/openthread:openthread_cli",
]
}

if (chip_shell_cmd_server) {
Expand Down
3 changes: 3 additions & 0 deletions examples/temperature-measurement-app/esp32/sdkconfig.defaults
Original file line number Diff line number Diff line change
Expand Up @@ -84,3 +84,6 @@ CONFIG_ESP_MAIN_TASK_STACK_SIZE=4096
#enable lwIP route hooks
CONFIG_LWIP_HOOK_IP6_ROUTE_DEFAULT=y
CONFIG_LWIP_HOOK_ND6_GET_GW_DEFAULT=y

# Disable softap support by default
CONFIG_ESP_WIFI_SOFTAP_SUPPORT=n
Loading

0 comments on commit 9ac1290

Please sign in to comment.