Commit graph

13224 commits

Author SHA1 Message Date
Piotr Narajowski 1029800a64 bluetooth: tester: add missing config
Set CONFIG_BT_MAX_PAIRED with same value as in host.
This is needed for CSIP tests with three lower testers:
CSIP/CL/SP/BV-07-C, CSIP/CL/SP/BV-03-C, CSIP/CL/SP/BV-04-C,
CSIP/CL/SPE/BI-01-C

Signed-off-by: Piotr Narajowski <piotr.narajowski@codecoup.pl>
2024-04-02 14:31:30 +01:00
cyliang tw fc69f25202 tests: drivers: spi: spi_loopback: support numaker_m2l31ki
Add support for Nuvoton numaker board numaker_m2l31ki.

Signed-off-by: cyliang tw <cyliang@nuvoton.com>
2024-04-02 14:30:57 +01:00
Renato Soma 50fb272f94 tests: drivers: add LM35 to build_all
Add LM35 driver to build_all test

Signed-off-by: Renato Soma <renatoys08@gmail.com>
2024-04-02 14:29:42 +01:00
Richard Wheatley 0b53f7a9fd tests: drivers: counter: counter_basic_api
Enable reliable_cancel_capable feature for Ambiq counter

Signed-off-by: Richard Wheatley <richard.wheatley@ambiq.com>
2024-04-02 10:37:02 +03:00
Anas Nashif ebb503ff7b kernel: move thread related helper function kthread.h
Move some helper functions to inernal kthread.h, to offload crowded
sched.c

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2024-04-01 18:47:36 -04:00
Jeppe Odgaard 128e8059d2 tests: drivers: build_all: add build test for ad559x i2c driver
Add build-only test of the ad559x I2C based ADC, DAC and GPIO driver.

Signed-off-by: Jeppe Odgaard <jeppe.odgaard@prevas.dk>
2024-04-01 12:18:47 -05:00
Jeppe Odgaard 17b1912bc3 drivers: ad559x: add i2c bus support
Rename ad5592 files in dts, driver and include to ad559x and add support
for I2C bus which is required for AD5593.

Signed-off-by: Jeppe Odgaard <jeppe.odgaard@prevas.dk>
2024-04-01 12:18:47 -05:00
Gaetan Perrot c877cd903d posix: Implement tests for set and get inheritsched APIs for pthread attr
Add tests for `pthread_attr_setinheritsched()`
and `pthread_attr_getinheritsched()`

signed-off-by: Gaetan Perrot <gaetanperrotpro@gmail.com>
2024-04-01 11:04:35 +01:00
Reto Schneider 3aba7d5bc6 tests: net: buf: Better clone coverage
This commit ensures that user data get copied when cloning a buffer.

Signed-off-by: Reto Schneider <reto.schneider@husqvarnagroup.com>
2024-03-29 16:00:39 -05:00
Piotr Narajowski e8d4a68f8e bluetooth: tester: Add CSIS btp command
This commit adds CSIS command to change type of SIRK.
This is needed for CSIS/SR/SP/BV-05-C test case.

Signed-off-by: Piotr Narajowski <piotr.narajowski@codecoup.pl>
2024-03-29 15:57:59 -05:00
Robert Lubos 8e2722e1ca net: Provide separate configs for TX/RX memory pool for variable bufs
Instead of having a single config specifying the memory pool size for
variable-sized net buffers, have a separate one for TX and RX for better
configuration granularity when optimizing memory usage of the
application.

Deprecate the old configuration but use its value as a default (for now)
for the new configs. This will need to change when the config is
deleted.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2024-03-29 15:56:07 -05:00
Chris Friedt f2d1851c2b tests: thrift: build_only until c++11 threads are in sdk
There was a make-shift mutex implementation added to thrift
while waiting for C++11 thread support in the SDK. This was
fairly racey and would cause issues in CI regularly.

Make the tests build-only for now until C++11 thread, mutex,
etc support is stabilized.

Signed-off-by: Chris Friedt <chrisfriedt@gmail.com>
2024-03-29 15:54:34 -05:00
Armin Brauns f4c596ae28 drivers: add iis328dq stmemsc driver
Based on the iis2dlpc driver, with some significant differences in
interrupt handling.

Signed-off-by: Armin Brauns <armin.brauns@embedded-solutions.at>
2024-03-29 10:01:37 -05:00
Alberto Escolar Piedras 082f283271 tests/bsim: Remove too small timeouts
Remove explicit timeouts which are either the same as the
default one or smaller.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-03-28 17:05:49 -05:00
Alberto Escolar Piedras 7d7188e792 tests bsim: Increase runtime timeouts
Let's increase the timeout for a few tests whose
timeout is less than 3x a typical execution time in CI.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-03-28 17:05:49 -05:00
Alberto Escolar Piedras 693ae8635a tests bsim edtt: Kill stuck processes in the same way as other tests
This test keeps its own partial way of running tests.
Let's have it kill stuck processes in the same way as
the rest (sending another kill 5 seconds after, and printing
a message about what happened)

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-03-28 17:05:49 -05:00
Seppo Takalo c62dd778cd net: lwm2m: Fix socket hints for block transfer
Outgoing block-transfers now set the socket hint
to ONGOING as long as the BLOCK1/BLOCK2 header has
MORE flag set to true.
This means as only the last packet in the block-transfer
set the socket hint to LAST or ONE_RESPONSE.

Signed-off-by: Seppo Takalo <seppo.takalo@nordicsemi.no>
2024-03-28 16:02:34 -05:00
Alberto Escolar Piedras b0339136c1 tests bsim: run_parallel: Print how long tests take
To give an idea of which tests are taking
too long either on CI or locally.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-03-28 16:02:06 -05:00
Alberto Escolar Piedras dfe34ca03a tests/bsim/run_parallel: Create folder for results xml if missing
Create the folder for the results if it does not exist.
Fixes these warnings in CI:
```
touch: cannot touch '/__w/zephyr/zephyr/./bsim_bt/
53_bsim_results.xml': No such file or directory
realpath: /__w/zephyr/zephyr/./bsim_bt/
53_bsim_results.xml: No such file or directory
```

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-03-28 14:45:17 +00:00
Jukka Rissanen b06602c3f3 tests: net: vlan: Fix the socket API usage
The tests should use zsock_ APIs after the commit
0512e7ffae

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2024-03-28 14:45:08 +00:00
Daniel DeGrasse d5eb328544 boards: nxp: rd_rw612_bga: enable DMIC
Enable DMIC on RW612 BGA board. The DMIC is enabled for both onboard
MEMS microphones for this board, and the board is enabled with the DMIC
sample and test

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2024-03-28 09:44:25 +00:00
IBEN EL HADJ MESSAOUD Marwa 12c69562cf tests: drivers: i2c: i2c_target_api: add stm32h573i_dk
Add necessary overlay and stm32h573i_dk in i2c_target_api test case
to enable the board.

Signed-off-by: IBEN EL HADJ MESSAOUD Marwa <marwa.ibenelhadjmessaoud-ext@st.com>
2024-03-28 09:42:12 +00:00
Jukka Rissanen def4a7ec12 net: gptp: Remove VLAN support
The gPTP is not suppose to be run on top of VLAN and the
earlier support was just for testing purposes. Remove VLAN
support now after the VLAN overhaul.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2024-03-28 09:41:38 +00:00
Jukka Rissanen c28ca1ce1f tests: net: vlan: Update because of VLAN changes
Update the tests because of the VLAN overhaul.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2024-03-28 09:41:38 +00:00
Daniel Leung d34351d994 kernel: align thread stack size declaration
When thread stack is defined as an array, K_THREAD_STACK_LEN()
is used to calculate the size for each stack in the array.
However, standalone thread stack has its size calculated by
Z_THREAD_STACK_SIZE_ADJUST() instead. Depending on the arch
alignment requirement, they may not be the same... which
could cause some confusions. So align them both to use
K_THREAD_STACK_LEN().

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2024-03-27 19:27:10 -04:00
Daniel Leung 6cd7936f57 kernel: align kernel stack size declaration
When kernel stack is defined as an array, K_KERNEL_STACK_LEN()
is used to calculate the size for each stack in the array.
However, standalone kernel stack has its size calculated by
Z_KERNEL_STACK_SIZE_ADJUST() instead. Depending on the arch
alignment requirement, they may not be the same... which
could cause some confusions. So align them both to use
K_KERNEL_STACK_LEN().

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2024-03-27 19:27:10 -04:00
Daniel Leung b9f66b26f8 tests: debug/coredump_backends: more space for qemu_x86
The reserved flash space for coredump is 4KB. However,
the dump_stack itself is larger than 4KB due to kernel stack
size adjustment. So enlarge the space for another page.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2024-03-27 19:27:10 -04:00
Daniel Leung efe30749de kernel: rename Z_THREAD_STACK_BUFFER to K_THREAD_STACK_BUFFER
Simple rename to align the kernel naming scheme. This is being
used throughout the tree, especially in the architecture code.
As this is not a private API internal to kernel, prefix it
appropriately with K_.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2024-03-27 19:27:10 -04:00
Daniel Leung b69d2486fe kernel: rename Z_KERNEL_STACK_BUFFER to K_KERNEL_STACK_BUFFER
Simple rename to align the kernel naming scheme. This is being
used throughout the tree, especially in the architecture code.
As this is not a private API internal to kernel, prefix it
appropriately with K_.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2024-03-27 19:27:10 -04:00
Daniel Leung f05111dea0 kernel: rename Z_KERNEL_STACK_LEN to K_KERNEL_STACK_LEN
Since there is a K_THREAD_STACK_LEN, its kernel counterpart
should also be prefixed with K_ for consistency.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2024-03-27 19:27:10 -04:00
Jukka Rissanen d7c9d67a9c net: Use always zephyr/posix/fcntl.h
Changing remaining users of fcntl.h to use the include from our own
POSIX file so that the values in there are consistent in all parts
of the sources.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2024-03-27 13:40:13 -05:00
Jukka Rissanen 66bc15d89d tests: net: lwm2m: Fix zsock_fcntl impl name
The syscall name has _impl postfix so adjusting the stub
name.

