Commit graph

16700 commits

Author SHA1 Message Date
Jeppe Odgaard
231b2a0c19 drivers: sensor: rename tmp116 to tmp11x
The tmp116 sensor driver also supports tmp117 and tmp119. Therefore rename
to indicate that is supports a range of tmp devices.

Signed-off-by: Jeppe Odgaard <jeppe.odgaard@prevas.dk>
2025-04-11 16:17:35 +02:00
Jordan Yates
52415ed94f tests: pm: device_driver_init: test state_get during init
Test the value returned by `pm_device_state_get` during device driver
initialisation.

Signed-off-by: Jordan Yates <jordan@embeint.com>
2025-04-11 14:53:53 +02:00
Utsav Munendra
12cba7addf portability: cmsis: Bugfix osThreadFlagsWait behavior
The osFlagsWaitAny option is not handled correctly.  It returns once any
flag at all is set, whereas it is supposed to only return once one of
the flags specified in flags is set.

Signed-off-by: Utsav Munendra <utsavm@meta.com>
2025-04-11 06:34:06 +02:00
Pavel Vasilyev
f46fd075d4 tests: bsim: bluetooth: host: hfc_multilink: Run test on nRF5340
Run test on nRF5340 to check if recombination works with HCI IPC
driver.

Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
2025-04-11 06:32:58 +02:00
Pavel Vasilyev
82a7110406 tests: bsim: bluetooth: host: hfc: Run test for nRF5340
Run test for nRF5340 to check that it works with a different HCI driver.

Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
2025-04-11 06:32:58 +02:00
Christoph Winklhofer
a5e295c452 json: improve parsing and serializing of integers
Add support for parsing and serializing of following integer types:
'int8_t', 'uint8_t', 'int16_t', 'uint16_t' and 'uint32_t'.

The generic integer token JSON_TOK_INT and JSON_TOK_UINT, in combination
with the field size (set by JSON_OBJ_DESCR_PRIM) allows to parse different
integer types, for example:

struct foo {
  int64_t i64;
  uint32_t u32;
  int16_t i16;
  uint8_t u8;
};

struct json_obj_descr foo_descr[] = {
  JSON_OBJ_DESCR_PRIM(struct foo, i64, JSON_TOK_INT),
  JSON_OBJ_DESCR_PRIM(struct foo, u32, JSON_TOK_UINT),
  JSON_OBJ_DESCR_PRIM(struct foo, i16, JSON_TOK_INT),
  JSON_OBJ_DESCR_PRIM(struct foo, u8, JSON_TOK_UINT),
};

These tokens also support parsing and serializing enums:

enum unsigned_enum { UA=0, UB=1, UC=2 };
enum signed_enum { SA=-1, SB=0, SC=1 };

struct foo {
  enum unsigned_enum u;
  enum signed_enum s;
};

struct json_obj_descr foo_descr[] = {
  JSON_OBJ_DESCR_PRIM(struct foo, u, JSON_TOK_UINT),
  JSON_OBJ_DESCR_PRIM(struct foo, s, JSON_TOK_INT),
};

Signed-off-by: Christoph Winklhofer <cj.winklhofer@gmail.com>
2025-04-11 06:32:50 +02:00
Christoph Winklhofer
63d33e631c json: support parsing and serializing of strings with char arrays
Support parsing and serializing of struct fields that are defined as a
char array.

Use the token JSON_TOK_STRING_BUF to parse and serialize a string for a
char array, for example:

struct foo {
  const char *str;
  char str_buf[30];
};

struct json_obj_descr foo_descr[] = {
  JSON_OBJ_DESCR_PRIM(struct foo, str, JSON_TOK_STRING),
  JSON_OBJ_DESCR_PRIM(struct foo, str_buf, JSON_TOK_STRING_BUF),
};

The struct 'json_obj_descr' now has an additional union member 'field'
to store the size of the struct field, which is used with the token
'JSON_TOK_STRING_BUF' to determine the element size.

Fixes: #65200
Signed-off-by: Christoph Winklhofer <cj.winklhofer@gmail.com>
2025-04-11 06:32:50 +02:00
Hake Huang
98458e2220 tests: uart: add extra_conf to disable CONFIG_USERSPACE
while disable USERSPACE we need set
CONFIG_TEST_ENABLE_USERSPACE=n

