Commit graph

16700 commits

Author SHA1 Message Date
Josh DeWitt
0ae0c3dc44 linker: Allow for 999 priority levels in init levels
Some projects may have needs for more than 99 priority levels, so add
a third linker input section for each obj level.

Signed-off-by: Josh DeWitt <josh.dewitt@garmin.com>
2025-03-19 18:53:22 -04:00
Josh DeWitt
da867dbcfc tests: Ensure the maximum expected SYS init priority works
Add a test to ensure that the max expected 2-digit SYS init priority
works.

Signed-off-by: Josh DeWitt <josh.dewitt@garmin.com>
2025-03-19 18:53:22 -04:00
Jilay Pandya
71947627ce tests: stepper_api: add a4979 to common stepper api tests
Add a4979 to common stepper api test

Signed-off-by: Jilay Pandya <jilay.pandya@outlook.com>
2025-03-19 20:27:35 +01:00
Lyle Zhu
0e792d4271 Bluetooth: BR: Shell: L2CAP mode support
Add more parameters to command `connect` and `register`, including mode,
mode_optional, extended_control, and hold_credit.

Add command `credits` to give the rx credit.

Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
2025-03-19 08:52:07 -04:00
Anas Nashif
b0792bbfa2 twister: config: test on integration plaforms if defined
Add option to force integration mode on a defined list of tests, for
example tests for sample that are identified with 'sample.'.

A sample per definition shall be tested on documented and supported
platforms listed in the sample documentation. Samples shall not be used
as tests to verify functionality of a feature on all available plaforms
in Zephyr.

To still allow testing on platforms not listed in the doc, and when such
platforms are covered by the provided filter, we should still be able to
build/run the tests on those platforms (not directly listed in
integration_platforms).

We detect a sample by its test identifier, i.e., it starts with 'sample.'.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2025-03-19 08:51:50 -04:00
Emil Gydesen
065dca7e92 Bluetooth: ISO: Make setting ISO data explicit
The stack will no longer implicitly set the data path
for ISO channel, and the responsibility for doing that is
now for the upper layers/applications.

This provides additional flexibility for the higher layers
as they can better control the values and timing of the data
path, as well as support removing and even reconfiguring the
data path at will.
This also removes some complexity from the stack.

This commit also fixed a inconsistency in the disconnected
handler. CIS for centrals as well as BIS were still valid
bt_iso_chan channels in the disconnected callback,
but CIS for peripherals were completely cleaned up at this
point. This issue is fixed by moving the disconnected callback
handling to before the code to cleanup the channel for
peripherals.

Since there is a difference in how you remove data paths
depending on the GAP role (central/peripheral), the
iso_info struct type has been expanded to be more
concise of which type of CIS it is.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2025-03-19 10:56:57 +01:00
Nhut Nguyen
a853460382 tests: arch: arm64: arm64_high_address: Exclude Renesas RZ/A3UL SMARC
Exclude RZ/A3UL SMARC board as the redefined CONFIG_SRAM_BASE_ADDRESS
degrades the BUILD_OUTPUT_ADJUST_LMA option that will generate a bin
file >10GB

Signed-off-by: Nhut Nguyen <nhut.nguyen.kc@renesas.com>
2025-03-19 03:34:15 +01:00
Nhut Nguyen
16c77ba448 drivers: gpio: Add support for RZ/A3UL
Add GPIO driver support for RZ/A3UL

Signed-off-by: Nhut Nguyen <nhut.nguyen.kc@renesas.com>
Signed-off-by: Quang Le <quang.le.eb@bp.renesas.com>
Signed-off-by: Tien Nguyen <tien.nguyen.zg@renesas.com>
2025-03-19 03:34:15 +01:00
Aksel Skauge Mellbye
5d08177276 tests: drivers: adc: Add support for xg24_rb4187c
Add overlays and enable support for xg24_rb4187c in ADC tests.

