Commit graph

9359 commits

Author SHA1 Message Date
Lucas Tamborrino
a5515d43a5 tests: kernel: fpu_sharing: add xtensa arch
Add xtensa arch to Shared Floating Point Support test.

Signed-off-by: Lucas Tamborrino <lucas.tamborrino@espressif.com>
2022-12-27 13:23:17 +01:00
Gerard Marull-Paretas
adbd0603b6 lib: linear_range: fix count for ranges with step 0
Ranges with step 0, that is, multiple indices representing the same
value, need to report the count exclusively based on indices. This makes
it possible to later retrieve all values, e.g. in a group.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-12-27 13:12:55 +01:00
Gerard Marull-Paretas
1ca1f25918 drivers: regulator: add get_mode API
Add a new API to query the configured regulator mode. Updated fake
driver and API tests.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-12-27 13:12:55 +01:00
Gerard Marull-Paretas
fbba106a23 drivers: regulator: apply initial mode
Apply initial mode (regulator-initial-mode) as part of the
regulator_common_init_enable call. Update tests to cover this change.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-12-27 13:12:55 +01:00
Gerard Marull-Paretas
88c082a46e tests: drivers: regulator: api: check init conditions during setup
Check conditions that happened during device init at setup stage, so
that we can reset fakes and make tests stateless.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-12-27 13:12:55 +01:00
Quang Bui Trong
411549c22c tests: drivers: watchdog: add test watchdog for s32z270dc2_r52
This test to verify Watchdog install/setup/feed can work and
 interrupt can be triggered on timeouts. This test doesn't test the
 case of reseting the board on time out because flash isn't currently
 support.

Signed-off-by: Quang Bui Trong <quang.buitrong@nxp.com>
2022-12-27 10:36:42 +01:00
Marek Matej
025c73908b tests: adc: esp32 api test
Update adc test to support ESP32 targets

Signed-off-by: Marek Matej <marek.matej@espressif.com>
2022-12-23 23:45:05 +00:00
TOKITA Hiroshi
1b93f036d7 tests: dma: loop_transfer: add overlay for GD32 boards
Add overlay file for gd32_e507z_eval, gd32f407v_start,
gd32f450v_start, gd32f450v_start and longan_nano_lite.

Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
2022-12-22 13:43:49 +01:00
TOKITA Hiroshi
6dc1187e44 tests: dma: loop_transfer: Correct DMA definition of gd32f350r_eval
The overlay file overrides not existing node `dma0`.
Correct it to `dma`.

Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
2022-12-22 13:43:49 +01:00
Dominik Ermel
db34adf9c3 mgmt/mcumgr: Standardise MCUmgr Kconfig names
Standardise Kconfig options for MCUmgr.

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
2022-12-22 12:36:34 +01:00
Rob Barnes
61b5566e74 logging: Add an option for a custom log header
There are scenarios when it is necessary to globally redefine
a log macro. The existing logging frontend is not sufficient since
it redirects at the function level.

One example is using pigweed_tokenzier. The pigweed tokenizer depends
on intercepting log strings at the macro level to function.

Introduce an option to include a custom application provided header
named "zephyr_custom_log.h" at the end of log.h. This allows an
application to extend the LOG_* macros globally.

This change includes a simple test that redefines the core LOG macros
to include a custom prefix.

Signed-off-by: Rob Barnes <robbarnes@google.com>
2022-12-22 11:09:59 +01:00
Andriy Gelman
eef672ed5b tests: uart: Test pushing more than 1 byte in uart_fifo_fill call
Currently the test only pushes 1 byte in each call to uart_fifo_fill().
This doesn't test cases where the driver can accept more than 1 byte
in the fifo.
Instead, try to push all the bytes in the uart_fifo_fill() call.
Internally the driver may only accept 1 byte, in which case the test
will be equivalent as before the patch.

Signed-off-by: Andriy Gelman <andriy.gelman@gmail.com>
2022-12-22 11:06:43 +01:00
Fabio Baltieri
551c632ac4 drivers: espi: enable ESPI_EMUL automatically
Enable ESPI_EMUL automatically based on the corresponding devicetree
compatible.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2022-12-22 11:06:18 +01:00
Jamie McCrae
d7557102c0 mgmt: mcumgr: Add iterable section to register MCUmgr handlers
This replaces the requirement for applications to manually
register MCUmgr handlers by having an iterable section which
then automatically registers the handlers at boot time.

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2022-12-22 11:03:04 +01:00
Emil Gydesen
4e3205d238 Bluetooth: Audio: Add packing to unicast group create
Add the ISO packing field when creating a unicast group.

