Skip to content

Commit

Permalink
[nrfconnect] Initial Matter over WiFi implementation. (#23607)
Browse files Browse the repository at this point in the history
* [nrfconnect] Initial Matter over WiFi implementation.

Some WiFi related features might not work as expected yet.
This will be fixed when the Zephyr NRF WiFi module is improved.
All implementations have been synchronized to sdk-nrf v2.1.1.

Commits included:
- Prepare configuration for hci_rpmsg
- Adapt Android CHIPTool guide to Wi-Fi devices
Make the guide a little bit more aware of the world of
Wi-Fi devices.
- Disable Wi-Fi low-power mode
Noticed Wi-Fi low-power mode causes performance issues,
at least with some APs.
- Implemented the WiFiNetworkIterator.
Replaced dummy implementation of WiFiNetworkIterator
This fixes an issue with infinite loop when using this iterator in Matter core.
- Added including CHIPMemString.h to fix WiFi build

Signed-off-by: Marcin Kajor <[email protected]>
Signed-off-by: Damian Krolik <[email protected]>
Signed-off-by: Kamil Kasperczyk <[email protected]>
Signed-off-by: Arkadiusz Balys <[email protected]>

* Restyled by prettier-markdown

Restyled by gn

Signed-off-by: Marcin Kajor <[email protected]>
Signed-off-by: Damian Krolik <[email protected]>
Signed-off-by: Kamil Kasperczyk <[email protected]>
Signed-off-by: Arkadiusz Balys <[email protected]>
Co-authored-by: Restyled.io <[email protected]>
  • Loading branch information
2 people authored and pull[bot] committed Nov 24, 2023
1 parent 4171887 commit a66c6f7
Show file tree
Hide file tree
Showing 47 changed files with 2,029 additions and 98 deletions.
7 changes: 6 additions & 1 deletion config/nrfconnect/chip-module/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,7 @@ chip_gn_arg_bool ("chip_progress_logging" CONFIG_MATTER_LOG_LE
chip_gn_arg_bool ("chip_detail_logging" CONFIG_MATTER_LOG_LEVEL GREATER_EQUAL 4)
chip_gn_arg_bool ("chip_automation_logging" "false")
chip_gn_arg_bool ("chip_malloc_sys_heap" CONFIG_CHIP_MALLOC_SYS_HEAP)
chip_gn_arg_bool ("chip_enable_wifi" CONFIG_WIFI_NRF700X)

if (CONFIG_CHIP_FACTORY_DATA)
chip_gn_arg_bool ("chip_use_transitional_commissionable_data_provider" "false")
Expand All @@ -232,8 +233,12 @@ if (CONFIG_CHIP_ROTATING_DEVICE_ID)
chip_gn_arg_bool("chip_enable_additional_data_advertising" "true")
endif()

if (CONFIG_CHIP_ENABLE_DNSSD_SRP)
if (CONFIG_NET_L2_OPENTHREAD)
chip_gn_arg_string("chip_mdns" "platform")
elseif(CONFIG_WIFI_NRF700X)
chip_gn_arg_string("chip_mdns" "minimal")
else()
chip_gn_arg_string("chip_mdns" "none")
endif()

if (CONFIG_CHIP_CRYPTO_PSA)
Expand Down
64 changes: 58 additions & 6 deletions config/nrfconnect/chip-module/Kconfig.defaults
Original file line number Diff line number Diff line change
Expand Up @@ -213,20 +213,72 @@ config NVS_LOOKUP_CACHE_SIZE
int
default 512

# Enable OpenThread

config NET_L2_OPENTHREAD
bool
default y if !WIFI_NRF700X

if NET_L2_OPENTHREAD

# Increase the default RX stack size
config IEEE802154_NRF5_RX_STACK_SIZE
int
default 1024

# Enable OpenThread
endif

config NET_L2_OPENTHREAD
if CHIP_WIFI

config NRF_WIFI_LOW_POWER
bool
default y
default n

config MBEDTLS_PSA_CRYPTO_EXTERNAL_RNG
bool
default n

config SYSTEM_WORKQUEUE_STACK_SIZE
int
default 1120

# align these numbers to match the OpenThread config
config NET_IF_UNICAST_IPV6_ADDR_COUNT
int
default 6

config NET_IF_MCAST_IPV6_ADDR_COUNT
int
default 8

config NET_SOCKETS_POSIX_NAMES
bool
default n

config MBEDTLS_SSL_OUT_CONTENT_LEN
int
default 900

# options managed by IP4/IP6 simultaneous support
# aligned here to match OpenThread config
config NET_MAX_ROUTERS
int
default 1

config NET_MAX_CONN
int
default 4

config SHELL_STACK_SIZE
int
default 2616

config HEAP_MEM_POOL_SIZE
int
default 200000

endif

choice OPENTHREAD_STACK_VERSION
default OPENTHREAD_THREAD_VERSION_1_3
endchoice

# Enable mbedTLS from nrf_security library

Expand Down
25 changes: 25 additions & 0 deletions config/nrfconnect/chip-module/Kconfig.features
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,31 @@

if CHIP

config CHIP_WIFI
bool "Enable nrfconnect Wi-Fi support"
default y if SHIELD_NRF7002_EK || BOARD_NRF7002DK_NRF5340_CPUAPP
select WIFI_NRF700X
select WIFI
select WPA_SUPP
imply FLASH
imply SETTINGS
imply NVS
imply FLASH_MAP
imply NORDIC_SECURITY_BACKEND
imply MBEDTLS_ENTROPY_C
imply MBEDTLS_PSA_CRYPTO_C
imply NET_STATISTICS
imply NET_L2_ETHERNET
imply NET_PKT_TXTIME
imply NET_PKT_TIMESTAMP
imply MBEDTLS_PROMPTLESS
imply BUILD_OUTPUT_META
imply USE_DT_CODE_PARTITION # might be removed when the OTA is enabled
imply NET_IPV6_ND # enable Neighbor Discovery to handle Router Advertisements
imply NET_IPV6_NBR_CACHE
imply NET_STATISTICS_IPV6
imply NET_STATISTICS_USER_API

config CHIP_QSPI_NOR
bool "Enable QSPI NOR feature set"
help
Expand Down
99 changes: 99 additions & 0 deletions config/nrfconnect/chip-module/Kconfig.hci_rpmsg.defaults
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
#
# 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.
#

# The purpose of this file is to define new default values of settings used when building hci_rpmsg child image for Matter samples.

config LOG
bool
default n

config HEAP_MEM_POOL_SIZE
int
default 8192

config MAIN_STACK_SIZE
int
default 2048

config SYSTEM_WORKQUEUE_STACK_SIZE
int
default 2048

config BT
bool
default y

config BT_HCI_RAW
bool
default y

config BT_MAX_CONN
int
default 1

config BT_PERIPHERAL
bool
default y

config BT_CENTRAL
bool
default n

config BT_BUF_ACL_RX_SIZE
int
default 502

config BT_BUF_ACL_TX_SIZE
int
default 251

config BT_CTLR_DATA_LENGTH_MAX
int
default 251

config BT_CTLR_ASSERT_HANDLER
bool
default y

config BT_HCI_RAW_RESERVE
int
default 1

# Workaround: Unable to allocate command buffer when using K_NO_WAIT since
# Host number of completed commands does not follow normal flow control.
config BT_BUF_CMD_TX_COUNT
int
default 10

config ASSERT
bool
default y

config DEBUG_INFO
bool
default y

config EXCEPTION_STACK_TRACE
bool
default y

config IPC_SERVICE
bool
default y

config MBOX
bool
default y
21 changes: 21 additions & 0 deletions config/nrfconnect/chip-module/Kconfig.hci_rpmsg.root
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#
# 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.
#

# The purpose of this file is to create a wrapper Kconfig file that will be set as
# hci_rpmsg_KCONFIG_ROOT and processed before any other Kconfig for hci_rpmsg child image.

rsource "Kconfig.hci_rpmsg.defaults"
source "Kconfig.zephyr"
2 changes: 1 addition & 1 deletion config/zephyr/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ config CHIP_ENABLE_PAIRING_AUTOSTART

config CHIP_ENABLE_DNSSD_SRP
bool "Enable support for service registration"
default y
default y if NET_L2_OPENTHREAD
imply OPENTHREAD_ECDSA
imply OPENTHREAD_SRP_CLIENT
help
Expand Down
Binary file removed docs/guides/images/CHIPTool_device_commissioned.jpg
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit a66c6f7

Please sign in to comment.