Skip to content

[nrfconnect] Added support for WiFi communication#33

Open
markaj-nordic wants to merge 84 commits into
masterfrom
nrf-wifi
Open

[nrfconnect] Added support for WiFi communication#33
markaj-nordic wants to merge 84 commits into
masterfrom
nrf-wifi

Conversation

@markaj-nordic
Copy link
Copy Markdown
Owner

@markaj-nordic markaj-nordic commented Jun 27, 2022

Problem

The nrfconnect platform needs to be adapted to support Wi-Fi.

Change overview

Adaptation of KConfig, additional if-defs, support for non-Thread builds, mocked Matter Wi-Fi interfaces.
With these changes by default the Thread support is enabled and it's disabled automatically if the
CONFIG_CHIP_WIFI_NRF is selected.

This code base has been adapted to the pre NCS 2.0 revision to support the current Sheliak implementation.

Testing

Built nrfconnect all-clusters-app and lock-app applications with and without Wi-Fi support (CONFIG_CHIP_WIFI) and run them on the nrf53+nrf7002.
After bootup the following log should pop up: Successfully initialized wpa_supplicant

NOTE

This PR takes advantage of the sdk-nrf fork:
https://github.com/markaj-nordic/sdk-nrf/tree/nrf700x-dev with nrf700x-dev development branch for Sheliak driver Matter-related tweaks.

To build Matter samples first run:

git remote add markaj-nordic git@github.com:markaj-nordic/sdk-nrf.git
git fetch markaj-nordic
git checkout markaj-nordic/nrf700x-dev
west update

Build command:
west build -p -b nrf5340dk_nrf5340_cpuapp -- -DSHIELD=nrf7002_ek

Damian-Nordic and others added 26 commits June 6, 2022 14:22
Add Zephyr module manifest in the CHIP root directory in
order to automatically pull CHIP into a project when CHIP
is one of the submodules specified in west manifest.

CHIP module takes all compilatinon flags associated with
the zephyr_interface target and passes them to the external
GN-based project. For that reason we must ensure that the
Matter module is processed after other revelant modules
that modify the zephyr_interface target. nrfxlib is such
a module as it contains nrf_security which carries the
mbedtls configuration.

Signed-off-by: Damian Krolik <damian.krolik@nordicsemi.no>
Add a manually triggered workflow for building Android
CHIPTool packages for arm and arm64 architectures, and
CHIP Tool for Linux x64 and arm64.
The packages are uploaded both as github artifacts and
release packages (as the latter require a release tag).

The doxygen workflow pushes doxygen HTML files to another
branch which is undesired on the sdk-connectedhomeip fork
as it causes significant growth of the repository size.

Signed-off-by: Damian Krolik <damian.krolik@nordicsemi.no>
Signed-off-by: Kamil Kasperczyk <kamil.kasperczyk@nordicsemi.no>
Set for CI build NCS recommended version to origin/main
Recently the Zephyr include path was changed from
${ZEPHYR_BASE}/include/posix/ to ${ZEPHYR_BASE}/include/zephyr/posix.
We need to align this in Matter SDK to avoid build errors.
…print.

OnboardingCodesUtil uses SetupPayload object that contains
a lot unnecessary data and takes a lot of flash.

Replaced using SetupPayload with PayloadContents
and QRCodeSetupPayloadGenerator with QRCodeBasicSetupPayloadGenerator.
It allowed to save about 3.28 k of flash for nrfconnect platform.

(cherry picked from commit 4175f40)
I applied a code review comment only partially and forgot
to remove the multiplication.

(cherry picked from commit f45e998)
-Fix hash size issue (grew from 240 to 244 bytes)
-Changing default to disable PSA Crypto driver for nrf_cc3xx
 as it is not in use yet
-Removed CC3XX_BACKEND configuration from defaults

ref: NCSDK-13857

Signed-off-by: Frank Audun Kvamtrø <frank.kvamtro@nordicsemi.no>
Fixed bug observed on nRF53 SED that ends with assert due to
not initialized QSPI during OTA Requestor init.
…roperly

Output buffer span is not reduced properly, as subspan is
passed to the base38Encode method and changed size doesn't
propagate to the outBuffer.

Added reducing outBuffer size to the subSpan + prefixLen size.
…p#18434)

* [opcreds] Fix LEAVE event on RemoveFabric

LEAVE event is not emitted on RemoveFabric or factory reset.
There are two reasons for that:
- Removing a fabric causes closing all active ReadHandlers
  for a given fabric, so we must flush the event log before
  that happens.
- There are two listeners for removing a fabric; the one
  that removes ACLs for a given fabric index is executed
  prior to the other one that generates LEAVE event. That
  causes "Accces control: denied" error.

Fix both issues.

* Add comment

