Commit Graph

16062 Commits

Author SHA1 Message Date
Nicolas Pitre
ea7a969204 tests: benchmarks: sys_kernel: add k_malloc() test
Useful to evaluate malloc performance changes.

Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
2025-04-01 22:13:04 +02:00
Konrad Sikora
8ad2cac1b5 drivers: sensor: Add support for LTR329 sensor
Add support for Liteon LTR329 Digital Ambient Light Sensor

Signed-off-by: Konrad Sikora <kontakt@konradsikora.pl>
2025-04-01 22:12:01 +02:00
Konrad Sikora
85e9cef24e drivers: sensor: Change vendor prefix from 'ltr' to 'liteon'
The vendor prefix has been changed from 'ltr' to 'liteon'.
This change is made to better reflect the actual name of
the vendor, which is LiteOn. The previous prefix 'ltr'
was referring to the LiteOn Optical Sensor family, which
could lead to misunderstandings.

Signed-off-by: Konrad Sikora <kontakt@konradsikora.pl>
2025-04-01 22:12:01 +02:00
Johan Hedberg
39c2605930 Bluetooth: Fix deadlock with settings and bt_hci_cmd_send_sync()
We can't do synchronous HCI command sending in any settings commit()
callback, since we don't know what context the callback is being called
from. One particular deadlock can happen if settings_load() is called from
the preemptible main thread:

main()
 |--> settings_load() (aquire settings_lock mutex)
       |-->commit callback A that defers to system wq
       |-->commit callback B that calls bt_hci_cmd_send_sync()

system wq from the previous deferral from within settings_load():
 |--> work item
       |--> settings_save_one()
             |--> attempt to aquire settings_lock mutex

In the above scenario, the bt_hci_cmd_send_sync() call from the main thread
depends on the system workqueue being processed (since that's what does HCI
command processing by default), while at the same time holding the settings
subsystem's mutex. At the same time, a system wq item tries to store
something into settings, however it deadlocks waiting for the settings
mutex.

The actual scenario that we have in the Bluetooth subsystem is where
"commit callback A" is commit_settings() in host/settings.c, and "commit
callback B" is keys_commit() in host/keys.c.

The solution to the deadlock is to take advantage of deferred bt_id_add()
handling which already exists, i.e. set a flag and deferre the actual
adding to the system workqueue.

Signed-off-by: Johan Hedberg <johan.hedberg@silabs.com>
2025-04-01 16:28:00 +02:00
Ryan Chu
c9240cc99f bluetooth: host: Report status of Channel Sounding complete events
If the HCI status of a complete event is not BT_HCI_ERR_SUCCESS,
the remaining parameters could be invalid.

In this case, the params is passed as NULL pointer to the callbacks.
- LE CS Read Remote Supported Capabilities Complete event
- LE CS Read Remote FAE Table Complete event
- LE CS Config Complete event
- LE CS Security Enable Complete event
- LE CS Procedure Enable Complete event

This change avoids forwarding the invalid fileds to the applications.

Signed-off-by: Ryan Chu <ryan.chu@nordicsemi.no>
2025-04-01 16:26:58 +02:00
Ryan McClelland
19c2c33be6 tests: drivers: spi: add build all for cadence spi
As there is no currently known board that has the cadence spi,
add a test to just build it under the qemu cortex m3.

Signed-off-by: Ryan McClelland <ryanmcclelland@meta.com>
2025-04-01 16:26:38 +02:00
Håkon Amundsen
1fac1b917f boards: nordic: add 'iron' board variant
This is needed for next generation Secure Domain firmware.

Signed-off-by: Håkon Amundsen <haakon.amundsen@nordicsemi.no>
2025-04-01 11:54:30 +02:00
Tom Hughes
785e36520f tests: subsys: usb: bos: Remove dummy_descriptor struct
When building with clang, it warns:

tests/subsys/usb/bos/src/test_bos.c:24:22: error: variable
'dummy_descriptor' is not needed and will not be emitted
[-Werror,-Wunneeded-internal-declaration]
static const uint8_t dummy_descriptor[] = {
                     ^

Only the size of dummy_descriptor is used, not the contents. Replace the
struct with a constant for the size.

Signed-off-by: Tom Hughes <tomhughes@chromium.org>
2025-04-01 11:54:20 +02:00
Andrej Butok
efbe756b62 tests: ext2: reduce ram disk size for small.overlay
- Reduces the ram disc sector count from 400 to 220.
- Saves about 90KB of RAM. All tests still passed.
- Allows platforms with less RAM to run
  the ramdisc_small.overlay test.

Signed-off-by: Andrej Butok <andrey.butok@nxp.com>
2025-04-01 11:52:34 +02:00
Declan Snyder
2eb8cfb7f5 tests: spi_loopback: Fix synchronization mistakes
There are a couple things going wrong in this test code right now.

First of all, there is no syncrhonization of when the async polling
thread should start polling, causing sometimes the poll to fail on tests
before the async test ran. Add a semaphore to fix this.

The lock test was setting up a nonsense NOP transfer of 0 length.
This might cause unexpected behavior and is not the point of
this test case.
But, still we should add a seperate test case specifically for
testing this instead.

Also add a teardown function to release the locks to allow other test
cases to run in case of some failures.

Also a minor change to remove some ARG_UNUSED invocations for some
arguments that are actually used.

Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
2025-04-01 04:15:31 +02:00
Emil Gydesen
26e74f75b6 tests: Bluetooth: Tester: Fix typo in PBP announcement
Fixes typo in the event name.
Changes the struct to also use _ev instead of _rp as it
is an event and not a response.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2025-03-31 19:48:25 -04:00
Aleksandr Khromykh
69c5c6f40e Bluetooth: Mesh: make corresponding group ID unique
Commit fixes bug when corresponding group ID was never
incremented for independent corresponding relationships.

Signed-off-by: Aleksandr Khromykh <aleksandr.khromykh@nordicsemi.no>
2025-03-31 22:01:11 +02:00
Jukka Rissanen
e58407c5bf tests: net: dns: packet: Add test case for compression bit in CNAME
Add checks that we will be able to catch invalid compression bit in
response CNAME handling.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2025-03-31 22:00:36 +02:00
Jukka Rissanen
b086c9d0f0 tests: net: dns: packet: Add test case for recursive name in CNAME
Add checks that we will be able to catch recursive name pointers and
abandon the response for CNAME handling.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2025-03-31 22:00:36 +02:00
Sebastian Głąb
f2cf2662c9 tests: drivers: i2c: i2c_target_api: Enable test on nRF54L20 cpuapp
Add Overlay required to run the test on
nrf54l20pdk/nrf54l20/cpuapp.

Signed-off-by: Sebastian Głąb <sebastian.glab@nordicsemi.no>
2025-03-31 22:00:26 +02:00
Krzysztof Chruściński
830a22e48f tests: drivers: timer: nrf_grtc: Fix test_get_ticks
Test was occasionally failing when two types of current time
reading occurred at different system tick. In that case they
were of by one system tick and test was failing.

Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
2025-03-31 14:31:48 +02:00
Sudan Landge
a1e3083def tests: arm: adjust test for relocated rom
Add a memory barrier to make sure write to NVIC is completed
before continuing with the test fails in scenarios where
CONFIG_ROMSTART_RELOCATION_ROM is enabled for boards like MPS3
Corstone310 and k_sem_take is called before the isr's are called.

Signed-off-by: Sudan Landge <sudan.landge@arm.com>
2025-03-31 11:30:55 +02:00
Sudan Landge
5f91f17e68 boards: arm: Enable default testing of MPS3 boards
Enable tests by default for CS300 and CS310 since they support
simulation and FVP's are available in upstream docker.

Signed-off-by: Sudan Landge <sudan.landge@arm.com>
2025-03-31 11:30:55 +02:00
Ta Minh Nhat
1adce5710e tests: drivers: pwm: Change pwm channel for ek_ra6m3
Change default pwm to pwm0 on ek_ra6m3 in test app pwm_loopback
to avoid pin conflict with ethernet phy.

Signed-off-by: Ta Minh Nhat <nhat-minh.ta.yn@bp.renesas.com>
2025-03-31 08:07:22 +02:00
Amneesh Singh
932953d2e6 tests: float_disable: honor custom ARM interrupt controllers
This patch allows checking for any custom ARM interrupt controller to get a
non-enabled IRQ line instead of assuming that GIC is enabled

Signed-off-by: Amneesh Singh <a-singh7@ti.com>
2025-03-31 08:06:36 +02:00
Arkadiusz Cholewinski
9a4104dc28 tests: power_wakeup_timer: Tests the RTC alarm’s ability to wake the CPU
As above, the test verify the ability to wake up CPU
from the lowest power state. The test has been
prepared for stm32l562e_dk board.

Signed-off-by: Arkadiusz Cholewinski <arkadiuszx.cholewinski@intel.com>
2025-03-31 08:06:25 +02:00
Arkadiusz Cholewinski
21f7e5fc28 tests: power_residency_time: Tests the residency time of each power state
This test evaluates the residency time of different power states
on the stm32l562e_dk board and calculates the
RMS (Root Mean Square) current for every detected state.

Signed-off-by: Arkadiusz Cholewinski <arkadiuszx.cholewinski@intel.com>
2025-03-31 08:06:25 +02:00
Arkadiusz Cholewinski
513eb43377 tests: power_states: Verifies the transition to all available power states
During the test, pytest detects each step and calculates
the RMS (Root Mean Square) current for every detected state.
The test then compares the calculated RMS values
against the expected values.

Signed-off-by: Arkadiusz Cholewinski <arkadiuszx.cholewinski@intel.com>
2025-03-31 08:06:25 +02:00
Tomasz Bursztyka
f17f6af5e6 tests: debug: Add in-memory coredump backend test scenario
Providing the right config options and a new test scenario,
coredump_backends test will run under the in-memory backend.

Signed-off-by: Tomasz Bursztyka <tobu@bang-olufsen.dk>
2025-03-29 07:44:11 -04:00
Vinayak Kariappa Chettimada
306b6ecdfc tests: bsim: Bluetooth: Enable MIC failure CIS tests
Enable back previously failed CIS tests due to MIC failures.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2025-03-29 06:32:21 +01:00
Vinayak Kariappa Chettimada
4ab805b389 Bluetooth: Controller: Fix incorrect CIS offset accepting peer instant
Fix incorrect CIS offset in use if instant is picked from
the peer sent CIS RSP PDU. Instead, keep the instant that
was sent in the CIS REQ PDU as the instant to send in the
CIS IND PDU.

This fixes CIS failed to be established when dissimilar
ACL and ISO intervals are in use.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2025-03-29 06:32:21 +01:00
Anas Nashif
3d4c7736e1 tests: logging: remove inactive test
This test is being skipped for the last 3 years, had lots of issues when
it was introduced. No need to keep it in the tree.

If fixed and made to work again, we can always add it back.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2025-03-28 21:52:13 +01:00
Anas Nashif
1a9a43a7fa tests: unskip some tests
Few tests are being skipped for no goot reason (anymore). Add some
coverage using few platforms that work with intention to expand if all
works well and if needed.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2025-03-28 21:52:13 +01:00
Anas Nashif
37c4631a0b tests: remove various filters due to bugs/issue that were fixed
Some platforms were excluded due to issues that were fixed or resolved
themselves. Enable those platforms again and remove the comments related
to the issues.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2025-03-28 21:52:13 +01:00
Jukka Rissanen
9264c5c941 tests: net: dhcpv4: Fix test case for ignored options
If CONFIG_NET_DHCPV4_OPTION_PRINT_IGNORED is set, then adjust the
tests as we no longer get so many events.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2025-03-28 21:51:33 +01:00
Jukka Rissanen
8ec4fba67c net: dhcpv4: Add parsing of broadcast address
Currently we ignore the broadcast address but make sure we
print it in order to avoid unknown option prints.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2025-03-28 21:51:33 +01:00
Ibrahim Abdalkader
d91cea6ac4 tests: drivers: Add ST7701 test.
Add a test for ST7701 display driver.

Signed-off-by: Ibrahim Abdalkader <i.abdalkader@gmail.com>
2025-03-28 21:50:58 +01:00
Krzysztof Chruściński
5cbae7f2b6 tests: kernel: tickless: tickless_concept: Support more frequencies
Test was assuming that CONFIG_SYS_CLOCK_TICKS_PER_SEC=100 but such
frequency is not well supported on SoC which are based on 32768 Hz RTC
clock. Align test to be able to work with different sys_clock
frequency by converting previously 20 ticks to milliseconds.

Set CONFIG_SYS_CLOCK_TICKS_PER_SEC=32768 when system clock is using
Nordic RTC timer driver.

Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
2025-03-28 16:10:51 +01:00
Mathieu Anquetin
fa3da27f15 boards: st: add support for the nucleo_f439zi
Add support for the nucleo_f439zi board.

Signed-off-by: Mathieu Anquetin <mathieu.anquetin@groupe-cahors.com>
2025-03-28 16:09:50 +01:00
Anisetti Avinash Krishna
98dba7da7c include: zephyr: sys: time_units: Type cast SYS_CLOCK_HW_CYCLES_PER_SEC
Type case CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC to uint32_t
while defining sys_clock_hw_cycles_per_sec_runtime_get()
to extend the range of frequency to 0xffffffff.

Signed-off-by: Anisetti Avinash Krishna <anisetti.avinash.krishna@intel.com>
2025-03-28 12:21:07 +01:00
Henrik Brix Andersen
5b63242e75 tests: boards: neorv32: add build_all test for the NEORV32
Add a dedicated "build_all" test for the NEORV32 and its peripheral
drivers. These drivers depend on the NEORV32 SYSINFO (syscon) and thus
cannot easily be built for non-NEORV32 board targets.

Signed-off-by: Henrik Brix Andersen <henrik@brixandersen.dk>
2025-03-28 12:20:41 +01:00
Nhut Nguyen
f3d3b361d7 tests: drivers: gpio: Add support for RZ/V2L-SMARC
Enable GPIO driver tests for RZ/V2L-SMARC

Signed-off-by: Nhut Nguyen <nhut.nguyen.kc@renesas.com>
2025-03-28 08:35:13 +01:00
Anas Nashif
66b04f9198 tests: sensors: fix identifier
Use drivers.sensor for all tests related to sensors.

Also change MAINTAINER file to reflect that. It was using
drivers.sensors

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2025-03-27 17:18:27 +01:00
Andrzej Kuros
d15c9fe9a6 drivers: i2c_nrfx_twim: add exclusive access API
This commit provides an extension to the i2c_nrfx_twim driver.
It introduces possibility to acquire/release exclusive access to the
i2c bus. While the exclusive access to the i2c bus is acquired
you can access the underlying nrfx_twim driver directly.

Signed-off-by: Andrzej Kuros <andrzej.kuros@nordicsemi.no>
2025-03-27 17:17:32 +01:00
Andrej Butok
235a28318b tests: fat_fs_api: fix main-stack overflow for the RAM-disk case
- Fixes the main stack overflow for the fat_fs_api
  RAM disk configuration on real platforms.
- Sets CONFIG_MAIN_STACK_SIZE=3072. By default it is 1KB,
  but the stack usage is about 2KB.

Signed-off-by: Andrej Butok <andrey.butok@nxp.com>
2025-03-27 14:02:03 +01:00
Bartosz Miller
90299f0b0a tests: drivers: flash: Add non-Quad mode test for nrf52 and nrf53
QSPI NOR driver non-Quad mode was not tested before.
Add configuration that uses driver in the non-Quad mode.

Signed-off-by: Bartosz Miller <bartosz.miller@nordicsemi.no>
2025-03-27 14:01:54 +01:00
Robert Budai
d7e363e358 drivers: gpio: max22190: add max22199 extended support
The MAX22199 is an IEC 61131-2 compliant industrial digital input device.
The MAX22199 translates eight 24V current-sinking industrial inputs to a
serialized SPI-compatible output that interfaces with 3V to 5.5V logic. It
can operate as eight Type 1/Type 3 digital inputs or four Type 2 digital
inputs. The device provides diagnostic functions, including thermal
shutdown, 24V under voltage alarm, 24V missing voltage alarm, and SPI and
CRC communication error detection.

Signed-off-by: Robert Budai <robert.budai@analog.com>
2025-03-27 03:49:44 +01:00
Derek Snell
725c0ebc50 doc: tests: drivers: spi_loopback: frdm_rw612 add comment
Document the signals to short to pass this test.

Signed-off-by: Derek Snell <derek.snell@nxp.com>
2025-03-26 21:57:05 +01:00
Tom Hughes
a9c5b72a6f tests: net: lib: http_server: Check response
Building with clang, it warns:

tests/net/lib/http_server/core/src/main.c:1400:19: error: variable
'http1_header_capture_common_response' is not needed and will not be
emitted [-Werror,-Wunneeded-internal-declaration]
static const char http1_header_capture_common_response[]
                  ^                             = "HTTP/1.1 200\r\n"

Add a check to make sure the response actually matches the expected
response.

Signed-off-by: Tom Hughes <tomhughes@chromium.org>
2025-03-26 21:56:51 +01:00
Nidhal BEN OTHMEN
a584534791 boards: st: nucleo_wba52cg: Remove the support of Nucleo WBA52CG board
Remove the support of the Nucleo WBA52CG board since it is NRND
(Not Recommended for New Design) and it is not supported anymore
in the STM32CubeWBA from version 1.1.0 (July 2023).

Signed-off-by: Nidhal BEN OTHMEN <nidhal.benothmen@st.com>
2025-03-26 21:55:39 +01:00
Corey Wharton
a7f6cee9de drivers: sensors: lsm6dsv16x: add support for lsm6dsv32x variant
The LSM6DSV32X part is nearly identical to the LSM6DSV16X but has different
sensitivity scales for the accelerometer (4-32G versus 2-16G). This commit
adds support for this part via the "st,lsm6dsv32x" compatible string.

Signed-off-by: Corey Wharton <xodus7@cwharton.com>
2025-03-26 16:19:54 +01:00
Robert Lubos
347653e72a tests: net: mqtt: Add MQTT 5.0 packet encoder/decoder tests
Add new test suite covering MQTT 5.0 packet format.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2025-03-26 16:19:42 +01:00
Robert Lubos
55e1c10894 net: mqtt: Add MQTT 5.0 support for DISCONNECT
Add support for DICONNECT message specified in MQTT 5.0.
As with MQTT 5.0, the disconnect can now also be initiated by the
broker, it was needed to add decoder support for the message.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2025-03-26 16:19:42 +01:00
Robert Lubos
2459ffae41 net: mqtt: Add MQTT 5.0 support for SUBACK/UNSUBACK
Add support for SUBACK/UNSUBACK messaged specified in MQTT 5.0.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2025-03-26 16:19:42 +01:00
Robert Lubos
efd795b066 net: mqtt: Add MQTT 5.0 support for SUBSCRIBE/UNSUBSCRIBE
Add support for SUBSCRIBE/UNSUBSCRIBE messages specified in MQTT 5.0.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2025-03-26 16:19:42 +01:00