fixes: #82758

Signed-off-by: Hake Huang <hake.huang@oss.nxp.com>
2025-04-10 18:01:18 +02:00
Kiara Navarro
77c1414082 drivers: charger: add driver for bq25713
Create a driver implementation for the battery charge controller
TI BQ25713.

It includes the ability to enable / disable the controller and also
to setup max current and voltage charge parameters at initialization
time but also at run time.

On the other hand, it is possible to assign / obtain input voltage
and current regulation.

Signed-off-by: Kiara Navarro <knavarro@paltatech.com>
2025-04-10 18:01:02 +02:00
Troels Nilsson
c3df8fcd92 Bluetooth: Controller: Add validation of received LL_CIS_REQ
Validate that a received LL_CIS_REQ is valid and reject if it is not

Fixes EBQ test failure in LL/CIS/PER/BI-07-C

Signed-off-by: Troels Nilsson <trnn@demant.com>
2025-04-10 15:51:54 +02:00
Benjamin Cabé
975b8e137f tests: json: fix tests involving double numbers
Update the JSON test cases to explicitly cast NAN and INFINITY to double
type to avoid implicit promotion.

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2025-04-10 14:43:19 +02:00
Tim Lin
327f8df862 test: drivers/gpio: ite: it515xx_evb: Add gpio test
Add GPIO node for it515xx_evb test.

Signed-off-by: Tim Lin <tim2.lin@ite.corp-partner.google.com>
2025-04-10 12:58:01 +02:00
Sebastian Głąb
3c34f88678 tests: drivers: uart: uart_elementary: Run test on nRF54L* FLPR
Add overlays required to run the test on:
- nrf54l09pdk/nrf54l09/cpuflpr,
- nrf54l20pdk/nrf54l20/cpuflpr.

Signed-off-by: Sebastian Głąb <sebastian.glab@nordicsemi.no>
2025-04-10 12:57:27 +02:00
Sebastian Głąb
a9e822ee29 tests: drivers: watchdog: wdt_basic_api: Enable test on nRF54L09 and L20
Enable wdt_basic_api test on:
- nrf54l09pdk/nrf54l09/cpuapp (missing supported),
- nrf54l09pdk/nrf54l09/cpuflpr (missing overlay),
- nrf54l20pdk/nrf54l20/cpuflpr (missing supported and overlay).

Signed-off-by: Sebastian Głąb <sebastian.glab@nordicsemi.no>
2025-04-10 12:57:27 +02:00
Sebastian Głąb
729e39a0a7 tests: boards: nrf: qdec: Enable test on nRF54L20 FLPR
Add overlay required to run qdec tests
on nrf54l20pdk/nrf54l20/cpuflpr.

Signed-off-by: Sebastian Głąb <sebastian.glab@nordicsemi.no>
2025-04-10 12:57:27 +02:00
Sebastian Głąb
6a782cf31f tests: drivers: timer: Enable test on nRF54L* cpuflpr
Enable nrf_grtc_timer test on:
- nrf54l09pdk/nrf54l09/cpuflpr and
- nrf54l20pdk/nrf54l20/cpuflpr.

Signed-off-by: Sebastian Głąb <sebastian.glab@nordicsemi.no>
2025-04-10 12:57:27 +02:00
Sebastian Głąb
fb1d730f5c tests: drivers: gpio: gpio_basic_api: Enable test on nRF54L* cpuflpr
Add overlay required to run gpio_basic_api test on
- nrf54l09pdk/nrf54l09/cpuflpr and
- nrf54l20pdk/nrf54l20/cpuflpr.

Signed-off-by: Sebastian Głąb <sebastian.glab@nordicsemi.no>
2025-04-10 12:57:27 +02:00
Tomasz Moń
b3eb6f2d11 usb: device_next: Reduce code size on Full-Speed only configuration
Allow compiler optimizations to remove High-Speed handling code. Knowing
that maximum operating speed is Full-Speed allows to reduce bulk buffers
from 512 to 64 bytes. More RAM optimizations are possible but this
commit only gets the low hanging fruits.

