Skip to content

Commit 4ee8d4e

Browse files
kkasperczyk-noArekBalysNordicmarkaj-nordic
committed
[nrfconnect] Pulled patches for the nRF Wi-Fi platform (#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 <marcin.kajor@nordicsemi.no> * [nrfconnect] Fix build for 7001 Emulation For nRF7001DK (emulation) build fails with SPI driver errors, this fixes the build. Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no> --------- Signed-off-by: Marcin Kajor <marcin.kajor@nordicsemi.no> Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no> Co-authored-by: Arkadiusz Balys <arkadiusz.balys@nordicsemi.no> Co-authored-by: Marcin Kajor <marcin.kajor@nordicsemi.no>
1 parent 2211869 commit 4ee8d4e

File tree

5 files changed

+35
-6
lines changed

5 files changed

+35
-6
lines changed

config/nrfconnect/chip-module/Kconfig.defaults

+13-1
Original file line numberDiff line numberDiff line change
@@ -203,15 +203,27 @@ config CHIP_QSPI_NOR
203203
default y if BOARD_NRF5340DK_NRF5340_CPUAPP || BOARD_NRF52840DK_NRF52840
204204

205205
# nRF7002DK uses SPI NOR external flash
206+
207+
if BOARD_NRF7002DK_NRF5340_CPUAPP || BOARD_NRF7002DK_NRF7001_NRF5340_CPUAPP
208+
206209
config CHIP_SPI_NOR
207-
default y if BOARD_NRF7002DK_NRF5340_CPUAPP
210+
default y
211+
212+
endif # BOARD_NRF7002DK_NRF5340_CPUAPP || BOARD_NRF7002DK_NRF7001_NRF5340_CPUAPP
208213

209214
config BOOT_IMAGE_ACCESS_HOOKS
210215
default y if SOC_SERIES_NRF53X
211216

212217
config UPDATEABLE_IMAGE_NUMBER
218+
default 3 if NRF_WIFI_PATCHES_EXT_FLASH_STORE
213219
default 2 if SOC_SERIES_NRF53X
214220

221+
config DFU_MULTI_IMAGE_MAX_IMAGE_COUNT
222+
default 3 if NRF_WIFI_PATCHES_EXT_FLASH_STORE
223+
224+
config NRF_WIFI_FW_PATCH_DFU
225+
default y if NRF_WIFI_PATCHES_EXT_FLASH_STORE
226+
215227
# ==============================================================================
216228
# OpenThread configuration
217229
# ==============================================================================

config/nrfconnect/chip-module/Kconfig.features

+2-2
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ if CHIP
2121

2222
config CHIP_WIFI
2323
bool "Enable nrfconnect Wi-Fi support"
24-
default y if SHIELD_NRF7002EK || BOARD_NRF7002DK_NRF5340_CPUAPP || SHIELD_NRF7002EB
24+
default y if SHIELD_NRF7002EK || BOARD_NRF7002DK_NRF5340_CPUAPP || SHIELD_NRF7002EB || BOARD_NRF7002DK_NRF7001_NRF5340_CPUAPP
2525
select WIFI_NRF700X
2626
select WIFI
2727
select WPA_SUPP
@@ -149,7 +149,7 @@ endif
149149
config CHIP_DFU_OVER_BT_SMP
150150
bool "Enable DFU over Bluetooth LE SMP feature set"
151151
imply CHIP_QSPI_NOR if BOARD_NRF5340DK_NRF5340_CPUAPP || BOARD_NRF52840DK_NRF52840
152-
imply CHIP_SPI_NOR if BOARD_NRF7002DK_NRF5340_CPUAPP
152+
imply CHIP_SPI_NOR if BOARD_NRF7002DK_NRF5340_CPUAPP || BOARD_NRF7002DK_NRF7001_NRF5340_CPUAPP
153153
imply BOOTLOADER_MCUBOOT
154154
select MCUMGR
155155
select MCUMGR_TRANSPORT_BT

config/nrfconnect/chip-module/Kconfig.mcuboot.defaults

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ choice LIBC_IMPLEMENTATION
3939
endchoice
4040

4141
# nRF7002DK uses SPI NOR external flash
42-
if BOARD_NRF7002DK_NRF5340_CPUAPP
42+
if BOARD_NRF7002DK_NRF5340_CPUAPP || BOARD_NRF7002DK_NRF7001_NRF5340_CPUAPP
4343

4444
config SPI
4545
default y

src/platform/nrfconnect/wifi/WiFiManager.cpp

+16-1
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,22 @@ CHIP_ERROR WiFiManager::Scan(const ByteSpan & ssid, ScanResultCallback resultCal
189189
mWiFiState = WIFI_STATE_SCANNING;
190190
mSsidFound = false;
191191

192-
if (0 != net_mgmt(NET_REQUEST_WIFI_SCAN, mNetIf, NULL, 0))
192+
wifi_scan_params * scanParams{ nullptr };
193+
size_t scanParamsSize{ 0 };
194+
195+
if (!ssid.empty())
196+
{
197+
/* We must assume that the ssid is handled as a NULL-terminated string.
198+
Note that the mScanSsidBuffer is initialized with zeros. */
199+
VerifyOrReturnError(ssid.size() < sizeof(mScanSsidBuffer), CHIP_ERROR_INVALID_ARGUMENT);
200+
memcpy(mScanSsidBuffer, ssid.data(), ssid.size());
201+
mScanSsidBuffer[ssid.size()] = 0; // indicate the end of ssid string
202+
mScanParams.ssids[0] = mScanSsidBuffer;
203+
mScanParams.ssids[1] = nullptr; // indicate the end of ssids list
204+
scanParams = &mScanParams;
205+
scanParamsSize = sizeof(*scanParams);
206+
}
207+
if (0 != net_mgmt(NET_REQUEST_WIFI_SCAN, mNetIf, scanParams, scanParamsSize))
193208
{
194209
ChipLogError(DeviceLayer, "Scan request failed");
195210
return CHIP_ERROR_INTERNAL;

src/platform/nrfconnect/wifi/WiFiManager.h

+3-1
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,9 @@ class WiFiManager
222222

223223
net_if * mNetIf{ nullptr };
224224
ConnectionParams mWiFiParams{};
225-
ConnectionHandling mHandling;
225+
ConnectionHandling mHandling{};
226+
wifi_scan_params mScanParams{};
227+
char mScanSsidBuffer[DeviceLayer::Internal::kMaxWiFiSSIDLength + 1] = { 0 };
226228
wifi_iface_state mWiFiState;
227229
wifi_iface_state mCachedWiFiState;
228230
net_mgmt_event_callback mWiFiMgmtClbk{};

0 commit comments

Comments
 (0)