Commit graph

13543 commits

Author SHA1 Message Date
Sebastian Głąb
89489d6e2d tests: drivers: counter: counter_nrf_rtc: Run test on nrf54h20
Add nrf54h20dk to platform allow list.
Overlay for tht target was already added.

Signed-off-by: Sebastian Głąb <sebastian.glab@nordicsemi.no>
2024-05-28 18:55:01 +02:00
Adam Kondraciuk
2cd2d5fef3 tests: drivers: timer: grtc: Fix GRTC test
The `z_nrf_grtc_timer_get_ticks()` function converts system ticks
to GRTC ticks. It gets the current system tick to calculate an
absolute GRTC value. The same does the test function to provide
an argument to be converted. If the system tick occurs between those
`sys_clock_tick_get()` calls the `z_nrf_grtc_timer_get_ticks()` will
take into account the newer tick while the test estimate bases on
the old tick value. Due to that the maximum result error is 1 system
tick minus 1 GRTC tick which equals (`CYC_PER_TICK` - 1) for GRTC
ticks.

Signed-off-by: Adam Kondraciuk <adam.kondraciuk@nordicsemi.no>
2024-05-28 18:53:39 +02:00
Rubin Gerritsen
ff80c0b926 Bluetooth: Host: Fix connection establishment upon RPA timeout
Before this commit, the following bugs were present:
- When `CONFIG_BT_FILTER_ACCEPT_LIST` was set, connection establishment
  was cancelled upon RPA timeout. This required the application
  to restart the initiator every RPA timeout.
- When `CONFIG_BT_FILTER_ACCEPT_LIST` was not set, the RPA was not updated
  while the initiator was running.

This commit unifies the RPA timeout handling for both these cases.
Upon RPA timeout the initiator is cancelled and restarted when
the controller raises the LE Connection Complete event.
The workqueue state is checked when restarting the initiator to prevent
it being restarted when the timeout is hit.

Corresponding test cases have been added to ensure that this
feature works.

Signed-off-by: Rubin Gerritsen <rubin.gerritsen@nordicsemi.no>
2024-05-28 09:12:05 -07:00
Rubin Gerritsen
3ce106c620 Bluetooth: Host: Fix not clearing IDs and keys upon bt_disable()
Expectation: After calling `bt_disable()` it is possible to
use the Bluetooth APIs as if `bt_enable()` was never called.

This was not the case for `bt_id_create()`, it was not possible
to set the default identity. This prevented an application
developer to restart the stack as a different identity.

Keys also need to be cleared to avoid the following pattern:
1. Pair two devices
2. Central calls `bt_disable()` and `bt_enable()`.
   The central will now generate a new identity address.
3. Connect the two devices.
4. Re-establish encryption. Now the central will try to use
   the previously used keys. The procedure will fail
   because the peripheral does not have any keys associated
   with the new central address.

The API documentation is updated accordingly.

Signed-off-by: Rubin Gerritsen <rubin.gerritsen@nordicsemi.no>
2024-05-28 09:11:52 -07:00
Fin Maaß
cd0c67f35a tests: kernel: add test for k_realloc
add test for k_realloc.

Co-authored-by: Yong Cong Sin <ycsin@meta.com>
Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
2024-05-28 17:55:12 +02:00
Jukka Rissanen
6465e73825 tests: net: dns_resolve: Increase the number of socket descriptors
The test needs couple of more socket/file descriptors to work because
CONFIG_POSIX_API creates three more file descriptors namely the
stdin, stdout and stderr descriptors.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2024-05-28 17:49:59 +02:00
Mark Wang
5a8652b0c2 tests: bluetooth: shell: test a2dp on mimxrt1060_evk + murata 1xk
add the mimxrt1060_evk hci uart overlay file.

Signed-off-by: Mark Wang <yichang.wang@nxp.com>
2024-05-28 12:56:42 +02:00
Mark Wang
c56183529c tests: bluetooth: shell: add a2dp shell test
implement the current a2dp APIs test.
update the document.

Signed-off-by: Mark Wang <yichang.wang@nxp.com>
2024-05-28 12:56:42 +02:00
Michał Szprejda
959ea1a172 resc: cmake: robot: Rename Renode variable
Rename Renode variable used to store the .elf file path from `bin` to
`elf` for consistency.

Signed-off-by: Michał Szprejda <mszprejda@antmicro.com>
2024-05-28 12:54:52 +02:00
Franck Thebault
c12cfb247d tests: drivers: i2s: speed: add stm32h5 support
Test on STM32H573i disco board , only the Tx transfer is ok.