Signed-off-by: Tomasz Moń <tomasz.mon@nordicsemi.no>
2025-04-10 12:57:19 +02:00
Luca Burelli
a90870da4c cmake: yaml: improve escaping of strings with backslashes and quotes
Switching the intermediate file format from JSON to YAML has a very
significant benefit: the file is now loaded via yaml_load(), which
internally calls Python to parse the file into the JSON format that
CMake expects. This means that the file contents are now automatically
escaped properly for JSON; it is a huge improvement over the previous
implementation, which was escaping everything given as input to
to_yaml().

With the removal of the now-redundant call in to_yaml(), escaping is
applied exactly once per value or list, when it is passed to yaml_set().
This allows to convert the logic in zephyr_string(ESCAPE ...) to a more
robust "escape everything" approach.

These changes fix the handling of strings with backslashes and different
types of quotes passed either directly or via generator expression. The
existing tests are updated to cover these cases.

Two other small changes are made in this commit:

- a small check in internal_yaml_list_append() is removed, as the same
  issue is already detected by the caller yaml_set() logic.

- the to_yaml() function is modified to initialize the YAML output
  variable at the top level, which is the expected behavior. This
  resulted in genex temp files sometimes having duplicate lines.

Signed-off-by: Luca Burelli <l.burelli@arduino.cc>
2025-04-10 10:11:47 +02:00
Luca Burelli
4a50fbf804 cmake: yaml: properly store strings
Store strings in YAML as single-quoted entries to avoid issues with
special characters. This also fixes a quirk with the current test
suite where the quotes in the expected value are filtered out by the
YAML import.

Signed-off-by: Luca Burelli <l.burelli@arduino.cc>
2025-04-10 10:11:47 +02:00
Christoph Winklhofer
fc37c02eb1 json: improve parsing and serializing of 'float' and 'double'
Up to now, the handling of type float was offloaded to the users of the
JSON utility, with the token JSON_TOK_FLOAT.

Improve handling of floating point types and support the types 'float'
and 'double' in a built-in way so that they can be directly parsed to
and serialized from variables (of type float or double).

The types are serialized in the shortest representation, either as a
decimal number or in scientific notation:
  * float (with JSON_TOK_FLOAT_FP): encoded with maximal 9 digits
  * double (with JSON_TOK_DOUBLE_FP): encoded with maximal 16 digits
  * NaN, Infinity, -Infinity: encoded and decoded as:
    {"nan_val":NaN,"inf_pos":Infinity,"inf_neg":-Infinity}

Enable the floating point functionality with the Kconfig option:
  JSON_LIBRARY_FP_SUPPORT=y

It requires a libc implementation with support for floating point
functions: strtof(), strtod(), isnan() and isinf().

Fixes: #59412
Signed-off-by: Christoph Winklhofer <cj.winklhofer@gmail.com>
2025-04-09 22:05:14 +02:00
Luis Ubieda
6feb1c639b tests: spi_loopback: Extend RTIO fallback messages to 5
Loopback test requires this in order to properly execute half
transactions. Otherwise, testsuite fails.

It was overlooked when fixing #85894.

Signed-off-by: Luis Ubieda <luisf@croxel.com>
2025-04-09 21:10:53 +02:00
Håkon Amundsen
76a825c5fa tests: spi_controller_peripheral: fix CTRLSEL conflict
Both EXMIF and SPIS peripherals are claiming GPIO port 6 pin 0, but
with different CTRLSEL values. This will trigger a build error with
nrf-regtool 9.0.0 as it is not possible to apply this configuration
to hardware.

Fix the issue by disabling the EXMIF node that is enabled by default.

Signed-off-by: Håkon Amundsen <haakon.amundsen@nordicsemi.no>
2025-04-09 21:10:19 +02:00
Jan Behrens
f75c057e85 drivers: stepper: Renamed DRV8424 to DRV84XX
Renamed the drv8424 stepper driver to indicate its support of the drv8424,
drv8425, drv8426, drv8434 and drv8436 stepper controllors. Also made the
microstep pins optional. All test files are renamed as well.

Signed-off-by: Jan Behrens <jan.behrens@navimatix.de>
2025-04-09 19:34:00 +02:00
Gerhard Jörges
235a363e63 tests: net: http_server: concurrent connections
update to reflect changes in 3ebecd15615197b81efe79fcde6e4bedc0f6b09d