(cherry picked from commit d016401)
1. Increase the default sleep time between emitting the
   shutdown event and rebooting the device to apply a new
   image. That is to increase chances of delivering the
   event to subscribers.
2. Do not auto-confirm a new image using the DFUoverSMP
   module when OTA Requestor is enabled. In such a case, it
   is the OTA Requestor's job to confirm the image and
   notify OTA Provider that it has just happened.
3. Limit UPGRADE_ONLY mode to nRF53 (it was mistakenly
   enabled for all Nordic boards).
4. Change OTAImageProcessorImpl::IsFirstImageRun impl to
   make it work even if UPGRADE_ONLY mode is enabled.

Signed-off-by: Damian Krolik <damian.krolik@nordicsemi.no>
(cherry picked from commit 645acff)
Signed-off-by: Damian Krolik <damian.krolik@nordicsemi.no>
Use DFU Multi Image package and library to allow for
multi-image updates.
Skip OTA requestor initialization if already initialized.

Signed-off-by: Damian Krolik <damian.krolik@nordicsemi.no>
…ter attributes (project-chip#18752)

* [nrfconnect] Fixed window covering bug in updating cluster attributes

Nrfconnect window covering example doesn't update window covering
cluster attributes properly.

* Moved PostAttributeChange method from window-covering-server.cpp
to header.
* Called PostAttributeChange method in nrfconnect implementation
of MatterWindowCoveringClusterServerAttributeChangedCallback
* Changed mode default value from 0x14 to 0.

* [nrfconnect] window-app: do not block in chip attribute changed callback.

Signed-off-by: Marcin Kajor <marcin.kajor@nordicsemi.no>

Co-authored-by: Marcin Kajor <marcin.kajor@nordicsemi.no>
(cherry picked from commit a3fdd05)
Commands for opening the commissioning window used too
low duration. Change the duration to 180s.

Signed-off-by: Damian Krolik <damian.krolik@nordicsemi.no>
NVS cache should speed up reading settings on the device
boot.

Signed-off-by: Damian Krolik <damian.krolik@nordicsemi.no>
UPDATEABLE_IMAGE_NUMBER was set to 2 for nRF53 SOCs only
if DFU over SMP was enabled. We need that for a regular
Matter OTA, too.

Signed-off-by: Damian Krolik <damian.krolik@nordicsemi.no>
Some buttons were not visible on low-resolution devices.

Signed-off-by: Damian Krolik <damian.krolik@nordicsemi.no>
Cluster Interaction Tool screen would crash when trying
to send a command that takes an optional argument. The
reason was that optional arguments were incorrectly
converted in the application and the underlying JNI layer.

Signed-off-by: Damian Krolik <damian.krolik@nordicsemi.no>
Build OTA Provider for Linux in release_tools workflow.
Also, disable debug symbols for chip-tool binaries.

Signed-off-by: Damian Krolik <damian.krolik@nordicsemi.no>
In sdk-connectedhomeip we run CI job against the current
nRF Connect main, but sometimes it may lack Python modules
introduced in newer nRF Connect revisions.

Signed-off-by: Damian Krolik <damian.krolik@nordicsemi.no>
Building with nRF Connect SDK 2.0 requires cbor2 Python
module.

Signed-off-by: Damian Krolik <damian.krolik@nordicsemi.no>
Make building nRF Connect examples optional in github
workflows in a sense that they do not fail the workflow
if they do not compile. The reason is that the CI is often
run for downstream patches, that are required to proceed
with changes in NCS or Zephyr and we do not want to force
developers to update examples in sdk-connectedhomeip at
that moment - they will be updated in the upstream later.

Signed-off-by: Damian Krolik <damian.krolik@nordicsemi.no>
…er::Init() (project-chip#19749)

Initialize CASESessionManager's mrpLocalConfig in Server::Init()

(cherry picked from commit 98a1c6b)
Damian-Nordic and others added 3 commits August 9, 2022 14:51
[nrfconnect] matter-wifi: add Wi-Fi network scan functionality

Signed-off-by: Damian Krolik <damian.krolik@nordicsemi.no>
…ure (#61)

* Cleaned WiFi configuration and files structure
* Moved WiFiManager from Zephyr platform to nrfconnect, as it
uses the nrf specific API.
* Added enabling CHIP_WIFI config automatically in case of
building the target with nRF700x.
* Added generating WiFiConnectivityChange event in case of
conencting to WiFi network that can be handled in the app task.
* Created Zephyr InetUtils module
)

* [nrfconnect] matter-wifi: implemented WiFi diagnostic cluster. 
* Use CONFIG_WIFI_NRF700X instead of CONFIG_CHIP_WIFI in the code.

Note that most of the attributes are not supported or set to dummy values
because we still lack proper WiFi driver API.

Signed-off-by: Marcin Kajor <marcin.kajor@nordicsemi.no>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants