Commit graph

16229 commits

Author SHA1 Message Date
Emil Gydesen
ee335399c1 Bluetooth: Audio: Use generic count_bits to count bits
Instead of re-implementing or assuming that POPCOUNT is available
we now use the generic function from Zephyr.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2025-03-17 21:03:56 -04:00
Emil Gydesen
d05de070db include: util: Add generic function to count bits set in a value
Adds a generic function that will count the number of bits set in
a value.

It uses POPCOUNT (e.g. __builtin_popcount for GCC) if available,
or else it will use Brian Kernighan’s Algorithm to count bits.

POPCOUNT will likely always support unsigned ints, but the function
was implemented to use it with uint8_t for the sake of simplicity
and compatibility with Brian Kernighan’s Algorithm.

A generic solution was chosen rather than a macro/function per
type (e.g. uint8_t, uint16_t, etc.) as that is easier to maintain
and also supports array types (e.g. counting the number of bits
in 128 or 256 octet arrays).

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2025-03-17 21:03:56 -04:00
Luca Burelli
a6584d5b2b llext: add test for section and symbol alignment
Add a test case for the alignment support in loadable extensions. This
test case creates a set of constants with specific alignment requirements
and verifies that they are placed in memory as expected.

Fix the detached section test to use a more standard syntax for the
section attribute, avoiding issues with different toolchains.

Signed-off-by: Luca Burelli <l.burelli@arduino.cc>
2025-03-17 19:58:15 +01:00
Jukka Rissanen
ac3cb9dac0 net: Change the net_linkaddr struct to not use pointers
Previously the net_linkaddr struct had pointers to the link address.
This is error prone and difficult to handle if cloning the packet as
those pointers can point to wrong place. Mitigate this issue by
allocating the space for link address in net_linkaddr struct. This will
increase the size of the net_pkt by 4 octets for IEEE 802.15.4 where the
link address length is 8, but there no increase in size if link address
is 6 bytes like in Ethernet/Wi-Fi.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2025-03-17 16:25:22 +01:00
Jukka Rissanen
fedd815c1e tests: net: utils: Verify src and dst link addresses
Make sure that source and destination link addresses are correct
after cloning and pulling net_pkt.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2025-03-17 16:25:22 +01:00
Vinayak Kariappa Chettimada
64ea1b8696 tests: bsim: Bluetooth: broadcast_audio_source interleaved/sequential
Test broadcast audio source sample in interleaved and
sequential packing.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2025-03-17 16:24:33 +01:00
Vinayak Kariappa Chettimada
872b19321f tests: bsim: Bluetooth: Test for single BIS with interleaved packing
Test for single BIS with interleaved packing or sequential
packing requested.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2025-03-17 16:24:33 +01:00
Alexander Svensen
33b4faed9c test: bluetooth: tester: Fix regression in PBP
- Allocate source in PBP first time adv is created
- Only set_adv_data in adv_setup if ext_adv already exists
- Fixes regression in PTS for PBP tests

Signed-off-by: Alexander Svensen <alexander.svensen@nordicsemi.no>
2025-03-17 13:57:41 +01:00
Sai Santhosh Malae
c6198008f5 drivers: watchdog: siwx91x: Add siwx91x WDT driver
Implement Watchdog driver for siwx91x device

Signed-off-by: Sai Santhosh Malae <Santhosh.Malae@silabs.com>
2025-03-17 13:56:24 +01:00
Arif Balik
5d3113e5e1 tests: misc: added stm32 tsc driver test implementation
integration tests for stm32 tsc

Signed-off-by: Arif Balik <arifbalik@outlook.com>
2025-03-17 13:55:48 +01:00
Nhut Nguyen
9077d46c5d drivers: gpio: Add support for RZ/T2L
Add GPIO driver support for RZ/T2L

Signed-off-by: Nhut Nguyen <nhut.nguyen.kc@renesas.com>
Signed-off-by: Hieu Nguyen <hieu.nguyen.ym@bp.renesas.com>
2025-03-17 09:26:13 +01:00
Peter Mitsis
1c5072780f tests: thread_metric: Fix cooperative for SMP
The thread metric cooperative benchmark had a subtle flaw on
SMP enabled systems. The reporting/main thread was running at
a higher priority than the "cooperative" threads. When that
reporting thread woke up from its 30 second sleep, there was a
chance that it would change the ordering of the "cooperative"
threads before the test expected it.

