The option CONFIG_NATIVE_UART_0_ON_STDINOUT
is only usable for the native_sim/posix(_64) targets,
but this test is only allowed for the nrf52840dk_nrf52840.
Building with this option set causes a kconfig warning.
Let's just remove it.
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
On the async configurations, the first part of the test
(test_uart_pm_in_idle) can interfere with the second part
of the test, if the device has a fast enough CPU.
This is due to the first part of the test ending
as soon as it queues the last byte for transmission.
If the device is fast enough (and the simulated
nrf52 is), the 2nd part of the test will start executing
enabling the UART Rx, which can result in either
the Rx being enabled mid frame, which can result in a frame
error or even before the Tx HW started pushing the byte
in the line (resulting in that byte being received).
Neither of these cases are handled by the 2nd test,
which sees a spurious error or received byte
and fails.
Let's just add a small delay at the end of the first test
to allow the Tx of the last byte to be done.
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
If $BASH_SOURCE is the empty string, then those two tests end up with
the same simulation ID. That's not a good time.
Signed-off-by: Jonathan Rico <jonathan.rico@nordicsemi.no>
Add emulation testing for it8xxx2, npcx, and mcp7940n. The test is made
to be generic and uses the backend API in order to verify both read and
write functionality. Additional tests are made for the API's limits when
reading/writing out of bounds.
Fixes#65018
Signed-off-by: Yuval Peress <peress@google.com>
Because it was exclusively used by the "common" RISC-V privileged code
to build CPU idle routines that are now handled by arch level code.
Also, all platforms defaulted to "y", making it pointless in practice.
Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
This test assumes nothing else is running in the background
but when the logger is on, this board will by default
start the RTC sync mechanism, which will awake the CPU
every now and then.
Let's disable this mechanism to avoid disturbing the test.
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
Refactor the bap_test_stream struct and rename to audio_test_stream
so that it can be used by CAP as well.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Implement transmit idle notification for TTY backend. Since TTY
has an "infinite" transmit buffer, we invoke transmit idle
immediately after writing the data to the TTY file.
The test suite for the TTY backend has been updated to match the
new behavior.
Signed-off-by: Bjarki Arge Andreasen <bjarki@arge-andreasen.me>
This is a driver targetting the Bosch BMA 4-series accelerometers. It
has been specifically developed for the BMA422 but should be compatible
with others in that line, excepting the BMA400. Supports key attributes
and async RTIO one-shot operation. I2C operation is supported, with
stubs for a SPI implementation provided for future improvement.
Signed-off-by: Tristan Honscheid <honscheid@google.com>
Update the unit test to expect the new simplified resync
behavior, and validate that new resync is working.
Signed-off-by: Bjarki Arge Andreasen <bjarki@arge-andreasen.me>
Refactor the existing `pthread_sigmask` test function to
get its function-under-test via arg and test `sigprocmask` with
that.
Signed-off-by: Yong Cong Sin <ycsin@meta.com>
Adds a test to stress k_thread_suspend() and k_thread_resume() on
an SMP system. The test should take about 30 seconds.
Signed-off-by: Peter Mitsis <peter.mitsis@intel.com>
Add internal loopback for testing purposes and
change wroom for wrover, which is default board
for testing.
Signed-off-by: Lucas Tamborrino <lucas.tamborrino@espressif.com>
Some MCU have limitations with GPIO interrupts. Add a polling mode to
the gpio-keys driver to support those cases.
This required a bit of a refactoring of the driver data structure to add
a instance wide data, and move the pin specific pointer in the config
structure.
For polling, reuse the button 0 delayed work so we minimize the resource
waste, the two work handler functions are only referenced when used so
at least those are discarded automatically if no instance needs them.
Fix a bug in the PM structure instantiation as well.
Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
__bswap_ in zephyr/sys/byteorder.h conflicts with __bswap_ in host's
byteswap.h. byteswap.h from host compiler used in posix_native_64 boards
causes a compilation issue.
This commit renames __bswap_ to BSWAP_ to prevent collision.
Before this commit a compilation error can be created by adding #include
<byteswap.h> to samples/net/sockets/echo/src/socket_echo.c
This does not change external API to byteorder.h, but does change
internal implementation which some other source files depend on.
Replaced manual byteswap operations in devmem_service.c with APIs from
byteorder.h which automatically converts to CPU endianess when necessary.
Fixes#44324
Signed-off-by: Jonathan Hamberg <jonathanhamberg@gmail.com>
When running on qemu_x86, the test test_socket_state failed on
stack overflow. Setting CONFIG_TEST_EXTRA_STACK_SIZE to 1024
seems to fix the issue. So add a board specific config for
qemu_x86 so this test would pass.
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
Add an input driver to read data from an analog device, such as a
thumbstick, connected to an ADC channel, and report it as an input
device.
Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
- Adjust refcount checks with regards to previous commit.
- Remove redundant zassert_not_null() on local pointers after a
sem_close(). There is no implicit reference passing in C.
Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
- Regroup refcount decrement and semaphore destruction by making the
linked state into a counted reference for it. This allows for
simplifying the code and cleanly adding a few assertions in a common
location.
- Remove redundant initialization to NULL on memory about to be freed
and local pointer in nsem_cleanup().
Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
For better manageability of tests building, add possibility to build
BabbleSim Bluetooth BIS tests by Twister.
Signed-off-by: Piotr Golyzniak <metody159@gmail.com>
For uart_async_api, uart_mix_fifo_poll & uart_pm:
These test can be run fine in the simulated nrf52_bsim board,
just connecting the UART Tx and Rx in loopback,
but we need an overlay just like for the real boards.
Let's provide it.
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
For some reason the host gcc (11 & 12) does not believe
rx_buf_size is constant. Let's work around it by using the
sizeof() expression it is initialized to instead.
This fixes a build error when targetting native targets
which use the host gcc:
tests/drivers/uart/uart_async_api/src/test_uart_async.c:236:34:
error: expression in static assertion is not constant
236 | BUILD_ASSERT(rx_buf_size <=
sizeof(tdata.rx_first_buffer), "Invalid buf size");
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
The test was actually filtered out in the integration platforms
(native_sim) as SERIAL was not enabled in its prj.conf
and that is not enabled by default for this target.
Let's just enable it.
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
Add a basic connection test between two devices,
in which the controllers are in separate nrf52_bsim devices
connected over UART to the devices running the host+app.
The controllers are running the HCI UART async sample.
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
Add a basic connection test between two devices,
in which the controllers are in separate nrf52_bsim devices
connected over UART to the devices running the host+app.
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
Use the common io-channel-cells name "input" instead of "positive" and
"negative" to make this binding work with the various ADC DT macros.
Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
Make the retransmission timer much shorter so that the test
is run faster (about 50% faster test run in qemu_x86).
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
Make sure the connection is closed by the timer if the final
ack is lost in closing state.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
Update the bsim test for the BAP broadcast to use 2 bis.
This tests a larger part of the code, and also verifies
that we can send and receive on 2 BIS without any ISO errors.
This requires the ADV interval to be a multiple of ISO interval
- 10ms, so the advertising interval has been set to 80ms.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
PBP API allows sources to create a Public Broadcast Announcement.
PBP API to parse a Public Broadcast Announcement.
public_broadcast_source application starts extended advertising and
includes a Public Broadcast Announcement. The advertised broadcast
audio stream quality will cycle between high and standard quality.
public_broadcast_sink application scans for broadcast sources and
synchronizes to the first found source which defines a Public Broadcast
Announcement including a High Quality Public Broadcast Audio Stream
configuration.
Add bsim tests for Public Broadcast Profile APIs.
Add shell implementation for Public Broadcast Profile APIs.
Signed-off-by: Daniela Andreea Dumitrache <danielaandreea.dumitrache@nxp.com>
- Support for listing both testcases and testsuites
- Support for running single suites or single test cases
- Support shuffling tests and repeating execution based on command line
arguments.
For example, build with
west build -p -b qemu_cortex_m3 tests/kernel/sleep -t run -- \
-DCONFIG_ZTEST_SHUFFLE=y -DCONFIG_ZTEST_SHELL=y
Following commands are available:
uart:~$ ztest
ztest - Ztest commands
Subcommands:
run-all :Run all tests
shuffle :Shuffle tests
list-testsuites :List all test suites
list-testcases :List all test cases
run-testsuite :Run test suite
run-testcase :Run testcase
shuffle accepts two arguments --suite_iter and --case_iter which allows
repeated exercution of testcases or suites.
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Introduce a new arch level Kconfig option to signal the implementation
of the RISCV Privileged ISA spec. This replaces
SOC_FAMILY_RISCV_PRIVILEGED, because this is not a SoC specific
property, nor a SoC family.
Note that the SoC family naming scheme will be fixed in upcoming
commits.
Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>