This refactors the structure of the unicast group create,
as it now takes both the packing as a group parameter, as well
as an array of stream-specific parameters.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-12-22 10:59:16 +01:00
Emil Gydesen
ba1949759d Bluetooth: Audio: Add packing field to broadcast source
Add support for setting the ISO packing field when
creating a broadcast source.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-12-22 10:59:16 +01:00
Declan Snyder
0afa2608db tests: fat_fs_api: MKFS still causing build errors
The MKFS portion of the test is still was being included
in the build when it shouldn't because of a file glob

Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
2022-12-21 13:37:03 +01:00
Arkadiusz Balys
3afd564bba modules: openthread: platform: Added setting default tx power
There were some requests from users for adding the possibility
of setting default openthread tx output power using kConfig.
It is possible by adding the CONFIG_OPENTHREAD_DEFAULT_TX_POWER
kConfig and assigning it to the tx_power variable in the radio.c
file in the Openthread module.

Added the possibility to set default openthread power using
kConfig.

Signed-off-by: Arkadiusz Balys <arkadiusz.balys@nordicsemi.no>
2022-12-21 12:21:09 +01:00
Piotr Kosycarz
b8815ddc36 tests: kernel: timer: starve: Adjust timeout value
The test in its default configuration needs 3600 seconds to complete,
adjust timeout for twister to meet that.

Signed-off-by: Piotr Kosycarz <piotr.kosycarz@nordicsemi.no>
2022-12-21 10:11:23 +01:00
Gerard Marull-Paretas
b67c78bfbe tests: drivers: regulator: refactor fixed regulator test
Refactor the test following latest changes on the regulator API. The
test has now a single case that tests all the features of the driver at
once.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-12-21 10:09:55 +01:00
Erwan Gouriou
66d4c64966 all: Fix "#if IS_ENABLED(CONFIG_FOO)" occurrences
Clean up occurrences of "#if IS_ENABLED(CONFIG_FOO)" an replace
with classical "#if defined(CONFIG_FOO)".

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2022-12-21 10:09:23 +01:00
Mateusz Sierszulski
fd658004d7 tests: drivers: counter: counter_basic_api support in counter_gecko_stimer
This commit adds test support for the counter_gecko_stimer
driver.

Signed-off-by: Mateusz Sierszulski <msierszulski@antmicro.com>
2022-12-20 22:50:19 +01:00
Gerard Marull-Paretas
6f3f71102b tests: regulator: pca9420: remove driver specific test
There's now the generic voltage test, which can be used to verify any
regulator. This test was out of date and broken.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-12-20 22:49:41 +01:00
Gerard Marull-Paretas
34fbf78968 tests: drivers: regulator: add voltage levels test
Add a new test that checks if the configured regulator voltage matches
the _real_ voltage obtained using an ADC. The test is generic so that
future regulators can be tested easily by just adding a new board
overlay file and a new test case entry.

Tested on nPM6001 using:

./scripts/twister \
	--device-testing \
	--device-serial /dev/ttyACM0 \
	-p nrf52840dk_nrf52840 \
	-X regulator_output_to_adc \
	-T tests/drivers/regulator/voltage

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-12-20 22:49:41 +01:00
Grixa Yrev
2a992c65c0 net: websocket: new receiving algorithm
websocket_recv_msg() is reworked with using fsm. Now the function
return 0 when payload is empty, -ENOTCONN if socket close. Receiving
empty ping and sending empty pong were added in tests.
Fixes #52327

Signed-off-by: Grixa Yrev <grixayrev@yandex.ru>
2022-12-20 17:05:12 +00:00
Lars Knudsen
081b83531b Bluetooth: has: Make HAS registration dynamic
This changes HAS registration to be dynamic and let's the
application set Hearing Aid Type and binaural features.

Often, devices are flashed with generic firmware with some
features stored post factory production, requiring
the settings to be moved from compile time to run-time.