zephyr-sdk-0.16.5-1/x86_64-zephyr-elf/bin/../lib/gcc/
  x86_64-zephyr-elf/12.2.0/../../../../x86_64-zephyr-elf/bin/ld.bfd:
  app/libapp.a(lwm2m_engine.c.obj): in function `zsock_fcntl_impl':
.../syscalls/socket.h:363: undefined reference to `z_impl_zsock_fcntl_impl'

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2024-03-27 13:40:13 -05:00
Jukka Rissanen 0512e7ffae tests: net: sockets: Remove use of NET_SOCKETS_POSIX_NAMES
The setting is deprecated so change the code to either use the
native zsock_* API or enable POSIX_API to use the BSD socket API.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2024-03-27 13:40:13 -05:00
Jukka Rissanen d67fb8321c tests: net: socket: tls_ext: Use POSIX_API
The test expects to use various POSIX APIs so enable the config.
Enabling POSIX_API requires also increase of max file descriptors.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2024-03-27 13:40:13 -05:00
Aleksander Wasaznik d4d84b0ac9 Bluetooth: tests: bsim: host/adv/resume2
This test is an attempt at formalizing at least part of the behavior
described in commit 6a79c3deae.

Signed-off-by: Aleksander Wasaznik <aleksander.wasaznik@nordicsemi.no>
2024-03-27 14:33:31 +00:00
Jukka Rissanen d1ef9167da net: if: Make sure no other interface has same name
When setting a name to a network interface, verify that no other
interface has the same name as that would make very difficult to
select an interface by a name.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2024-03-27 14:32:34 +00:00
Nathan Olff 13deb0365c drivers: sensor: dht20: implement new driver
The DHT20 sensor is a temperature and humidity sensor that uses I2C to
communicate with a microcontroller. The DHT20 sensor is Aosong.

use standard crc

update description to add reference to AHT20 and AM2301B

clean code, use defines and bit manipulation

add dht20 to i2c test suite for build tests

update bit manipulation

use more defines instead of raw numbers

add bindings to allow aht20 or am2301b to be used in devicetree

in all 3 cases, the same dht20.c driver is compiled

Signed-off-by: Nathan Olff <nathan@kickmaker.net>
2024-03-27 14:29:54 +00:00
Chris Friedt fc725a7ce3 tests: posix: headers: uncomment check for sockatmark()
Uncomment the check for sockatmark() to ensure that the function
is declared in sys/socket.h, as a stub implementation was added
in the previous commit.

Signed-off-by: Chris Friedt <chrisfriedt@gmail.com>
2024-03-27 07:36:18 -04:00
Chris Friedt 6720c92f3e tests: posix: headers: uncomment netdb.h tests
Uncomment netdb.h tests now that we have an implementation and
can check for the existence of e.g. hostent, netent, protoent,
and servent structure fields, as well as associated accessor
functions.

Signed-off-by: Chris Friedt <chrisfriedt@gmail.com>
2024-03-27 07:36:18 -04:00
Chris Friedt 9e5f54f017 tests: posix: net: add tests for if_nameindex et al
Add tests for if_indextoname(), if_freenameindex(),
if_nameindex(), and if_nametoindex().

Signed-off-by: Chris Friedt <chrisfriedt@gmail.com>
2024-03-27 07:36:18 -04:00
Chris Friedt 7b9bf85d9b tests: posix: headers: uncomment net/if.h tests
Uncomment net/if.h tests in tests/posix/headers since we now
have an implementation and can check for the existence of
structures, functions, etc.

Signed-off-by: Chris Friedt <chrisfriedt@gmail.com>
2024-03-27 07:36:18 -04:00
Chris Friedt bfb91da5ec tests: posix: net: tests for inet_ntoa()
Add tests for inet_ntoa()

Signed-off-by: Chris Friedt <chrisfriedt@gmail.com>
2024-03-27 07:36:18 -04:00
Chris Friedt 3a78607c1c tests: posix: net: add a posix network api testsuite
Add a testsuite for posix networking apis with an initial
test for inet_addr().

Signed-off-by: Chris Friedt <chrisfriedt@gmail.com>
2024-03-27 07:36:18 -04:00
Chris Friedt 22d51c11b0 tests: posix: common: reorder headers to avoid LOG_ERR conflict
The log subsystem defines LOG_ERR as a macro, which conflicts
with the standard POSIX LOG_ERR log level (3).

Reorder includes to avoid errors.

Signed-off-by: Chris Friedt <chrisfriedt@gmail.com>
2024-03-27 07:36:18 -04:00
Reto Schneider ddb075c398 net: buf: Add support for 40 bit data type
This enables pulling and pushing values in 40 bit format.

Signed-off-by: Reto Schneider <reto.schneider@husqvarnagroup.com>
2024-03-26 19:32:27 -04:00
Reto Schneider 8918247f37 net: buf_simple: Add support for 40 bit data type
This enables pulling and pushing values in 40 bit format.

Signed-off-by: Reto Schneider <reto.schneider@husqvarnagroup.com>
2024-03-26 19:32:27 -04:00
Reto Schneider f45b48fc51 sys: byteorder: Add 40 bit variants
This adds sys_*_*40 functions that operation on a 40 bits values.

Signed-off-by: Reto Schneider <reto.schneider@husqvarnagroup.com>
2024-03-26 19:32:27 -04:00
Ederson de Souza df916387f1 tests/subsys/llext: Add syscall tests
Check if syscalls can be accessed from both kernel and userspace, and if
optimised away ones indeed point to NULL.

Signed-off-by: Ederson de Souza <ederson.desouza@intel.com>
2024-03-26 19:31:56 -04:00
Reto Schneider a924c87dc2 tests: net: buf: Test zero-sized clone
This commit ensures that copying a zero-sized buffer works.

Signed-off-by: Reto Schneider <reto.schneider@husqvarnagroup.com>
2024-03-26 19:31:21 -04:00
Dominik Ermel d52a7ef31a tests: subsys: settings: Increase stack size
Fixes #62324

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
2024-03-26 17:34:25 -04:00
Mahesh Mahadevan 384e8b6af1 tests: spi: Add support for NXP MCXN947
Add support for NXP MCXN947

Signed-off-by: Mahesh Mahadevan <mahesh.mahadevan@nxp.com>
2024-03-26 16:39:18 -04:00
Lukasz Madej a64a64b3c2 drivers: charger: charger_max20355: handle thermistor mode
Allow to configure thermistor monitoring mode.

Signed-off-by: Lukasz Madej <l.madej@grinn-global.com>
2024-03-26 16:18:31 -04:00
Lukasz Madej bda4c18fc9 drivers: charger: charger_max20355: handle recharge threshold
Allow to configure recharge threshold.

Signed-off-by: Lukasz Madej <l.madej@grinn-global.com>
2024-03-26 16:18:31 -04:00
Lukasz Madej f1b35a5c78 drivers: charger: charger_max20335: handle minimum system voltage
Allow to configure minimum system voltage threshold parameter.

Signed-off-by: Lukasz Madej <l.madej@grinn-global.com>
2024-03-26 16:18:31 -04:00
Lukasz Madej d791526dd8 drivers: charger: charger_max20355: fix configuration
Maximum charging current is selected with an external resistor in
the MAX20335 charger. Therefore it is not possible to configure it
with software directly. There is only a capability to limit current
set with hardware but configuration of the limiter is not
straight-forward.

To reflect real functionality, drop usage of
`constant-charge-current-max-microamp` property as an required one and
use custom `chgin-to-sys-current-limit-microamp` instead.
Use enum in binding file to signalize improper values at compile time.

Drop support for `CHARGER_PROP_CONSTANT_CHARGE_CURRENT_UA` API property
since this cannot be handled.

The `max20335_get_constant_charge_current()` function become useless so
remove it.

Signed-off-by: Lukasz Madej <l.madej@grinn-global.com>
2024-03-26 16:18:31 -04:00
Aleksander Wasaznik b91728619c Bluetooth: host: remove CONFIG_BT_RECV_BLOCKING
This config selects a variant of the HCI driver interface that spills
out host internals unto the drivers and even the Zephyr controller. It
will now be removed in favor of driver interfaces that hide the
internals of the host.

The new default is `CONFIG_BT_RECV_WORKQ_BT`.

Any references to the removed kconfig are refactored out.

Any out-of-tree driver using the removed interface can be easily adapted
by copying the following implementations into the driver as private
functions:

 - `hci_driver.h:BT_HCI_EVT_FLAG_RECV_PRIO`
 - `hci_driver.h:BT_HCI_EVT_FLAG_RECV`
 - `hci_driver.h:bt_hci_evt_get_flags`
 - `hci_raw.c:bt_recv_prio`

In combination these symbols function as a interface adapter. These
symbols will be removed in this PR in subsequent commits.

Signed-off-by: Aleksander Wasaznik <aleksander.wasaznik@nordicsemi.no>
2024-03-26 11:17:29 -05:00
Aleksander Wasaznik 03d234d593 Bluetooth: tests: hfc: Avoid reconnecting too fast
The host refuses to connect to a peer with an address that is also used
by a connection object in disconnected state.

Add a guard to prevent `-EINVAL` from `bt_conn_le_create`.

Signed-off-by: Aleksander Wasaznik <aleksander.wasaznik@nordicsemi.no>
2024-03-26 11:17:29 -05:00
Yusuf Ahmed f22d30b853 tests/driver/adc: Add ADC accuracy test
These tests, that expects boards to be properly setup, allow one to
measure ADC value and compare to expected values.

Two tests are added. For one, a reference voltage is expected on the ADC
- and this value can be informed to the test via devicetree. The other
uses DAC to generate a value that is then read from ADC. This assumes
DAC is accurate. Naturally, one could make this a DAC test if ADC is
assumed to be accurate.

As the board setup involve connecting physical pins, they are behind
twister fixtures.

Signed-off-by: Yusuf Ahmed <muhammed.ahmed@intel.com>
Signed-off-by: Ederson de Souza <ederson.desouza@intel.com>
2024-03-26 10:38:01 -05:00
Alberto Escolar Piedras 6514b3b88d bsim tests|samples: Remove uses of the nrf5340bsim hwmv1 boards
Using the old hwmv1 board names is not supported anymore.
So we don't need to handle them specially in the sysbuild
files.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-03-26 10:35:34 -05:00
Jeppe Odgaard 2fdf88f71c tests: dac: overlay: change spi addresses to lowercase
Change to SPI address to lowercase to fix compile warning.

