Commit graph

13345 commits

Author SHA1 Message Date
Jan Kubiznak 030a8b1830 drivers: dac: dac_ad569x: Support for AD569x DACs.
Added support for Analog Devices AD5691 / AD5692 / AD5693 DACs.

Signed-off-by: Jan Kubiznak <jan.kubiznak@deveritec.com>
2024-04-22 06:50:01 -07:00
Jonathan Rico 65abd2186c tests: Bluetooth: Add regression test to l2cap/stress
43de309b3e made a buffer leak.
It was not detected by this test.

Add another configuration, where the final buffer is sent without
fragments in order to exercise the leaky code path.

Signed-off-by: Jonathan Rico <jonathan.rico@nordicsemi.no>
2024-04-22 06:49:54 -07:00
Théo Battrel ce3141fe6c Bluetooth: Shell: Allow bigger cmd in bsim shell
This is useful if we want to paste a list of multiple command or add
long advertising data for example.

Signed-off-by: Théo Battrel <theo.battrel@nordicsemi.no>
2024-04-22 06:49:47 -07:00
Wei-Tai Lee d459d0e76d tests: kernel: cache: Remove adp_xc7k/ae350 from the blacklist
Since Andes cache implementation is supported, remove
adp_xc7k/ae350 from the blacklist.

Signed-off-by: Wei-Tai Lee <wtlee@andestech.com>
2024-04-22 09:19:27 -04:00
Bartosz Miller 3147243c8f tests: drivers: uart: uart_elementary: Fix 'config_mismatch' test case
UART error may be reported with random timing
from either UART in configuration mismatch case.
The test case is now aligned to such behaviour.

Signed-off-by: Bartosz Miller <bartosz.miller@nordicsemi.no>
2024-04-22 03:48:26 -07:00
Yong Cong Sin b8b98c2c29 tests: arch: common: add stack_unwind test
Added test for archs that support it. It triggers an exception
and verify that the fatal message has stack unwind info.

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
2024-04-20 13:54:43 -04:00
Peter Mitsis 62db185d5b linker: tests: Use Z_LINK_ITERABLE_SUBALIGN
Updates the linker script fragments under 'tests' to use
Z_LINK_ITERABLE_SUBALIGN for the subalignment instead of
a hardcoded value of 4.

Signed-off-by: Peter Mitsis <peter.mitsis@intel.com>
2024-04-20 13:45:25 -04:00
Peter Mitsis 48fdcfd992 tests: Update iterable sections test
Updates the test_ram/test_rom structures to use a 'long' instead
of an 'int' so that the structure sizes will be 4-bytes on 32-bit
platforms and 8-bytes on 64-bit platforms.

Signed-off-by: Peter Mitsis <peter.mitsis@intel.com>
2024-04-20 13:45:25 -04:00
Johann Fischer fa5cfbd937 test: device_next: add overlays to build all functions
Add overlays and test case to build all USB device functions.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2024-04-19 17:04:00 +00:00
Krzysztof Chruściński b36550b8a5 tests: drivers: uart: uart_elementary: Fix RX handling
Rx_byte_offset was wrongly updated which could lead to test
failures.

Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
2024-04-19 16:55:46 +00:00
Dominik Ermel d3e7adc7da tests/flash/common: Disable soc flash for SPI with nrf52840dk
The commit sets CONFIG_SOC_NRF_FLASH=n for SPI/QSPI Flash tests
as building internal Flash driver is not needed in these
scenarios.

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
2024-04-19 16:55:01 +00:00
Dominik Ermel 30f6740512 tests/flash/common: Missing CONFIG_FLASH_PAGE_LAYOUT=y
Test depends on this option to get page information from
device.

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
2024-04-19 16:55:01 +00:00
Krzysztof Chruściński 8e65ed94cb tests: drivers: uart: uart_pm: Add support for nrf54h20dk
Add configuration for nrf54h20dk.

Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
2024-04-19 16:41:24 +00:00
Krzysztof Chruściński c72b6a75ba tests: drivers: uart: uart_pm: Limit scope for nrf54l15
Some configurations which are not valid for nrf54l15. Mainly those
which are using ENHANCED_POLL_OUT option which is not applicable for
nrf54l15 because it has ENDTX_STOPTX short so PPI connection is not
needed.

Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
2024-04-19 16:41:24 +00:00
Krzysztof Chruściński 3424c7af7f tests: drivers: uart: uart_pm: Minor adjustments in the test
Modifying arbitrary delay to cover for receivers with timeout.
Adding a delay between polling and asynchronous checking to cover
for cases when CPU processing is fast enough so that both checks
may overlap.
Allow error code for uart_rx_disable call.

Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
2024-04-19 16:41:24 +00:00
Krzysztof Chruściński a0bb05eb4c tests: drivers: uart: uart_pm: Call pm action from the thread context
PM action shall be called from the thread context thus switching to
k_work instead of the k_timer.

Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
2024-04-19 16:41:24 +00:00
Abderrahmane Jarmouni d834d4f974 tests: drivers: spi_loopback: modify stm32 configs
modify stm32 configs to add f7 series in dma w/ Nocache Mem test cases.

Signed-off-by: Abderrahmane Jarmouni <abderrahmane.jarmouni-ext@st.com>
2024-04-19 16:40:33 +00:00
Franciszek Pindel ff0cc742c1 fs: ext2: Test removing indirect blocks
This commit adds test for the situation when all blocks
referenced from the top-level indirect block are removed.

