Commit graph

106883 commits

Author SHA1 Message Date
Pavel Vasilyev
0d0669167b tests: bluetooth: buf: Test the freed buf callback
This commit adds a unit test that checks the freed buffer callback of
the bluetooth data buffer API.

Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
2024-12-10 11:09:36 +01:00
Pavel Vasilyev
c2488fdd30 bluetooth: buf: Add a callback for freed buffer in rx pool
The Bluetooth data buffer API currently lacks a mechanism to notify when
a buffer is freed in the RX pool. This limitation forces HCI drivers to
adopt inefficient workarounds to manage buffer allocation.

HCI drivers face two suboptimal options:

- Blocking calls: Use bt_buf_get_rx with K_FOREVER, which blocks the
  execution context until a buffer becomes available.
- Polling: Repeatedly call bt_buf_get_rx with K_NO_WAIT, which increases
  CPU load and reduces efficiency.

This commit introduces a callback mechanism that is triggered each time
a buffer is freed in the RX pool. With this feature, HCI drivers can:

- Call bt_buf_get_rx with K_NO_WAIT.
- Wait for the callback notification if a NULL buffer is returned,
  avoiding unnecessary polling.

The new callback improves efficiency by enabling event-driven behavior
for buffer management, reducing CPU overhead while maintaining
responsiveness.

Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
2024-12-10 11:09:36 +01:00
Pavel Vasilyev
bd9a1cea84 bluetooth: buf: Convert bt_buf_type enum to bitmask
This allows to combine several types in a single value.

Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
2024-12-10 11:09:36 +01:00
Jukka Rissanen
027760b6d4 net: if: Replace asserts by proper runtime checks
The asserts were not proper here, replace those by runtime
checks as the functions can be called from applications and
asserts are not meant for error checking.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2024-12-10 11:09:25 +01:00
Jukka Rissanen
692310d68c net: websocket: Remove assert call
Remove the useless assert as it is not needed at all here.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2024-12-10 11:09:25 +01:00
Jukka Rissanen
1e15eec64f net: vlan: Remove useless assert
The assert is not needed and it was in wrong place anyway.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2024-12-10 11:09:25 +01:00
Jukka Rissanen
2416cde90e net: trickle: Remove useless asserts
Replace asserts by runtime checks as the APIs can be used
from applications.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2024-12-10 11:09:25 +01:00
Gang Li
79fdf4a254 drivers: wifi: nxp: set the maximum number of stations
Add support for setting the maximum number of stations.
Add support for setting AP bandwidth.

Signed-off-by: Gang Li <gang.li_1@nxp.com>
2024-12-10 11:09:09 +01:00
Gang Li
5dcb3a0f6a hostap: fix VHT channel center segment0
1) Unless ACS is being used, both "channel" and
"vht_oper_centr_freq_seg0_idx" parameters must be set.
Fixed "channel center segment 0" not being set in VHT Operation IE.
2) Set HT capabilities and VHT capabilities via the wifi ap config command.
3) Set AP bandwidth to wifi driver via the wifi_mgmt_api->ap_config_params.

Signed-off-by: Gang Li <gang.li_1@nxp.com>
2024-12-10 11:09:09 +01:00
Gang Li
e73bc712cc net: wifi: add "bandwidth" parameter to "wifi ap enable" command
Add "bandwidth" parameter to "wifi ap enable" command.
Add "ht_capab" and "vht_capab" parameters to "wifi ap config" command.

Signed-off-by: Gang Li <gang.li_1@nxp.com>
2024-12-10 11:09:09 +01:00
Simon Guinot
c650720a83 samples: led_strip: fix bbc_microbit.conf location
Commit 55d9d1c6ba
("samples: led: consolidate LED samples under same directory")
moved the led_strip sample from samples/drivers to samples/drivers/led.