Signed-off-by: Gerhard Jörges <joerges@metratec.com>
2025-04-09 17:32:50 +02:00
Okan Sahin
826ac55454 tests: drivers: build_all: Add build test for AD4130 driver
This commit adds build-only test of ad4130 spi based
adc.

Signed-off-by: Okan Sahin <Okan.Sahin@analog.com>
2025-04-09 17:32:29 +02:00
Emil Gydesen
0270704bcb tests: Bluetooth: Tester: Fix bad check for valid RX
The check was incorrect, and only reported invalid ISO
packages instead of valid.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2025-04-09 15:23:39 +02:00
Emil Gydesen
a4f8744ccf Bluetooth: CCP: Client: Add get_bearers
Add bt_ccp_client_get_bearers that will return the bearers of
a client so that the application can always retrieve them if they
do not store them from the discovery callback.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2025-04-09 15:23:07 +02:00
Chaitanya Tata
63cfbadc5b tests: wifi: configs: Fix the test tags
When only changes are in the "hostap" module the wifi build tests should
be run. Add the module tag to fix that.

Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
2025-04-09 15:22:32 +02:00
Chaitanya Tata
fea0accb84 tests: net: wifi: Move AP to a separate test
AP mode shouldn't be enabled by default, it should be a separate
category.

Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
2025-04-09 15:22:32 +02:00
Robert Lubos
307694f3d9 net: sockets: Remove support for AF_PACKET/IPPROTO_RAW combination
IPPROTO_RAW is not a valid protocol type for AF_PACKET sockets, which
should only use IEEE 802.3 protocol numbers. Therefore remove support
for this type of sockets.

As an alternative, users can use AF_PACKET/SOCK_DGRAM or
AF_INET(6)/SOCK_RAW, depending on the actual use case.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2025-04-09 12:36:34 +02:00
Robert Lubos
4f92df61f1 tests: net: socket: Add tests for AF_INET raw sockets
Add test suite verifying AF_INET/AF_INET6 and SOCK_RAW sockets.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2025-04-09 12:36:34 +02:00
Robert Lubos
a713d8ea60 net: connection: Register connection type
Register connection type along with family and protocol, so that it's
possible to differentiate between connection listening for raw IP
datagrams and TCP/UDP/other packets.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2025-04-09 12:36:34 +02:00
Nhut Nguyen
53f6d8e3b6 tests: drivers: gpio: Add support for RZ/G2L-SMARC
Enable GPIO driver tests for RZ/G2L-SMARC

Signed-off-by: Nhut Nguyen <nhut.nguyen.kc@renesas.com>
2025-04-09 12:35:54 +02:00
Khoa Nguyen
f0d3f1c7e1 tests: drivers: adc: Change reference source test for RA
Using DAC_SOURCE_TEST instead of VREF for all available
boards in adc_accuracy_test app

Signed-off-by: Khoa Nguyen <khoa.nguyen.xh@renesas.com>
2025-04-09 12:35:45 +02:00
Khoa Nguyen
bde068905f tests: drivers: adc: Add config DAC_BUFFER_NOT_SUPPORTED
Add config DAC_BUFFER_NOT_SUPPORTED for adc_accuracy_test

Signed-off-by: Khoa Nguyen <khoa.nguyen.xh@renesas.com>
2025-04-09 12:35:45 +02:00
Khoa Nguyen
9f822a8e33 tests: drivers: adc: Add select DAC when using DAC_SOURCE_TEST
Add select config DAC when using DAC_SOURCE_TEST
for adc_accuracy_test

Signed-off-by: Khoa Nguyen <khoa.nguyen.xh@renesas.com>
2025-04-09 12:35:45 +02:00
alperen sener
08459ec165 tests: bluetooth: tester: Fix MESH/SR/PRB/PNID/BV-02-C test case
Private node identity advertisements must stop immediately when
ordered by PTS. To do so; adding enabled parameter to
btp_priv_node_id_get_cmd.

Signed-off-by: alperen sener <alperen.sener@nordicsemi.no>
2025-04-09 11:43:29 +02:00
Sreeram Tatapudi
970460e809 drivers: adc: Update configuration values for CAT1B ADC
- Update resolution and inter reference mV
	- make unused code conditional