This change will increase the RAM usage as the GATT
service is moved from ROM to RAM.

Signed-off-by: Lars Knudsen <larsgk@gmail.com>
Co-author: Soren Engquist <soren@engquist.dk>
2022-12-20 17:04:45 +00:00
Andriy Gelman
83da95931a tests: adc_api: Add xmc45_relax_kit config
Adds xmc45_relax_kit configuration.

Signed-off-by: Andriy Gelman <andriy.gelman@gmail.com>
2022-12-20 14:17:23 +01:00
Jamie McCrae
084b9b3514 tests: subsys: dfu: Remove nrf52 scratch
Removes deleting the nRF52840 scratch partition from tests as
this has now been removed.

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2022-12-20 11:57:38 +01:00
Jamie McCrae
a6ecd729d1 tests: subsys: settings: Remove nrf52 scratch
Removes deleting the nRF52840 scratch partition from tests as
this has now been removed.

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2022-12-20 11:57:38 +01:00
Jamie McCrae
9a842588fb boards: arm: nordic nrf91* nrf53* nrf52* nrf51*: Remove scratch areas
The scratch partition is not needed since MCUboot now operates in
swap using move mode instead of swap with scratch, as a result, the
main partitions on Nordic nRF51, nRF52, nRF53 and nRF91 boards can be
expanded to help in fitting large applications to them.

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2022-12-20 11:57:38 +01:00
Gerard Marull-Paretas
a7112c3137 tests: drivers: regulator: api: test API behavior
Add a new test that checks if the API works as expected provided we have
a well-behaved implementation. FFF-based fake is used to mock the
implementation behavior.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-12-20 10:15:29 +00:00
Emil Gydesen
281a846060 Bluetooth: Audio: Move common broadcast sink test code to function
Move the functionality that is common between the two
broadcast sink test to a common function.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-12-20 09:23:08 +01:00
Emil Gydesen
1424df424c Bluetooth: Audio: Add broadcast source metadata update function
Add API to do the BAP Broadcast Source Metadata update procedure,
which updates the metadata of a broadcast source while
it is streaming.

This is also makes all checks for the "head stream" the same.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-12-20 09:23:08 +01:00
Pavel Vasilyev
d0a660c87c tests: bluetooth: mesh: Update BT_MESH_LPN_RECV_DELAY default value
Update the default value of BT_MESH_LPN_RECV_DELAY to align with new
lower boundary for legacy advertiser.

Fixes: https://github.com/zephyrproject-rtos/zephyr/issues/53189

Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
2022-12-19 15:31:55 +01:00
Siyuan Cheng
5854670b98 DSP: add dsp unit test
add dsp context switch test
add complex multiplication test for ARC processor

Signed-off-by: Siyuan Cheng <siyuanc@synopsys.com>
2022-12-19 11:56:55 +01:00
Alperen Sener
1af9b40f6f Bluetooth: Test: Mesh: change mesh shell test log mode
Changing the log mode to minimal to reduce flash size

Signed-off-by: Alperen Sener <alperen.sener@nordicsemi.no>
2022-12-19 10:09:53 +00:00
Corey Wharton
21a7c2d7eb pm: don't suspend unready devices when entering low power states
The PM subsystem should not call the PM control callbacks on
uninitialized devices when entering low-power states.

Signed-off-by: Corey Wharton <xodus7@cwharton.com>
2022-12-19 09:46:17 +00:00
Jonathan Rico
57d7d62bee Bluetooth: host: add bsim test for #52059
The test should fail.

Signed-off-by: Jonathan Rico <jonathan.rico@nordicsemi.no>
2022-12-19 09:37:25 +00:00
Chris Friedt
74c9c0e7a3 tests: time_units: check for overflow in z_tmcvt intermediate
Prior to #41602, due to the ordering of operations (first mul,
then div), an intermediate value would overflow, resulting in
a time non-linearity.

This test ensures that time rolls-over properly.

