Commit graph

15182 commits

Author SHA1 Message Date
Jakub Michalski
191d38dee8 posix: define POLLPRI in posix/poll.h
Add the POLLPRI constant defined by POSIX and test for it.

Signed-off-by: Jakub Michalski <jmichalski@antmicro.com>
Signed-off-by: Maciej Sobkowski <msobkowski@antmicro.com>
2024-12-07 14:17:11 +01:00
Jakub Michalski
f4cb7e35ec posix: define nfds_t in posix/poll.h
Add the nfds_t type defined by POSIX and test for it.

Signed-off-by: Jakub Michalski <jmichalski@antmicro.com>
Signed-off-by: Maciej Sobkowski <msobkowski@antmicro.com>
2024-12-07 14:17:11 +01:00
Chris Friedt
55db0d84a8 tests: posix: threads_ext: remove stale comment
For a long time now, it's been possible to call
`pthread_attr_init()` and have it just to The Right Thing (TM)
without having to statically assign a stack.

Remove the stale comment and commented-out code.

Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>
2024-12-07 14:16:34 +01:00
Artur Dobrynin
d11f726942 tests: bsim: bluetooth: using full nrf52bsim board name
Some places kept using partial nrf52bsim board name which led to
inconsistencies.

Signed-off-by: Artur Dobrynin <artur.dobrynin@nordicsemi.no>
2024-12-07 02:03:31 +01:00
Artur Dobrynin
cdec82e103 tests: bsim: bluetooth: host: enable on nrf5340bsim/nrf5340/cpunet
Some bluetooth host tests can be run on nrf5340bsim/nrf5340/cpunet.
This commit enables building and running these tests.

Signed-off-by: Artur Dobrynin <artur.dobrynin@nordicsemi.no>
2024-12-07 02:03:31 +01:00
Artur Dobrynin
9cae99c1d2 tests: bsim: bluetooth: host: streamline conf files
Currently different test cases within the same folder are using largely the
same config files with only subtle variations. It is better instead to have
a base config file with general configuration, aided by overlay files for
specific cases.

Signed-off-by: Artur Dobrynin <artur.dobrynin@nordicsemi.no>
2024-12-07 02:03:31 +01:00
Artur Dobrynin
e0f74cf1b0 tests: bsim: bluetooth: host: use twister to compile tests
Bluetooth host bsim tests are compiled with shell scripts, but it is
possible to use twister, which supports compilation (but not running
at the moment). Compiling with twister requires fewer shell scripts,
provides cleaner interface and more flexible configuration.

Signed-off-by: Artur Dobrynin <artur.dobrynin@nordicsemi.no>
2024-12-07 02:03:31 +01:00
Josuah Demangeon
25f56342da tests: lib: devicetree: Add tests for endpoint DT macros
Add tests for the new port / endpoint DT macros

Signed-off-by: Josuah Demangeon <me@josuah.net>
Signed-off-by: Phi Bang Nguyen <phibang.nguyen@nxp.com>
2024-12-06 22:23:31 +01:00
Manuel Argüelles
87798f9e16 arch: arm: rename CPU_HAS_NXP_MPU to align with binding
Following the binding rename to "nxp,sysmpu", update the Kconfig
option to align with the binding name and to better reflect the
option's purpose.

Signed-off-by: Manuel Argüelles <manuel.arguelles@nxp.com>
2024-12-06 22:23:06 +01:00
Jilay Pandya
030444822e drivers: stepper: api: rename stepper_set_target_pos to stepper_move_to
rename stepper_set_target_position to stepper_move_to in following files:
- doc/hardware/peripherals/stepper.rst
- doc/releases/migration-guide-4.1.rst
- drivers/stepper/adi_tmc/adi_tmc5041_stepper_controller.c
- drivers/stepper/fake_stepper_controller.c
- drivers/stepper/gpio_stepper_controller.c
- drivers/stepper/stepper_shell.c
- include/zephyr/drivers/stepper.h
- include/zephyr/drivers/stepper/stepper_fake.h
- tests/drivers/stepper/shell/src/main.c
- tests/drivers/stepper/stepper_api/src/main.c