Signed-off-by: Franciszek Pindel <fpindel@antmicro.com>
2024-04-19 10:13:09 +02:00
Sebastian Głąb 5e4bbd5c7c tests: drivers: spi: Add negative test cases
Extend test coverage by adding tests that check invalid use
of the SPI API.

Signed-off-by: Sebastian Głąb <sebastian.glab@nordicsemi.no>
2024-04-19 10:11:36 +02:00
Luca Burelli 51195f4884 llext: set integration platform on relocatable test
This particular test was ignored in CI because, when using
platform_key, Twister picks the specific platform very early in
the process and it is possible that the chosen one is later
filtered out. To fix this, use the `integration_platforms` key
instead to specify the platforms where the test is expected to
complete successfully.

Signed-off-by: Luca Burelli <l.burelli@arduino.cc>
2024-04-19 10:10:39 +02:00
Luca Burelli 992d14948b llext: remove LOADER_BUILD_ONLY code
The latest commits allow llexts to be built on any architecture, even on
those where llext loading is still unsupported, which is very useful for
testing purposes. This means that the LOADER_BUILD_ONLY logic that was
added for this purpose in 1408d1e5b8 is no longer needed.

Signed-off-by: Luca Burelli <l.burelli@arduino.cc>
2024-04-19 10:10:39 +02:00
Manuel Argüelles 5d2670ac1f drivers: pwm: mcux_ftm: allow to select clock source
FTM internal counter can be clocked by one of three clock sources
independent of the module bus clock. This patch introduces a DT property
to perform the clock selection from DT.

DT sources are updated to keep the current clock selection for all boards,
with exception of ucans32k1sic board which is migrated to use system
clock by default, as this seems to be a better choice for most cases.
Some PWM LED samples require slower clock so overlays are added for
those cases.

Signed-off-by: Manuel Argüelles <manuel.arguelles@nxp.com>
2024-04-19 10:08:53 +02:00
Nikodem Kastelik 01ea0f2d7e tests: boards: nrf: add i2c driver test with TWIS slave
Test defines a lopback between i2c driver master and nrfx TWIS slave
to verify their functional correctness.

Signed-off-by: Nikodem Kastelik <nikodem.kastelik@nordicsemi.no>
2024-04-19 02:23:16 +01:00
Krzysztof Chruściński 1e6a2a00e2 tests: drivers: spi: spi_loopback_test: Add nrf54h20dk support
Add support for nrf54h20dk for the SPI loopback test.

Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
2024-04-18 08:48:05 -07:00
Nikodem Kastelik 1f9bec7f08 tests: drivers: timer: nrf_grtc_timer: add nRF54H20 target
GRTC peripheral is present on nRF54H20,
so the tests should be executed on this target as well.

Signed-off-by: Nikodem Kastelik <nikodem.kastelik@nordicsemi.no>
2024-04-18 08:41:04 -07:00
Alberto Escolar Piedras 5a329202c9 tests/bsim: sysbuild: Set primary MCU idx properly
When using sysbuild,
set the primary MCU index to be the app core
only when we are building the test app in the app core.

Otherwise, if the test app is build in the net core,
the test command line parameters won't be sent by default
to it, and tests will fail.

Luckily, these tests are only built in CI using sysbuild
when we target the 5340bsim app core, and in all but 2,
even if sysbuild was used, this setting was propagated
to the zephyr build if we had separate net and app core
images.
The issue was introduced during the transition to
hwmv2.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-04-18 08:05:55 -07:00
Krzysztof Chruściński d0224ab19f tests: drivers: counter: nrf_rtc: Add nrf52_bsim overlay and adapt test
Add overlay for nrf52_bsim to the fixed_top test.
For bsim board RTC register address has to be translated.

Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
2024-04-18 08:05:39 -07:00
Krzysztof Chruściński 0cc08cde62 tests: drivers: counter: nrf_rtc: Fail if no devices
Test was passing if there were no RTCs enabled given the false positive.

Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
2024-04-18 08:05:39 -07:00
Krzysztof Chruściński 94ee67e411 tests: drivers: counter: nrf_rtc: Move overlay to boards dir
Move overlay to boards directory.

Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
2024-04-18 08:05:39 -07:00
Emil Gydesen 53fa757cea Bluetooth: Audio: Shell: Add additional controller configs to audio.conf
The configuration file is mostly tested for the nRF53 series
where the controller configuration is usually from the
hci_ipc sample.

This means that the existing audio.conf before this commit
has not really been tested for audio, and were missing a few
configurations to make it work properly.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-04-18 14:55:49 +02:00
Alberto Escolar Piedras cf533cc89b tests input/gpio_keys: Add missing overlays for native_sim
During the hwmv1->v2 transition, overlays from a base
board were made to be shared with the variants.
So at that time all overlays for variants which were
just copies of the base overlay were removed.
After that in
https://github.com/zephyrproject-rtos/zephyr/pull/71149
this shared/merged overlay behaviour was reverted,
but not all tests were fixed.

