This changes the spi_loopback test application to use the DMA transfer.
In case of DMA, some testcases are useless.
It requires the MOSI to be connected to the MISO of the SPI1.
Signed-off-by: Francois Ramu <francois.ramu@st.com>
Convert DT_UART_{0,1}_NAME to DT_NODELABEL() references as the cases are
board specific and this allows us to remove DT_UART_{0,1}_NAME defines
in dts_fixup.h
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
Replace:
DT_FLASH_ERASE_BLOCK_SIZE ->
DT_PROP(DT_CHOSEN(zephyr_flash), erase_block_size)
DT_FLASH_WRITE_BLOCK_SIZE ->
DT_PROP(DT_CHOSEN(zephyr_flash), write_block_size)
As this allows us to phase out the old generator.
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
Currently there are no test for openthread on zephyr.
Created tests for OpenThread platform radio interface.
Signed-off-by: Marek Porwisz <marek.porwisz@nordicsemi.no>
This enables BT_EATT for shell samples so it can be build test by CI and
gives user the ability of test it using shell commands.
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Add support for running the DAC loopback test case on the NXP
FRDM-K64F development board.
Signed-off-by: Henrik Brix Andersen <henrik@brixandersen.dk>
Add support for running the DAC loopback test case on the NXP
TWR-KE18F development board.
Signed-off-by: Henrik Brix Andersen <henrik@brixandersen.dk>
Set the TICK_IRQ on litex and rv32m1 based on DT_IRQN(). For litex we
use DT_NODELABEL(timer0) and on rv32m1 we use DT_ALIAS(system_lptmr) to
determine the timer device.
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
Substitute integral constants where call sites passed named constants
that have timeout values as arguments to parameters that expect
millisecond durations.
Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
Update EDTT default configuration to make it easier to debug. The
use of maximum log level to restrict default output caused some
confusion. Instead remove debug options to reduce the default log
output. Enabling debug logs is now similar to other samples and tests.
Remove options commented out, no need to keep them.
Move comment to the matching CONFIG.
Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
This is more a sample than a test, so put it under samples with the goal
of having dedicated tracing tests in the future under tests.
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Convert CAN to use a chosen node property that is similar to how we
handle zephyr,entroy or zephyr,flash-controller as the means to select a
specific peripheral instance utilized by a subsystem.
Replace references of the form:
alias {
can-primary = &can1;
};
with:
chosen {
zephyr,can-primary = &can1;
};
Replace various macro/define references with either
DT_CHOSEN(zephyr_can_primary) or replace DT_ALIAS_CAN_PRIMARY_LABEL
with DT_CHOSEN_ZEPHYR_CAN_PRIMARY_LABEL.
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
The hwinfo driver test currently filters for `CONFIG_HWINFO`, but this
symbol is set to `y` by the `prj.conf` and therefore will always be
selected.
This commit removes the unnecessary `CONFIG_HWINFO` filter.
Note that the hwinfo driver test `ifdef`s `CONFIG_HWINFO_HAS_DRIVER`,
and having an actual hwinfo driver implementation is not a requirement
(if no hwinfo driver is available, the test validates that -ENOTSUP is
returned by `hwinfo_get_device_id`).
Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
The bounds check failed to account for the additional space required
for the terminating NUL after the encoded value was written.
Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
If timeout != K_NO_WAIT, then return immediately when not all
bytes_to_read or bytes_to_write have been transfered, but >=
min_xfer have been transferred.
Fixes#24485
Signed-off-by: Christopher Friedt <chrisfriedt@gmail.com>
Convert driver to use the new device tree macro's instead of
dts_fixup.h based macros. This moves us closer to removing both
dts_fixup.h and per instance Kconfig symbols.
The pinmux_mchp_xec is also being updated since it's using DT
from GPIO.
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
This implements a file descriptor used for event notification that
behaves like the eventfd in Linux.
The eventfd supports nonblocking operation by setting the EFD_NONBLOCK
flag and semaphore operation by settings the EFD_SEMAPHORE flag.
The major use case for this is when using poll() and the sockets that
you poll are dynamic. When a new socket needs to be added to the poll,
there must be some way to wake the thread and update the pollfds before
calling poll again. One way to solve it is to have a timeout set in the
poll call and only update the pollfds during a timeout but that is not
a very nice solution. By instead including an eventfd in the pollfds,
it is possible to wake the polling thread by simply writing to the
eventfd.
Signed-off-by: Tobias Svehagen <tobias.svehagen@gmail.com>
This commit renames all local definitions with the name `PORT` in the
net tests, in order to prevent name conflict with certain HALs
(notably, Atmel SAM E5x HAL).
Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
Replace DT_FLASH_DEV_NAME with DT_CHOSEN_ZEPHYR_FLASH_CONTROLLER_LABEL.
We now set zephyr,flash-controller in the chosen node of the device
tree to the flash controller device.
NOTE: For a SoCs with on die flash, this points to the controller and
not the 'soc-nv-flash' node. Typically the controller is the
parent of the 'soc-nv-flash' node).
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
This commit renames the Kconfig `FLOAT` symbol to `FPU`, since this
symbol only indicates that the hardware Floating Point Unit (FPU) is
used and does not imply and/or indicate the general availability of
toolchain-level floating point support (i.e. this symbol is not
selected when building for an FPU-less platform that supports floating
point operations through the toolchain-provided software floating point
library).
Moreover, given that the symbol that indicates the availability of FPU
is named `CPU_HAS_FPU`, it only makes sense to use "FPU" in the name of
the symbol that enables the FPU.
Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
No point to change the throw_sleep to k_timeout_t because we
are calculating the timeout beforehand which can lead to
unexpected results if using k_timeout_t.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Tests were failing as they were looking for an alias which didn't exist
Also, because some code in kscan_handlers.c wasn't compilable
Signed-off-by: Mark Olsson <mark@markolsson.se>
This commit adds the asynchronous UART API testing support on the SAM
R21 Xplained Pro board.
The SERCOM3 module is used as the secondary loop-back UART, which is
required to run this test.
Note that no external UART loop-back connection is necessary to run
this test, because the SERCOM3 UART TX and RX pads are configured to be
internally connected; it is, however, still necessary to configure the
pinmux because the module pads are not connected until the pinmux is
configured.
Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
Test is checking if alarm handler is executed at request time or later.
However, validation did not take into account wrapping of the counter.
Fixed by taking into account case where counter wraps.
Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
Fixes test which did not take into account that counter may
wrap (nrf51 has 16bit timers) and was setting alarm to wrong
value. Error was not seen on platforms with higher top value.
Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
This commit adds the asynchronous UART API testing support on the SAM
D21 Xplained Pro board.
The SERCOM1 module is used as the secondary loop-back UART, which is
required to run this test.
Note that no external UART loop-back connection is necessary to run
this test, because the SERCOM1 UART TX and RX pads are configured to be
internally connected.
Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
This change adds full shared floating point support for the RISCV
architecture with minimal impact on threads with floating point
support not enabled.
Signed-off-by: Corey Wharton <coreyw7@fb.com>
In order to reduce CI overhead, this commit restricts the CMSIS-DSP
tests to only run on the following ARM platforms:
* `frdm_k64f`: Cortex-M4 (to be replaced by `qemu_cortex_m4`)
* `sam_e70_xplained`: Cortex-M7
* `mps2_an521`: Cortex-M33
The following platforms should be added to the platform whitelist in
the future when adequate support is available:
* `qemu_cortex_m4`: Replace `frdm_k64f` when available
* `qemu_cortex_r5`: Add when Cortex-R VFP support is available
* `qemu_cortex_a53`: Add when AArch64 VFP support is available
(and other VFP-equipped ARM testing platforms added in the future)
Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
This commit adds the test application for the CMSIS-DSP 'filtering'
functions.
This test application is loosely based on the C++ test suite included
in the upstream CMSIS-DSP distribution.
Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
This commit adds the test application for the CMSIS-DSP 'svm'
functions.
This test application is loosely based on the C++ test suite included
in the upstream CMSIS-DSP distribution.
Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
This commit adds the test application for the CMSIS-DSP 'bayes'
functions.
This test application is loosely based on the C++ test suite included
in the upstream CMSIS-DSP distribution.
Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
This commit adds the test application for the CMSIS-DSP 'distance'
functions.
This test application is loosely based on the C++ test suite included
in the upstream CMSIS-DSP distribution.
Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
This commit adds the test application for the CMSIS-DSP 'transform'
functions.
This test application is loosely based on the C++ test suite included
in the upstream CMSIS-DSP distribution.
Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
This commit adds the test application for the CMSIS-DSP 'matrix'
functions.
This test application is loosely based on the C++ test suite included
in the upstream CMSIS-DSP distribution.
Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
This commit adds the test application for the CMSIS-DSP 'statistics'
functions.
This test application is loosely based on the C++ test suite included
in the upstream CMSIS-DSP distribution.
Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
This commit adds the test application for the CMSIS-DSP 'support'
functions.
This test application is loosely based on the C++ test suite included
in the upstream CMSIS-DSP distribution.
Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
This commit adds the test application for the CMSIS-DSP 'fast math'
functions.
This test application is loosely based on the C++ test suite included
in the upstream CMSIS-DSP distribution.
Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
This commit adds the test application for the CMSIS-DSP 'complex math'
functions.
This test application is loosely based on the C++ test suite included
in the upstream CMSIS-DSP distribution.
Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
This commit adds the benchmark application for the CMSIS-DSP 'basic
math' functions.
This benchmark application is loosely based on the C++ test suite
included in the upstream CMSIS-DSP distribution.
Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
This commit adds the test application for the CMSIS-DSP 'basic math'
functions.
This test application is loosely based on the C++ test suite included
in the upstream CMSIS-DSP distribution.
Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
The test of the absolute timeout feature was a simple whitebox test
that inspected the generated ticks field of different constructors for
identity. But it wasn't simple enough, because it was doing a
ticks->ms->ticks conversion (at compile time, sigh) on the input data,
which is obviously lossy on platforms where ticks are shorter than
milliseconds by non-integral factors.
Fix to do the conversion in just one direction.
Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
This test sets a timer, busy waits for half the duration, and then
checks the remaining time is correct. And it correctly does all its
math in tick precision and aligns to a timer interrupt to eliminate
aliasing due to the tick stride.
But it's waiting using k_busy_wait(), not a timer: "half the duration"
in MICROSECONDS (for k_busy_wait()) is not necessarily representable
as an integer number of TICKS on all platforms. Because k_busy_wait()
always rounds up, we need one extra tick of buffer on those platforms.
Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
The previous architecture proved unable to support user expectations,
so the API has been rebuilt from first principles. Backward
compatibility cannot be maintained for this change.
Key changes include:
* Formerly the service-provided transition functions were allowed to
sleep, and the manager took care to not invoke them from ISR
context, instead returning an error if unable to initiate a
transition. In the new architecture transition functions are
required to work regardless of calling context: it is the service's
responsibility to guarantee the transition will proceed even if it
needs to be transferred to a thread. This eliminates state machine
complexities related to calling context.
* Constants identifying the visible state of the manager are exposed
to clients through both notification callbacks and a new monitor API
that allows clients to be notified of all state changes.
* Formerly the release operation was async, and would be delayed for the
last release to ensure a client would exist to be notified of any
failures. It is now synchronous.
* Formerly the cancel operation would fail on the last client associated
with a transition. The cancel operation is now synchronous.
* A helper function is provided to safely synchronously release a
request regardless of whether it has completed or is in progress,
satisfying the use case underlying #22974.
* The user-data parameter to asynchronous notification callbacks has
been removed as user data can be retrieved from the CONTAINER_OF
the client data.
Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
Add the following macro's to get clock info by name:
DT_CLOCKS_LABEL_BY_NAME
DT_CLOCKS_CELL_BY_NAME
DT_INST_CLOCKS_LABEL_BY_NAME
DT_INST_CLOCKS_CELL_BY_NAME
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
Co-Authored-By: Marti Bolivar <marti.bolivar@nordicsemi.no>
The macros should have been DMAS_CELL_ not DMAS_CELLS_ as this matches
the other devicetree macro naming convention.
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
No in-tree boards support the NINT signal on an SX1509B IO extender,
so test using custom overlays/configurations for the Particle Xenon
board using an SX1509B breakout board.
Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
The following PR's #23941#23601 was merged using old boilerplate
inclusion.
This commit updates those tests to use find_package(Zephyr)
Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
Changes to Kconfig vs devicetree resulted in uart1 being enabled,
which steals the test pins away from the test.
Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
It is useful to know which test fails to semaphore timeout so
add line number of the failing test to assert print.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Move to the new devicetree API and stop using DT_WDT_0_NAME fixup
macros. All existing in-tree SoCs with fixup names are still supported
here via compatible. The watchdog0 alias is also still supported.
Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
New function allows to set from the code the root command. It is
an equivalent of calling 'select <rootcmd>' except it sets command
for all shell instances.
Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
The commit fixes problem with test attempting to perform 1 byte writes
to flash, which are not emulated by default.
GH issue: #24207
Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
Currently, the Cortex-M SysTick-based timing info implementation is
incorrectly specified for all 32-bit ARM architectures.
This commit fixes that by restricting the SysTick-based implementation
to the ARM Cortex-M architectures only; in addition, it removes the
ARM64 timing info implementation as it is identical to the default
generic implementation and was previously added only as a workaround
for the aforementioned problem.
Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
The board rename was missed. That's the only remaining case of a
missed rename I could find in tree, but I may have missed something.
Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
Some of the ARC platforms aren't consistent between kconfig and their
linker scripts as to the size of memory, add a special case.
Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
The renode emulator is REALLY slow on this test, what completes in 20
seconds on qemu takes 4-10 minutes on renode. That's causing trouble
in CI.
And this is a CPU-bound unit test of library code, where we have
coverage for riscv32 via qemu anyway. There's no value to having
better platform emulation here.
Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
CONFIG_SRAM_SIZE is a kconfig value, which is an int (units of kb),
but when doing math on it to produce a memory buffer size needs to be
done in size_t precision otherwise we could overflow on 64 bit
platforms with >4G memory.
Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
These five tests (mbox_api, mheap_api_concept, msgq_api, pipe_api and
queue) all had test cases where they needed a mem_pool allocation to
FAIL. And they are all written to assume the behavior of the original
allocator and not the more general k_heap code, which actually
succeeds in a bunch of these cases.
* Even a very small heap saves enough metadata memory for the very
small minimum block size, and this can be re-used as an allocation.
So you can't assume a small heap is full.
* Calculating the number of blocks based on "num_blocks * max size /
minimum size" and allocating them does not fill the heap, because
the conservative metadata reservation leaves some space left over.
So these have all been modified to "fill" a heap by iteratively
allocating until failure.
Also, this fixes a benign overrun bug in mbox. The test code would
insert a "big" message by reading past the end of the small message
buffer. This didn't fail because it happened to be part of an array
of messages and the other ones defined contained the memory read. But
still.
Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
The k_heap backend is now the default for mem_pool, so duplicate these
tests across that config so we continue to have coverage for the older
code.
Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
The original k_mem_pool tests were a mix of code that tests routine
allocator behavior, the synchronization layer above that, and a
significant amount of code that made low-level assumptions about the
specific memory layout of the original allocator, which doesn't run
out of memory in exactly the same way.
Adjust the expectations as needed for the backend. A few test cases
were skipped if they were too specific. Most have been generalized
(for example, iteratively allocating to use up all memory instead of
assuming that it will be empty after N allocations).
Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
Use the white box validation and test rig added as part of the
sys_heap work. Add a layer that puts hashed cookies into the blocks
to detect corruption, check the validity state after every operation,
and enumerate a few different usage patterns:
+ Small heap, "real world" allocation where the heap is about half
full and most allocations succeed.
+ Small heap, "fragmentation runaway" scenario where most allocations
start failing, but the heap must remain consistent.
+ Big heap. We can't test this with the same exhaustive coverage
(many re/allocations for every byte of storage) for performance
reasons, but we do what we can.
Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
Replace CONFIG_ENTROPY_NAME with DT_CHOSEN_ZEPHYR_ENTROPY_LABEL. We now
set zephyr,entropy in the chosen node of the device tree to the entropy
device.
This allows us to remove CONFIG_ENTROPY_NAME from dts_fixup.h. Also
remove any other stale ENTROPY related defines in dts_fixup.h files.
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
Pun all workqueue tests under 1 doxygen group.
This removes kernel_workqueue_triggered_tests and
kernel_workqueue_delayed_tests doxygen groups.
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Those are used only in tests, so remove them from kernel Kconfig and set
them in the tests that use them directly.
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Disable power management for boards mec15xxevb_assy6853 and
mec1501modular_assy6885 on latency_measure test. This prevents
the SoC from sleeping which may skew the results. Also this
prevents stopping mid-test due to SoC being in sleep state,
and there are no external interrupts to wake up the SoC.
Fixes#24136
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
Disable power management by setting CONFIG_SYS_POWER_MANAGEMENT=n
for this test. This is to prevent power management from
interfering with latency measurement.
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
Convert driver to use DT_INST macros and remove related board per
instance Kconfig symbol usage.
Updated the openisa,rv32m1_vega-pinmux binding to require the label
property and updated the rv32m1.dtsi to add label properties for the
pinmux nodes.
Also update gpio_basic_api test to use DT_NODELABEL.
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
Don't assume in the soc level device trees that flexcomm nodes will
always be configured as spi. Instead, configure flexcomm nodes at the
board level for lpcxpresso55s69 and lpcxpresso54114 boards.
Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
This commit converts the `fp_sharing` tests to use the ztest framework.
In addition, this commit also introduces a behavioural change to run
the `pi` unit test separately from the `load_store` unit test, in order
to allow more manageable and diagnosable test execution.
Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
The `fp_sharing` testsuite consists of two tests: `load_store` and
`pi`.
This commit reorganises the two tests into separate files and refactors
the common parameters into the `test_common.h` header file.
Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
The net_context API will change, the s32_t timeout parameter
will be changed to k_timeout_t. All the Zephyr users of this API will
be changed in subsequent commits. This is internal Zephyr API only,
so the API is not deprecated etc.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Mention in websocket API documentation that the timeout value
is in milliseconds. Check timeout values properly using K_TIMEOUT_EQ()
macro.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Due to the use of UTIL_EVAL*() macros, the UTIL_LISTIFY() macro used
by DT_INST_FOREACH(foo) can cause long build errors when there is a
build error in the expansion for "foo". More than a thousand lines of
build error output have been observed for an error in a single line of
faulty C.
To improve the situation, re-work the implementation details so the
errors are a bit shorter and easier to read. The use of COND_CODE_1
still makes the error messages quite long, due to GCC generating notes
for various intermediate expansions (__DEBRACKET,
__GET_ARG_2_DEBRACKET, __COND_CODE, Z_COND_CODE_1, COND_CODE1), but
it's better than the long list of UTIL_EVAL notes.
Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
We add a simple test case to verify the behavior
of z_arm_exc_spurious handler. We use the SysTick
interrupt for that so the test is enabled for
platforms that have but do not use the SysTick.
Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
The original API was misnamed, as the intent was to provide a manager
that decoupled state management from the service that needed to be
turned on or off. Update all the names, shortening them where
appropriate removing unncessary internal components like _service.
Also remove some API that misled developers into believing that onoff
managers are normally expected to be exposed directly to consumers.
While this is a use case, in most situations there are service or
client-specific actions that need to be coupled to transition events.
Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
k_poll() for a signal is often desired for notification of completion
of asynchronous operations, but there are APIs where it may be
necessary to invoke "asynchronous" operations from contexts where
sleep is disallowed, or before the kernel has been initialized.
Extract the general notification solution from the on-off service into
a utility that can be used for other APIs.
Also move documentation out to a resource management section.
Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
Extracted transition functions from onoff structure to external one
which allows to keep them in flash.
Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
The board name for the Thingy:52, so far known as nrf52_pca20020, is
renamed to thingy52_nrf52832. Its documentation and all references to
its name in the tree are updated accordingly. Overlay and configuration
files specific to this board are also renamed, to match the new board
name.
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
The board name for the nRF52840 Dongle, so far known as
nrf52840_pca10059, is renamed to nrf52840dongle_nrf52840. Its
documentation and all references to its name in the tree are updated
accordingly. Overlay and configuration files specific to this board are
also renamed, to match the new board name.
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
The board name for the nRF52833 DK, so far known as nrf52833_pca10100,
is renamed to nrf52833dk_nrf52833. Its documentation and all
references to its name in the tree are updated accordingly.
Overlay and configuration files specific to this board are also
renamed, to match the new board name.
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
The board target for emulation of nRF52810 on nRF5DK, so far
known as nrf52810_pca10040, is renamed to nrf52dk_nrf52810.
Its documentation and all references to its name in the tree are
updated accordingly. Overlay and configuration files specific to
this board are also renamed, to match the new board name.
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
The board name for the nRF52 DK, so far known as nrf52_pca10040, is
renamed to nrf52dk_nrf52832. Its documentation and all references
to its name in the tree are updated accordingly. Overlay and
configuration files specific to this board are also renamed, to
match the new board name.
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
Convert driver to use DT_INST macros and remove related board per
instance Kconfig symbol usage.
Also update counter_basic_api test to use DT_INST and remove the
udoo_neo_full_m4.conf as its not longer needed since the per instance
Kconfig sybmols don't exist anymore.
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
Convert driver to use DT_INST macros and remove related board per
instance Kconfig symbol usage.
Additionally remove udoo_neo_full_m4.conf from gpio_basic_api test since
the Kconfig symbols don't need to be set anymore.
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
The net_buf subsystem is now fully compatible with the new timeout
API, so move the selection of the legacy API to those specific
subsystems that use net_buf and still need converting.
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Add additional build configurations to the shell to catch build errors
when enabling extended advertising.
Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
Kconfig options that enable I2C and SPI instances are no longer used
in nRF drivers. Remove all assignments done to these options in related
board definitions, samples, and tests.
For nrf52_pca20020, also no longer needed setting of default values
for GPIO_SX1509B* options is removed (now the gpio_sx1509b driver is
enabled by default when a corresponding devicetree node is enabled).
Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
Remove prompts from Kconfig options `UART_x_NRF_UART*` that select
the type of nrfx driver (for UART or UARTE peripheral) to be used
for a given instance. This prevents the options from being modified
from configuration files.
Instead, make one of these options selected by default according to the
"compatible" property set for the corresponding UART node in devicetree.
This eliminates the need of changing both the "compatible" property in
devicetree and the Kconfig option selecting the driver type when a user
wants to switch between UART and UARTE for a given instance.
Since all `UART_x_NRF_UART*` options are made "hidden" by this commit,
all their occurrences in configuration files are removed.
Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
Even though radio driver can report in its capabilities that it does
support CSMA CA, there's no way in the driver to select how the frame
should be transmitted (with CSMA or without). As layers above radio
driver (Thread, Zigbee) can expect that both TX modes are available, we
need to extend the API to allow either of these modes.
This commits extends the API `tx` function with an extra parameter,
`ieee802154_tx_mode`, which informs the driver how the packet should be
transmitted. Currently, the following modes are specified:
* direct (regular tx, no cca, just how it worked so far),
* CCA before transmission,
* CSMA CA before transmission,
* delayed TX,
* delayed TX with CCA
Assume that radios that reported CSMA CA capability transmit in CSMA CA
mode by default, all others will support direct mode.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
PWM and other flags were missing for PCA10059.
Aligned also RAM and Flash while comparing the files.
Signed-off-by: Markus Becker <markus.becker@tridonic.com>
This commit enables nested interrupt test for the Cortex-R platforms
that use the ARM Generic Interrupt Controller (GIC).
Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
Use the appropriate K_SECONDS() or K_MSEC() macros to pass a timeout to
k_sleep() and other kernel APIs.
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
And implement DT_ANY_INST_ON_BUS() in terms of it.
This makes some error messages quite a bit shorter by avoiding
UTIL_LISTIFY(), which has a nasty temper and tends to explode if not
treated gently.
Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
The timer counter for ticks on MEC1501 SoC is based on the RTOS
timer which runs at 32kHz. This is too slow for timing benchmarks
as most cases can be finished within one or two ticks. Since
the SoC has higher frequency timers running at 48MHz, add
the necessary bits to use these for timing benchmarks.
Fix#23414
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
Add support for "absolute" timeouts, which are expressed relative to
system uptime instead of deltas from current time. These allow for
more race-resistant code to be written by allowing application code to
do a single timeout computation, once, and then reuse the timeout
value even if the thread wakes up and needs to suspend again later.
Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
Add a CONFIG_TIMEOUT_64BIT kconfig that, when selected, makes the
k_ticks_t used in timeout computations pervasively 64 bit. This will
allow much longer timeouts and much faster (i.e. more precise) tick
rates. It also enables the use of absolute (not delta) timeouts in an
upcoming commit.
Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
Add a k_timeout_t type, and use it everywhere that kernel API
functions were accepting a millisecond timeout argument. Instead of
forcing milliseconds everywhere (which are often not integrally
representable as system ticks), do the conversion to ticks at the
point where the timeout is created. This avoids an extra unit
conversion in some application code, and allows us to express the
timeout in units other than milliseconds to achieve greater precision.
The existing K_MSEC() et. al. macros now return initializers for a
k_timeout_t.
The K_NO_WAIT and K_FOREVER constants have now become k_timeout_t
values, which means they cannot be operated on as integers.
Applications which have their own APIs that need to inspect these
vs. user-provided timeouts can now use a K_TIMEOUT_EQ() predicate to
test for equality.
Timer drivers, which receive an integer tick count in ther
z_clock_set_timeout() functions, now use the integer-valued
K_TICKS_FOREVER constant instead of K_FOREVER.
For the initial release, to preserve source compatibility, a
CONFIG_LEGACY_TIMEOUT_API kconfig is provided. When true, the
k_timeout_t will remain a compatible 32 bit value that will work with
any legacy Zephyr application.
Some subsystems present timeout (or timeout-like) values to their own
users as APIs that would re-use the kernel's own constants and
conventions. These will require some minor design work to adapt to
the new scheme (in most cases just using k_timeout_t directly in their
own API), and they have not been changed in this patch, instead
selecting CONFIG_LEGACY_TIMEOUT_API via kconfig. These subsystems
include: CAN Bus, the Microbit display driver, I2S, LoRa modem
drivers, the UART Async API, Video hardware drivers, the console
subsystem, and the network buffer abstraction.
k_sleep() now takes a k_timeout_t argument, with a k_msleep() variant
provided that works identically to the original API.
Most of the changes here are just type/configuration management and
documentation, but there are logic changes in mempool, where a loop
that used a timeout numerically has been reworked using a new
z_timeout_end_calc() predicate. Also in queue.c, a (when POLL was
enabled) a similar loop was needlessly used to try to retry the
k_poll() call after a spurious failure. But k_poll() does not fail
spuriously, so the loop was removed.
Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
Kernel timeouts have always been a 32 bit integer despite the
existence of generation macros, and existing code has been
inconsistent about using them. Upcoming commits are going to make the
timeout arguments opaque, so fix things up to be rigorously correct.
Changes include:
+ Adding a K_TIMEOUT_EQ() macro for code that needs to compare timeout
values for equality (e.g. with K_FOREVER or K_NO_WAIT).
+ Adding a k_msleep() synonym for k_sleep() which can continue to take
integral arguments as k_sleep() moves away to timeout arguments.
+ Pervasively using the K_MSEC(), K_SECONDS(), et. al. macros to
generate timeout arguments.
+ Removing the usage of K_NO_WAIT as the final argument to
K_THREAD_DEFINE(). This is just a count of milliseconds and we need
to use a zero.
This patch include no logic changes and should not affect generated
code at all.
Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
This commit adds a filter to restrict the `arch/arm/arm_runtime_nmi`
test to the ARM Cortex-M platforms only, since this test currently
does not support the Cortex-A and Cortex-R platforms.
Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
This commit enables nested interrupt test for the Cortex-A platforms
that use the ARM Generic Interrupt Controller (GIC).
Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
This commit adds the nested interrupt testing support for the ARM
Generic Interrupt Controller (GIC).
Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
We rename the nRF91 Dev Kit board target (nrf9160_pca10090)
to nrf9160dk_nrf9160. We update all associated references
in the supportive documentation and all nRF9160-related
cofigurations and overlay files in the samples and tests
in the tree.
Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
This commit adds an explanation comment for the interrupt priorities
used by the Cortex-M nested interrupt test.
Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
Replace all occurences of BUILD_ASSERT_MSG() with BUILD_ASSERT()
as a result of merging BUILD_ASSERT() and BUILD_ASSERT_MSG().
Signed-off-by: Oleg Zhurakivskyy <oleg.zhurakivskyy@intel.com>
Do not attempt to build on all boards. Instead, do a build-only pass
of the generic test case on all boards with EEPROM support.
Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
Remove the dts_fixup.h with a DTS app overlay file instead. We have
sensors that show up on both the I2C and SPI busses, and we disable
the sensors to match how the tests work currently.
The app.overlay utilizes the testing dts bindings to create test nodes
that should not conflict with any existing SoC nodes. Thus allowing the
test to run on any platform.
The dts overlay is structured such that i2c.dtsi and spi.dtsi are
generated with default values for required properties. We than update
device properties for those nodes that the defaults are sufficient for
one reason or another.
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
Deprecate BT_LE_ADV defines in hci.h that are expected to be used by the
application in the scan received callback to identify the advertising
PDU type. These defines are mixing HCI input parameters and advertising
PDU types. Internally it is acceptable to mix these, but at the API we
should to mix in them.
Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
Deprecate bt_create_conn_le and rename it to in order to add return
code, new arguments and to follow the established naming convention.
Add API for the application to control the scan parameters of the
initiator role. This allows the application more scheduling control
of the initiator in multi-role scenarios. Also provides options to
configure the initiator for LE Coded PHY for long range support.
We deprecate the old way of creating connection to make the name more
consistent with the rest of the API.
Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
Identify when received PUBLISH message is malformed and overall packet
length received is smaller than parsed variable header lenght.
Add unit test to cover this case.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
The standard allows up to 4 bytes of packet length data, while current
implementation parsed up to 5 bytes.
Add additional unit test, which verifies that error is reported in case
of invalid packet length.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
The following commit:
commit 407b49b35c (refs/bisect/bad)
Author: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
Date: Wed Feb 12 15:00:46 2020 +0100
cmake: use find_package to locate Zephyr
breaks as we don't find the ZephyrUnittest package. For now revert to
the old means until a proper fix can be made.
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
This commit disables the nested interrupt test for the RISC-V platform,
as interrupt nesting is not supported on the current RISV-C
architecture port.
Furthermore, the current `trigger_irq` implementation for RISC-V is
mostly incorrect and cannot be used, so there is no point in leaving
that in the codebase (see #23593).
Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
The current nested interrupt test implementation is both buggy and
fundamentally flawed because it does not trigger a higher priority
interrupt from a lower priority interrupt context and relies on the
system timer interrupt, which is not fully governed by the test;
moreover, the current implementation does not properly validate the
test results and can report success if no interrupt is triggered and
serviced at all.
This commit reworks this test to have the following well-defined
and logical procedure:
1. [thread] Trigger IRQ 0 (lower priority)
2. [isr0] Set ISR 0 result token and trigger IRQ 1 (higher priority)
3. [isr1] Set ISR 1 result token and return
4. [isr0] Validate ISR 1 result token and return
5. [thread] Validate ISR 0 result token
The reworked test scenario ensures that the interrupt nesting works
properly and any abnormal conditions are detected (e.g. interrupts not
triggering at all, or ISR 1 not being nested under ISR 0).
Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
This commit re-organises the kernel interrupt tests for consistency.
In addition, it removes any references to the `irq_offload` feature,
which is no longer used by this test.
Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
Changing ZEPHYR_BASE throughout Zephyr tests and samples revealed that
intel s1000 crb cache test case could not be run on CI.
This has now been fixed by moving the tests file located in
tests/board/intel_s1000_crb folder into tests/board/intel_s1000_crb/main
instead so there is now main and cache folders with test projects.
Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
Using find_package to locate Zephyr.
Old behavior was to use $ENV{ZEPHYR_BASE} for inclusion of boiler plate
code.
Whenever an automatic run of CMake happend by the build system / IDE
then it was required that ZEPHYR_BASE was defined.
Using ZEPHYR_BASE only to locate the Zephyr package allows CMake to
cache the base variable and thus allowing subsequent invocation even
if ZEPHYR_BASE is not set in the environment.
It also removes the risk of strange build results if a user switchs
between different Zephyr based project folders and forgetting to reset
ZEPHYR_BASE before running ninja / make.
Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
By changing the various *NET_DEVICE* macros. It is up to the device
drivers to either set a proper PM function or, if not supported or PM
disabled, to use device_pm_control_nop relevantly.
All existing macro calls are updated. Since no PM support was added so
far, device_pm_control_nop is used as the default everywhere.
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
The board target for emulation of nRF52811 on nRF52840 DK, so far
known as nrf52811_pca10056, is renamed to nrf52840dk_nrf52811.
Its documentation and all references to its name in the tree are
updated accordingly. Overlay and configuration files specific to
this board are also renamed, to match the new board name.
Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
The nRF52840 DK board target, so far known as nrf52840_pca10056,
is renamed to nrf52840dk_nrf52840.
Its documentation and all references to its name in the tree are
updated accordingly. Overlay and configuration files specific to
this board are also renamed, to match the new board name.
Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
Remove a side effect in an assertion check of the
expected reason after spurious interrupt handling.
Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
This commit changes the behaviour of the CMSIS-RTOS periodic timers to
have an initial timeout equal to the periodic timeout instead of
executing the callback function directly when calling the
osTimerStart(...); function.
This behavioural change is according to the CMSIS-RTOS specification.
Signed-off-by: Måns Ansgariusson <Mans.Ansgariusson@AssaAbloy.com>
These are short-circuiting utility helpers that can save typing
in situations where avoiding evaluation of the not-taken branch
skips invalid expressions.
Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
This is joint work with Kumar Gala (see signed-off-by).
Add helper macros which abstract the "true names" of each of the four
types of node identifier we intend to support (e.g. DT_ALIAS(),
DT_INST()).
These can be passed to a new DT_PROP() macro which can be used to read
the value of a devicetree property given a node identifier from one of
these four other macros, and the as-a-c-token name of the property.
Add other accessor macros and tests as well.
Add some convenience APIs for writing device drivers based on instance
numbers as well. Drivers can "#define DT_DRV_COMPAT driver_compatible"
at the top of the file, then utilize these DT_INST_* macros to access
various property defines.
For example, the uart_sifive driver can do:
#define DT_DRV_COMPAT sifive_uart0
Then use DT_INST macros like:
.port = DT_INST_REG_ADDR(0),
.sys_clk_freq = DT_INST_PROP(0, clock_frequency),
For convenience working with specific hardware, also add:
<devicetree/gpio.h>
<devicetree/adc.h>
<devicetree/spi.h>
Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
We rename the nRF51 Dev Kit board target (nrf51_pca10028)
to nrf51dk_nrf51422. We update all associated references
in the supportive documentation and all nRF51-related
cofigurations and overlay files in the samples and tests
in the tree.
Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
We update README file to correct the text for k_cpu_idle
testing, since now we cover the test for both tickless
and non-tickless kernel configuration.
Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
We fix the kernel.context test, so it tests the
implementation of k_cpu_idle for tickless kernel.
As most platforms now support tickless kernel by
default, this extension of the test is essential
to get coverage on k_cpu_idle() API.
Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
Recently added test for pthread_getname_np()/pthread_setname_np()
functions used uninitialized array value. As we can't check behavior
for arbitrary uninitialized value, but at most NULL value, make the
test calls to explicitly use NULL, to make the test intent clear
(instead of for example initializing the original array with zeros).
Also, these test cases use variable names not consistent with Zephyr
codestyle, and named to generically to cause confuse when used in a
general context of the test_posix_pthread_execution() function, so
rename them to be specific. (And alternative would be to separate
pthread_getname_np()/pthread_setname_np() tests into a separate
function, but it was indeed practical to piggyback them on existing
test_posix_pthread_execution()).
Fixes: #23473
Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
The documentation motivates this function by saying it is more
efficient than the core 64-bit version. This was untrue when
originally added, and is untrue now. Mark the function deprecated and
replace its sole in-tree use with the trivial equivalent.
Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
The `xlnx,ttcps` binding, despite having the file name of
`xlnx,ttcps.yaml`, had the compatible property of `cdns,ttc`.
While it is true that the Xilinx ZynqMP platform embeds the Cadence
Triple Timer Counter (TTC) IP core, its TTC differs from the original
Cadence core in that it implements 32-bit counters, instead of the
16-bit counters defined in the original; hence, the Xilinx variant is
not compatible with the original Cadence version and should be treated
as a different device.
This commit changes the `xlnx,ttcps.yaml` compatible property to
`xlnx,ttcps` for the above reasons.
Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
The `tests/kernel/context` test fails for the `qemu_cortex_r5` when the
icount emulation mode is used, because the Xilinx QEMU ignores the WFI
instruction when the icount parameter is specified.
This will be fixed in the Zephyr SDK 0.11.3 and this commit must be
reverted once the CI is updated to use this new SDK version.
For more details, see zephyrproject-rtos/sdk-ng#191.
Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
The IIS2MDC is a 3D digital magnetometer ultra-low power sensor
for industrial applications, which can be interfaced through
either I2C or SPI bus.
https://www.st.com/resource/en/datasheet/iis2mdc.pdf
This driver is based on stmemsc i/f v1.02.
Signed-off-by: Armando Visconti <armando.visconti@st.com>
Tests were added for the UART configure API in #22849. The existing test
implementation works, but suggested to reduce dependency between test
cases. This commit allows each test to run independently of each other
by removing the function call of uart_config_get() in the
uart_configure() test case, and uses the uart_config_get() test case to
confirm the value set and gotten/read.
Fixes#23459
Signed-off-by: Jennifer Williams <jennifer.m.williams@intel.com>
This reverts commit 8739517107.
Pull Request #23437 was merged by mistake with an invalid manifest.
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
Replace all occurences of BUILD_ASSERT_MSG() with BUILD_ASSERT()
as a result of merging BUILD_ASSERT() and BUILD_ASSERT_MSG().
Signed-off-by: Oleg Zhurakivskyy <oleg.zhurakivskyy@intel.com>
Reworked calibration to not use HW platform which is not available on
some platforms (nrf53) and does not bring any value compared to using
system timer. Switched to use k_timer. Additionally, improved
calibration algorithm to request also LF clock before starting
calibration. This simplifies the algorithm because it does not need
to support disabling low frequency clock which in calibration.
Tests has been updated and simplified. Former tests relied on HW timer
event.
Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
Allocates segmented message buffers as slabs in a common pool for RX and
TX. This reduces memory requirements for both TX and RX, as TX messages
can be stored without the network and advertising buffer overhead, and
RX can use only the slabs it needs, instead of allocating a full size
segmented message. This approach also removes the need for decrypting
the segments for each retransmission, reducing overall processing load.
Slab based segmentation for tx also introduces queuing of segmented
messages, which allows the application layer to send multiple messages
to the same destination without violating Bluetooth Mesh specification
v1.0.1, section 3.6.4.1. This mechanism is provided through a flag that
blocks segmented messages to a destination which a message is already
being sent to until the previous message finishes.
This changes the SDU size configuration to a symmetrical
RX_SEG_MAX/TX_SEG_MAX pair of configurations, plus a new segment pool
side configuration. It also removes the binding between the TX_SEG_MAX
config and the advertising buffers, reducing the minimum advertising
buffer count from 6 to 3.
Signed-off-by: Trond Einar Snekvik <Trond.Einar.Snekvik@nordicsemi.no>
The ISM330DHCX is a ultra-low power IMU with a 3D digital accelerometer
and 3D digital gyroscope tailored for Industry 4.0 applications, which
can be interfaced through either I2C or SPI bus.
https://www.st.com/resource/en/datasheet/ism330dhcx.pdf
This driver is based on stmemsc i/f v1.02.
Signed-off-by: Armando Visconti <armando.visconti@st.com>