Signed-off-by: Jilay Pandya <jilay.pandya@outlook.com>
2024-12-06 22:21:44 +01:00
Jilay Pandya
05e94ed234 drivers: stepper: api: rename stepper_move to stepper_move_by
rename stepper_move to stepper_move_by in following files:
- include/zephyr/drivers/stepper.h
- include/zephyr/drivers/stepper/stepper_fake.h
- doc/hardware/peripherals/stepper.rst
- doc/releases/migration-guide-4.1.rst
- drivers/stepper/adi_tmc/adi_tmc5041_stepper_controller.c
- drivers/stepper/fake_stepper_controller.c
- drivers/stepper/gpio_stepper_controller.c
- drivers/stepper/stepper_shell.c
- tests/drivers/stepper/shell/src/main.c

Signed-off-by: Jilay Pandya <jilay.pandya@outlook.com>
2024-12-06 22:21:44 +01:00
Andries Kruithof
6f180e49f9 Bluetooth: Audio: set correct project name in CMakeList.txt
Some of the unittests had an incorrect project name in the
CMakeList.txt file
This is corrected here

Signed-off-by: Andries Kruithof <andries.kruithof@nordicsemi.no>
2024-12-06 22:20:57 +01:00
Théo Battrel
d5d3ac7427 Tests: Bluetooth: Build Host with different configurations
The new `host_config_variants` goal is to be able to test specific set
of configurations when building the Host without the need of having a
specific application for it.

The first test check that the Host build correctly with
`CONFIG_BT_SMP_OOB_LEGACY_PAIR_ONLY` enabled.

Signed-off-by: Théo Battrel <theo.battrel@nordicsemi.no>
2024-12-06 18:20:21 +01:00
Emil Gydesen
e12096ee4a tests: Bluetooth: Tester: Increase RTT_MESSAGE_SIZE
Sets CONFIG_LOG_BACKEND_RTT_MESSAGE_SIZE=256 as some log
messages are longer than 128 (default) and may be truncated
with the existing configuration and implementation.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-12-06 15:17:55 +01:00
Emil Gydesen
829519dd6f Bluetooth: BAP: Add broadcast sink callback structs
These callbacks are trigger for changes that affect the entire
broadcast sink, such as the BIG synced and terminated events.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-12-06 15:17:06 +01:00
Emil Gydesen
0ae976166f Bluetooth: CAP: Add broadcast source callback structs
These callbacks are trigger for changes that affect the entire
broadcast source, such as the BIG started and terminated events.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-12-06 15:17:06 +01:00
Emil Gydesen
ab9ee0817d Bluetooth: BAP: Add broadcast source callback structs
These callbacks are trigger for changes that affect the entire
broadcast source, such as the BIG started and terminated events.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-12-06 15:17:06 +01:00
Krzysztof Chruściński
384e940c66 drivers: serial: nrfx_uarte: Deprecate CONFIG_UART_x_NRF_HW_ASYNC
Deprecate mode which is using TIMER+(D)PPI for reliable byte counting.
Recently a new approach is added (CONFIG_UART_NRFX_UARTE_ENHANCED_RX)
which supports reliable byte counting without additional HW resource.
This mode is planned to be the only supported RX path mode.

Enhanced RX has slightly different behavior. There are no partial RX
packets (events with non-zero offset). There is UART_RX_BUF_RELEASED
after each UART_RX_RDY event.

Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
2024-12-06 12:14:02 +01:00
Lucien Zhao
30c45057ae tests: drivers: pwm: pwm_api: support mimxrt1180_evk board
Set tpm5 status as ok
add pwm-0 as aliases

Signed-off-by: Lucien Zhao <lucien.zhao@nxp.com>
2024-12-06 12:13:54 +01:00
Alexander Svensen
49e5a0dc5a bluetooth: tester: audio: Add NULL checks
- Add NULL checks for broadcast_source_stop
- Add NULL checks for broadcast_source_release
- Return -ESRCH if trying to stop ext_adv before creation

Signed-off-by: Alexander Svensen <alexander.svensen@nordicsemi.no>
2024-12-06 12:13:03 +01:00
Neil Chen
765b3aac30 tests: drivers/adc/adc_api: Support adc api test for NXP frdm_mcxa156
Support adc api test for NXP frdm_mcxa156