Signed-off-by: Aksel Skauge Mellbye <aksel.mellbye@silabs.com>
2025-03-19 01:23:24 +01:00
Lyle Zhu
144d329130 test: Bluetooth: BR: Add label platform_allow
Add label `platform_allow` to limit the allowed platforms.

Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
2025-03-18 16:45:09 +01:00
Aksel Skauge Mellbye
4d6efb2302 tests: kernel: sleep: Add Silabs adjustment to max limit
Several devices have hardware-specific additional limits for
how short a sleep cycle can be. Add an entry for devices based
on Silabs sleeptimer when the OS tick rate is equal to the timer
frequency.

Signed-off-by: Aksel Skauge Mellbye <aksel.mellbye@silabs.com>
2025-03-18 16:42:42 +01:00
Sebastian Głąb
13ede4ecc1 tests: drivers: spi: Tests SPI at 16 and 32 MHz on nRF54 devices
Extend spi_loopback test on nRF54 chip family.
Add configurations to run this test at 8/16/32 MHz.

Signed-off-by: Sebastian Głąb <sebastian.glab@nordicsemi.no>
2025-03-18 16:40:37 +01:00
Sebastian Głąb
c42513a134 tests: drivers: i2s: Add tests at typical audio sample rates
Add short transfer test at 8000, 16000, 32000, 44100, 48000, 88200
and 96000 frame clock frequency.

Add KConfigs to skip test cases based on value of sample rate.

Add configuration for nrf5340dk where i2s peripheral is clocked
from ACLK.

Signed-off-by: Sebastian Głąb <sebastian.glab@nordicsemi.no>
2025-03-18 16:40:28 +01:00
Jilay Pandya
0a4acd8ee8 dts: bindings: spi: use hyphen instead of underscore
use hyphen instead of underscore in order to comply with device tree
specification.

Signed-off-by: Jilay Pandya <jilay.pandya@outlook.com>
2025-03-18 16:40:19 +01:00
Emil Gydesen
351805435c Revert "include: util: Add generic function to count bits set in a value"
This reverts commit d05de070db.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2025-03-18 16:39:47 +01:00
Emil Gydesen
fb68b4be7e Revert "Bluetooth: Audio: Use generic count_bits to count bits"
This reverts commit ee335399c1.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2025-03-18 16:39:47 +01:00
Emil Gydesen
fadaae42f0 Revert "tests: kernel: adopt new count_bits util function"
This reverts commit e34270519e.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2025-03-18 16:39:47 +01:00
Raymond Lei
3610724174 test: spi: spi_loopback: fix a typo in frdm_mcxn236.overlay
Fix a typo in the comments of how to connect HW pins for loopback test.

Signed-off-by: Raymond Lei <raymond.lei@nxp.com>
2025-03-18 08:27:12 +01:00
The Nguyen
e2780b2642 tests: watchdog: add support for Renesas RA boards
Add Renesas RA board support for this tests:
- tests/drivers/watchdog/wdt_basic_reset_none

Signed-off-by: The Nguyen <the.nguyen.yf@renesas.com>
2025-03-18 08:26:40 +01:00
Tom Hughes
481a3c77c9 tests: lib: cmsis_dsp: Fix -Wsometimes-uninitialized warning
Building with clang warns:

tests/lib/cmsis_dsp/distance/src/u32.c:82:3: error: variable 'val' is
used uninitialized whenever switch default is taken
[-Werror,-Wsometimes-uninitialized]
                default:
                ^~~~~~~
tests/lib/cmsis_dsp/distance/src/u32.c:87:19: note: uninitialized use
occurs here
                output[index] = val;
                                ^~~
tests/lib/cmsis_dsp/distance/src/u32.c:47:16: note: initialize the
variable 'val' to silence this warning
                float32_t val;
                             ^
                              = 0.0

Hitting the default switch will assert, so this won't cause any problems
as written, but it doesn't hurt to initialize the variable.

Signed-off-by: Tom Hughes <tomhughes@chromium.org>
2025-03-18 08:24:56 +01:00
Benjamin Cabé
e34270519e tests: kernel: adopt new count_bits util function
Adopt new count_bits helper from util.h and avoid
having conflicting definition

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2025-03-18 08:24:16 +01:00
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