Check for RPU context as well.
To fix this properly we need more fixes to be backported, but this
should suffice for now.
Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
This is to avoid successive recoveries in case we get successive
watchdog interrupts from the RPU.
Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
During recovery we might get further watchdog interrupts causing
multiple recovery requests, ignore them if a recovery is already in
progress.
Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
In order for the interface down to propagate and cleanup it needs more
time, using Shell 10ms was working due to human delay, but
programatically this needs higher delay.
Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
Before proceeding with RPU bringup, do a sanity check by reading a known
signature to make sure the Host-RPU comms are operational.
Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
In case RPU is stuck and need a recovery, the failures in interface down
should be ignored as they are expected and we should proceed with device
removal that in turn removes power to the RPU.
TODO: This works for single VIF, but needs more thought for multi-VIF.
Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
During watchdog (or any) interrupt processing, RPU accesses are being
made and they assert the wakeup_now flag this causes RPU recovery to not
trigger.
New false or true recovery detection algo:
Check the time difference b/w last de-assert and assert, and if it
exceeds minimum time needed for RPU to enter sleep, then not the
timestamp. This timestamp will be used to compare when a watchdog
interrupt is received and see if during the last window if host has
given a chance for RPU to attempt sleep, if yes, then attempt recovery
else ignore watchdog.
Also, add a Kconfig for the 10s active time that triggers recovery, this
needs to be passed to the FW (once we have enough patch memory).
Also, add a Kconfig for the minimum time needed for RPU to attempt sleep
in positive case.
Also, add a new _ms API for time stamp fetch, this is to avoid
precision loss when converting to and from ms to us and also makes code
readable by avoiding *1000 and /1000.
Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
This commit applies several changes in the way "heap_runtime"
feature is used. It can't be split due to bisectability issues.
Whenever the feature is enabled, a new heap is created and
custom malloc/calloc/free functions are added into the build
system. Those functions are currently used for internal Wi-Fi and BLE
drivers only.
Such changes are described below:
1) Rename heap.c to esp_heap_runtime.c for better readability.
2) Rename RUNTIME_HEAP to HEAP_RUNTIME to make it similar to what is
available in Zephyr.
3) Add runtime heap to BT as such as Wi-Fi.
Fixes#79490Fixes#79470
Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
Update both Wi-FI and BLE init codes to return proper
error code and logging when it is missing heap.
Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
`eswifi-uart` uses the ring buffer library, but the dependency is
not indicated.
Specify `select RING_BUFFER` to resolve the dependency.
Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
`_POSIX_C_SOURCE` must be specified to use the `strnlen()` function
in string.h. Make sure to specify this explicitly.
Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
The FW blobs are contentious topic in OSS, so, add a provision to use
external tooling (e.g., NCS) to handle FW blobs for advanced usecases
(e.g., storing in external flash).
This won't be used upstream, only built-in or build-only are supported.
Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
Instead of relying on INCBIN macros which do not properly add
dependencies, e.g., modifying FW file doesn't trigger rebuild.
Use the Zephyr cmake tooling to load the FW patch file as a header.
This also improves memory report where the patch target is clearly
visible instead of a hidden section.
Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
This reverts commit e2e96acebf.
This will be properly fixes by adding a target for nRF70.bin and
removing INCBIN approach.
Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
Random MAC address setting can never be configured as the two defaults
cover all cases. Fix the defaults, now the order is
* Fixed
* OTP (default, in case of no config)
* Random
Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
Whenever FW blobs are updated manually, we need to tell cmake to
auto-build the source files to use the latest firmware without doing a
pristine build.
This adds a custom target to be run with nRF Wi-Fi driver and updates
timestamp of fw_load.c to rebuild whenevr the blob is updated.
Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
This script is needed only when external flash is used to store nRF70
firmware patches. This also uses PM which is supported only in NCS.
Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
For using external flash the tooling is only available in NCS, so, use
the existing Kconfig option to override the FW loading.
Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
Checks blobs presence as dependency to allow driver build.
Goal is to avoid building in environment where blobs won't
be present (e.g GitHub CI environment).
Signed-off-by: Raffael Rostagno <raffael.rostagno@espressif.com>
Currently a user, or a shield definition, must select a Kconfig to
signal that the iovdd_ctrl and bucken GPIOs are connected to the same
pin. We can instead check this in the driver by simply checking if
the iovdd_ctrl_spec and bucken_spec are the same pin.
Update the nrfwifi driver and remove the redundant
NRF_WIFI_COMBINED_BUCKEN_IOVDD_GPIO config.
Signed-off-by: Bjarki Arge Andreasen <bjarki.andreasen@nordicsemi.no>
For code clarity, this commit adjusts the use of `return` statements
in functions with a void return type as follows:
- Transform `return foo();` into separate statements:
`foo();`
`return;`
- Remove unnecessary `return` statements when
they don't affect control flow.
Signed-off-by: Pisit Sawangvonganan <pisit@ndrsolution.com>
There is a regression caused by #76177, which
causes build to fail due to missing includes and others.
This wraps it with proper checks and fixes wifi scan call.
This also remove unused variable present in the same driver.
Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
Add missing braces to comply with MISRA C:2012 Rule 15.6 and
also following Zephyr's style guideline.
Signed-off-by: Pisit Sawangvonganan <pisit@ndrsolution.com>
Remove all entries that as not being used.
This also update hal to re-enable warning flags
as such as -Wno-unused-variable.
Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
Removes constant error logging when parsing IPD headers in active mode and
waiting on remote IP and port. Currently an error message is logged for
every character in the remote IP and port until the full length obtained.
Signed-off-by: Daniel Mangum <georgedanielmangum@gmail.com>
The ESP32 Wi-Fi driver previously did not support APSTA mode,
enabling AP mode would disable STA mode and vice versa.
Support for APSTA has been added by introducing additional
network interface: one for STA (Interface 2) and one for
AP (Interface 1). The CONFIG_ESP32_WIFI_AP_STA_MODE option in
Kconfig now allows enabling or disabling this support.
Signed-off-by: Muhammad Haziq <muhammad.haziq@zintechnologies.com>
When build with the psa_crypto_driver, it will try to include common.h
of mbedtls, but actually include the common.h from hostap, and causes
build error of undefined symbol. Now link the library of hostap to use
the header file in /utils path, to fix the build error.
Signed-off-by: Maochen Wang <maochen.wang@nxp.com>
Updated condition to enable NET_STATISTICS. Changed
CONFIG_NET_STATISTICS_ETHERNET to CONFIG_NET_STATISTICS_WIFI
in airoc_wifi.c
Signed-off-by: Nazar Palamar <nazar.palamar@infineon.com>
Add a mode to build the driver without FW blobs, this is mainly for
twister to run and catch any build issues without depending on any FW
blobs.
Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
1) After the wifi driver successfully connects to the AP,
the dormant state should be set to OFF.
Once a deauth/disassoc frame is received or link lost occurs,
the dormant state should be set to ON.
2) Enable CONFIG_NET_TC_SKIP_FOR_HIGH_PRIO and CONFIG_NET_CONTEXT_PRIORITY
to push high priority packets directly to network driver.
Signed-off-by: Gang Li <gang.li_1@nxp.com>
Add overrun count in statistics. It will represent
the number of packets dropped either at received and
sent due to lack of buffer memory.
Signed-off-by: Kapil Bhatt <kapil.bhatt@nordicsemi.no>
- Slightly improve the name of this kconfig adding the suffix
_POLL in order to highlight that this adds a callback
function used to poll data.
- Description was also updated to point out that this symbols
might not only use the (secure) entropy driver, but also
generic number generators, some of which are not really
secure.
- The symbol was move from Kconfig to Kconfig.tls-generic because
this is where MBEDTLS_ENTROPY_C is located and since
MBEDTLS_ENTROPY_HARDWARE_ALT depends on the former (it only
makes sense if the entropy module is also enabled), we add
also the "depends on".
Signed-off-by: Valerio Setti <vsetti@baylibre.com>
Monitor mode relies on core Wi-Fi management functions, so, the file
should be included for both system and system with raw modes.
Fix this by adding a hidden symbol.
Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
If Wi-Fi management is enabled, then independent of modes scan
functionality is always included.
Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
This is a fix from QSPI-NOR driver to wait for clock divider change to
be applied and take effect.
Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
For less than 32MHz using HFCLK192M, /2 divider should be used and only
for Anamoly159 /1 divider should be used.
Without this fix 8MHz clock in DTS uses 16MHz clock.
Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>