Signed-off-by: Jeppe Odgaard <jeppe.odgaard@prevas.dk>
2024-03-26 11:24:50 -04:00
Jeppe Odgaard 4b15e48b98 tests: adc: boards: native_sim: fix spi addresses and missing test_gpio
Give each SPI node a unique address to fix warnings.
Add missing test_gpio to fix compile error for last node.

Signed-off-by: Jeppe Odgaard <jeppe.odgaard@prevas.dk>
2024-03-26 11:24:50 -04:00
Fabio Baltieri 55c14e6fa6 input: analog_axis: rework deadzone calibration code
Rework the data scaling algorithm for the "deadzone" mode so that the
deadzone is subtracted from the input rather than from the output. This
makes the whole output range usable rather than making the output jump
from the center value to the minimum deadzone range.

This changes the calibration data structure as well so now all values
refer to the input data, which is more coherent.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2024-03-26 11:10:10 -04:00
Jeppe Odgaard 69e1d86371 tests: build_all: sensor: uart: add fcx_mldx5
Add FCX_MLDx5 uart node in the build_all tests.

Signed-off-by: Jeppe Odgaard <jeppe.odgaard@prevas.dk>
2024-03-26 10:46:30 -04:00
Krzysztof Chruściński d2bd82eb5f drivers: serial: uart_async_rx: Add return value to consume function
Return availability of free buffers after data is consumed. This
information may be important for the module using uart_async_rx to
schedule next reception if there is a new buffer available.

Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
2024-03-26 10:46:02 -04:00
Andries Kruithof f967e08364 Bluetooth: audio: test: Refactor unit test
The unittest for cap commander is refactored, so that tests
for volumecontrol is in its own module.
This avoids the problem of having all tests in one huge file.

Due to their small size the tests for registering callbacks and
discovery haven't been put into their own module.

Signed-off-by: Andries Kruithof <andries.kruithof@nordicsemi.no>
2024-03-26 09:46:50 +00:00
Clement Dysli bc140e1a36 drivers: input: add cf1133 controller touchscreen
The driver allows to use CF1133 controller touchscreen (I2C)

Signed-off-by: Clement Dysli <clementdy@kickmaker.net>
2024-03-26 09:24:43 +00:00
Armando Visconti 8d83b76f84 drivers/sensor: add support to STTS22H temperature sensor
The STTS22H is an ultralow-power, high-accuracy, digital temperature
sensor offering high performance over the entire operating temperature
range. This driver is based on stmemsc HAL i/f v2.3

https://www.st.com/resource/en/datasheet/stts22h.pdf