Signed-off-by: Chris Friedt <cfriedt@meta.com>
2022-12-19 09:36:38 +00:00
Emil Gydesen
0114bc8199 Bluetooth: Audio: Shell: Add TBS Client debug logging in audio.conf
Add TBS client debug logging like all the other modules.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-12-16 14:46:57 +01:00
Emil Gydesen
18fe973df2 Bluetooth: Audio: Shell: Enable optional TBS features
Enable the optional TBS features to provide a full TBS experience.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-12-16 14:46:57 +01:00
Emil Gydesen
24d22ebbdb Bluetooth: Audio: Shell: Add support for more connections
Add support for 3 connections. Mainly we need to support
at least 2 connection to use the CSIP Set Coordinator role,
but some sets may also be 3 or even larger.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-12-16 14:46:57 +01:00
Emil Gydesen
cc9006f211 Bluetooth: Audio: Shell: Add EATT to audio.conf
Add EATT support for audio.conf as that is quite useful
for LE Audio.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-12-16 14:46:57 +01:00
Marcin Niestroj
0d26fe6c45 tests: settings: functional: remove per platform prj_*.conf
All per-platform prj_*.conf files are the same as prj.conf, so there is no
need to duplicate those configuration files.

Signed-off-by: Marcin Niestroj <m.niestroj@emb.dev>
2022-12-16 14:38:51 +01:00
Marcin Niestroj
a854d1d6f5 tests: settings: remove explicit CONFIG_STDOUT_CONSOLE=y
This option is selected by default, so there is no need to select it
explicitly. Additionally, selecting this option for native_posix platforms
results in configuration time warning due to unsatisfied
!NATIVE_APPLICATION dependency.

Signed-off-by: Marcin Niestroj <m.niestroj@emb.dev>
2022-12-16 14:38:51 +01:00
Marcin Niestroj
eea6587ac5 tests: settings: enable ARM MPU
Remove CONFIG_ARM_MPU=n from all settings tests. This is possible due to
CONFIG_MPU_ALLOW_FLASH_WRITE=y automatically being enabled, which was not
true some time ago.

Enabling ARM MPU allows to detect stack overflows during tests runtime.

Signed-off-by: Marcin Niestroj <m.niestroj@emb.dev>
2022-12-16 14:38:51 +01:00
Marcin Niestroj
1088a2d9d5 tests: settings: file: increase main stack size to 2kB
Running tests on `nrf52840dk_nrf52840` with ARM MPU enabled results in
following error:

  Running TESTSUITE settings_config_fs
  ===================================================================
  I: LittleFS version 2.5, disk version 2.0
  I: FS at mx25r6435f@0:0x0 is 16 0x1000-byte blocks with 512 cycle
  I: sizes: rd 16 ; pr 16 ; ca 64 ; la 32
  E: WEST_TOPDIR/modules/fs/littlefs/lfs.c🔢 Corrupted dir pair at \
     {0x0, 0x1}
  W: can't mount (LFS -84); formatting
  E: ***** MPU FAULT *****
  E:   Stacking error (context area might be not valid)
  E:   Data Access Violation
  E:   MMFAR Address: 0x20001f78
  E: r0/a1:  0x00000000  r1/a2:  0x00000000  r2/a3:  0x00000000
  E: r3/a4:  0x0000b461 r12/ip:  0x00000000 r14/lr:  0x0000da8d
  E:  xpsr:  0x00003800
  E: Faulting instruction address (r15/pc): 0x00000000
  E: >>> ZEPHYR FATAL ERROR 2: Stack overflow on CPU 0
  E: Current thread: 0x20000468 (main)
  E: Halting system

Increase main stack size to 2kB to prevent stack overflow.

Signed-off-by: Marcin Niestroj <m.niestroj@emb.dev>
2022-12-16 14:38:51 +01:00
Marcin Niestroj
06454d9ac6 tests: settings: functional: file: increase ztest stack size to 2kB
Running tests on `qemu_x86` results in following error:

  START - test_direct_loading
  E: Double Fault
  E: EAX: 0x00224820, EBX: 0x00000000, ECX: 0x00000010, EDX: 0x00000010
  E: ESI: 0x00224820, EDI: 0x00000000, EBP: 0x0021e020, ESP: 0x0021e000
  E: EFLAGS: 0x00000206 CS: 0x0008 CR3: 0x0022b000
  E: call trace:
  E: EIP: 0x001096ec
  E:      0x00109a76 (0x4)
  E:      0x0010a1f8 (0x78000000)
  E:      0x0010dbec (0x0)
  E:      0x00107a3c (0x224894)
  E:      0x00106ce2 (0x224940)
  E:      0x00104f11 (0x21e260)
  E:      0x00104747 (0x224f00)
  E:      0x0010476f (0x21e3c4)
  E: >>> ZEPHYR FATAL ERROR 2: Stack overflow on CPU 0
  E: Current thread: 0x11a0a0 (test_direct_loading)
  E: Halting system