This is one of those. Let's fix it.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-04-18 12:20:14 +02:00
Alberto Escolar Piedras 35c90a5cc1 tests input/gpio_kbd_matrix: Add missing overlays for native_sim
During the hwmv1->v2 transition, overlays from a base
board were made to be shared with the variants.
So at that time all overlays for variants which were
just copies of the base overlay were removed.
After that in
https://github.com/zephyrproject-rtos/zephyr/pull/71149
this shared/merged overlay behaviour was reverted,
but not all tests were fixed.

This is one of those. Let's fix it.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-04-18 12:20:14 +02:00
Alberto Escolar Piedras 8ce6a53494 tests kscan/kscan_input: Add missing overlays for native_sim
During the hwmv1->v2 transition, overlays from a base
board were made to be shared with the variants.
So at that time all overlays for variants which were
just copies of the base overlay were removed.
After that in
https://github.com/zephyrproject-rtos/zephyr/pull/71149
this shared/merged overlay behaviour was reverted,
but not all tests were fixed.

This is one of those. Let's fix it.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-04-18 12:20:14 +02:00
Alberto Escolar Piedras 2b68f22d55 tests adc/adc_rescale: Add missing overlays for native_sim
During the hwmv1->v2 transition, overlays from a base
board were made to be shared with the variants.
So at that time all overlays for variants which were
just copies of the base overlay were removed.
After that in
https://github.com/zephyrproject-rtos/zephyr/pull/71149
this shared/merged overlay behaviour was reverted,
but not all tests were fixed.

This is one of those. Let's fix it.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-04-18 12:20:14 +02:00
Alberto Escolar Piedras 2da2028aaf tests input/kbd_matrix: Add missing overlays for native_sim
During the hwmv1->v2 transition, overlays from a base
board were made to be shared with the variants.
So at that time all overlays for variants which were
just copies of the base overlay were removed.
After that in
https://github.com/zephyrproject-rtos/zephyr/pull/71149
this shared/merged overlay behaviour was reverted,
but not all tests were fixed.

This is one of those. Let's fix it.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-04-18 12:20:14 +02:00
Alberto Escolar Piedras 6d8f0f58d5 tests dfu/mcuboot_multi: Add missing overlay for native_sim
During the hwmv1->v2 transition, overlays from a base
board were made to be shared with the variants.
So at that time all overlays for variants which were
just copies of the base overlay were removed.
After that in
https://github.com/zephyrproject-rtos/zephyr/pull/71149
this shared/merged overlay behaviour was reverted,
but not all tests were fixed.

This is one of those. Let's fix it.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-04-18 12:20:14 +02:00
Alberto Escolar Piedras f664cffd9d tests input/longpress: Add missing overlays for native_sim_64
During the hwmv1->v2 transition, overlays from a base
board were made to be shared with the variants.
So at that time all overlays for variants which were
just copies of the base overlay were removed.
After that in
https://github.com/zephyrproject-rtos/zephyr/pull/71149
this shared/merged overlay behaviour was reverted,
but not all tests were fixed.

This is one of those. Let's fix it.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-04-18 12:20:14 +02:00
Alberto Escolar Piedras 14cf0c5b71 tests check_init_priorities: Add missing overlays for native_sim
During the hwmv1->v2 transition, overlays from a base
board were made to be shared with the variants.
So at that time all overlays for variants which were
just copies of the base overlay were removed.
After that in
https://github.com/zephyrproject-rtos/zephyr/pull/71149
this shared/merged overlay behaviour was reverted,
but not all tests were fixed.

This is one of those. Let's fix it.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-04-18 12:20:14 +02:00
Alberto Escolar Piedras 73c0ca109c tests/subsys log_backend_fs: Add missing overlays for native_sim
During the hwmv1->v2 transition, overlays from a base
board were made to be shared with the variants.
So at that time all overlays for variants which were
just copies were removed.
After that in
https://github.com/zephyrproject-rtos/zephyr/pull/71149
this shared/merged overlay behaviour was reverted,
but not all tests were fixed.

This is one of those. Let's fix it.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-04-18 12:20:14 +02:00
Dominik Ermel 3238ab50d3 tests/drivers/flash_simulator: 64bit native_sim/native_posix overlays
Added missing overlays for native_sim/native/64
and native_posix/native/64 platforms.

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
2024-04-18 12:18:41 +02:00
Hake Huang 7f115412b1 tests: driver: vmu_rt1170 remove hwv1 overlay
remove hwv1 overlay to avoid conflicts with hwv2

Signed-off-by: Hake Huang <hake.huang@oss.nxp.com>
2024-04-18 11:12:13 +02:00
Hake Huang 246803cb35 tests: adc_api: fix build issue
after HWv2 the board overlay need to be dedicated

Signed-off-by: Hake Huang <hake.huang@oss.nxp.com>
2024-04-18 11:12:13 +02:00
Hake Huang 36ab337e3c tests: adc_api: fix build issue with bl654_dvk_nrf52840_pa
need use dedicated board overlay to support HWv2

Signed-off-by: Hake Huang <hake.huang@oss.nxp.com>
2024-04-18 11:12:13 +02:00
Hake Huang 23197260a8 tests: driver: adc_api : update test overlay for hwv2
board overlay need align with board hwv2 naming

fixing: #71437