Signed-off-by: Franck Thebault <franck.thebault@st.com>
Signed-off-by: IBEN EL HADJ MESSAOUD Marwa <marwa.ibenelhadjmessaoud-ext@st.com>
2024-05-28 12:51:00 +02:00
Krzysztof Chruściński
4a61fa32f0 tests: drivers: gpio: gpio_basic_api: Add nrf54h20dk overlays
Add overlays for nrf54h20dk_nrf54h20 cpuapp and cpurad.

Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
2024-05-28 10:08:09 +02:00
Bjarki Arge Andreasen
000784b91d modem: chat: Add runtime APIs for chat scripts
Add runtime APIs for chat scripts.

Signed-off-by: Bjarki Arge Andreasen <bjarki@arge-andreasen.me>
2024-05-28 10:02:06 +02:00
Bjarki Arge Andreasen
2a575a6bf5 modem: chat: Add runtime API to modem_chat_script_chat
Add APIs allowing for modifying the modem_chat_script_chat
safely at runtime.

Signed-off-by: Bjarki Arge Andreasen <bjarki@arge-andreasen.me>
2024-05-28 10:02:06 +02:00
Bjarki Arge Andreasen
8b4822861b modem: chat: Add runtime API to modem chat matches
Add APIs for changing the contents of modem chat matches
safely at runtime.

This allows for reusing a single modem_chat_match at the cost
of placing the match and its buffers in RAM.

Signed-off-by: Bjarki Arge Andreasen <bjarki@arge-andreasen.me>
2024-05-28 10:02:06 +02:00
Yong Cong Sin
ab8c0dd3c0 tests: drivers: build_all: gpio: fix efinix_sapphire indentation
Fix indentation of the `efinix_sapphire.overlay`

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
2024-05-28 09:59:20 +02:00
Yong Cong Sin
af450ea3cc drivers: gpio: add Broadcom iProc GPIO controller driver
Add device driver, bindings and build-only test for
Broadcom iProc GPIO controller.

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
2024-05-28 09:59:20 +02:00
Yong Cong Sin
97ba7fd48d drivers: i2c: add Broadcom iProc I2C driver
Add device driver, bindings and build-only test for
Broadcom iProc I2C.

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
2024-05-28 09:57:40 +02:00
Emil Gydesen
a66672885d samples: Bluetooth: Audio: Add missing board/conf
Add missing configuration files for the nRF5340DK
and missing configuration values for the unicast
samples w.r.t. buffer sizes and encryption.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-05-28 09:55:30 +02:00
Marcin Szymczyk
8999446ab8 tests: kernel: gen_isr_table: add support for nRF54L15 FLPR
Align testcase to nRF54L15 FLPR.
Follow up of #71948.

Signed-off-by: Marcin Szymczyk <marcin.szymczyk@nordicsemi.no>
2024-05-27 08:15:46 -07:00
Marcin Szymczyk
809c6c34d3 tests: drivers: timer: nrf_grtc_timer: add nRF54L15 FLPR to targets
Allow testing FLPR with this testcase.

Signed-off-by: Marcin Szymczyk <marcin.szymczyk@nordicsemi.no>
2024-05-27 14:04:46 +01:00
Jukka Rissanen
5248657f57 tests: net: dns_resolve: Fix resolver tests
The compilation was failing if IPv4 was disabled.
Also fix the IPv6 test so that they pass properly.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2024-05-27 05:01:28 -07:00
Jonathan Rico
ea41a24d3a Bluetooth: tests: fix double-registering of callbacks
This was the source of assert failures.
If only they were enabled in the first place...

The issue is that in order to save on build time, these two tests build
only one image, from which two devices are
instantiated (`gatt_client_test.c` and `gatt_server_test.c`).

The double-registration happens as `BT_CONN_CB_DEFINE()` is build-time, and
is included in two files of the same image. Then _both_ images will end up
with both `connected()` `disconnected()` etc callbacks, which have logic
specific to their respective images/devices.

The patch uses runtime registration instead so each device only ever
registers its own callbacks and not the other device's too.

Signed-off-by: Jonathan Rico <jonathan.rico@nordicsemi.no>
2024-05-27 03:39:50 -07:00
Jonathan Rico
1b4844aad0 tests: bsim: Enable asserts by default
Asserts should always be enabled in test builds.

Signed-off-by: Jonathan Rico <jonathan.rico@nordicsemi.no>
2024-05-27 03:39:50 -07:00
Lucas Tamborrino
4684b192bc tests: boards: espressif: Add RTC CLK test
Add tests for the rtc clk subsystem.

Signed-off-by: Lucas Tamborrino <lucas.tamborrino@espressif.com>
2024-05-27 01:37:18 -07:00
Lucas Tamborrino
0b72ded057 tests: drivers: counter: support rtc timer
Add support for rtc timer node in the test.