Signed-off-by: Neil Chen <cheng.chen_1@nxp.com>
2024-12-06 10:01:26 +01:00
Chris Friedt
3f60489fae tests: benchmarks: move pthread_pressure to benchmarks/posix
The pthread_pressure test was not a typical test per se. It was
a benchmark in search of the proper home.

Let's move it to the correct place in the Zephyr tree, add a
doc, and provide some reporting.

Currently, k_threads out-perform pthreads by almost a factor of
2. The theoretical maximum performance of pthreads would be at
parity of k_threads, since pthreads are a wrapper around kernel
threads. It would be great to reduce the gap.

Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>
2024-12-06 06:51:13 +01:00
Josuah Demangeon
9e908b1b72 drivers: video: add emulated Imager driver and RX driver
Add a new implementation of a test pattern generator, with the same
architecture as real drivers: split receiver core and
I2C-controlled sub-device, with changes of video format in
"zephyr,emul-imager" leads to different data produced by
"zephyr,emul-rx".

Signed-off-by: Josuah Demangeon <me@josuah.net>
2024-12-05 20:00:21 -05:00
Josuah Demangeon
46a262ffe6 drivers: video: common: Add utilities to seek frmival/caps structures
Introduce a video_get_format_index() utility to help finding a caps
entry out of a given format. Introduce several utilities to seek and
apply frame intervals.

Signed-off-by: Josuah Demangeon <me@josuah.net>
2024-12-05 20:00:21 -05:00
Emil Gydesen
49a458e5aa tests: Bluetooth: Update PTS ICS with new spec versions
Added support for BAP 1.0.2, CSIS 1.01, PACS 1.0.2, PBP 1.0.1
Enabled support for extended adv in the LL (mandatory requirement)
Enabled support for multiple BIGs support in the LL.

Due to a bug in the BT qualification tool, the following
features are values in the .bqw file are manually added
<Feature>BAP 4/1</Feature>
<Feature>BAP 26/1</Feature>
<Feature>BAP 49/1</Feature>
<Feature>BAP 62/1</Feature>
<Feature>BAP 77/1</Feature>
<Feature>BAP 83/1</Feature>
<Feature>CSIP 3/1</Feature>
<Feature>CSIP 8/1</Feature>
<Feature>PBP 10/1</Feature>

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-12-05 16:13:55 -05:00
Dmytro Firsov
b3758a787c tests: kernel: exclude xenvm with GICv3 from device tests
The issue with mentioned test for GICv3 version of xenvm virtual
board is the same as for regular xenvm - device tree overlay for this
test overrides #address-cells and #size-cells property for original
device tree file (from 0x2 to 0x1), which leads to incorrect DT parsing
by actual Xen drivers. This causes build errors, so test should be
skipped for GICv3 platform too.