This ordering change is not present on UP systems as the current
thread is always in the ready queue. However, on SMP systems the
current thread is not in the ready queue and is re-added to the
end of the list when it is preempted by a higher priority thread.

To work around this, we make the priority of the main/reporting
thread to be the same as the "cooperative" threads. Thus when
the reporting thread wakes, it is added to the end of list and
no longer introduces an unexpected schedule point.

Signed-off-by: Peter Mitsis <peter.mitsis@intel.com>
2025-03-17 07:05:36 +01:00
Nicolas Pitre
023daf2331 tests/lib/heap_align: improve test some more
- Make sure the align-and-rewind feature is explicitly tested.

- Add sub-unit allocations to the mix.

- Rely on some heap internal facilities  to determine heap boundaries
  (32- vs 64-bit builds do cause a difference).

Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
2025-03-17 02:21:27 +01:00
Utsav Munendra
9379c35dbf portability: cmsis: Clarify Kconfig set max limit on dynamic objects
Clarify that all max limit on RTOS objects set by Kconfig only apply
to objects whose control blocks were dynamically allocated. The
CMSIS-RTOSv2 impl layer itself does not restrict the number of
statically created RTOS objects.

Signed-off-by: Utsav Munendra <utsavm@meta.com>
2025-03-17 02:21:15 +01:00
Utsav Munendra
c006922b22 portability: cmsis: Remove max limit on new statically created threads
Clarify thread Kconfigs to denote the maximum number of dynamically
allocated control blocks and stacks for threads. Allow application to
create any number of threads with statically allocated control block
and stack.

Signed-off-by: Utsav Munendra <utsavm@meta.com>
2025-03-17 02:21:15 +01:00
Sai Santhosh Malae
935c8e4701 drivers: pwm: siwx91x: Add siwx91x PWM driver
Implement PWM driver for siwx91x device

Signed-off-by: Sai Santhosh Malae <Santhosh.Malae@silabs.com>
2025-03-15 06:43:58 +01:00
Chia-Yang Lin
bd365a0bae drivers: rtc: rts5912: add rtc driver
Add rtc driver for Realtek rts5912.

Signed-off-by: Chia-Yang Lin <cylin0708@realtek.com>
2025-03-15 06:43:46 +01:00
Anas Nashif
f29ae72d79 kernel: rename 'dumb' scheduler and simply call it 'simple'
Improve naming of the scheduler and call it what it is: simple. Using
'dumb' for the default scheduler algorithm in Zephyr is a bad idea.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2025-03-15 00:34:58 +01:00
Declan Snyder
ad431b3c1a tests: spi_loopback: Fix frdm_ke17z overlay
The ke17z overlay for this test is incorrect in that the chip select
line sent to the spi pins on the header is PCS1, not PCS0. This is
having no functional effect on the test right now but soon I am trying
to implement a chip select test, and regardless it helps to have the CS
actually toggle right now for debugging purposes.

Also, I checked the frdm_ke17z512 and it looks like the board pinctrl
file is configuring for PCS2, so I fixed that as well because it looks
also like the same mistake, but I don't have that hardware.

Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
2025-03-14 17:56:28 +01:00
Daniel Leung
1530e86877 tests: kernel/pipe_api: move local k_pipe var to global
When CONFIG_KERNEL_COHERENCE is enabled, pend_locked() asserts
when wait_q is not in coherent memory. The k_pipes used in
the pipe_api tests are declared locally within the test. They
are located within the thread stacks and those wait_q inside
k_pipe struct are thus not considered in coherent memory.
To make them work, replace the local ones with a global
k_pipe object. Since each test initializes the pipe object
locally, the tests are not functionally changed.