Signed-off-by: Lucas Tamborrino <lucas.tamborrino@espressif.com>
2024-05-27 01:37:18 -07:00
Lucas Tamborrino
9808aa9f9e tests: drivers: clock control api: Make test generic
Changes for making the clock control api tests generic for
any board.
All the device subsys definitions were moved to its own folder
according to the clock compatible.
Also if the clock's async feature is not supported by the target,
the test is skipped instead of failed.

Signed-off-by: Lucas Tamborrino <lucas.tamborrino@espressif.com>
2024-05-27 01:37:18 -07:00
Yong Cong Sin
4a49a88348 tests: drivers: intc: verify registration of controllers
Test the registration of interrupt controller with the
intc_table and verify that thru the sw_isr_table APIs.

Verified registration with all 3 interrupt levels.

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
2024-05-25 11:24:32 +03:00
Yong Cong Sin
cd0ef1ad27 tests: drivers: build_all: intc: add a common build-only test
Add a generic build-only test for:
 - intc_nxp_irqsteer
 - intc_cavs
 - intc_rv32m1_intmux
 - intc_dw_ace
 - intc_dw

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
2024-05-25 11:24:32 +03:00
Yong Cong Sin
dcaf217336 irq: multilevel: add APIs with level as argument
Add APIs that accept an additional `level` argument, and use
that to call the respective functions. In some cases this can
reduce code complexity, especially when the level isn't known
at build time.

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
2024-05-25 11:24:32 +03:00
Yong Cong Sin
c5f5b964c1 arch: sw_isr: revamp multi-level interrupt architecture
Previously the multi-level irq lookup table is generated by
looping through the devicetree nodes using macros & Kconfig,
which is hard to read and flimsy.

This PR shifts the heavy lifting to devicetree & DT macros such
that an interrupt controller driver, which has its info in the
devicetree, can register itself directly with the multi-level
interrupt architecture, which is more straightforward.

The previous auto-generated look up table with macros is now
moved in a file of its own. A new compatibility Kconfig:
`CONFIG_LEGACY_MULTI_LEVEL_TABLE_GENERATION` is added and
enabled by default to compile the legacy look up table for
interrupt controller drivers that aren't updated to support the
new architecture yet.

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
2024-05-25 11:24:32 +03:00
Yong Cong Sin
84da6c8e6c test: gen_isr_table: exclude NRFX_CLIC from riscv_no_direct
VPR cores CLIC supports vectored mode only and can't be
disabled. Filter out `CONFIG_NRFX_CLIC` to prevent build
error.

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
2024-05-25 11:24:32 +03:00
Yassine El Aissaoui
4a755a3157 samples: tests: bluetooth: Add support for rd_rw612_bga
Adding bt_tester support.

Adding bt_tester app build
with Twister for rd_rw612_bga board

Fix failing tests/samples due to unsufficent MPU ressources
by releasing unnecessary MPU regions.

Disable twister build on samples that are not meant to
be supported on this board, so exclude it from the test cases.

Update peripheral/central ht sample.yaml files
to test build for rd_rw612_bga.

Signed-off-by: Axel Le Bourhis <axel.lebourhis@nxp.com>
Signed-off-by: Yassine El Aissaoui <yassine.elaissaoui@nxp.com>
2024-05-25 11:23:04 +03:00
Krzysztof Chruściński
33db820400 tests: drivers: uart: async_api: Add nrf54h20 support
Add overlays for nrf54h20dk.

Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
2024-05-24 18:04:46 -04:00
Swift Tian
5df8ca2965 tests: sensor: fix compile
Add CONFIG_EMUL=y to prj.conf

Signed-off-by: Swift Tian <swift.tian@ambiq.com>
2024-05-24 18:03:44 -04:00
Swift Tian
cf5a273aa5 tests: subsys: fix emul test compile
Add CONFIG_EMUL=y to the test .conf

Signed-off-by: Swift Tian <swift.tian@ambiq.com>
2024-05-24 18:03:44 -04:00
Sebastian Bøe
afbaaf241d samples: wdt_basic_api: nrf: Add missing nrf overlays
Add missing nrf overlays to fix the sample at build time.

Copied from samples/drivers/watchdog/boards.

It is not clear why the build failure was not detected earlier.

Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
2024-05-24 18:00:47 -04:00
Sebastian Bøe
9ef16f55cd boards: nordic: 54l: use wdt31 instead of wdt30
Use wdt31 instead of wdt30 as wdt30 is hardware fixed to secure.

Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
2024-05-24 18:00:47 -04:00
Alberto Escolar Piedras
ab50b375e5 tests/posix/env: set CONFIG_PICOLIBC=y
Chosing by default in the prj.conf
PICOLIBC ensures we also use an embedded
libC even when built for a native target
and even if we dont set POSIX_API.

This ensures the test will build and pass
properly when built with default configuration
from command line without using the test yaml.