Signed-off-by: Hake Huang <hake.huang@oss.nxp.com>
2024-04-18 11:12:13 +02:00
Dominik Ermel db49d0ee26 tests/fs: Add missing native_sim_native_64.overlays
Prevent native_sim/native/64 platforms from failing at build.

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
2024-04-18 11:08:35 +02:00
Bartosz Miller 32dd4ec4e8 drivers: Extend coverage for i2s driver
Add more tests cases in the i2s driver error management area
Signed-off-by: Bartosz Miller <bartosz.miller@nordicsemi.no>
2024-04-17 10:20:13 -07:00
Konrad Derda b26b01bc38 tests: net: mcast_routing: add verification of multiple interfaces
This commit adds a test for veryfing new functionality of storing
mutliple interfaces per single multicast routing entry.

Signed-off-by: Konrad Derda <konrad.derda@nordicsemi.no>
2024-04-17 14:39:35 +02:00
Eran Gal e58dfac374 drivers: dac: Add TI DACx0501 driver
Adds a DAC driver for Texas Instruments DACx0501 family of devices

Signed-off-by: Eran Gal <erang@google.com>
Co-authored-by: Martin Jäger <17674105+martinjaeger@users.noreply.github.com>
2024-04-17 14:37:21 +02:00
Armin Brauns 2c8ea07b34 tests: add test for loopback disk access
This sets up a backing device, creates a FAT file system, then opens a file
as a loopback device and runs the disk_access tests on that.

Signed-off-by: Armin Brauns <armin.brauns@embedded-solutions.at>
2024-04-15 10:55:29 -07:00
Karthikeyan Krishnasamy 8c8868c51e tests: posix: fs: add test suite for ftruncate
Add test suite support for posix ftruncate

Signed-off-by: Karthikeyan Krishnasamy <karthikeyan@linumiz.com>
2024-04-15 13:23:37 -04:00
Karthikeyan Krishnasamy feae0a229b tests: posix: fs: add test suite for fsync
Add test suite for posix fsync

Signed-off-by: Karthikeyan Krishnasamy <karthikeyan@linumiz.com>
2024-04-15 13:23:37 -04:00
Alberto Escolar Piedras becf4c1c81 tests/bsim: Fix not detecting failures
b0339136c1
Broke the check for failed bsim tests.
Let's fix it.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-04-15 16:24:12 +02:00
Robert Lubos 9a52efb29e tests: net: tcp: Replace test case numbers with enums
So far test cases in TCP test suite were represented by magic numbers.
With the increasing size of this test suite, it started to become
troublesome to follow, which number represents which test case or what
number can a new test case get.

Introduce a new enum for the test suite, which can be used to represent
individual test case. It simplifies adding new test cases (test case ids
are now defined in a single place, so easier to extend), and also
improves code readability.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2024-04-15 12:51:52 +02:00
Robert Lubos b1adbbe0be tests: net: tcp: Add test case verifying FIN with data processing
Verify, that when TCP stack received FIN packet containing data bytes,
the data is provided to the application and respective seq/ack counters
are updated respectively.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2024-04-15 12:51:52 +02:00
Gaetan Perrot 0b51d37f35 posix: Implement test for isastream
Add tests for `isastream()`

signed-off-by: Gaetan Perrot <gaetanperrotpro@gmail.com>
2024-04-13 20:23:34 -04:00
Dominik Ermel 78ddcdd6fa tests/disk_access: Add flash-disk overlay for testing
Adds native_posix overlay and modifies code to allow testing
flash-disk access.

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
2024-04-13 07:04:24 -04:00
Celina Sophie Kalus 325f22a16f tests: posix: eventfd: Add ioctl F_SETFL test
Add a test to protect against future regressions in the ioctl F_SETFL
operation of eventfd. Flags are set and unset and validity of the file
descriptor is checked by reading and writing.

Signed-off-by: Celina Sophie Kalus <hello@celinakalus.de>
2024-04-13 06:00:08 -04:00
Seppo Takalo 51d80a9838 net: lwm2m: Allow CoAP block size to be changed
Allow changing the CoAP Block-wise transfers block-size
for subsequent GET requests.

It looks like Leshan switches block size back to its
configured value, if it is smaller.
So even when we send block N=0 with size of 512, Leshan
seem to handle that properly but still asks N=2 with
block size 256(if that is configured).

