Skip to content

Commit

Permalink
[nrfconnect] Pulled patches for the nRF Wi-Fi platform (project-chip#…
Browse files Browse the repository at this point in the history
…33196)

* [nrfconnect] Adapt Matter SDK to the WiFi FW patch on external flash

This commit sets the default kconfigs if the WiFi FW patch on
external flash is enabled.

* [nrfconnect] Wi-FI directed scan implementation

This patch implements directed scanning and
single ssid scanning during commissioning.

Signed-off-by: Marcin Kajor <[email protected]>

* [nrfconnect] Fix build for 7001 Emulation

For nRF7001DK (emulation) build fails with SPI driver errors, this fixes
the build.

Signed-off-by: Chaitanya Tata <[email protected]>

---------

Signed-off-by: Marcin Kajor <[email protected]>
Signed-off-by: Chaitanya Tata <[email protected]>
Co-authored-by: Arkadiusz Balys <[email protected]>
Co-authored-by: Marcin Kajor <[email protected]>
  • Loading branch information
3 people authored May 7, 2024
1 parent bc0f5ee commit 4319ab1
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 6 deletions.
14 changes: 13 additions & 1 deletion config/nrfconnect/chip-module/Kconfig.defaults
Original file line number Diff line number Diff line change
Expand Up @@ -203,15 +203,27 @@ config CHIP_QSPI_NOR
default y if BOARD_NRF5340DK_NRF5340_CPUAPP || BOARD_NRF52840DK_NRF52840

# nRF7002DK uses SPI NOR external flash

if BOARD_NRF7002DK_NRF5340_CPUAPP || BOARD_NRF7002DK_NRF7001_NRF5340_CPUAPP

config CHIP_SPI_NOR
default y if BOARD_NRF7002DK_NRF5340_CPUAPP
default y

endif # BOARD_NRF7002DK_NRF5340_CPUAPP || BOARD_NRF7002DK_NRF7001_NRF5340_CPUAPP

config BOOT_IMAGE_ACCESS_HOOKS
default y if SOC_SERIES_NRF53X

config UPDATEABLE_IMAGE_NUMBER
default 3 if NRF_WIFI_PATCHES_EXT_FLASH_STORE
default 2 if SOC_SERIES_NRF53X

config DFU_MULTI_IMAGE_MAX_IMAGE_COUNT
default 3 if NRF_WIFI_PATCHES_EXT_FLASH_STORE

config NRF_WIFI_FW_PATCH_DFU
default y if NRF_WIFI_PATCHES_EXT_FLASH_STORE

# ==============================================================================
# OpenThread configuration
# ==============================================================================
Expand Down
4 changes: 2 additions & 2 deletions config/nrfconnect/chip-module/Kconfig.features
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ if CHIP

config CHIP_WIFI
bool "Enable nrfconnect Wi-Fi support"
default y if SHIELD_NRF7002EK || BOARD_NRF7002DK_NRF5340_CPUAPP || SHIELD_NRF7002EB
default y if SHIELD_NRF7002EK || BOARD_NRF7002DK_NRF5340_CPUAPP || SHIELD_NRF7002EB || BOARD_NRF7002DK_NRF7001_NRF5340_CPUAPP
select WIFI_NRF700X
select WIFI
select WPA_SUPP
Expand Down Expand Up @@ -149,7 +149,7 @@ endif
config CHIP_DFU_OVER_BT_SMP
bool "Enable DFU over Bluetooth LE SMP feature set"
imply CHIP_QSPI_NOR if BOARD_NRF5340DK_NRF5340_CPUAPP || BOARD_NRF52840DK_NRF52840
imply CHIP_SPI_NOR if BOARD_NRF7002DK_NRF5340_CPUAPP
imply CHIP_SPI_NOR if BOARD_NRF7002DK_NRF5340_CPUAPP || BOARD_NRF7002DK_NRF7001_NRF5340_CPUAPP
imply BOOTLOADER_MCUBOOT
select MCUMGR
select MCUMGR_TRANSPORT_BT
Expand Down
2 changes: 1 addition & 1 deletion config/nrfconnect/chip-module/Kconfig.mcuboot.defaults
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ choice LIBC_IMPLEMENTATION
endchoice

# nRF7002DK uses SPI NOR external flash
if BOARD_NRF7002DK_NRF5340_CPUAPP
if BOARD_NRF7002DK_NRF5340_CPUAPP || BOARD_NRF7002DK_NRF7001_NRF5340_CPUAPP

config SPI
default y
Expand Down
17 changes: 16 additions & 1 deletion src/platform/nrfconnect/wifi/WiFiManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,22 @@ CHIP_ERROR WiFiManager::Scan(const ByteSpan & ssid, ScanResultCallback resultCal
mWiFiState = WIFI_STATE_SCANNING;
mSsidFound = false;

if (0 != net_mgmt(NET_REQUEST_WIFI_SCAN, mNetIf, NULL, 0))
wifi_scan_params * scanParams{ nullptr };
size_t scanParamsSize{ 0 };

if (!ssid.empty())
{
/* We must assume that the ssid is handled as a NULL-terminated string.
Note that the mScanSsidBuffer is initialized with zeros. */
VerifyOrReturnError(ssid.size() < sizeof(mScanSsidBuffer), CHIP_ERROR_INVALID_ARGUMENT);
memcpy(mScanSsidBuffer, ssid.data(), ssid.size());
mScanSsidBuffer[ssid.size()] = 0; // indicate the end of ssid string
mScanParams.ssids[0] = mScanSsidBuffer;
mScanParams.ssids[1] = nullptr; // indicate the end of ssids list
scanParams = &mScanParams;
scanParamsSize = sizeof(*scanParams);
}
if (0 != net_mgmt(NET_REQUEST_WIFI_SCAN, mNetIf, scanParams, scanParamsSize))
{
ChipLogError(DeviceLayer, "Scan request failed");
return CHIP_ERROR_INTERNAL;
Expand Down
4 changes: 3 additions & 1 deletion src/platform/nrfconnect/wifi/WiFiManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,9 @@ class WiFiManager

net_if * mNetIf{ nullptr };
ConnectionParams mWiFiParams{};
ConnectionHandling mHandling;
ConnectionHandling mHandling{};
wifi_scan_params mScanParams{};
char mScanSsidBuffer[DeviceLayer::Internal::kMaxWiFiSSIDLength + 1] = { 0 };
wifi_iface_state mWiFiState;
wifi_iface_state mCachedWiFiState;
net_mgmt_event_callback mWiFiMgmtClbk{};
Expand Down

0 comments on commit 4319ab1

Please sign in to comment.