Fixes #84235

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2025-03-14 17:55:50 +01:00
Daniel Leung
289f80f4a1 tests: zbus/hlp_priority_boost: use 1cpu setup
The zbus hlp_priority_boost test requires thread priority
boosting. If it is running SMP, it is possible that
the message has already been processed before the check
for priority boosting is done, thus failing the test.
So change the test to use 1 CPU only.

Fixes #79197

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2025-03-14 17:55:41 +01:00
Lucien Zhao
483796888d boards: nxp: mimxrt700_evk: enable wwdt0 as watchdog0 for cm33_cpu0
enable wwdt0 as watchdog0.
test wdt_basic_api case passed(Only support cm33_cpu0 core).

Signed-off-by: Lucien Zhao <lucien.zhao@nxp.com>
2025-03-14 17:53:53 +01:00
Declan Snyder
08351250db tests: spi_loopback: nxp: remove lpspi async=n cfg
Remove the overlay files for many of the NXP platforms, because they
were doing two things that are no longer relevant:

1) CONFIG_SPI_ASYNC=n -> LPSPI driver used to not work with
   CONFIG_SPI_ASYNC, now it does, so we should test it.
2) CONFIG_SPI_MCUX_LPSPI_DMA=y -> This is redundant with the
   testcase.yaml

Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
2025-03-14 17:53:24 +01:00
Krzysztof Chruściński
bec4a84749 tests: drivers: counter: basic_api: Add nrf54l15dk_nrf54l15_cpuflpr
Add overlay for nrf54l15dk_nrf54l15_cpuflpr target.

Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
2025-03-14 14:52:12 +01:00
Tomi Fontanilles
b920686812 tests: secure_storage: enable entropy driver if available
On top of enabling and allowing test entropy sources, enable
CONFIG_ENTROPY_GENERATOR so that a real driver and entropy source gets
used if available.
This is needed for some PSA Crypto implementations that have random number
generation conditionally compiled in.

Signed-off-by: Tomi Fontanilles <tomi.fontanilles@nordicsemi.no>
2025-03-14 14:51:58 +01:00
Tomi Fontanilles
f50c3d9d26 tests: secure_storage: its: increase stack sizes
Some implementations require more stack than others.
Increase the Ztest and main stack sizes to accommodate them.

Signed-off-by: Tomi Fontanilles <tomi.fontanilles@nordicsemi.no>
2025-03-14 14:51:58 +01:00
Tomi Fontanilles
eb1ed1205f secure_storage: use hybrid key store in samples/tests
Use dynamic allocation for key material for
better compatibility as a fully static key store is a new
feature that not all PSA Crypto implementations support.

Explicitly enable CONFIG_MBEDTLS_ENABLE_HEAP to ensure that Mbed TLS uses
heap for the PSA keys' data (instead of failing at runtime).
This will turn off CONFIG_MBEDTLS_PSA_STATIC_KEY_SLOTS, making the
implementation default to dynamic key slots.

Signed-off-by: Tomi Fontanilles <tomi.fontanilles@nordicsemi.no>
2025-03-14 14:51:58 +01:00
Tomi Fontanilles
25ad578694 secure_storage: enable CONFIG_ENTROPY_GENERATOR in samples/tests
Explicitly enable CONFIG_ENTROPY_GENERATOR instead of relying on the
build system's defaults.

This:
- Makes sure the filtering works properly between entropy_driver and
entropy_not_secure test scenarios for the samples.
- Helps with TF-M builds in certain scenarios where key generation (via
`psa_generate_key()`) would fail due to the RNG functionality being
disabled.

Signed-off-by: Tomi Fontanilles <tomi.fontanilles@nordicsemi.no>
2025-03-14 14:51:58 +01:00
Tomi Fontanilles
744e9f70f4 tests: secure_storage: psa: crypto: improve compatibility
The psa_key_attributes_t type is implementation-defined according to
the PSA Crypto spec.
Compare its fields individually instead of doing a memcmp() over the
entire struct.

Signed-off-by: Tomi Fontanilles <tomi.fontanilles@nordicsemi.no>
2025-03-14 14:51:58 +01:00
Tomi Fontanilles
62fe34dd02 secure_storage: improve tests' compatibility in TF-M-enabled scenarios
Explicitly set the TF-M profile to not rely on the build system defaults
which might differ.