Signed-off-by: Seppo Takalo <seppo.takalo@nordicsemi.no>
2024-04-12 09:14:36 -04:00
Vinayak Kariappa Chettimada 7ece6aed16 Bluetooth: Controller: Fix regression in BT_RX_STACK_SIZE use
Fix regression in BT_RX_STACK_SIZE use due to
commit b91728619c ("Bluetooth: host: remove
`CONFIG_BT_RECV_BLOCKING`").

Profiling of Controller Rx thread has been mentioned in
commit 586ba9fd13 ("Bluetooth: Controller: Increase
BT_RX_STACK_SIZE for BT_HCI_RAW enabled").

Also, move the TX_STACK_SIZE value as default in Kconfig
from the explicit value being set in hci_ipc sample.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2024-04-12 13:48:57 +02:00
Jukka Rissanen d40abe8c0f net: vlan: Fix net_eth_get_vlan_tag() to check correct interface
The network interface parameter for net_eth_get_vlan_tag() should
be the VLAN interface so use the search loop properly.
Earlier the main interface could be checked.

Add also test cases for this so that we can catch that the func
works properly.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2024-04-12 11:54:33 +02:00
Sebastian Głąb 5600ae335b tests: drivers: clock_control: Add nRF54L15 to platform allow
Add nRF54L15 to platform_allow in the sample.yaml:
- clock_control_api,
- nrf_clock_calibration,
- nrf_lf_clock_start,
- onoff.

Signed-off-by: Sebastian Głąb <sebastian.glab@nordicsemi.no>
2024-04-12 10:19:57 +02:00
Bartosz Miller 211477f874 drivers: Extend coverage for UARTE driver
Add more test cases for UARTE driver API
Signed-off-by: Bartosz Miller <bartosz.miller@nordicsemi.no>
2024-04-12 09:19:15 +02:00
Erik Brockhoff dca085e155 bluetooth: controller: refactor node_rx_pdu for memory optimization
Generic node_rx_hdr struct contains data not used for done event, so this
pdu specific data is moved to node_rx_pdu to minimize memory usage for
MFIFO_done alloc.

This however calls for a considerable write-through replacing the generic
node_rx_hdr with node_rx_pdu when relevant and needed.

Signed-off-by: Erik Brockhoff <erbr@oticon.com>
2024-04-12 09:19:08 +02:00
Henrik Brix Andersen 8eded2f76b drivers: can: add can_get_bitrate_{min,max}(), deprecate existing APIs
Since the minimum/maximum supported bitrates are now stored in the common
CAN controller driver configuration struct, retrieving these can no longer
fail.

Add new CAN controller API functions can_get_bitrate_min() and
can_get_bitrate_max() reflecting this and deprecate the existing
can_get_min_bitrate() and can_get_max_bitrate().

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2024-04-11 17:08:35 -04:00
Tom Burdick 4180d70439 dma: Fix error_callback enable/disable confusion
Previously the logic was inverted for error_callback_en where 0 was
enablement and 1 was disable. This was likely done so that the default,
sensibly so, was to enable the error callback if possible. A variety of
in tree users had confused the enable/disable value.

Change the name of the flag to error_callback_dis where the default
remains 0 (do not disable the callback!) and correct in tree uses of the
flag where it seemed incorrect.

Signed-off-by: Tom Burdick <thomas.burdick@intel.com>
2024-04-11 17:08:10 -04:00
Ederson de Souza 2febacc60b tests/kernel/device: Add tests for device deferred init
Ensure that devices are not ready before calling `device_init()`, but
are after the call.

Signed-off-by: Ederson de Souza <ederson.desouza@intel.com>
2024-04-11 15:50:44 -04:00
Guennadi Liakhovetski ce01d96402 llext: add a relocatable extension test to Xtensa
LLEXT on Xtensa now supports both shared and relocatable (partially
linked) extensions. This commit adds a copy of the LLEXT test for the
relocatable case.

Signed-off-by: Luca Burelli <l.burelli@arduino.cc>
Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2024-04-11 11:35:24 -05:00
Erik Brockhoff ad46ed78d4 bluetooth: controller: fix periph failure to disconnect on proc. collision
If central initiates incompatible procedure after having replied (with
_IND), peripheral fails to disconnect as spec'ed.

Fix by correctly setting the INCOMPAT flag to reserved on IND receipt to
enforce the disconnect.

Signed-off-by: Erik Brockhoff <erbr@oticon.com>
2024-04-11 16:01:34 +02:00
Jonathan Rico 43de309b3e Bluetooth: l2cap: Remove (net/buf) frag support
It's needless complexity, and the terminology clashes with
Bluetooth (HCI frags).

It has one user, IPSP, that is going away soon.

Removing frag support will allow a future optimization, removing the
need for HCI and L2CAP fragment buffer pools, saving memory.

Signed-off-by: Jonathan Rico <jonathan.rico@nordicsemi.no>
2024-04-11 14:40:32 +02:00
Krzysztof Chruściński 1cd7f51507 tests: drivers: spi: Add test for SPI master and slave
Add test which is using one SPI master and one SPI slave instance.
There is already a loopback test for SPI master so this test is
focusing on SPI slave API. Test requires 4 pairs of GPIO pins
shortened together. One set of pins is used by SPI master and
one for SPI slave.

Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
2024-04-11 14:30:23 +02:00
Jonathan Rico e3ff993000 Network: L2: remove IPSP
Remove IPSP support from the tree.

It has no maintainers, and is regularly broken. The fact that it's
nontrivial to set-up in linux makes it hard to fix reported issues.

Signed-off-by: Jonathan Rico <jonathan.rico@nordicsemi.no>
2024-04-11 12:48:50 +02:00
Franciszek Pindel e13d1b47c6 fs: ext2: Fix calculating fs_memory in ext2_format
First sector starts at CONFIG_EXT2_DISK_STARTING_SECTOR.
This commit fixes calculating free space, based on that value.

Signed-off-by: Franciszek Pindel <fpindel@antmicro.com>
2024-04-11 09:07:43 +02:00
Cedric Lescop b573f447f0 llext: add movt/movw relocation test
Arch arm relocatate test covers:
R_ARM_ABS32: all tests
decode_thm_jumps -> relative jmp extension
decode_thm_movs -> movwmovt extension

Signed-off-by: Cedric Lescop <cedric.lescop@se.com>
2024-04-10 14:13:15 -04:00
Daniel Leung e7554117b7 tests: mem_protect/stackprot: test mapped stack
This extends the mem_protect/stackprot tests to support testing
with memory mapped stack.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2024-04-10 07:44:27 -04:00
Daniel Leung cfbbcac3f7 tests: threads/thread_stack: extend tests for mapped stack
This extends the test for memory mapped stack, as the address of
memory mapped stack object would be different than the actual
stack object.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2024-04-10 07:44:27 -04:00
Daniel Leung 0b3a4f35d0 tests: mem_protect/userspace: extend tests for mapped stack
This extends the test for memory mapped stack, as the address of
memory mapped stack object would be different than the actual
stack object.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2024-04-10 07:44:27 -04:00
Jonathan Rico f818cbd8cc tests: Bluetooth: Add example bsim test
This test is intended to teach the conventions and best practices to a
potential contributor that wants to add a test, for say a new feature.

It is liberally commented on purpose, so new contributors don't have to
spend two weeks understanding the intricacies of the simulator, the bsim
test framework, the native builds, backchannels, etc..

Signed-off-by: Jonathan Rico <jonathan.rico@nordicsemi.no>
2024-04-10 07:43:41 -04:00
Jonathan Rico 389192a94d tests: Bluetooth: Add common helpers for bsim
This code can be found (kinda) duplicated all over
`tests/bsim/bluetooth`.

Put it in a common place.

Refactoring the current tests will be done in a future commit.

Signed-off-by: Jonathan Rico <jonathan.rico@nordicsemi.no>
2024-04-10 07:43:41 -04:00
Alberto Escolar Piedras 936598ddf1 tests/bsim/common sh: Improve getting test name/relative path
Improve function which guesses the test name so the calling
script can be invoked from any folder, not just Zephyr's
base.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-04-10 07:43:21 -04:00
Jamie McCrae 9c05618c2b tests: Fix missed renames
Fixes some missed renames for overlays with the recent change

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2024-04-10 11:50:29 +02:00
Dominik Ermel 5a0ecb9641 flash: Move dependency on FLASH_PAGE_LAYOUT where it belongs
The commit adds dependency on Kconfig FLASH_PAGE_LAYOUT to subsystems
that really require it:
 FCB, NVS, LittleFS
and removes direct selection from '*.conf' files where no longer
needed.

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
2024-04-10 10:01:40 +02:00
Flavio Ceolin 7b209eee0a tests: intel_adsp: Add vecbase lock test
Add a test to check if vecbase register was properly locked.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2024-04-10 10:00:27 +02:00
Torsten Rasmussen b9f3d68863 samples: tests: additional overlay and conf file adjustments
Adjustments of overlay and conf files to adjust for the MERGE removal.

The revert of MERGE requires specific overlay and conf files for boards
which relied on the MERGE feature.

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2024-04-09 23:35:54 +02:00
Flavio Ceolin 3b895064af pm: Remove state lock/unlock API
This API is not widely used and it is actually broken since device
runtime power management is not checking it when suspending and
resuming.

On top of that, this API is very close to pm_device_busy* API,
close enough to consolidate in only one API.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2024-04-09 20:11:48 +02:00
Emil Gydesen 16ec531a5b Bluetooth: Audio: Shell: Disable EATT support
EATT is not properly used by LE audio nor is the
Zephyr implementation very good, so disable for now
or at least until the BSIM tests are passing with it
enabled.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-04-09 14:21:04 +02:00
Benedikt Schmidt abf32ced74 tests: drivers: build_all: sensor: add TLE9104
Add an instance of the output diagnostics sensor for the
power train switch TLE9104 to the build all tests.

Signed-off-by: Benedikt Schmidt <benedikt.schmidt@embedded-solutions.at>
2024-04-09 11:07:27 +02:00
Benedikt Schmidt 84a40778af drivers: gpio: split up driver for TLE9104 into a MFD
Split up the driver for the power train switch TLE9104 into a
MFD and GPIO.

Signed-off-by: Benedikt Schmidt <benedikt.schmidt@embedded-solutions.at>
2024-04-09 11:07:27 +02:00
Jiafei Pan f5fdc483e7 tests: counter: add imx8mn evk support
Add counter_basic_api application support on imx8mn_evk.

Signed-off-by: Jiafei Pan <Jiafei.Pan@nxp.com>
2024-04-09 11:06:24 +02:00
Jiafei Pan a1000b514f tests: counter: add imx8mm evk support
Add counter_basic_api application support on imx8mm_evk.

Signed-off-by: Jiafei Pan <Jiafei.Pan@nxp.com>
2024-04-09 11:06:24 +02:00
Jiafei Pan 2e80cf4fd6 tests: counter: add imx8mp evk support
Add counter_basic_api application support on imx8mp_evk.

Signed-off-by: Jiafei Pan <Jiafei.Pan@nxp.com>
2024-04-09 11:06:24 +02:00
Nikodem Kastelik 53a7a402a7 tests: drivers: pwm: add support for nRF54 devices
Add missing alignments and overlays so that nRF54H20 and nRF54L15
can run the test.

Signed-off-by: Nikodem Kastelik <nikodem.kastelik@nordicsemi.no>
2024-04-09 11:05:46 +02:00
Richard Wheatley 9f0cd47c78 tests: drivers: rtc: rtc_api
Correct time check for get/set
Previous check would always pass as it checked get/get.

Signed-off-by: Richard Wheatley <richard.wheatley@ambiq.com>
2024-04-08 18:22:41 -05:00
Richard Wheatley 6d7b62452e tests: drivers: gpio: gpio_basic_api
Update to remove failure on GPIO_INT_EDGE_BOTH
when devices return -ENOTSUP

Signed-off-by: Richard Wheatley <richard.wheatley@ambiq.com>
2024-04-08 18:22:41 -05:00
Nicolas Goualard d9fd292f4b drivers: input: CHSC6X Driver
Added a driver for the CHSC6X chip used on the
Seeed Studio Round Display for Xiao

Signed-off-by: Nicolas Goualard <nicolas.goualard@sfr.fr>
2024-04-08 09:28:36 -04:00
Maureen Helm b2b2d704f4 drivers: sensor: ti: Move to vendor subdirectory
Organizes sensor drivers by vendor to distribute maintainership
responsibilities.

Signed-off-by: Maureen Helm <maureen.helm@analog.com>
2024-04-08 09:14:06 -04:00
Emil Gydesen 6073b630da Bluetooth: Audio: Shell: Increase BAP BA recv state count
Increase the supported receive state count to 4, as
several on-market device have at least 2 and sometimes
more.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-04-08 09:11:06 -04:00
Sebastian Głąb 2b549daabc tests: drivers: uart: uart_mix_fifo_poll: Add nRF54L15 to platform allow
Add nRF54L15 to the platform allow list.
Overlay file already exists.

Signed-off-by: Sebastian Głąb <sebastian.glab@nordicsemi.no>
2024-04-08 10:57:18 +03:00
Luca Burelli 313c09bffb llext: add support for build time custom commands
This patch adds support for custom commands to be executed during the
build of an llext target. The commands can be executed at different
points in the build process:

 - PRE_BUILD:  Before the llext code is linked.
 - POST_BUILD: After the llext code is built, but before packaging
	       it in an .llext file.
 - POST_PKG:   After the llext file has been created.

Note that PRE_BUILD is not supported for ARM targets, as in that case
object files are used directly and there is no actual linking step.

The commands can be added using the new add_llext_command() function.
An example usage of it, along with some target properties, is added to
the hello_world test case.

Signed-off-by: Luca Burelli <l.burelli@arduino.cc>
2024-04-08 09:04:32 +02:00
Daniel DeGrasse b5b5291df2 tests: drivers: build_all: add st7796s to display test
Add entry for st7796s to display build_all test, so that the controller
driver will be built by CI.

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2024-04-08 09:04:06 +02:00
Chun-Chieh Li 4a0aa603c8 tests: drivers: i2c: i2c_target_api: support numaker_m2l31ki
Add support for Nuvoton numaker board numaker_m2l31ki.

Signed-off-by: Chun-Chieh Li <ccli8@nuvoton.com>
2024-04-08 09:03:53 +02:00
Fin Maaß e354927895 tests: use appropriate sys_randX_get()
use the appropriate sys_randX_get() instead
of always sys_rand32_get().

Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
2024-04-05 10:57:45 -05:00
Krzysztof Chruściński 362389ee17 tests: drivers: uart: Re-enabling some tests on nrf52_bsim
Tests which were using the new nordic UART shim where failing
on the bsim targets. They are now fixed and tests can be
re-enabled.

Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
2024-04-05 12:21:58 +02:00
Emil Gydesen f70ba925ea tests: Bluetooth: CAP Commander Change Microphone mute unittests
Adds unittests for the CAP Commander Change Microphone mute
procedure.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-04-05 12:21:38 +02:00
Emil Gydesen 50b37cb564 tests: bsim: Bluetooth: CAP Commander Change Microphone Mute
Adds bsim test of the CAP Commander Change Microphone Mute
procedure.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-04-05 12:21:38 +02:00
Abderrahmane Jarmouni c0ce237d9f tests: lib: gui: lvgl: add stm32 test cases
Add test cases for stm32h747i_disco_stm32h747xx_m7.

Signed-off-by: Abderrahmane Jarmouni <abderrahmane.jarmouni-ext@st.com>
2024-04-05 12:21:32 +02:00
Abderrahmane Jarmouni 52f318c85e tests: lib: gui: lvgl: add LittleFS block device support
Add support for running this test on a block device (MMC/SDMMC).

Signed-off-by: Abderrahmane Jarmouni <abderrahmane.jarmouni-ext@st.com>
2024-04-05 12:21:32 +02:00
Lauren Murphy 83ccc8e29b llext: add threads and kernel object test case
Tests threads and kernel objects with userspace. Includes cleanups
suggested by Luca Burelli.

Signed-off-by: Lauren Murphy <lauren.murphy@intel.com>
2024-04-05 12:19:36 +02:00
Daniel DeGrasse 2ad951ca85 tests: drivers: uart_async_api: enable for frdm_mcxn947
Enable the UART async API test for the frdm_mcxn947 board.

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2024-04-04 19:27:28 +02:00
Gaetan Perrot 46f489da3a tests: posix: add tests for pthread_setschedprio()
Add tests for pthread_setschedprio()

Signed-off-by: Gaetan Perrot <gaetanperrotpro@gmail.com>
2024-04-04 10:25:53 -04:00
Ilia Kharin 828a0c04a1 drivers: input: pinnacle: add driver for trackpad
The initial version of an input driver for Cirque Pinnacle ASIC supports:
 * Setting sensitivity
 * Choosing between relative and absolute modes
  * Relative mode
   * Primary tap
   * Swapping X and Y
  * Absolute mode
   * Setting number of idle packets
   * Clipping coordinates outside of active range
   * Scaling coordinates
   * Inverting X and Y coordinates

Signed-off-by: Ilia Kharin <akscram@gmail.com>
2024-04-04 09:46:06 +01:00
Kyle Dunn a846b81d58 drivers: sensor: lis2dux12: Add lis2dux12 driver
Adds support for the STMicroelectronics LIS2DUX12 3-axis accelerometer.

Signed-off-by: Kyle Dunn <kdunn926@gmail.com>
2024-04-04 09:45:49 +01:00
Konrad Derda d4dc516119 tests: net: mld: fix waiting for MLDv2 report after query
This commit fixes 'test_verify_send_report()' function as it was
not properly waiting for a MLDv2 report after sending a query. The
asserted value was set for the previous report sent after joining a
group.

Signed-off-by: Konrad Derda <konrad.derda@nordicsemi.no>
2024-04-03 15:30:03 -05:00
Robert Lubos f211cd6345 net: tcp: Deprecate CONFIG_NET_TCP_ACK_TIMEOUT
Deprecate CONFIG_NET_TCP_ACK_TIMEOUT as it is redundant with the
combination of CONFIG_NET_TCP_INIT_RETRANSMISSION_TIMEOUT and
CONFIG_NET_TCP_RETRY_COUNT. The total retransmission timeout (i. e.
waiting for ACK) should depend on the individual retransmission timeout
and retry count, having separate config is simply ambiguous and
confusing for users.

Moreover, the config was currently only used during TCP handshake, and
for that purpose we could use the very same timeout that is used for the
FIN timeout. Therefore, repurpose the fin_timeout_ms to be a generic,
maximum timeout at the TCP stack.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2024-04-03 15:32:45 -04:00
Daniel Baluta 68a7057513 soc: nxp: imxrt: Prepare imxrt6xx soc for AMP support
imxrt6xx are dual core devices featuring an ARM Cortex-M33
core and an Cadence Xtensa HIFI4 Audio DSP.

Currently only m33 core is supported. In order to support
the Cadence DSP we need first to do some code-reorganization
for m33.

We start by moving all cm33 related code to its own directory
and introduce the cpuclusters property in soc.yml file.

Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
2024-04-03 15:41:16 +01:00
Chris Friedt 3c42daee9c tests: posix: headers: fix undefined ref to zsock_socketpair
Update prj.conf so that

subsys/net/lib/sockets/socketpair.c

is pulled into the build and zsock_socketpair() is
properly defined.

Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>
2024-04-03 07:09:16 -04:00
Gaetan Perrot aad1f6e47b test: posix: headers: check for pthread_rwlockattr_getpshared()
Check for the existence of
pthread_rwlockattr_getpshared()
and
pthread_rwlockattr_setpshared().

Signed-off-by: Gaetan Perrot <gaetanperrotpro@gmail.com>
2024-04-03 10:38:42 +03:00
Reto Schneider 6ab94f0429 tests: drivers: pwm: Add lpcxpresso55s69 board name
This adds a board name that got missed in commit
8dc3f85622 (hwmv2: Introduce Hardware
model version 2 and convert devices)

Signed-off-by: Reto Schneider <reto.schneider@husqvarnagroup.com>
2024-04-03 09:37:21 +03:00
Pieter De Gendt c093ff4260 tests: drivers: spi: spi_loopback: Add mimx8mp_evk board
Add a config and overlay for NXP mimx8mp_evk board.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2024-04-02 21:03:47 -04:00
Mahesh Mahadevan 8ea68cc0b4 tests: i2c: Add support for NXP MCXN947
Add support for NXP MCXN947

Signed-off-by: Mahesh Mahadevan <mahesh.mahadevan@nxp.com>
2024-04-02 21:00:24 -04:00
Filip Kokosinski 11a30924d2 tests/posix/getopt: add hifive1.conf
This commit sets `CONFIG_NEWLIB_LIBC_MIN_REQUIRED_HEAP_SIZE=2048` for the
SiFive HiFive1 board. Otherwise, the test fails on the following assert
from Newlib:

memory space available for newlib heap is less than the minimum required
size specified by CONFIG_NEWLIB_LIBC_MIN_REQUIRED_HEAP_SIZE

Signed-off-by: Filip Kokosinski <fkokosinski@antmicro.com>
2024-04-02 14:31:39 +01:00
Filip Kokosinski 1903756888 tests/lib/cbprintf_fp: add hifive1.conf
This commit sets `CONFIG_NEWLIB_LIBC_MIN_REQUIRED_HEAP_SIZE=2048` for the
SiFive HiFive1 board. Otherwise, the test fails on the following assert
from Newlib:

memory space available for newlib heap is less than the minimum required
size specified by CONFIG_NEWLIB_LIBC_MIN_REQUIRED_HEAP_SIZE

Signed-off-by: Filip Kokosinski <fkokosinski@antmicro.com>
2024-04-02 14:31:39 +01:00
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