samples: sid_end_device: add nRF70 Wi-Fi location PAL#788
Conversation
Add a Sidewalk Wi-Fi PAL (sid_pal_wifi_ifc.h) backed by an asynchronous Zephyr net_mgmt Wi-Fi scan on the nRF70, enabling Wi-Fi-based location alongside (or instead of) the LR1110 GNSS/Wi-Fi PAL. - subsys/nrf70_location: new nrf70_wifi_scan (net_mgmt scan wrapper) and sid_pal_wifi_nrf70_impl (Wi-Fi PAL) backend, enabled via the new CONFIG_SIDEWALK_WIFI_LOCATION_NRF70 Kconfig option (with scan band/type/timeout sub-options), and select NET_MGMT/NET_MGMT_EVENT/ NET_MGMT_EVENT_INFO so struct net_mgmt_event_callback::info is actually available to the scan callback. - subsys/semtech: skip the sx126x_location NOSUPPORT stub and the LR1110's own Wi-Fi PAL entry points when the nRF70 PAL is active, so it takes priority while LR1110 keeps providing GNSS. - Kconfig: tie the whole nRF70 Wi-Fi stack (WIFI, NETWORKING, WIFI_NRF70, NRF70_SCAN_ONLY, FW patch storage, and the scan band/type defaults) to the presence of the nrf7002eb2 shield via `if SHIELD_NRF7002EB2`, so `--shield nrf7002eb2` alone is enough - no -DFILE_SUFFIX or sysbuild SB_CONFIG_WIFI_NRF70* flags needed. - samples/sid_end_device: no per-board wifi variant file needed either - the DUT/CLI shell variant (needed to drive `location scan`) is already the existing, board-agnostic overlay-dut.conf, applied the usual way (-DOVERLAY_CONFIG="overlay-dut.conf"). sysbuild_wifi.conf and the nRF54LM20 wifi board conf are both removed as redundant. Also a board overlay fix for the LED pin the shield repurposes as its SPI-CS line. - west.yml / .gitignore: pull in the nrf_wifi module and ignore local provisioning artifacts. Verified building and linking end to end (west build) for: nrf54lm20dk/nrf54lm20a/cpuapp --shield nrf7002eb2 nrf54l15dk/nrf54l15/cpuapp (default, unaffected by this change) Co-authored-by: Cursor <cursoragent@cursor.com> Signed-off-by: Bartosz Ludwin <bartosz.ludwin@nordicsemi.no>
LuDuda
left a comment
There was a problem hiding this comment.
Overall looks good. Initial review.
| aliases { | ||
| state-notifier-connected = &led0; | ||
| state-notifier-time-sync = &led1; | ||
| /* led1 is repurposed as SPI-CS by the nrf7002eb2 Wi-Fi shield */ |
There was a problem hiding this comment.
I don't think this is correct. We should have the dedicated overlay, which changes it only when nRF7002eb2 is enabled.
There was a problem hiding this comment.
Right, the problem is that there's no application-specific shield overlays support in Zephyr so I guess there's no way to do it without requiring a manual setting EXTRA_DTC_OVERLAY_FILE : zephyrproject-rtos/zephyr#90469.
Ideally, the shield shouldn't delete the led but just mark it as disabled but I guess it's too late to change it for sidewalk :)
| return sid_pal_common_process_event(); | ||
| } | ||
|
|
||
| #if !defined(CONFIG_SIDEWALK_WIFI_LOCATION_NRF70) |
There was a problem hiding this comment.
I don't think that LR1110 PAL implementation should depend on NRF70. If this is really necessary due to the build system, let's use different defines and maybe compile it out => @ktaborowski, thoughts?
| # When the nRF70 Wi-Fi PAL is active it provides the GNSS/Wi-Fi PAL symbols | ||
| # instead of the sx126x_location NOSUPPORT stub, so skip the stub to avoid | ||
| # duplicate symbol definitions. | ||
| if(CONFIG_SIDEWALK_SUBGHZ_RADIO_SX126X AND NOT CONFIG_SIDEWALK_WIFI_LOCATION_NRF70) |
There was a problem hiding this comment.
@ktaborowski any other generic Config we could use rather than referencing to NRF70 here?
| When SIDEWALK_SUBGHZ_RADIO_SX126X is also selected this PAL replaces | ||
| the sx126x_location NOSUPPORT stub, so the (lora_fsk) Sidewalk library | ||
| actually invokes the Wi-Fi PAL. | ||
|
|
||
| This PAL can also coexist with SIDEWALK_SUBGHZ_RADIO_LR1110 (for | ||
| example the nRF Sidewalk EB together with an nRF7002 EB): whenever WIFI | ||
| is enabled the nRF70 provides the Wi-Fi PAL (taking priority), while the | ||
| LR1110 keeps providing the GNSS PAL and the sub-GHz radio. When WIFI is | ||
| disabled the LR1110 provides the Wi-Fi PAL itself. |
There was a problem hiding this comment.
I would love to not have direct dependencies between LR1110/SX1262. Maybe we can introduce new set of configs which would compile in/out certain features.
| LR1110 keeps providing the GNSS PAL and the sub-GHz radio. When WIFI is | ||
| disabled the LR1110 provides the Wi-Fi PAL itself. | ||
|
|
||
| if SIDEWALK_WIFI_LOCATION_NRF70 |
There was a problem hiding this comment.
Can we have these defines as part o subsys and nrf70 support instead?
| config WIFI | ||
| default y | ||
|
|
||
| config NETWORKING | ||
| default y | ||
|
|
||
| config NET_L2_ETHERNET | ||
| default y | ||
|
|
||
| config NET_OFFLOAD | ||
| default y | ||
|
|
||
| config WIFI_NRF70 | ||
| default y |
There was a problem hiding this comment.
Can we imply this configs when SIDEWALK_WIFI_LOCATION_NRF70 is enabled?
| endchoice | ||
|
|
||
| choice NRF_WIFI_PATCHES_EXT_FLASH_SUPPORT | ||
| default NRF_WIFI_PATCHES_EXT_FLASH_DISABLED |
.config diff.config change: https://github.com/nrfconnect/sdk-sidewalk/actions/runs/29733142417/artifacts/8457135701 Configuration diff too long to fit. Check file in artifacts. |
Add a Sidewalk Wi-Fi PAL (sid_pal_wifi_ifc.h) backed by an asynchronous Zephyr net_mgmt Wi-Fi scan on the nRF70, enabling Wi-Fi-based location alongside (or instead of) the LR1110 GNSS/Wi-Fi PAL.
if SHIELD_NRF7002EB2, so--shield nrf7002eb2alone is enough - no -DFILE_SUFFIX or sysbuild SB_CONFIG_WIFI_NRF70* flags needed.location scan) is already the existing, board-agnostic overlay-dut.conf, applied the usual way (-DOVERLAY_CONFIG="overlay-dut.conf"). sysbuild_wifi.conf and the nRF54LM20 wifi board conf are both removed as redundant. Also a board overlay fix for the LED pin the shield repurposes as its SPI-CS line.Verified building and linking end to end (west build) for:
nrf54lm20dk/nrf54lm20a/cpuapp --shield nrf7002eb2
nrf54l15dk/nrf54l15/cpuapp (default, unaffected by this change)
CI parameters
Description
JIRA ticket:
Self review