This change does not affect the build result
for other targets as those defaulted already
to PICOLIBC.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-05-24 09:57:31 -05:00
Francois Ramu
362588037e tests: drivers: rtc api testing with timeout
Add a timeout to the tests/drivers/rtc_api testcase so twister
can end properly when running with twister.

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2024-05-24 09:56:29 -05:00
Babak Arisian
b0dceffacc Bluetooth: Audio: add bt_audio_get_chan_count
Implement a function bt_audio_get_chan_count that takes an enum
bt_audio_location and returns the number of channels in that value.

This PR fixes #69617
(https://github.com/zephyrproject-rtos/zephyr/issues/69617)

Signed-off-by: Babak Arisian <bbaa@demant.com>
2024-05-24 09:55:37 -05:00
Dmitrii Golovanov
d38913ba48 tests/kernel/timer/timer_behavior/pytest: aligh grpcio version
Align grpcio version with logic2-automation package fixing its fail
on Channel.unary_unary() call with missing _registered_method argument..

Signed-off-by: Dmitrii Golovanov <dmitrii.golovanov@intel.com>
2024-05-24 09:54:05 -05:00
Andrzej Głąbek
418210dbf3 tests: drivers: wdt_basic_api: Allow testing without PAUSE_HALTED_BY_DBG
This is a follow-up to commit e53e5448ee.

In the above commit, the calls to `wdt_setup()` were modified to use
the `WDT_OPT_PAUSE_HALTED_BY_DBG` option to prevent problems with
flashing of boards after this test was executed on them (the still
active watchdog could interrupt such flashing), but this option
is not essential to the test itself. And if a watchdog driver does not
support pausing when the CPU is halted by a debugger (this is the case
for example for wdt_counter), it is not able to pass the test because
of that option. Add then the possibility to continue the test when
pausing by debugger is not supported.

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2024-05-24 08:24:56 -04:00
Andrzej Głąbek
ccedcd1ac0 tests: drivers: wdt_basic_api: Add missing failure indications
Two API calls that are supposed to set up the watchdog are not actually
causing the test to fail, only error messages are printed. This patch
adds the proper return statements.

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2024-05-24 08:24:56 -04:00
Krzysztof Chruściński
c026b55fe5 tests: drivers: clock_control: nrf_lf_clock_start: Fix SYNTH test
Test was not covering nrf54l15 which had Synth source bitfield
renamed. Changing the test to use Kconfig to determine if
Synth is present.

Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
2024-05-24 07:50:53 -04:00
Aleksander Wasaznik
26f3073b9a Bluetooth: audio: tests: Switch to one-time adv
This patch removes all uses of the adv auto-resume feature in the audio
bsim tests, and instead makes all adv starts explicit.

The auto-resume feature is planned for deprecation. And, explicit
starting of adv makes what happens in the test more explicit as well.

Signed-off-by: Aleksander Wasaznik <aleksander.wasaznik@nordicsemi.no>
2024-05-24 07:48:54 -04:00
Emil Gydesen
cc602a6941 tests: Bluetooth: Fix incorrect comments about adv sets
Several places we simply had
/* Create a non-connectable non-scannable advertising set */
regardless of the type of advertising it was.

Modified the comment to omit the scannable part
and corrected the connectable part.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-05-24 07:46:43 -04:00
Szymon Janc
d3c0dfbf36 tests: Bluetooth: tester: Fix assert in OTS
MCS OTS support doesn't implement OTS checksum and if this is globally
enabled assert is triggered.

[00:00:03.409,484] <dbg> bttester_gap: set_io_cap: io_cap: 0
ASSERTION FAIL [ots_init->cb->obj_cal_checksum]
     @ WEST_TOPDIR/zephyr/subsys/bluetooth/services/ots/ots.c:476
 Callback for object calculate checksum is not set

This should be reverted when Zephyr issue #72471 is fixed.

Signed-off-by: Szymon Janc <szymon.janc@codecoup.pl>
2024-05-24 12:57:26 +03:00
Flavio Ceolin
e0c955eba3 tests: uoscore: Set necessary PSA options
Set necessary psa options to the test execution.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2024-05-24 11:39:28 +02:00
Valerio Setti
ffe79b5522 test: mbedtls: add custom target to check MbedTLS auto-generated files
This commit adds a custom target to tests/crypto/mbedtls in
order to verify that MbedTLS auto-generated files are up to
date.

Signed-off-by: Valerio Setti <vsetti@baylibre.com>
2024-05-23 11:53:02 -04:00
Yong Cong Sin
2a3d9d0d90 arch: arm64: use symtab to print function name in stack trace
Selecting `CONFIG_SYMTAB` will
enable the symtab generation which will be used in the
stack trace to print the function name of the return
address.

Added `arm64` to the `arch.common.stack_unwind.symtab` test.

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
2024-05-23 11:52:08 -04:00