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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>