Signed-off-by: Sreeram Tatapudi <sreeram.praveen@infineon.com>
2025-04-09 09:03:19 +02:00
Emil Gydesen
ecceec9b28 tests: drivers: SPI: Replace OVERLAY_CONFIG with EXTRA_CONF_FILE
Replace OVERLAY_CONFIG with EXTRA_CONF_FILE as the former
is deprecated.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2025-04-08 22:58:43 +02:00
Emil Gydesen
fd3f93ac53 tests: boot: mcuboot_recovery_retention: rm OVERLAY_CONFIG
Replace uses of OVERLAY_CONFIG with EXTRA_CONF_FILE
to follow the rest of Zephyr where OVERLAY_CONFIG was
deprecated in favor of EXTRA_CONF_FILE.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2025-04-08 22:58:43 +02:00
Szymon Janc
ddedff7155 tests: bluetooth: tester: Add helper for supported commands response
This makes sure that supported commands are reported correctly.

Signed-off-by: Szymon Janc <szymon.janc@codecoup.pl>
2025-04-08 17:37:33 +02:00
Yishai Jaffe
71bbe52828 tests: drivers: display: add support for htiled mode
Added test support for htiled displays

Signed-off-by: Yishai Jaffe <yishai1999@gmail.com>
2025-04-08 17:37:14 +02:00
Yunshao Chiang
c6fe84caf2 drivers: counter: add ite it8xxx2 timer driver
The IT8xxx2 timer driver uses timer 7 and timer 8 to implement the alarm
timer and the top timer, respectively.

Signed-off-by: Yunshao Chiang <Yunshao.Chiang@ite.com.tw>
2025-04-08 16:12:11 +02:00
Jilay Pandya
4838c0f200 drivers: stepper: introduce valid micro-step resolution check
Introduce macro to check for valid microstep resolution in stepper api
Use this macro in tmc50xx driver. Stepper api tests adjusted in order to
accomodate the not implemented stepper api functions.

Signed-off-by: Jilay Pandya <jilay.pandya@outlook.com>
2025-04-08 11:45:40 +02:00
Christoph Winklhofer
061e345972 json: Fix calculation of object size
The calculation of the object size may be incorrect when the size of
a field is smaller than the struct alignment. When such a struct is
used in an array field, the decoded object contains wrong values.

The alignment influences the object size. For example the following
struct has a calculated object size of 8 bytes, however due to
alignment the real size of the struct is 12 bytes:

struct test_bool {
  bool b1; /* offset 0, size 1 */
           /* 3-byte padding */
  int i1;  /* offset 4, size 4 */
  bool b2; /* offset 8, size 1 */
           /* 3-byte padding */
};

This commit changes the object size calculation and computes the size
with the offset and size of the last field in the struct (rounded up
by the struct alignment).

Fixes: #85121
Signed-off-by: Christoph Winklhofer <cj.winklhofer@gmail.com>
2025-04-08 11:44:51 +02:00
Paul Alvin
a173fceba3 tests: drivers: gpio: gpio_basic_api: Add support for kv260
Add gpio driver testcase support for kv260. The overlay will select the
PS gpio bank to be tested.

For running this testcase on kv260 PS gpio bank 3 has been chosen
because it is EMIO and design is required to connect pins together.

Signed-off-by: Paul Alvin <alvin.paulp@amd.com>
2025-04-08 10:49:34 +02:00
Emil Gydesen
d8e771ded9 tests: Bluetooth: Add BT Tester GAP smoke test
Add a babblesim test of the BT Tester doing a GAP smoke test
connecting 2 BT testers using BTP.

The purpose of this is to further increase the test coverage
of the BT Tester in CI, as it is only being built, and runtime
errors are typically not caught.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2025-04-08 10:49:00 +02:00
Tim Lin
09f25854b3 soc: Separate it8xxx2 related files from the common folder
Some files should be separated from the common folder to
each soc folder for future expansion of the chip.

Signed-off-by: Tim Lin <tim2.lin@ite.corp-partner.google.com>
2025-04-08 10:48:26 +02:00
Georgios Vasilakis
ce4240f893 samples: tests: Exclude nRF54L15 NS for unsupported tests/samples
The ADC and watchdog samples are not currently supported for the
non secure target of the nRF54L15 DK.

Add exclusions for these until they are supported.

Signed-off-by: Georgios Vasilakis <georgios.vasilakis@nordicsemi.no>
2025-04-08 01:51:18 +02:00