Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[nrfconnect] Pulled patches for the nRF Wi-Fi platform #33196

Merged
merged 3 commits into from
May 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion config/nrfconnect/chip-module/Kconfig.defaults
Original file line number Diff line number Diff line change
Expand Up @@ -199,15 +199,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 @@ -151,7 +151,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 @@ -48,7 +48,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
Loading