Signed-off-by: Tomi Fontanilles <tomi.fontanilles@nordicsemi.no>
2025-03-14 14:51:58 +01:00
Andreas Klinger
72b2f01298 drivers: sensor: add vishay veml6031 ambient light sensor
- add driver for Vishay VEML6031 High Accuracy Ambient Light Sensor.
- add new compatible "vishay,veml6031".
- read and write consecutive 8 bit registers as bulk operation.
- add driver to build all test of sensors.
- support fetch and get.
- triggered mode and interrupt is not yet supported.

Signed-off-by: Andreas Klinger <ak@it-klinger.de>
2025-03-14 14:40:12 +01:00
Sebastian Głąb
2e23dfd401 tests: drivers: audio: dmic_api: Enable test execution on nrf54l15
Enable execution of dmic_api test on nrf54l15:
- add 'dmic' to the list of supported peripherals;
- add overlay for nrf54l15;
- align Nordic's implementation of PDM driver to pass the test.

Signed-off-by: Sebastian Głąb <sebastian.glab@nordicsemi.no>
2025-03-14 09:24:16 +01:00
Verena Schweinstetter
a1c3131949 tests: drivers: Add test case for allegro a4979
Adding a test case for stepper driver implementation of
allegro a4979 microstepping programmable stepper motor driver.

Signed-off-by: Verena Schweinstetter <verena.schweinstetter@zeiss.com>
2025-03-14 09:23:57 +01:00
Quang Le
b7f99ffbdd drivers: gpio: Add support for RZ/N2L
Add GPIO driver for RZ/N2L

Signed-off-by: Quang Le <quang.le.eb@bp.renesas.com>
Signed-off-by: Nhut Nguyen <nhut.nguyen.kc@renesas.com>
2025-03-14 09:23:50 +01:00
Tien Nguyen
7e39286441 tests: drivers: dma: Add support for RZ/G3S-SMARC
Enable DMA driver tests for RZ/G3S-SMARC

Signed-off-by: Tien Nguyen <tien.nguyen.zg@renesas.com>
Signed-off-by: Nhut Nguyen <nhut.nguyen.kc@renesas.com>
2025-03-14 09:16:42 +01:00
Lyle Zhu
ec1b384917 tests: Bluetooth: BR: Add test suite sdp_client
IUT works as a SDP Client. The peer device, SDP server, is a PC with
running `bumble` on it.

Add shell command `discovery` to discover specific SDP record
according to specific UUID.

In the test suite, there are three groups test cases,
Group 1 is for Service Search Attribute transaction.
Group 2 is for Service Search transaction.
Group 3 is for Service Attribute transaction.

For each test group, there are four test cases,
Case 1, No SDP record is registered on PC. IUT should not find any SDP
record.
Case 2, A2DP source SDP record is registered on PC. IUT can find SDP
record. And the discovered PSM and version should be same with
registered.
Case 3, A2DP source and HFP HF SDP Records are registered. IUT can
find SDP record. And the discovered RFCOMM channel and HFP version
should be same with registered. This case is used to test the
"continuation state information".
Case 4, Multiple SDP Records are registered. This case is used to test
 the "continuation state information". And also it used to test the
total length exceeds the ACL RX Buffer Size.

Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
2025-03-14 05:46:12 +01:00
Emil Gydesen
bd254eea25 tests: Bluetooth: Tester: Fix bad memset in btb_bap_broadcast
btp_bap_broadcast_local_source_free used &source, but since
source was already a pointer, it should just use source.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2025-03-14 01:02:22 +01:00
Chaitanya Tata
ac8c28f7b7 tests: drivers: nrf_wifi: Fix the tags
When the only changes are nrf_wifi module the twister runs with tag
"nrf_wifi" and restricts tests, and that excludes this test as well.

Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
2025-03-14 01:01:07 +01:00
Emil Gydesen
25f3de75a2 tests: Bluetooth: CAP: Fix issues for CAP BSIM tests
Some CAP BSIM could not be built after some commits were merged.
One CAP test was missing a call to backchannel_sync_send_all
A change in the controller and/or timing seems to have triggered
an old issue on a bunch of tests. Theses tests have been disabled
while the issue is pending investigation.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2025-03-13 18:05:12 +01:00
Fabio Baltieri
60a9a202df kscan: drop kscan and any reference
Drop the whole kscan subsystem and reference to it.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2025-03-13 16:56:26 +00:00
Emil Gydesen
501b95ff9b Bluetooth: CSIP: Rename BT_CSIP_SET_MEMBER_NOTIFIABLE
Renamed BT_CSIP_SET_MEMBER_NOTIFIABLE to
BT_CSIP_SET_MEMBER_SIRK_NOTIFIABLE to be more specific.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2025-03-13 16:56:14 +00:00
Luis Ubieda
2bc963bfea tests: paa3905: Add node to Build-All tests
Basic, build time validation. No streaming validation supported by this
test, though.