But commit f54a53b4b3
("drivers: ws2812_gpio: Make timing configurable and less hardware
dependend") was merged at the same time and added the bbc_microbit.conf
file to the old location.

This patch moves bbc_microbit.conf to its correct location.

Signed-off-by: Simon Guinot <simon.guinot@sequanux.org>
2024-12-10 11:09:00 +01:00
Nikodem Kastelik
a1152cd9fb modules: nordic: nrfx: workaround MDK erratas symbol for nRF54L05 & L10
MDK 8.68.1 uses nRF54L15_XXAA symbol for determining whether
given errata is applicable or not for nRF54L Series SoCs.
This causes all erratas to be disabled for nRF54L05 and nRF54L10.
To mitigate this DEVELOP_IN_NRF54L15 symbol needs to be defined,
and removed once new MDK is integrated.

Signed-off-by: Nikodem Kastelik <nikodem.kastelik@nordicsemi.no>
2024-12-10 11:08:49 +01:00
Nikodem Kastelik
a96b3e3d5d soc: nordic: nrf54l: add preliminary workaround for nRF54L anomaly 31
This workaround will be replaced with a variant
executed at SystemInit() level, once MDK implements it.

Signed-off-by: Nikodem Kastelik <nikodem.kastelik@nordicsemi.no>
2024-12-10 11:08:49 +01:00
Nikodem Kastelik
2d378a19fe soc: nordic: nrf54l: remove configuration of DCDC regulator
Since nrfx 3.9 integration, configuration is executed
in MDK SystemInit().

Signed-off-by: Nikodem Kastelik <nikodem.kastelik@nordicsemi.no>
2024-12-10 11:08:49 +01:00
Dawid Niedzwiecki
9b3fe8cb88 clock: stm32_ll_h7: add missing STM32_SRC_HSI_KER entry
Add a missing case for STM32_SRC_HSI_KER in the
stm32_clock_control_get_subsys_rate function.

Signed-off-by: Dawid Niedzwiecki <dawidn@google.com>
2024-12-10 11:08:39 +01:00
Francois Ramu
cdba98219d include: binding defines MCO division factor for stm32U5
On the stm32U5 serie the MCO prescaler is a value
set in the CFGR1 register to divide the MCO output clock.
See the RefMan for accepted values for this stm32U5 serie

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2024-12-10 11:08:30 +01:00
Henrik Brix Andersen
ea8bd5a09a doc: releases: remove v3.6.0 from the list of supported releases
remove Zephyr v3.6.0 from the list of supported releases. Zephyr v3.6.0
reached end-of-life on 2024-11-29.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2024-12-10 11:08:20 +01:00
Pisit Sawangvonganan
0156a322b1 bluetooth: host: hci_core: fix num_handles assignment
Replaced `sys_cpu_to_le16(1)` with a direct `1` assignment to the
`cp->num_handles` (uint8_t) field to avoid truncation to `0x00` on
big-endian architectures.

Signed-off-by: Pisit Sawangvonganan <pisit@ndrsolution.com>
2024-12-10 11:08:15 +01:00
Fin Maaß
5d2068f491 logging: log_output: move partly unused code
move code, that is only needed for one case
to that case.

Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
2024-12-10 08:06:25 +01:00
Fin Maaß
a9a475e525 lib: libc: newlib: Don't replace newlib libc time _r functions
Select TC_PROVIDES_POSIX_C_LANG_SUPPORT_R to keep Zephyr from
including the common libc implementation of the various _r APIs.

Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
2024-12-10 08:06:25 +01:00
Fin Maaß
1d4249dea6 logging: remove part for when gmtime_r is not available
now that CONFIG_POSIX_C_LANG_SUPPORT_R will
add a custom implementation for gmtime_r() if that
is not provided by the toolchain, we can simply depend on
that, instead of using out own.

Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
2024-12-10 08:06:25 +01:00
Fin Maaß
c221496f14 lib: libc: select POSIX_C_LANG_SUPPORT_R
also select POSIX_C_LANG_SUPPORT_R, so we can check
that, to see if gmtime_r() is available.

Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
2024-12-10 08:06:25 +01:00
Fin Maaß
0418771902 lib: posix: set default of POSIX_C_LANG_SUPPORT_R
enable POSIX_C_LANG_SUPPORT_R by default if
the functions are already provided by the toolchain.

Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
2024-12-10 08:06:25 +01:00
Fin Maaß
fc50427f3e logging: backend: net: add missing dependency
add missing dependency of NET_SOCKETS to LOG_BACKEND_NET.

Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
2024-12-10 08:06:25 +01:00
Fin Maaß
048e7dc502 tests: logging: log_output: net: add test for syslog output
add test for syslog log output.

Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
2024-12-10 08:06:25 +01:00
Khoa Nguyen
d95f82c36a boards: renesas: Add support CAN-FD for Renesas RA6, RA4
- Add support CAN-FD for EK-RA6E2, EK-RA4E2
- Enable ioport for can-transceiver on EK-RA6E2, EK-RA4E2

Signed-off-by: Khoa Nguyen <khoa.nguyen.xh@renesas.com>
2024-12-10 08:05:58 +01:00
Khoa Nguyen
f8325413dc dts: arm: renesas: Add dts node to support canfd for RA4E2, RA6E2
Add dts node for R7FA6E2Bx and R7FA4E2B93CFM MCU to support canfd

Signed-off-by: Khoa Nguyen <khoa.nguyen.xh@renesas.com>
2024-12-10 08:05:58 +01:00
Valerio Setti
35324319b9 doc: updates concerning ENTROPY_GENRATOR auto-enabling
Update the migration-guide to inform the users that now
CONFIG_ENTROPY_GENERATOR is automatically enabled as soon as
devicetree property "zephyr,entropy" is set.

Update also the "General recommendations" section of the Board Porting
Guide on the same topic.

Signed-off-by: Valerio Setti <vsetti@baylibre.com>
2024-12-10 08:05:33 +01:00
Valerio Setti
22e30e04f5 tests: disable NRF5 entropy driver on some bsim/qemu tests
CONFIG_ENTROPY_GENERATOR is now enabled by default as soon as
"zephyr,entropy" is set in the device-tree. Since the sub-Kconfig
CONFIG_ENTROPY_NRF5_RNG is also enabled by default on nrf boards,
this means that the driver is pulled in the build and intialized
at boot. This might cause runtime issues during some IRQ/kernel
tests, so it's better to remove "zephyr,entropy" on these tests.

Signed-off-by: Valerio Setti <vsetti@baylibre.com>
2024-12-10 08:05:33 +01:00
Valerio Setti
e3817d0ffc test: misc|shell: disable "zephyr,entropy" chosen property
When "zephyr,entropy" is enabled the corresponding entropy driver is
pulled in the build and initialized during boot. This

- changes the initialization sequence expected by "check_init_priorities";
- add one extra device to the expected list in "shell_device_filter".

Therefore this commit removes the "zephyr,entropy" propery to return the
test to the original state.

Signed-off-by: Valerio Setti <vsetti@baylibre.com>
2024-12-10 08:05:33 +01:00
Valerio Setti
4c43e3b756 samples: mcumgr: smp_svr: disable "zephyr,entropy" in mcuboot
If/when "zephry,entropy" is enabled CONFIG_ENTROPY_GENRATOR is
automatically enabled, therefore enabling the corresponding
platform entropy driver. On some platform this is a problem
because the entropy driver is not used directly as random
source, but only to seed the ctr-drbg algorithm provided
by Mbed TLS. Unfortunately CONFIG_MBEDTLS_CIPHER_MODE_CTR_ENABLED
cannot be directly enabled because CONFIG_MBEDTLS_CFG_FILE used
in mcuboot is different from the "config-tls-generic.h" which
is required to use Kconfig symbols defined in
"zephyr/modules/mbedtls/Kconfig.tls-generic".
Moreover entropy and random number generators are not required
in mcuboot because signature verification is a
deterministic operation.
In conclusion this commit disables "zephyr,entropy" in
mcuboot DTS overlay file.

Signed-off-by: Valerio Setti <vsetti@baylibre.com>
2024-12-10 08:05:33 +01:00
Valerio Setti
daab04857f drivers: entropy: nrf5: add "depends on MULTITHREADING"
entropy_nrf5 modules uses k_sem_xxx() functions in several
places, but these functions are only functional when
CONFIG_MULTITHREADING is set, otherwise they just fallback to
the empty weak implementation provided in
zephyr/lib/libc/armstdc/src/threading_weak.c.

Signed-off-by: Valerio Setti <vsetti@baylibre.com>
2024-12-10 08:05:33 +01:00
Valerio Setti
62581570a7 drivers: entropy: mcux_rnga: add "depends on SYS_CLOCK_EXISTS"
mcux_rnga driver calls k_cycle_get_32() which is not available
if CONFIG_SYS_CLOCK_EXISTS is not defined. Therefore we add
this depedendency to CONFIG_ENTROPY_MCUX_RNGA.

Signed-off-by: Valerio Setti <vsetti@baylibre.com>
2024-12-10 08:05:33 +01:00
Valerio Setti
8564df571a samples/tests: bluetooth: remove ENTROPY_GENERATOR selection
ENTROPY_GENERATOR is now automatically enabled if the board
has "zephyr,entropy" chosen property set, so there is no need
to manually select it.

Signed-off-by: Valerio Setti <vsetti@baylibre.com>
2024-12-10 08:05:33 +01:00
Valerio Setti
e05518146b boards: remove ENTROPY_GENERATOR selection if BT
ENTROPY_GENERATOR is now automatically enabled if the board
has "zephyr,entropy" chosen property set, so there is no need
to manually select it.

Signed-off-by: Valerio Setti <vsetti@baylibre.com>
2024-12-10 08:05:33 +01:00
Valerio Setti
2d959d96fb drivers: entropy: enable ENTROPY_GENERATOR if "zephyr,entropy" is set in DT
Automatically enable ENTROPY_GENERATOR if the device-tree has
any "zephyr,entropy" chosen property specified. This helps
in having CONFIG_ENTROPY_HAS_DRIVER set if the platform support
an entropy driver and this then enables CONFIG_CSPRNG_ENABLED.

Signed-off-by: Valerio Setti <vsetti@baylibre.com>
2024-12-10 08:05:33 +01:00
Lyle Zhu
69d415c9ce Bluetooth: SSP: Improve BR SC only mode
Actively disconnect the connection with error code `BT_HCI_ERR_AUTH_FAIL`
when the notified link key type is not `BT_LK_AUTH_COMBINATION_P256` in
BR SC only mode.

Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
2024-12-10 05:39:10 +01:00
Johan Hedberg
bc086f53e2 drivers: bluetooth: silabs_efr32: Declare supported features in Kconfig
Now that we enable `HAS_BT_CTLR` we should also declare which optional
features are supported. For now, we only add the features that are
available through the current driver init routine and found on all
supported platforms.

Signed-off-by: Johan Hedberg <johan.hedberg@silabs.com>
2024-12-10 05:38:39 +01:00
Grant Ramsay
31b54e7cee arch: arm: cortex_m: Include TBLBASE in VTOR mask if present
In some Cortex-M3 implementations SCB_VTOR bit[29] is called
the TBLBASE bit.
This enables setting VTOR to an SRAM address for qemu_cortex_m3

Signed-off-by: Grant Ramsay <gramsay@enphaseenergy.com>
2024-12-10 03:16:23 +00:00
Maochen Wang
c007ac4577 drivers: wifi: nxp: add Wi-Fi thread configurations
Support configuring Wi-Fi threads stack size and priority through
Kconfig.

Signed-off-by: Maochen Wang <maochen.wang@nxp.com>
2024-12-10 03:16:11 +00:00
TOKITA Hiroshi
3a69ed6c02 drivers: sensors: ti_hdc20xx: Remove ti,hdc20xx compatible
The `ti,hdc20xx` is a common definition for TI HDC20xx series,
so the actual device named `hdc20xx` does not exist.
Remove the "compatible" section.

Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
2024-12-09 22:06:52 +00:00
David Leach
259302a201 boards: nxp: frdm_rw612: restructure dts
Restructure board dts file to prepare for NS targets using common
dts.

Signed-off-by: David Leach <david.leach@nxp.com>
2024-12-09 22:06:32 +00:00
Félix Turgeon
9cdb07cb52 scripts: coredump: Fix loading coredumps when thread info is enabled.
When loading a coredump with an an elf built using
'CONFIG_DEBUG_THREAD_INFO=y', gdbstubs assumes that the thread info
memoryblock populated by 'CONFIG_DEBUG_COREDUMP_MEMORY_DUMP_THREADS=y'
will be present in the coredump. This is not always true and causes an
error, and a failure to load the coredump. Add a default value for the
threads_metadata variable in CoredumpLogFile which can be used to detect
when the memory block is not present. This allows the coredump to load
successfully.

Signed-off-by: Félix Turgeon <felixturgeon@meta.com>
2024-12-09 22:06:23 +00:00
Jianxiong Gu
29436c2b29 include: drivers: usb_c: unify status register data type to uint32_t
The tcpc_get_status_register function was using int32_t for the status
parameter, while the other related functions used uint32_t. This change
unifies the data type across all related functions to uint32_t for
consistency and clarity.

Signed-off-by: Jianxiong Gu <jianxiong.gu@outlook.com>
2024-12-09 22:06:09 +00:00
Jianxiong Gu
414ac1895a include: drivers: usb_c: Run clang-format
Run clang format before making changes

Signed-off-by: Jianxiong Gu <jianxiong.gu@outlook.com>
2024-12-09 22:06:09 +00:00
Carles Cufi
af299be0fc boards: nordic: nRF54L15DK: Add debug configuration for FLPR
Add the required code for `west debug` to work the FLPR
core over JLink in the nRF54L 05, 10 and 15 devices.

Note that this requries an external J-Link probe, it will not work with
the on-board (OB) probe soldered on the DK.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2024-12-09 22:05:58 +00:00
Andrej Butok
e669bf8d3d soc: nxp: mcx: Add flash runner configuration
- Adds a flash runner configuration for mcxn/c/a/w
  used for sysbuild multi-image projects.
- Solves sysbuild issue with multiple resets and mass erases.

Signed-off-by: Andrej Butok <andrey.butok@nxp.com>
2024-12-09 22:05:40 +00:00
Sylvio Alves
fc7cacc983 soc: esp32: fix smp_log usage
smp_log usage should be only used when SMP is enabled.
This is currently causing build issues after the fix
provided by #82377

Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
2024-12-09 22:05:23 +00:00
Krzysztof Chruściński
e8a5ecc160 soc: nordic: common: mram_latency: Add option to auto request no latency
Add CONFIG_MRAM_LATENCY_AUTO_REQ. When option is enabled then module
requests no latency during the initialization. This option might be
useful for cases where we want to achieve maximum performance and
want to avoid controlling MRAM in the code.

Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
2024-12-09 22:05:17 +00:00
Krzysztof Chruściński
c8d50e4ef1 drivers: serial: nrfx_uarte: Add support for non ISR PM mode
When fast UARTE instance is used (e.g. UARTE120 in nrf54h20), PM actions
are not ISR safe because they include communication over IPC so they can
only be called from the thread context. Extend driver to support both
PM modes. When non ISR mode is used then uart_rx_enable() and uart_tx()
will return error if they are called from ISR and resume operation
would need to be called because device is suspended. On completion,
driver is calling pm_device_runtime_put_async which can be called from
the ISR context.

Additionally, suspending in the TXSTOPPED and RXTO events has been
moved after user callback. It allows to support the case where
uart_rx_enable() or uart_tx() are called from that callback context.
Since suspending is called after returning from the callback it will
not trigger suspend action because API called in the callback context
will increment the usage counter (when pm_device_runtime_get() is
called).

Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
2024-12-09 22:05:03 +00:00