Same issue for regular xenvm was fixed by commit 40fe36669c ("tests:
kernel: exclude xenvm from device tests"). Issue for GICv3 appeared
after migrating to HWMv2.

Signed-off-by: Dmytro Firsov <dmytro_firsov@epam.com>
2024-12-05 22:09:31 +01:00
Andy Ross
da35377256 tests/boards/mtk_adsp: Handle protocol skew
Recent kernel drivers for some devices have swapped the mailbox device
used for replies.  It used to be that all commands in either direction
were sent on mbox0 and all replies on mbox1.  Now mbox0 handles
commands and replies for "DSP to Host" communication, and mbox1 is for
"Host to DSP".  Listen to both devices for our simple test.

Signed-off-by: Andy Ross <andyross@google.com>
2024-12-05 22:08:55 +01:00
Vinayak Kariappa Chettimada
fbbde51853 Revert "test: bsim: bt: fix test scripts"
This reverts commit 18119e8f6e.

Audio tests are enabled back, but change to random number
seed is retained for the multiple identity test.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2024-12-05 15:18:11 +01:00
Vinayak Kariappa Chettimada
ab478f543c Revert "tests: bsim: comment out some failing AC tests"
This reverts commit 1320b3dd66.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2024-12-05 15:18:11 +01:00
Emil Gydesen
0851cb2772 tests: Bluetooth: CAP: Acceptor bsim test use ext_adv
Remove a duplicated advertising set in the CAP acceptor babblesim
test. The advertising set is configured in test_start_adv.

The BSIM test for the CAP acceptor used legacy instead
of extended advertising.

This also adds the required advertising data and validation
on the CAP initiator and CAP commander.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-12-05 15:18:11 +01:00
TOKITA Hiroshi
1d40a7ee34 tests: lib: devicetree: add test for zephyr,memory-region-flags attr
Add a test for zephyr,memory-region-flags.

This test tests the attributes of memory regions defined in the linker
script, but this information cannot be obtained at runtime.
It verifies that the expected memory region attributes are defined in
the linker.cmd.

Since no syntax analysis is performed, this is not an entirely rigorous
test but sufficient for practical purposes.

Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
2024-12-05 06:39:46 -05:00
Andrew Featherstone
411c69234e tests: drivers: dma: Increase test coverage for RP2040
Increase test coverage for Raspberry Pi's RP2040. Use the `socs` folder
rather than `boards` to enable these tests to run on any boards with the
same SoCs.

Signed-off-by: Andrew Featherstone <andrew.featherstone@gmail.com>
2024-12-05 12:29:33 +01:00
TOKITA Hiroshi
2953c38948 tests: drivers: build_all: gpio: Add config for AW9523B
Add test configuration for "awinic,aw9523b".

Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
2024-12-05 07:44:58 +01:00
TOKITA Hiroshi
ef95203267 tests: drivers: gpio: gpio_basic_api: Add AW9523B test configuration
Add test configuration for Awinic AW9523B.

This device is a GPIO Expander, and no boards currently implement it.
Define the connection that connects it via the Arduino header and
define a fixture to enable it.

This has been confirmed with nucleo_h503rb.

Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
2024-12-05 07:44:58 +01:00
TOKITA Hiroshi
59a82ab357 tests: drivers: gpio: gpio_api_1pin: Add AW9523B test configuration
Add test configuration for Awinic AW9523B.

This device is a GPIO Expander, and no boards currently implement it.
Define the connection that connects it via the Arduino header and
define a fixture to enable it.

This has been confirmed with nucleo_h503rb.

Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
2024-12-05 07:44:58 +01:00
Audun Korneliussen
66ccc2e241 drivers: watchdog: npm2100: Add driver for npm2100 pmic
Add watchdog driver for npm2100 pmic.

This pmic has one timer that can be used for multiple functions,
including a watchdog that can reset or power-cycle connected devices.

Signed-off-by: Audun Korneliussen <audun.korneliussen@nordicsemi.no>
2024-12-04 14:19:53 -05:00
Audun Korneliussen
439d3b2973 drivers: sensor: npm2100: Add driver for npm2100 pmic
Add sensor driver for npm2100 pmic.

This pmic performs measurements of battery voltage, regulator voltage
and die temperature.

Configurable pmic attributes are also organized under this driver.

Signed-off-by: Audun Korneliussen <audun.korneliussen@nordicsemi.no>
2024-12-04 14:19:53 -05:00
Audun Korneliussen
f4443617d8 drivers: regulator: npm2100: Add driver for npm2100 pmic
Add regulator driver for npm2100 pmic.
This pmic has one boost and one ldo regulator.

Signed-off-by: Audun Korneliussen <audun.korneliussen@nordicsemi.no>
2024-12-04 14:19:53 -05:00
Audun Korneliussen
7fccb646cd drivers: gpio: npm2100: Add driver for npm2100 pmic
Add gpio driver for npm2100 pmic.

Signed-off-by: Audun Korneliussen <audun.korneliussen@nordicsemi.no>
2024-12-04 14:19:53 -05:00
Bansidhar P.M
da90ce571a tests: boards: nrf70: Add ztests for bus library
Add ztests for nrf70 bus lib to help validate functional integrity
of the QPSI/SPI interface to nRF70 device via appropriate reads/writes
from host processor to relevant memory blocks of nrf70 device.
Note that this will NOT serve as a memory test for nrf70 device,
rather just a functional verification of the wiring between the host
processor and the nrf70 device.

Signed-off-by: Bansidhar P.M <bansidhar.mangalwedhekar@nordicsemi.no>
2024-12-04 14:15:13 -05:00
Gerard Marull-Paretas
d4a67e321b samples, tests: remove usage of space-separated lists
Convert them to native YAML lists. Support for space-separated
lists was deprecated in Twister a long time ago.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2024-12-04 14:14:53 -05:00
Jilay Pandya
c4f044ed81 test: drivers: build_all: stepper: fix gpio stepper
fixes gpio stepper in build_all tests for stepper drivers

Signed-off-by: Jilay Pandya <jilay.pandya@outlook.com>
2024-12-04 14:14:07 -05:00
Matt Rodgers
ddaeb1379a net: http_server: fix header capture on concurrent http2 streams
Concurrent HTTP POST requests on different HTTP2 concurrent streams
require that the client's header_capture_context is re-used to capture
headers on a second stream before all of the body data has been received
(and sent to the application) on the first stream.

As a result, any captured headers must be sent to the application
callback before any headers can be received on a different stream. In
practice this means that for HTTP2 the application callback is called
for the first time on receiving a headers frame, before any data frames
are received. All subsequent application callbacks will not include the
request header data.

While this mechanism is not necessary for HTTP1, it is also updated to
only send headers in the first application callback for consistency.

Fixes #82273

Signed-off-by: Matt Rodgers <mrodgers@witekio.com>
2024-12-04 14:13:24 -05:00
Alberto Escolar Piedras
9a66eb5cbe tests/bsim: For nrf52bsim use full board name with qualifiers
So when building with twister we get the same executable name
as with compile.sh

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-12-04 16:12:18 +01:00
Alberto Escolar Piedras
77fd5f4ecc tests/bsim conn_stress/scripts/_conn_stress.sh: Fix
This custom test script had rotten and was not working.
Let's fix it.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-12-04 16:12:06 +01:00
Alberto Escolar Piedras
8310017dd3 tests/bsim/bluetooth/ll/_compile_permutate_kconfigs: Update
This test was starting to rot: BOARD should have been replaced
with BOARD_TS. Let's also remove a few duplicate checks
and definitions.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-12-04 16:12:06 +01:00
Alberto Escolar Piedras
7cd64a33a4 tests/bsim: Fix host/gatt/notify_multiple _notify-debug
This custom debug script had rotten, let's fix it.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-12-04 16:12:06 +01:00
Sergey Korotkov
2ee0e38929 Bluetooth: Host: more secure defaults for key size and legacy pairing
Default the Minimum encryption key size to 16.
Key with reduced size is easier to brut force.
Disable LE legacy pairing by default since it's not secure.

These defaults should suite majority of newly developed applications.
It's better to use sensible more secure defaults,
so applications that really need less secure option consciously change it,
not the other way around.
This may help to prevent downgrade attacks.

Signed-off-by: Sergey Korotkov <sergey.korotkov@nordicsemi.no>
2024-12-04 12:10:54 +01:00
Stine Akredalen
6c0306622e Bluetooth: fix GATT service reregistering
* Fixed issue with reregistering of GATT services.
* Added unit tests covering the GATT reregistering scenario.

Signed-off-by: Stine Åkredalen <stine.akredalen@nordicsemi.no>
2024-12-04 12:10:22 +01:00
Jilay Pandya
af68d97507 drivers: stepper: api: rename enable_constant_velocity_mode to run
rename enable_constant_velocity_mode to run in following files:
- include/zephyr/drivers/stepper.h
- include/zephyr/drivers/stepper/stepper_fake.h
- doc/hardware/peripherals/stepper.rst
- doc/releases/migration-guide-4.1.rst
- drivers/stepper/adi_tmc/adi_tmc5041_stepper_controller.c
- drivers/stepper/fake_stepper_controller.c
- drivers/stepper/gpio_stepper_controller.c
- drivers/stepper/stepper_shell.c
- tests/drivers/stepper/shell/src/main.c

Signed-off-by: Jilay Pandya <jilay.pandya@outlook.com>
2024-12-04 09:24:05 +01:00