Similar error is on `nrf52840dk_nrf52840` when ARM MPU is enabled:

  START - test_clear_settings
  I: LittleFS version 2.5, disk version 2.0
  I: FS at flash-controller@4001e000:0xde000 is 16 0x1000-byte blocks \
     with 512 cycle
  I: sizes: rd 16 ; pr 16 ; ca 64 ; la 32
  E: WEST_TOPDIR/modules/fs/littlefs/lfs.c🔢 Corrupted dir pair at \
     {0x1, 0x0}
  W: can't mount (LFS -84); formatting
  E: ***** MPU FAULT *****
  E:   Data Access Violation
  E:   MMFAR Address: 0x20000d70
  E: r0/a1:  0x20000074  r1/a2:  0x20000084  r2/a3:  0x20000074
  E: r3/a4:  0x00000000 r12/ip:  0x000004ff r14/lr:  0x0000f221
  E:  xpsr:  0x41000000
  E: Faulting instruction address (r15/pc): 0x000093d8
  E: >>> ZEPHYR FATAL ERROR 0: CPU exception on CPU 0
  E: Current thread: 0x20000348 (test_clear_settings)
  E: Halting system

Increase ZTEST stack size to 2kB to prevent stack overflow.

Signed-off-by: Marcin Niestroj <m.niestroj@emb.dev>
2022-12-16 14:38:51 +01:00
Marcin Niestroj
4cef4de98d tests: settings: fcb: increase ztest stack size to 2kB
Tests are passing now on `nrf52840dk_nrf52840` platform, just because ARM
MPU is disabled and stack overflow is not detected. When running those
tests on `qemu_x86` there is following error during runtime:

  START - test_config_compress_reset
  E: Double Fault
  E: EAX: 0x0011c1c8, EBX: 0x00000002, ECX: 0x00000002, EDX: 0x0000100a
  E: ESI: 0x0000000a, EDI: 0x0021f370, EBP: 0x0021f000, ESP: 0x0021f000
  E: EFLAGS: 0x00000202 CS: 0x0008 CR3: 0x0022b000
  E: call trace:
  E: EIP: 0x001075be
  E:      corrupted? (bp=0x21f000)
  E: >>> ZEPHYR FATAL ERROR 2: Stack overflow on CPU 0
  E: Current thread: 0x11b140 (test_config_compress_reset)
  E: Halting system

Same happens on `nrf52840dk_nrf52840` when ARM MPU is enabled:

  START - test_config_compress_reset
  E: ***** MPU FAULT *****
  E:   Stacking error (context area might be not valid)
  E:   Data Access Violation
  E:   MMFAR Address: 0x20008cb8
  E: r0/a1:  0x39beca54  r1/a2:  0x9abe9566  r2/a3:  0xe333d994
  E: r3/a4:  0x41387fc2 r12/ip:  0x7c2e5c00 r14/lr:  0xdc5006d9
  E:  xpsr:  0x81000000
  E: Faulting instruction address (r15/pc): 0x0000b50e
  E: >>> ZEPHYR FATAL ERROR 2: Stack overflow on CPU 0
  E: Current thread: 0x200001d8 (test_config_compress_reset)
  E: Halting system

Increase ZTEST stack size to 2kB to prevent stack overflow.

Signed-off-by: Marcin Niestroj <m.niestroj@emb.dev>
2022-12-16 14:38:51 +01:00
Troels Nilsson
c0a5b1ef7b bluetooth: controller: Reduce user ops status to uint8_t
The status field is currently a uint32_t even though there are only
3 possible values. Reducing it to a uint8_t allows status to fit in
existing padding in the struct, saving 4 bytes per ticker_user_op

Updated function signatures to match; ticker_op_func left as-is
to avoid having to update a whole bunch of files for no real benefit

Signed-off-by: Troels Nilsson <trnn@demant.com>
2022-12-16 11:02:30 +00:00