Signed-off-by: Armando Visconti <armando.visconti@st.com>
2024-03-25 18:40:54 -04:00
Sylvio Alves 93d005fc87 samples: hwmv2: rename espxx_luatos_core files
This board has variant model "usb" and is currently missing
hwmv2 changes.

Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
2024-03-25 18:40:34 -04:00
Jukka Rissanen 4ac3392611 tests: net: virtual: Fix the tests
The tests are now working as expected after the virtual interface
refactoring which required changes to IP tunneling.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2024-03-25 17:07:43 +01:00
Alberto Escolar Piedras a5f255d604 tests/bsim sh scripts: Reduce boilerplate
Remove the boilerplate which is not necessary beacuse
it is already provided by the common scripts

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-03-25 16:17:13 +01:00
Alberto Escolar Piedras 13e31b2736 tests/bsim/compile.source: Provide common check and default
Provide a common check for BSIM_COMPONENTS_PATH
and a default WORK_DIR
So we avoid boilerplate in other scripts

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-03-25 16:17:13 +01:00
Alberto Escolar Piedras 13206221b0 tests/bsim: build scripts: Use hwmv2 board names
Use the hwmv2 board names instead of the hwmv1 ones.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-03-25 16:17:13 +01:00
Alberto Escolar Piedras fd8857539d tests/bsim: All scripts: Use boardtarget string instead of BOARD
In all scripts, where we were using the BOARD variable
let's use BOARD_TS which is the full BOARD target string
with "/" replaced with "_"
This is neccessary to support hwmv2 board names

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-03-25 16:17:13 +01:00
Alberto Escolar Piedras 1d231dda33 tests/bsim/bluetooth/host/gatt: Use common scripts
Use the common functions instead of replicating functionality

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-03-25 16:17:13 +01:00
Alberto Escolar Piedras 42d97fdf99 tests/bsim/bluetooth/ll/conn: Use common scripts
Use the common functions instead of
replicating functionality and do a minor cleanup

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-03-25 16:17:13 +01:00
Alberto Escolar Piedras ab3e4d4bbe tests/bsim/bluetooth/audio: Use common scripts
Use the common functions instead of
replicating functionality and do a minor cleanup

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-03-25 16:17:13 +01:00
Alberto Escolar Piedras a7ea72cee0 tests/bsim bt host/id/settings: Test scripts cleanup
Use the common scripts to perform common functions
and do a cleanup.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-03-25 16:17:13 +01:00
Alberto Escolar Piedras a7d381854e tests/bsim bt host/iso/*: Test scripts cleanup
Use the common scripts to perform common functions
and do a cleanup.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-03-25 16:17:13 +01:00
Alberto Escolar Piedras 8002730b65 tests/bsim bt host/security/*: Test scripts cleanup
Use the common scripts to perform common functions
and do a cleanup.
Do not set variables to their defaults, set things
closer to were they are needed;
Do not perform unnecesary checks;
And in general avoid unnecessary complexity.

Some of the _compile scripts were rotten => Fix them.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-03-25 16:17:13 +01:00
Alberto Escolar Piedras 06326dc8c2 tests/bsim bt host/privacy/*: Tests scripts cleanup
Ensure we call the common source script before using
the BOARD variable;
Use the common scripts to perform common functions
and do a cleanup.
Do not set variables to their defaults, set things
closer to were they are needed;
Do not perform unnecesary checks;
And in general avoid unnecessary complexity.

And for the 2 parts of the peripheral rpa sharing
test, use different sim_ids, so the traces for each
part can be checked.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-03-25 16:17:13 +01:00
Alberto Escolar Piedras e9c6f37daf tests/bsim bt host/misc: Tests scripts cleanup
Ensure we call the common source script before using
the BOARD variable;
Use the common scripts to perform common functions
and do a cleanup.
Do not set variables to their defaults, set things
closer to were they are needed;
Do not perform unnecesary checks;
And in general avoid unnecessary complexity.

And return !=0 on error.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-03-25 16:17:13 +01:00
Alberto Escolar Piedras 769910b3e9 tests/bsim bt host/l2cap: Tests scripts cleanup
Use the common scripts to perform common functions
and do a cleanup.
Do not set variables to their defaults, set things
closer to were they are needed;
Do not perform unnecesary checks;
And in general avoid unnecessary complexity.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-03-25 16:17:13 +01:00
Alberto Escolar Piedras f1aaff5115 tests/bsim bt gatt/settings: Use common scripts
Use the common scripts and do a minor cleanup

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-03-25 16:17:13 +01:00
Alberto Escolar Piedras 48e813ed6e tests/bsim bt gatt/ccc_store: Minor cleanup
Ensure we call the common source script before using
the BOARD variable, and let's not set things
which are already set to the same by default

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-03-25 16:17:13 +01:00
Alberto Escolar Piedras 39c9a995cb tests/bsim bt host/att: Test scripts cleanup
Use the common scripts so we have a consitent way of
running the tests, report failures in the same way,
can stop them with ctrl+C, properly wait for
all processes to exit..
Let's also place the test scripts in the test_scripts/
folder as it is convention.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>

(f) ests/bsim bt att:  Use common s
2024-03-25 16:17:13 +01:00
Alberto Escolar Piedras 5acc7c4815 tests/bsim bt host/adv: Tests scripts cleanup
Ensure we call the common source script before using
the BOARD variable;
Use the common scripts to perform common functions
and do a cleanup.
Do not set variables to their defaults, set things
closer to were they are needed;
Do not perform unnecesary checks;
And in general avoid unnecessary complexity.

Also, remove all timeouts which were unnecessarily too short

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-03-25 16:17:13 +01:00
Alberto Escolar Piedras 0053f03d59 tests/bsim/sh_common.source: Add function to guess test name
Some developers want to programmatically get the
test name instead of hardcoding it.
So let's have a common function for this.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-03-25 16:17:13 +01:00
Alberto Escolar Piedras 61be043f26 tests/bsim/sh_common.source: Set a variable with the board target string
As now, with hwmv2, boards can have "/" in their name,
and the board name is not anymore the complete target
name, let's set a new variable with the
whole board target name, but converted into the format
which can be used in paths.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-03-25 16:17:13 +01:00
Alberto Escolar Piedras 3041f05d18 tests/bsim/bt l2cap/stress: Be more silent
This test was way too verbose (produced a log over 65000 lines
long).
Let's mute it a bit. If the test fails, developers
can raise the log level as needed.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-03-25 16:17:13 +01:00
Daniel Leung 6ea749de52 arch: rename arch_start_cpu() to arch_cpu_start()
Rename arch_start_cpu() to arch_cpu_start() so it belongs to
the "cpu" namespace.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2024-03-25 09:58:35 +00:00
Daniel Leung 3664ed64c3 arch: move arch_interface.h under zephyr/arch
arch_interface.h is for architecture and should not be
under sys/. So move it under include/zephyr/arch/.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2024-03-25 09:58:35 +00:00
Reto Schneider 9dd87a7194 net: buf: Support copying of user data
This functionality is useful on the following scenario:

1) The first buffer in a net_pkt contains user data which is relevant
   for the (whole) net_pkt.
2) When inserting a new buffer in front of the net_pkt, the (previously)
   first buffer (and its user data) are no longer accessible via
   net_pkt->buffer.
3) net_buf_user_data_copy() allows to simply copy the user data from the
   old to the new first  buffer.

Signed-off-by: Reto Schneider <reto.schneider@husqvarnagroup.com>
2024-03-25 09:32:48 +01:00
Chen Xingyu b72e78f7ca tests: drivers: build_all: gpio: Build gpio_dw
This commit adds gpio_dw to the build_all CI test to ensure the driver is
always buildable.

Signed-off-by: Chen Xingyu <hi@xingrz.me>
2024-03-24 12:49:23 +01:00
Jonathon Penix 3723493f60 tests: coredump: Disable optimizations to prevent unexpected failures
debug.coredump.logging_backend is currently failing for most of the targets
I have tried when building with clang. Depending on the target, func_3
invokes undefined behavior by dereferencing addr (which is NULL) which
can lead to the compiler optimizing out significant portions of the code,
resulting in unexpected/incorrect failures.

Here, clang seems to inline func_3 into main then marks the inlined
implementation as unreachable (due to the UB) and removes it and everything
after it in main. So, we fall through to whatever code lies past main,
resulting in a test failure (timeout) from what I've seen. GCC seems to do
similar things, but creates an invalid opcode instruction so the test still
succeeds.

clang is correct in both optimizing this behavior out and leaving
buggy code behind, so disable optimizations for func_3 to keep things under
control and prevent the incorrect failures.

Signed-off-by: Jonathon Penix <jpenix@quicinc.com>
2024-03-23 19:04:06 -04:00
Jonathon Penix a28d5df5c6 tests: coredump: Change additional boards to directly call k_panic()
The riscv_virtual, hifive_unleashed, and hifive_unmatched boards all
timeout on this test if they actually perform the null dereference when
they are simulated. Whether the null dereference happens seems to depend
on the compiler used as well as whether optimizations are enabled though.

To make this more consistent, handle these boards in the same way as others
which use Renode simulation and have them directly call k_panic().

Signed-off-by: Jonathon Penix <jpenix@quicinc.com>
2024-03-23 19:04:06 -04:00
Reto Schneider 6c300c9c66 tests: net: buf: Improve testing coverage
Before this commit, cloning a buffer was tested only for a buffer
belonging to a reference counted pool.

By using a buffer from a pool that does not support reference counting,
the added test ensures that the non-ref-counting code path also works.

Signed-off-by: Reto Schneider <reto.schneider@husqvarnagroup.com>
2024-03-22 21:01:26 -05:00
Reto Schneider 397b8465dc tests: kernel: interrupt: lto: Exclude builds with warning
Trying to enable LTO when CODE_DATA_RELOCATION is already enabled
produces a warning.

This commit prevents twister from building such combinations for
arch.shared_interrupt.lto.

Signed-off-by: Reto Schneider <reto.schneider@husqvarnagroup.com>
2024-03-22 17:42:35 -04:00
Reto Schneider f4430827d8 tests: kernel: common: lto: Exclude builds with warning
Trying to enable LTO when CODE_DATA_RELOCATION is already enabled
produces a warning.

This commit prevents twister from building such combinations for
kernel.common.lto.

Signed-off-by: Reto Schneider <reto.schneider@husqvarnagroup.com>
2024-03-22 17:42:35 -04:00
Christopher Friedt a010ad23bd tests: posix: tests for pthread_rwlockattr_setpshared
Add tests for pthread_rwlockattr_setpshared() and
pthread_rwlockattr_getpshared().

Signed-off-by: Christopher Friedt <cfriedt@meta.com>
2024-03-22 16:19:57 -04:00
Christopher Friedt 0084092fae tests: posix: add a test for clock_getres()
Add a test for clock_getres().

Signed-off-by: Christopher Friedt <cfriedt@meta.com>
2024-03-22 16:19:27 -04:00
Jonathan Rico 06f6c5c992 doc: bsim: Move contents into .rst
This makes the information more discoverable and linkable in the docs.

Signed-off-by: Jonathan Rico <jonathan.rico@nordicsemi.no>
2024-03-22 15:59:49 -04:00
Alberto Escolar Piedras fddbd79cf7 tests/drivers/can/timing: Remove unused overlays
The native_{posix,sim}_64 boards are not anymore twister
targets, native_{posix,sim}/native/64 are, and those
default to just use the overlays for the non variant
version.
These 2 overlays were not used by anything.
Remove them.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-03-22 12:42:31 +00:00
Konrad Derda 5e46a49358 tests: net: mdns: add test for external mDNS records
This commit adds a test for externally stored mDNS records for mDNS
responder.

Signed-off-by: Konrad Derda <konrad.derda@nordicsemi.no>
2024-03-22 12:41:56 +00:00
Carles Cufi 592f434d0e Revert "Bluetooth: tests: bsim: host/adv/resume2"
This reverts commit d00cdf9868.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2024-03-22 07:36:55 -04:00
Aleksander Wasaznik d00cdf9868 Bluetooth: tests: bsim: host/adv/resume2
This test is an attempt at formalizing at least part of the behavior
described in commit 6a79c3deae.

Signed-off-by: Aleksander Wasaznik <aleksander.wasaznik@nordicsemi.no>
2024-03-22 10:25:07 +01:00
Aleksander Wasaznik ebd176905a Bluetooth: testlib: add bt_testlib_disconnect
This is a convenience function.

Signed-off-by: Aleksander Wasaznik <aleksander.wasaznik@nordicsemi.no>
2024-03-22 10:25:07 +01:00
Aleksander Wasaznik 89c9491804 Bluetooth: testlib: add bt_testlib_conn_wait_free
This function waits for a free connection slot. It should be used to
slow down a busy loop trying to obtains a connection slot.

Signed-off-by: Aleksander Wasaznik <aleksander.wasaznik@nordicsemi.no>
2024-03-22 10:25:07 +01:00
Aleksander Wasaznik c84c9beece Bluetooth: testlib: Add bt_testlib_conn_unindex
This function obtains a reference to a connection object by its index.

Signed-off-by: Aleksander Wasaznik <aleksander.wasaznik@nordicsemi.no>
2024-03-22 10:25:07 +01:00
Aleksander Wasaznik dd038b4405 Bluetooth: testlib: Support BT_SMP=n
This is the minimal change to make compilation with `BT_SMP=n` work.

Signed-off-by: Aleksander Wasaznik <aleksander.wasaznik@nordicsemi.no>
2024-03-22 10:25:07 +01:00
Robert Lubos 09c4328b2a tests: net: dhcpv4: server: Fix tests after including client ID
Client ID option is now expected in Request/Ack responses so tests need
to be updated accordingly.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2024-03-22 10:24:15 +01:00
Jamie McCrae 0c936f8bda tests: drivers: mbox: mbox_data: Fix usage of board name checking
Fixes using outdated hwmv1 board name checking with proper board
defines

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2024-03-22 10:06:04 +01:00
Christopher Friedt b30b4bcfd5 tests: posix: common: add a test for confstr()
Add a test for confstr(), which is required by the
POSIX_SINGLE_PROCESS Option Group, as per IEEE
1003.1-2017.

Signed-off-by: Christopher Friedt <cfriedt@meta.com>
2024-03-22 08:57:44 +01:00
Alberto Escolar Piedras f3360265e6 tests|samples/bluetooth: Fix sysbuild due to BOAD_IDENTIFIER
After https://github.com/zephyrproject-rtos/zephyr/pull/70438
got merged simultaneously with
https://github.com/zephyrproject-rtos/zephyr/pull/70564
all these tests stopped building properly due to the
change of avaliable variables in Kconfig & cmake.
Let's fix them.
As a bonus, as for kconfig the BOARD_TARGET_STRING is the
same for the hwmv1 backwards compatible name, let's
just remove the check for the old names.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-03-21 18:44:04 +01:00
Robert Lubos 8731c8ead0 tests: net: all: Enable CONFIG_NET_IPV6_ND_LOG_LEVEL
Make sure build-all smoke test enables IPv6 ND logging.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2024-03-21 18:00:50 +01:00
Emil Gydesen 984b0807c4 tests: Bluetooth: PBP: Fix several issues in the PBP bsim tests
The PBP bsim tests had several issues that was not uncovered
until the PA sync timeout was increased. This commit fixes these,
as well as increase some timeout values due to recently
increased PA sync timeout.

Among the issues were lack of support for the alternating PBA
features, missing reset of values and specific time sleeps.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-03-21 15:24:14 +01:00
Emil Gydesen 0dcf3c197e Bluetooth: Audio: Increase PA sync timeouts
Increase the timeouts to be 60 instead of 6.
The reason for this is that some controllers (like the Zephyr
controller) will reserve some of these to ensure stability,
and in fact with skip = 5 and retry = 6, it would still
send the PA reports at every interval.

To accomodate a higher timeout value, the functions used to
convert PA intervals to PA timeouts have been updated.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-03-21 15:24:14 +01:00
Alberto Escolar Piedras 1f4f307bd2 samples|tests/* yamls: Replace all nrf5340bsim hwmv1 names w hwmv2 version
Replace all instances of
nrf5340bsim_nrf5340_cpunet & nrf5340bsim_nrf5340_cpuapp
with
nrf5340bsim/nrf5340/cpunet & nrf5340bsim/nrf5340/cpuapp
In these samples/tests twister yamls definitions.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-03-21 15:23:56 +01:00
Alberto Escolar Piedras 4235efc7bd samples|tests several: Support using nrf5340bsim hwmv2 names
For all samples which handle the nrf5340bsim in some special way
(for example in sysbuild files, or by checking what samples are
supported) handle also building with the hwmv2 names.

Also, let's fix the cmake info message in these respective
samples which tells the user which board target is used for which
part of the app.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-03-21 15:23:56 +01:00
Alperen Şener de41005fe9 tests: bluetooth: Update ICS for Mesh v1.1, DFU v1.0 and MBT v1.0
Mesh v1.1, DFU v1.0 and MBT v1.0 are supported by default in the stack.
In this regard, this commit updates the ICS file and Launch Studio
Project file to reflect supported features.

Signed-off-by: Alperen Şener <alperen.sener@nordicsemi.no>
2024-03-21 12:40:07 +01:00
Aleksander Wasaznik 1e2b889bbb Bluetooth: tests: use global testlib in read_fill_buf
This deduplicates a copy of testlib from before testlib was a globally
available cmake library.

Signed-off-by: Aleksander Wasaznik <aleksander.wasaznik@nordicsemi.no>
2024-03-21 10:08:01 +00:00
Jordan Yates 61ee9f4fbf tests: logging: log_api: test LOG_WRN_ONCE
Add a test for the `LOG_WRN_ONCE` wrapper around `LOG_WRN`.

Signed-off-by: Jordan Yates <jordan.yates@data61.csiro.au>
2024-03-21 10:07:36 +00:00
Declan Snyder 557e5969f3 boards: rd_rw612_bga: Enable counters
Enable CTimer0 and MRT0 channel 0 by default on the board,
and add more of the device instances in the counter api test overlay.

Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
2024-03-21 09:06:48 +01:00
Dominik Ermel 4c8ed7dd9a devicetree.h: Rework DT_ANY_INST_HAS_PROP_STATUS_OKAY
The macro is searching for all instances of specific device
that contain specific property and evaluates to true (1) if
any device does.
The macro used to do that by generating, using
DT_ANY_INST_HAS_PROP_STATUS_OKAY, a logical expression
like (0 || 1 || 0), where each digit represented existence of
property (1) or lack of it (0).
Unfortunately other util macros, like IS_ENABLED, were
not able to evaluate such expression, as they often simply
expect something they can evaluate to 0 or 1.

The commit here changes DT_ANY_INST_HAS_PROP_STATUS_OKAY
to generate a list of tokens (1) where token is added to list
only for instance of a device that has the property;
then such list is processed using IS_EMPTY() macro and
in the end 0 or 1 is generated, depending on whether
any enabled instance of a device has the property or not.
This change allows result of DT_ANY_INST_HAS_PROP_STATUS_OKAY
to be used with macros like IS_ENABLED, IF_ENABLED or
COND_CODE_x.

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
2024-03-20 16:52:48 +00:00
Alberto Escolar Piedras f532937e92 tests|scripts/net: Change native_posix references to native_sim
* As we are replacing native_posix with native_sim, let's
  refer to native_sim instead of native_posix in the comments
  of why we have 1 extra interface.

* scripts/net/run-sample-tests.sh builds for native_sim now,
  not native_posix => let's fix it

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-03-20 15:43:05 +01:00
Pieter De Gendt 5f3a69fada tests: drivers: build_all: ethernet: Build without L2
Limit the number of files built when building ethernet device drivers.
Use the ETH_DRIVER_RAW_MODE to provide weak funtions for upper layer
handling.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2024-03-20 08:05:55 -05:00
Nithin Ramesh Myliattil 139a40098b Tests: Bluetooth: Host: update rpa expired bsim to cover more use cases
rpa expired bsim is refactored so that every rpa rotation, one of
the adv set belong to an adv_id returns false based on adv_index.
In turn all adv sets under the same adv_Id continues with old rpa.

Signed-off-by: Nithin Ramesh Myliattil <niym@demant.com>
2024-03-20 07:55:49 -05:00
Benedikt Schmidt 370c977b4e tests: drivers: build_all: sensor: add sensors of MAX31790
Add instances for the senors of MAX31790 to the
build all tests.

Signed-off-by: Benedikt Schmidt <benedikt.schmidt@embedded-solutions.at>
2024-03-20 07:38:18 -05:00
Benedikt Schmidt 961c985ee4 drivers: pwm: split up driver for MAX31790 into a MFD
Split up the driver for the PWM controller MAX31790
into a multi function device driver.

Signed-off-by: Benedikt Schmidt <benedikt.schmidt@embedded-solutions.at>
2024-03-20 07:38:18 -05:00
Fabio Baltieri 2c5b992209 input: pmw3610: add few config options
Add config options for resolution, force awake and smart mode.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2024-03-20 09:02:50 +01:00
Guillaume Gautier edbfe9a4c7 tests: drivers: adc: adc_api: boards: add stm32 boards
Add STM32 boards overlays for all series supporting ADC DMA.

Signed-off-by: Guillaume Gautier <guillaume.gautier-ext@st.com>
2024-03-20 09:02:04 +01:00
Guillaume Gautier 4102d3c452 tests: drivers: adc: remove adc_dma test
adc_dma test is now redundant with adc_api test, so it can be removed.

Signed-off-by: Guillaume Gautier <guillaume.gautier-ext@st.com>
2024-03-20 09:02:04 +01:00
Guillaume Gautier 5eb045dc83 tests: drivers: adc: adc_api: add dma test
Move ADC DMA tests directly into adc_api test for Kinetis and STM32 boards.
Needs to disable CONFIG_TEST_USERSPACE for this subtest because of caching
issue for STM32H7 (as it was done dor adc_dma test).

Signed-off-by: Guillaume Gautier <guillaume.gautier-ext@st.com>
2024-03-20 09:02:04 +01:00
Daniel Leung aa09b41f29 tests: kernel/userspace: skip other thread tests if needed
With memory domain enabled, all threads within the same domain
have access to each other threads' stacks, especially with
CONFIG_ARCH_MEM_DOMAIN_SYNCHRONOUS_API enabled (as it is
expected behavior). So update the conditions to skip both
tests to read and write to other threads' stacks.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2024-03-19 22:17:34 -04:00
Daniel Leung 2fc55f3938 tests: kernel/mem_protect/userspace: support for Xtensa MPU
Add support to test for Xtensa MPU.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2024-03-19 22:17:34 -04:00
Aleksander Wasaznik f82a86c21b Bluetooth: testlib: bt_testlib_connect: better error logs
Changes to logging:
 - Don't log "Connected" if there was an error.
 - Identify the relevant bt_conn object in log messages by its index.
 - Special case non-fatal errors:
  - Failure due to out of free conn object is INF.
 - Improve transparancy of error messages:
  - For errno, include the name of the API.
  - For HCI errors, include the common prefix of the symbols
    'BT_HCI_ERR_' so they are easier to look up.

This change includes some light refactoring to make the code more
understandable, but does not change any behavior.

Signed-off-by: Aleksander Wasaznik <aleksander.wasaznik@nordicsemi.no>
2024-03-19 21:15:44 -05:00
Alberto Escolar Piedras 6161207e30 tests/drivers/dma: Run on native_sim instead of native_posix
native_posix is being replaced with native_sim, let's
have this tests be run on native_sim instead.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-03-19 13:15:48 -05:00
Alberto Escolar Piedras ecf29a2f46 tests/bsim/bt l2cap/stress: Be more silent
This test was way too verbose (produced a log over 65000 lines
long).
Let's mute it a bit. If the test fails, developers
can raise the log level as needed.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-03-19 10:25:07 -05:00
Alberto Escolar Piedras f4972347d4 tests/bsim/bt l2cap/stress: Increase runtime timeout
This test has been seen failing in the new runners
due to a (realtime) timeout.
Let's double the timeout so it does not.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-03-19 14:30:22 +01:00
Marc Herbert 7a21c6f16a tests: llext: fix conflict between BUILD_ONLY and "object" case
Fix conflict between commit ce24394437 ("llext: add object test case")
and commit 1408d1e5b8 ("tests: llext: compile architectures not
supported yet") which were tested separately but merged at the same
time.

Github "Merge Queues" can avoid this (and save resources) but:
- they're not used by Zephyr CI
- they provide confusing feedback

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2024-03-19 10:28:52 +01:00
Henrik Brix Andersen c6583e7672 tests: drivers: can: timing: enable all bitrates on select boards
Enable testing of all CiA recommended bitrates on the following boards:
  - stm32h735g_disco

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2024-03-19 09:47:24 +01:00
Henrik Brix Andersen a472870b6d tests: drivers: can: timing: enable all bitrates on simulators/emulators
Enable testing of all CiA recommended bitrates on the following
simulated/emulated boards:
- native_sim
- native_sim_64
- native_posix
- native_posix_64
- qemu_x86
- qemu_x86_64

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2024-03-19 09:47:24 +01:00
Henrik Brix Andersen 91751f4fc2 drivers: can: fake: use CiA recommeded configurations ranges
Use the CAN clock and configuration ranges recommended by CAN in Automation
(CiA). Adjust the CAN shell test, which makes use of the fake CAN
controller driver, to match the new timing limits.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2024-03-19 09:47:24 +01:00
Henrik Brix Andersen cae4dd8e1a tests: drivers: can: timing: assert at least one bitrate test supported
Some CAN controllers may be unable to meet all bitrates due to timing
restrictions, but assert that at least one of the tested bitrates was
supported.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2024-03-19 09:47:24 +01:00
Henrik Brix Andersen 9f174ec452 tests: drivers: can: timing: add tests for all CiA recommended bitrates
Add tests for all CAN bitrates recommended by CAN in Automation (CiA). The
newly added bitrate tests are guarded by new, local Kconfig option
(CONFIG_TEST_ALL_BITRATES) to avoid breaking existing board tests.

Some boards may need adjustments to their CAN core clock in order to pass
the newly added tests. Once a board is confirmed to meet these additional
checks, this Kconfig can be enabled for that board to avoid future
regressions.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2024-03-19 09:47:24 +01:00
Henrik Brix Andersen f9dc6f7d13 tests: drivers: can: timing: do not test additional sample points
Remove tests for additional sample points as this does not provide any real
value.

The purpose of this test suite is to see if the selected CAN clock allows
meeting the standard bitrates and sample points used by Zephyr. Any
tweaking needed for a specific board or system design is left up to the
user and not something that can be covered by testing a few additional
sample point locations.

Change a few comments and remove an unneeded conditional while here.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2024-03-19 09:47:24 +01:00
Henrik Brix Andersen 675ce0d255 tests: drivers: can: timing: remove support for invalid test configs
Remove now unused support for specifying invalid timing test
configurations.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2024-03-19 09:47:24 +01:00
Henrik Brix Andersen d0ec48cb60 tests: drivers: can: move tests for invalid sample points to API test suite
Move the tests for using invalid sample points from the CAN timing tests to
the CAN API tests as these are validating basic API behavior.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2024-03-19 09:47:24 +01:00
Henrik Brix Andersen fa00a73e76 tests: drivers: can: move tests for too high bitrates to API test suite
Move the tests for setting a too high bitrate from the CAN timing tests to
the CAN API tests as these are validating basic API behavior.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2024-03-19 09:47:24 +01:00
Henrik Brix Andersen 8ccccbbb88 tests: drivers: can: move min/max timing tests to API test suite
Move the test for setting the minimum/maximum supported timing parameters
from the CAN timing tests to the CAN API tests as these are validating
basic API behavior.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2024-03-19 09:47:24 +01:00
Marc Herbert 1408d1e5b8 tests: llext: compile architectures not supported yet
For now llext supports a very limited number of architectures.  This
restriction is enforced by add_llext_target() in CMake at configuration
time.

Add a new `LOADER_BUILD_ONLY` conditional in tests/subsys/llext/simple/
and a new `llext.simple.loader_build`, `build_only` test that does not
invoke `add_llext_target()` and only compiles the llext framework code.

This helps find and fix bugs in `subsys/llext/*.c` and make it ready to
be used when add_llext_target() limitations are lifted.

Note this is pure `tests/` change without any change in the actual llext
framework code. The existing test is only modified to conditionally
invoke add_llext_target().

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2024-03-18 20:50:01 -05:00
Alberto Escolar Piedras 337769c7db tests/drivers/build_all/w1: Run on native_sim instead of native_posix
native_posix is being replaced with native_sim, let's
have these tests be run on native_sim instead.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-03-18 22:11:59 +01:00
Alberto Escolar Piedras 731ba72423 tests/bsim: Reorder tests to avoid failure in GATT/SR/GAS/BV-01-C
GATT/SR/GAS/BV-01-C has just broken due to what appears
like a minor timing change.
This indicates the test may be too time sensitive.
Just reordering the tests, it passes again.
So let's reorder the test list, and we get the minor
benefit of havign them move alphabetically ordered.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-03-18 19:11:53 +00:00
Andrzej Głąbek 787e245761 tests: Replace nRF54H20 PDK with nRF54H20 DK
nRF54H20 PDK is superseded by nRF54H20 DK and will no longer be
supported.

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2024-03-18 19:11:36 +00:00
Daniel DeGrasse d921659d6a boards: nxp: rd_rw612_bga: enable DMA support
Enable support for dma controller on RD RW612 BGA board, and add overlay
to enable board in dma loop transfer test

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2024-03-18 18:57:03 +01:00
Gaetan Perrot 99f62a749c posix: Implement tests for set and get scope APIs for pthread attr
Add tests for `pthread_attr_setscope()`
and `pthread_attr_getscope()`

signed-off-by: Gaetan Perrot <gaetanperrotpro@gmail.com>
2024-03-18 10:15:53 +01:00
Henrik Brix Andersen 41960ab366 dts: bindings: can: remove optional sample point properties
Remove all optional, initial CAN sample point properties and rely on the
CAN timing calculations to automatically pick the preferred sample point
location based on the initial bitrate.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2024-03-17 15:36:19 +01:00
Alberto Escolar Piedras 3981b9a560 tests/drivers/build_all/w1: Add gpio dependency
This driver enables CONFIG_GPIO, so if we try
to target a board which does not support it it
will fail.
Let's add the required tag in the testcase yaml.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-03-17 15:35:53 +01:00
Declan Snyder d1029da089 tests: spi_loopback: Support rd_rw612_bga
Add rd_rw612_bga to spi loopback test

Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
2024-03-15 18:07:45 -04:00
Jiafei Pan ee4131afc1 tests: gpio_basic_api: change imx93 evk board name
Updated according to hardware model v2 board name changes.

Signed-off-by: Jiafei Pan <Jiafei.Pan@nxp.com>
2024-03-15 17:13:41 -04:00
Daniel DeGrasse ec5df8a0e5 treewide: fix board identifier in overlays for lpcxpresso55s69
Fix board identifier in overlays for the lpcxpresso55s69_cpu0 target.
Board identifiers were renamed with the following command:

for file in $(find . -name "lpcxpresso55s69_cpu0.*"); do;
	mv $file ${file/_cpu0/_lpc55s69_cpu0};
done

Additionally, remove lpcxpresso55s69_ns overlay targets where they are
no longer needed (or rename them where they are)

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2024-03-15 17:12:08 -04:00
Flavio Ceolin 417747886c tests: sprintf: Avoid buffer overrun
fwrite parameters are "size_t size" and "size_t nmemb",
when writing a string we should set sizeof(char) and len(string).
The test is doing it wrongly and making the function read more
memory than it should.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2024-03-15 17:08:58 -04:00
Alberto Escolar Piedras 88e48375ec tests/modules/nanopb: Use hwmv2 native targets identifiers
For the 64 bit targets, change identifiers to the new hwmv2 ones

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-03-15 16:13:12 +01:00
Alberto Escolar Piedras 0d5ac4ef11 tests/ztest: Use hwmv2 native targets identifiers
For the 64 bit targets, change identifiers to the new hwmv2 ones

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-03-15 16:13:12 +01:00
Alberto Escolar Piedras 8abdc49664 tests/subsys several: Use hwmv2 native targets identifiers
For the 64 bit targets, change identifiers to the new hwmv2 ones.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-03-15 16:13:12 +01:00
Alberto Escolar Piedras 94a8681527 tests/subsys/dfu: Use hwmv2 native targets identifiers
For the 64 bit targets, change identifiers to the new hwmv2 ones.
And remove redundant overlays (which were equal for the 32
and 64 bit versions)

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-03-15 16:13:12 +01:00
Alberto Escolar Piedras 5ddb8d499e tests/subsys/fs: Use hwmv2 native targets identifiers
For the 64 bit targets, change identifiers to the new hwmv2 ones.
And remove redundant overlays (which were equal for the 32
and 64 bit versions)

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-03-15 16:13:12 +01:00
Alberto Escolar Piedras 0df3c62461 tests/subsys/input: Use hwmv2 native targets identifiers
For the 64 bit targets, change identifiers to the new hwmv2 ones.
And remove redundant overlays (which were equal for the 32
and 64 bit versions)

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-03-15 16:13:12 +01:00
Alberto Escolar Piedras 00f2397364 tests/subsys/settings: Use hwmv2 native targets identifiers
For the 64 bit targets, change identifiers to the new hwmv2 ones.
And remove redundant overlays (which were equal for the 32
and 64 bit versions)

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-03-15 16:13:12 +01:00
Alberto Escolar Piedras 822778ddab tests/posix: Use hwmv2 native targets identifiers
For the 64 bit targets, change identifiers to the new hwmv2 ones

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-03-15 16:13:12 +01:00
Alberto Escolar Piedras 9ccf2074e4 tests/misc/check_init_priorities: Use hwmv2 native targets ident
For the 64 bit targets, change identifiers to the new hwmv2 ones
And remove redundant overlays (which were equal for the 32
and 64 bit versions)

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-03-15 16:13:12 +01:00
Alberto Escolar Piedras 2c6db3b717 tests/lib: Use hwmv2 native targets identifiers
For the 64 bit targets, change identifiers to the new hwmv2 ones

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-03-15 16:13:12 +01:00
Alberto Escolar Piedras 185c60673b tests/boards/native_sim: Use hwmv2 native targets identifiers
For the 64 bit targets, change identifiers to the new hwmv2 ones

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-03-15 16:13:12 +01:00
Alberto Escolar Piedras ac1610ec72 tests/net: Use hwmv2 native targets identifiers
For the 64 bit targets, change identifiers to the new hwmv2 ones

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-03-15 16:13:12 +01:00
Alberto Escolar Piedras de0fb67c9f tests/drivers several: Use hwmv2 native targets identifiers
For the 64 bit targets, change identifiers to the new hwmv2 ones.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-03-15 16:13:12 +01:00
Alberto Escolar Piedras 40a88a7b48 tests/drivers/kscan: Use hwmv2 native targets identifiers
For the 64 bit targets, change identifiers to the new hwmv2 ones.
And remove redundant overlays (which were equal for the 32
and 64 bit versions)

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-03-15 16:13:12 +01:00
Alberto Escolar Piedras b2fa6067a3 tests/drivers/udc: Use hwmv2 native targets identifiers
For the 64 bit targets, change identifiers to the new hwmv2 ones.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-03-15 16:13:12 +01:00
Alberto Escolar Piedras 8d59309cca tests/drivers/flash_simulator: Use hwmv2 native targets identifiers
For the 64 bit targets, change identifiers to the new hwmv2 ones.
And remove redundant overlays (which were equal for the 32
and 64 bit versions)

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-03-15 16:13:12 +01:00
Alberto Escolar Piedras 7edcc4eb06 tests/drivers/input: Use hwmv2 native targets identifiers
For the 64 bit targets, change identifiers to the new hwmv2 ones.
And remove redundant overlays (which were equal for the 32
and 64 bit versions)

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-03-15 16:13:12 +01:00
Alberto Escolar Piedras 73ab92e530 tests/drivers/gpio: Use hwmv2 native targets identifiers
For the 64 bit targets, change identifiers to the new hwmv2 ones.
And remove redundant overlays (which were equal for the 32
and 64 bit versions)

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-03-15 16:13:12 +01:00
Alberto Escolar Piedras 821d2efdb9 tests/subsys/logging: Use hwmv2 native targets identifiers
For the 64 bit targets, change identifiers to the new hwmv2 ones.
And remove redundant overlays (which were equal for the 32
and 64 bit versions)

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-03-15 16:13:12 +01:00
Alberto Escolar Piedras 42dbca31b4 tests/drivers/dma: Use hwmv2 native targets identifiers
For the 64 bit targets, change identifiers to the new hwmv2 ones.
And remove redundant overlays (which were equal for the 32
and 64 bit versions)

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-03-15 16:13:12 +01:00
Alberto Escolar Piedras 054de9f9c3 tests/drivers/build_all: Use hwmv2 native targets identifiers
For the 64 bit targets, change identifiers to the new hwmv2 ones.
And remove redundant overlays (which were equal for the 32
and 64 bit versions)

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-03-15 16:13:12 +01:00
Alberto Escolar Piedras 844f75a78c tests/drivers/adc: Use hwmv2 native targets identifiers
For the 64 bit targets, change identifiers to the new hwmv2 ones.
And remove redundant overlays (which were equal for the 32
and 64 bit versions)

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-03-15 16:13:12 +01:00
Alberto Escolar Piedras 68975aa837 tests/bluetooth: Use hwmv2 native targets identifiers
For the 64 bit targets, change identifiers to the new hwmv2 ones.
And remove redundant overlays (which were equal for the 32
and 64 bit versions)

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-03-15 16:13:12 +01:00
Vinayak Kariappa Chettimada d435acf28d Bluetooth: Controller: Fix CIS accept fails with unsupp parameters
Fix CIS accepted by Host being failed in the Controller with
reason 0x20 Unsupported LL Parameter Value, by relaxing the
check that the ACL connection is sufficiently placed such
that the time reservation using in the Controller
implementation does not overlap with the CIG event.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2024-03-15 09:40:13 +00:00
Carlo Kirchmeier 21ce4a271e tests: net: dns: Add DNS cache tests
Added tests in order to verify the functionality of the newly
added DNS cache.

Signed-off-by: Carlo Kirchmeier <carlo.kirchmeier@zuehlke.com>
2024-03-15 08:37:29 +00:00
Lauren Murphy ce24394437 llext: add object test case
Adds a case to the simple llext test testing global
non-static object relocation.

Signed-off-by: Lauren Murphy <lauren.murphy@intel.com>
2024-03-15 08:37:13 +00:00
Benedikt Schmidt b839f41161 tests: drivers: build_all: sensor: add BD8LB600FS diagnostics
Add the BD8LB600FS diagnostics sensor driver to the
build all tests.

Signed-off-by: Benedikt Schmidt <benedikt.schmidt@embedded-solutions.at>
2024-03-15 09:00:26 +01:00
Benedikt Schmidt 31450fcb12 drivers: gpio: split up driver for BD8LB600FS into a GPIO and MFD
Split up the driver for the low side switch BD8LB600FS into a GPIO
and MFD part.

Signed-off-by: Benedikt Schmidt <benedikt.schmidt@embedded-solutions.at>
2024-03-15 09:00:26 +01:00
Rubin Gerritsen 7c2f26bd2a Bluetooth: Host: Add macros for contiuous scanner
It is often desired to maximize the chances of receiving advertising
when scanning. To achieve this, the scanner should be enabled all the time.

Some controller implementations (like Nordic's SoftDevice Controller)
handle scheduling differently when scan_window = scan_interval.
Having a macro that defines this scanning configuration simplifies
writing applications.

Signed-off-by: Rubin Gerritsen <rubin.gerritsen@nordicsemi.no>
2024-03-14 17:03:44 -05:00
Bjarki Arge Andreasen 67d7c13da9 tests: llext: Update testcase to filter on ARCH_HAS_USERSPACE
Change the filter from CPU_HAS_MPU to ARCH_HAS_USERSPACE to
when filtering boards which support userspace.

Signed-off-by: Bjarki Arge Andreasen <bjarki@arge-andreasen.me>
2024-03-14 19:07:49 +00:00
Bjarki Arge Andreasen d80945a968 tests: llext: add relative jump test ext.c
Validate the new relocations for BL and BLX instructions by
creating a new test extension which contains a chain of global
functions in a pseudo random order to (hopefully) generate
relative jumps in both positive and negative directions.

Signed-off-by: Bjarki Arge Andreasen <bjarki@arge-andreasen.me>
2024-03-14 19:07:49 +00:00
Kurtis Dinelle 3c3bee96ef drivers: sensor: tsl2591
Add the tsl2591 sensor to drivers.

Signed-off-by: Kurtis Dinelle <kurtisdinelle@gmail.com>
2024-03-14 16:32:24 +00:00
Jonathan Rico 074a541fb0 tests: Bluetooth: add minimal coverage for BT_RECV_WORKQ_SYS
Run the l2cap stress test so we have some minimal runtime coverage of that
config.

Signed-off-by: Jonathan Rico <jonathan.rico@nordicsemi.no>
2024-03-14 10:21:23 +02:00
Théo Battrel 4a55bc00f0 Bluetooth: Shell: Add support for EAD
Add new commands to manage the Encrypted Advertising Data feature.

Overview of those new commands:

- `bt encrypted-ad set-keys`: set key materials (session key and
  initialisation vector) used for encrypted and decryption of EAD;
- `bt encrypted-ad add-ad`: store a given advertising data structure;
- `bt encrypted-ad add-ead`: encrypt the given advertising data
  structres and store the generated AD structure;
- `bt encrypted-ad commit-ad`: set the AD of the selected advertiser
  with the stored AD;
- `bt encrypted-ad clear-ad`: remove all stored AD;
- `bt encrypted-ad decrypt-scan`: decrypt data using the previously set
  key materials when receiving AD with type `0x31`.

The documentation of the Bluetooth Shell has been updated to include
those new commands.

Signed-off-by: Théo Battrel <theo.battrel@nordicsemi.no>
2024-03-13 18:51:03 +02:00
Jonathan Rico f3f42d363b Bluetooth: shell: add bsim runner script
Spawns n instances of the bt-shell in separate xterm windows.

Assumes in-tree build of the shell, can optionally specify another .exe
image.

Also add snippet for that use-case (`-S xterm-native-shell`).

Signed-off-by: Jonathan Rico <jonathan.rico@nordicsemi.no>
2024-03-13 18:47:50 +02:00
Gerson Fernando Budke 8303b3dab0 tests: i2s: sam: Add missing overlays
Add missing overlays files to allow I2S tests pass on ci.

Fixes #69936

Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
2024-03-13 10:41:52 -04:00
TaiJu Wu be9a85bf6c test: Remove multi level queue limit test
Set total priorities to 71.
This setting already exceeds original limit(32) and exceeds 64 to test
secondary bitmap.

Signed-off-by: TaiJu Wu <tjwu1217@gmail.com>
2024-03-12 19:37:40 -04:00
Fabio Baltieri d123a4571a input: kbd_matrix: define PRIkbdrow coherently
It's not supposed to have the "%" in the macro, reuse the existin one
for the data type.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2024-03-12 19:28:40 -04:00
Anas Nashif f9932c578d tests: benchmark: adapt recording of benchmark results
We now have a different output, so capture it correctly.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2024-03-12 15:02:49 -04:00
Dominik Ermel 6d40cb8038 tests/flash: Fix nrf52840dk configurations
The commit disables QSPI in SoC configurations, as QSPI got enabled
by default and test never really run on SoC.

In QSPI configuration erase page size is set to 4096
There is not TC_PRINT showing name of device that the test will
run on, in test setup.

The nrf52840dk configuration files have been renamed to reflect
dk name and SoC.

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
2024-03-12 17:57:39 +00:00
Alberto Escolar Piedras 2e5a71961e tests/drivers/counter: Allow on nrf52_bsim
Allow all tests which run in the real nrf52840 to also
run in the simulated nrf52_bsim.
That way we will have runtime tests in CI.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-03-12 17:57:18 +00:00
Alberto Escolar Piedras 16cbf80620 tests/drivers/counter/counter_basic_api: Add overlay for nrf52_bsim
Add a DT overlay so this test can also be run in the nrf52_bsim
simulated board.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-03-12 17:57:18 +00:00
Emil Gydesen 6f405f6b80 tests: Bluetooth: CAP Commander Change Microphone Gain unittests
Adds unittests for the CAP Commander Change Microphone Gain
procedure.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-03-12 17:56:09 +00:00
Emil Gydesen 8956642265 tests: bsim: Bluetooth: CAP Commander Change Microphone Gain
Adds bsim test of the CAP Commander Change Microphone Gain
procedure.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-03-12 17:56:09 +00:00
Gaetan Perrot d9e9f75bfc kernel: api: implement test for sys_slist_find
implement test for sys_slist_find

signed-off-by: Gaetan Perrot <gaetanperrotpro@gmail.com>
2024-03-12 13:46:29 -04:00
Erwan Gouriou 68616f23d8 boards: nucleo_h563zi: Enable I2C
Enable i2c1 on nucleo_h563zi (arduino_i2c).
Additionally provide a test configuration for i2c_target_api.

Signed-off-by: Erwan Gouriou <erwan.gouriou@st.com>
2024-03-12 16:07:20 +01:00
Alberto Escolar Piedras d592455cc0 tests/bsim mesh: Increase realtime timeout
One of these tests has been seen failing in older slower
computers due to timeouts, let's increase the timeout so
we don't break in those cases.
Note this timeout is just a safety to eventually kill
hung simulations even if nobody presses Ctrl+C.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-03-12 22:15:34 +09:00
Alberto Escolar Piedras e9c8856165 tests/bsim audio mcs_mcc: Increase realtime timeout
This test has been seen failing in older slower computers
due to timeouts, let's increase the timeout so we don't
break in those cases.
Note this timeout is just a safety to eventually kill
hung simulations even if nobody presses Ctrl+C.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-03-12 22:15:34 +09:00
Alberto Escolar Piedras 0888882262 tests/bsim broadcast_audio: Increase realtime timeout
This test has been seen failing in older slower computers
due to timeouts, let's increase the timeout so we don't
break in those cases.
Note this timeout is just a safety to eventually kill
hung simulations even if nobody presses Ctrl+C.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-03-12 22:15:34 +09:00
Mikhail Siomin 0157a89f52 tests: spi: spi_loopback: Added MCUX FlexIO SPI test
Added FlexIO SPI test. Overlay in the tests for mimxrt1064_evk
board only.

Signed-off-by: Mikhail Siomin <victorovich.01@mail.ru>
2024-03-12 14:00:45 +01:00
Gerard Marull-Paretas 6cb283d106 tests: arch: common: ramfunc: add nrf54h20pdk cpuapp overlays
On nRF54H20, we need to configure RAM with execution permissions in
order to execute code from it. This patch adds overlays for the nRF54H20
PDK cpuapp cores so that RAM0X region is given execution permissions and
so the test runs successfully.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2024-03-12 10:58:51 +01:00
Magdalena Pastula 1e20632b36 tests: drivers: counter: add nRF54L15 overlay
Add nRF54L15 overlay for counter_basic_api test.

Signed-off-by: Magdalena Pastula <magdalena.pastula@nordicsemi.no>
2024-03-12 10:54:27 +01:00
Magdalena Pastula c57946173f tests: drivers: timer: add nrf_grtc_timer tests
Add NRF GRTC timer test for nRF54L15.

Signed-off-by: Magdalena Pastula <magdalena.pastula@nordicsemi.no>
2024-03-12 10:54:27 +01:00
Henrik Brix Andersen a0b4bf21b5 tests: drivers: can: timing: report unsupported bitrates
Enable testing of all bitrates for all drivers and report which bitrates
are not supported by the CAN controller under test.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2024-03-12 10:43:36 +01:00
Henrik Brix Andersen 810eaf1fb0 tests: drivers: can: api: add test for bitrate limits
Add test for validating the CAN controller bitrate limits.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2024-03-12 10:43:36 +01:00
Henrik Brix Andersen 57c015d017 tests: lib: devicetree: api: add tests for minimum CAN phy bitrate
Add tests for DT_CAN_TRANSCEIVER_MIN_BITRATE() and
DT_INST_CAN_TRANSCEIVER_MIN_BITRATE().

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2024-03-12 10:43:36 +01:00
Hake Huang b624013335 tests: tests/drivers/adc/adc_api: change the overlay naming to HWV2
update overlay names

fixing: #69945

Signed-off-by: Hake Huang <hake.huang@oss.nxp.com>
2024-03-12 10:41:00 +01:00
Maksim Salau a9c2d81bd0 drivers: adc: add ADC_DT_SPEC_*_BY_NAME() macros
The commit adds macros to get ADC io-channel information
from devicetree by name.

Signed-off-by: Maksim Salau <maksim.salau@gmail.com>
2024-03-11 17:24:40 +01:00
Andy Ross 19ad64b98b tests/kernel/sched/deadline: Add a SCHED_SCALABLE=y case for coverage
It turns out the deadline scheduling and the scalable scheduling
backend didn't work right together (for almost six years!) because we
never had coverage of that combination.  Add it explicitly given the
known issue in #69935.

We might want to consider adding a whole CI target with SCALABLE=y,
which we've done for other common tunables to get coverage.

Signed-off-by: Andy Ross <andyross@google.com>
2024-03-11 15:42:26 +01:00
Jukka Rissanen 66eb627b02 tests: net: ieee802154: Invalid number of params in debug print
The debug print did not had print modifier for errno which
causes compiler error.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2024-03-11 10:39:05 -04:00
IBEN EL HADJ MESSAOUD Marwa 302da95b30 tests: drivers: i2c: i2c_target_api: add nucleo_f401re
Adds i2c3 on the dts of nucleo_f401re.
Adds necessary overlay and nucleo_f401re in i2c_target_api test case
to enable the board.

Signed-off-by: IBEN EL HADJ MESSAOUD Marwa <marwa.ibenelhadjmessaoud-ext@st.com>
2024-03-11 09:07:45 -05:00
Dominik Ermel a454bb9abc tests/storage/stream_flash: Fix the test_stream_flash_erase_page
Fix for test that was failing due to incorrectly testing of
stream_flash_erase_page.
The stream_flash_erase_page would never be able to erase a page
it has been requested to erase.

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
2024-03-11 14:26:34 +01:00
Gaetan Perrot 45f907b9fd posix: Implement test for getmsg and getpmsg
Add tests for `getmsg()` and `getpmsg()`

signed-off-by: Gaetan Perrot <gaetanperrotpro@gmail.com>
2024-03-11 14:25:26 +01:00
Nithin Ramesh Myliattil 6ce38c1aa7 bluetooth: id: fix adv sets with same id use different RPA
The fix is to check if any of the adv set's rpa expired
callback returns false, then all adv sets continues with
the old RPA.

Note: Fix is applicable only to adv sets which shares the
same id.

Signed-off-by: Nithin Ramesh Myliattil <niym@demant.com>
2024-03-11 14:24:41 +01:00
Henrik Brix Andersen 75c9f0fb0e tests: drivers: can: shell: skip dtiming test if CAN FD is not enabled
Skip the "test_can_dtiming" test case if CONFIG_CAN_FD_MODE is not enabled,
not the "test_can_timing_missing_value" test case.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2024-03-11 14:20:20 +01:00
Aleksandr Khromykh aa87ed5d8a Bluetooth: Mesh: make models metadata const
Commit adds const qualifier to models metadata.
Specification claims: Composition Metadata Page 0
shall not change during a term of a node on the network.

Signed-off-by: Aleksandr Khromykh <aleksandr.khromykh@nordicsemi.no>
2024-03-11 09:26:12 +01:00
Tom Burdick 0650a88bed llext: Rework hello_world test case to be "simple"
The simple test is there to test the API and simple extensions in
unison. Hello world was intended to be the first not the only extension
being tested.

Also refactors the entry thread to allow for usermode potentially by
passing the pointer to the function symbol rather than having it look it
up directly.

Signed-off-by: Tom Burdick <thomas.burdick@intel.com>
2024-03-09 14:44:23 +00:00
Christopher Friedt 8912ba9004 tests: posix: tests for environ, getenv, setenv, unsetenv
Add tests for environ, getenv(), setenv(), unsetenv(), and
getenv_r().

Signed-off-by: Christopher Friedt <cfriedt@meta.com>
2024-03-08 04:28:47 -05:00
Pieter De Gendt 91f36191be boards: st: stm32h573i_dk: Add netif:eth support
Add build_only for the st,stm32-ethernet driver to the build_all
ethernet tests and add an entry for ethernet support to make sure
ethernet driver is built.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2024-03-08 09:37:15 +01:00
Pieter De Gendt 2054b9f982 tests: drivers: build_all: ethernet: Move app overlay to spi
Use the native_sim board to build ethernet drivers for spi devices and
add an entry for the default testcase.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2024-03-08 09:37:15 +01:00
Pieter De Gendt 6d99fc6d47 tests: drivers: build_all: ethernet: Do not set NET_TEST
The ethernet drivers can only be built if the NET_TEST option is not
selected.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2024-03-08 09:37:15 +01:00
Chaitanya Tata 5af6dfdd0e tests: Add a test for duplicate event handlers
This will help to detect any issues with duplicate handlers, currently,
it causes an infinite loop in the handler that processes the single
linked list.

Also, increase the stack size to pass the synchronous test case.

Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
2024-03-08 09:35:04 +01:00
Robert Lubos 328ff9ac45 tests: llext: Set min_ram requirement for readonly_mpu variant
Set the minimal RAM requirement for the test variant, so that it does
not get built for platforms it won't fit anyway.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2024-03-07 21:38:46 +00:00
Emilio Benavente 9815296500 dts: arm: Enabling pit for imx devices
Enabled the PIT and Multi channel support
for some of the rtXXXX devices.
- rt1010
- rt1060
- rt1160
- rt1170

Signed-off-by: Emilio Benavente <emilio.benavente@nxp.com>
2024-03-07 13:23:58 -06:00
Emilio Benavente 8bb95d33be drivers: counter: Adding Mutli Channel PIT Support
Updating the nxp,pit driver to support mutliple
channels. Updating the dts and board overlays
to account for the changes.

Signed-off-by: Emilio Benavente <emilio.benavente@nxp.com>
2024-03-07 13:23:58 -06:00
Emilio Benavente 04b240c830 dts: bindings: renamed binding used for pit
Renamed pit binding from nxp,kinetis-pit
to nxp,pit

Signed-off-by: Emilio Benavente <emilio.benavente@nxp.com>
2024-03-07 13:23:58 -06:00
Peter Mitsis a55a078909 tests: Use z_pend_curr() in sched benchmark
Replaces the use of z_pend_curr_irqlock() with z_pend_curr()
as the former is not used anywhere else anymore.

Signed-off-by: Peter Mitsis <peter.mitsis@intel.com>
2024-03-07 11:51:06 -05:00
Gerard Marull-Paretas 80cc7d1ee5 drivers: mbox: update MBOX consumers to the new API
Update all usages of the MBOX API to the latest API changes (to be
squashed for bisectability).

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2024-03-07 14:32:57 +00:00
Gerard Marull-Paretas b39d123163 tests: drivers: mbox: mbox_data: use DT
Instead of hardcoding everything in the sample.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2024-03-07 14:32:57 +00:00
Anisetti Avinash Krishna 9eadfef4cf tests: drivers: gpio: gpio_basic_api: boards: Enabled test for rpl_s
Enable gpio_basic_api test for intel_rpl_s_crb platform

Signed-off-by: Anisetti Avinash Krishna <anisetti.avinash.krishna@intel.com>
2024-03-07 11:09:30 +00:00
Chang An 3605d57ae1 LE Audio: bt_bap_broadcast_sink_cb.syncable should provide the BIGInfo
Modify bt_bap_broadcast_sink_cb.syncable to provide the BIGInfo
instead of just the encryption field.

Signed-off-by: Chang An <chang.an_1@nxp.com>
2024-03-07 11:09:12 +00:00
Emil Gydesen a472133587 Bluetooth: BAP: Apply missing guards for Kconfig values
Some pieces of code were missing proper guards for Kconfig
values, which could cause compile issues

The massive amount of #if in bap.c clearly indicates that the
file should be split, as it contains many things that are specific
for various roles.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-03-07 10:58:32 +00:00
Ying Zhang b32c819b09 Bluetooth: tester: Add support for BTP_GAP_SET_POWERED command
Fill BTP_GAP_SET_POWERED command to support power on/off BT controller

Fixes: #67346

Signed-off-by: Ying Zhang <ying.zhang_2@nxp.com>
2024-03-07 10:57:17 +00:00
Giancarlo Stasi 95851583b8 Bluetooth: Controller: Vendor Specific: support for Scan Request Reports
Add support for vendor specific Set Scan Request Reports command and
Scan Request Received Event, available for legacy advertising.

Signed-off-by: Giancarlo Stasi <giancarlo.stasi.co@gmail.com>
2024-03-07 10:57:09 +00:00
Lyle Zhu 40cf23daff Bluetooth: Rename BT_BREDR to BT_CLASSIC
Rename BT_BREDR to BT_CLASSIC
Rename CONFIG_BT_BREDR to CONFIG_BT_CLASSIC

Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
2024-03-07 11:26:45 +02:00
Lyle Zhu 3a927a2833 Bluetooth: Host: Move BR/EDR files to host/classic
Add subfolder "subsys/bluetooth/host/classic".
Move BR/EDR source files to the subfolder.

Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
2024-03-07 11:26:45 +02:00
Anas Nashif 5e591c38f1 kernel: do not export z_thread_priority_set
This function is only being used by a test, so instead of reimplementing
a syscall in the test, provide a Kconfig option to provide the
functionality that only works with tests and remove some of the
duplication and extra code.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2024-03-06 19:27:28 -05:00
Anas Nashif 8791012ed1 kernel: move essential flag related routines out
The functions to manipulate the essential flag indeed operate on
threads, but they are misplaced in the thread implementation file. Put
them alongside other routines setting other thread flags and cleanup
headers a bit.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2024-03-06 19:27:28 -05:00
Stephanos Ioannidis cb81b295e0 tests: kernel: thread_runtime_stats: Relax precision test for QEMU
This commit relaxes the idle event statistics test precision requirement
for emulated QEMU targets because the cycle counts may be inaccurate when
the host CPU is overloaded (e.g. when running tests with twister) and a
high failure rate is observed for this test in the CI.

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2024-03-06 16:42:33 -05:00