Signed-off-by: Luis Ubieda <luisf@croxel.com>
2025-03-13 16:56:07 +00:00
Vincent van der Locht
21f839b754 tests: net: mdns: updated interface to match unicast MDNS function
To add the functionality conform rfc6762 chapter 6.7  the interface for
setup_dst_addr(...) has changed. This patch fixes the interface mismatch

Signed-off-by: Vincent van der Locht <vincent@synchronicit.nl>
2025-03-13 16:54:24 +00:00
Emil Gydesen
b2310b69bb tests: Bluetooth: Tester: Do not send MICP Mute ev on write cb
When the BT Tester gets the write response, it should not send
the state change event, as the write response may come
before the notifications, and in which case the state may
not have changed.

The BT Tester should always wait for the state change notification
before sending the event.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2025-03-13 10:49:35 +01:00
Sebastian Głąb
321fcaf44d boards: nordic: nrf54l20pdk: Add SPI to the supported peripherals
Enable Twister tests of SPI peripheral on nRF54L20pdk.

Signed-off-by: Sebastian Głąb <sebastian.glab@nordicsemi.no>
2025-03-13 10:48:30 +01:00
Emil Gydesen
5918427278 Bluetooth: Host: Make bt_le_addr_is_bonded public
Some GATT services and profiles define specific behavior
based on whether the remote device is bonded or not.
The internal function, bt_addr_le_is_bonded, is the
only function to do this, but it was kept internal,
and could thus not be used for those services
without including hci_core.h.

The function has been moved to the public API
so that application can determine if a remote
address is bonded or not, and has been renamed
to not use the bt_addr namespace, but rather the
bt_le.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2025-03-13 10:48:19 +01:00
Emil Gydesen
b8a9f1f3ed tests: Bluetooth: CAP: Refactor CAP broadcast tests to multiple tests
The cap_broadcast test has been split into 3 tests:
1) Regular test
2) Regular test with metadata update
3) Test for invalid parameters

This will make it easier to use the regular cap_broadcast test
for other test cases, as it does less now.
It also makes each test run faster seperately and reduce their
scopes.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2025-03-13 10:28:19 +01:00
Emil Gydesen
1148b9ac3e tests: Bluetooth: CAP and GMAP: Add TX/RX for AC tests
Add TX and RX verification for the audio configuration tests.
This requires modifying some of the underlying structures
used in those tests, as well as initializating and triggering
TX, and with verification of RX as well.

These tests were implemented to ensure that the streams are not
just established, but can send ISO data without issues.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2025-03-13 10:28:10 +01:00
Emil Gydesen
1f26899229 Bluetooth: TBS: Ensure sending notifications
The existing implemented only attempted to send all notifications,
but if host was out of ATT TX buffers the notifications would fail
and the client may miss out on important information, and would be
a spec violation.

This commit refactors notificatios in TBS so that they are always
sent.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2025-03-13 10:27:59 +01:00
Maureen Helm
b72deba645 tests: drivers: build_all: Keep sensor conf files sorted
Adds zephyr-keep-sorted-start and zephyr-keep-sorted-stop directives to
keep tests/drivers/build_all/sensor/*.conf sorted.

Signed-off-by: Maureen Helm <maureen.helm@analog.com>
2025-03-13 07:40:54 +01:00