arm_psci test suite is specific to ARM64, while
all other test suites in tests/arch/arm directory
are supported in Cortex-M architecture only. We
move arm_psci to arm64 directory, effectively,
separating tests suites for AARCH32 and AARCH64.
Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
If user sets CONFIG_NUM_PREEMPT_PRIORITIES=0, then the priority
of the net_mgmt thread will be -1 which is the same as idle thread.
This will trigger assert in kernel as then the minimum coop priority
is -2 in this case. Remove the net_mgmt thread priority setting from
Kconfig file as it is low value and set the coop thread priority
the same way as other network threads are doing it.
Fixes#32375
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Provide a helper to extract the devicetree node_id for a CLOCKS
controller from a clocks phandle array. This can be used with
DEVICE_DT_GET() to directly reference the corresponding controller
device.
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
Co-authored-by: Marti Bolivar <marti.bolivar@nordicsemi.no>
Correct a bunch of precision/analysis errors in this test:
* Test items weren't consistent about tick alignment and resetting of
the timestamp, so put these steps into init_timer_data() and call
that immediately before k_timer_start().
* Many items would calculate the initial timestamp AFTER
k_timer_start(), leading to an extra (third!) point where the timer
computation could alias by an extra tick. Always do this
consistently before the timer is started (via init_timer-data()).
* Tickless systems with high tick rates can easily advance the system
uptime while the timer ISR is running, so the system can't expect
perfect accuracy even there (this test was originally written for
ticked systmes where the ISR was by definition happening "at the
same time").
(Unfortunately our most popular high tick rate tickless system,
nRF5, also has a clock that doesn't divide milliseconds exactly, so
it had a special path through all these precision comparisons and
avoided the bugs. We finally found it on a x86 HPET system with 10
kHz ticks.)
* The interval validation was placing a minimum bound on the interval
time but not a maximum (this mistake was what had hidden the failure
to reset the timestamp mentioned above).
Longer term, the millisecond precision math in these tests is at this
point an out of control complexity explosion. We should look at
reworking the core OS tests of k_timer to use tick precision (which is
by definition exact) pervasively and leave the millisecond stuff to a
separate layer testing the alternative/legacy APIs.
Fixes#31964 (probably -- that was reported against up_squared, on
which I had trouble reproducing, but it was a common failure on
ehl_crb).
Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
This adds X86 keyword to the kconfigs to indicate these are
for x86. The old options are still there marked as
deprecated.
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
The app_kernel benchmarking app has the config file for benchmarking
with floating point enabled, but it was never used. So add it
to the testcase.yaml.
Note that this also limits to run on one CPU on a SMP system as
the resulting numbers would be more consistent among runs.
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
Even though ARC QEMU has received advanced multiplication
instructions support recently the ARC QEMU in the latest
Zephyr SDK still misses them, so tinycrypt may execute
too long and reach timeout in case of execution on
slow host.
Disable tinycrypt for ARC QEMU platforms till we update
ARC QEMU in Zephyr SDK.
Signed-off-by: Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>
Move common code that may be used by different test units
from main.c to common.c. Main.c should be clean and responsible
for unit tests executioon only. Common functionalities should be
stored in separate file and provided to test source files by
appropriate header file.
Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
Add set of functions that will make possible to configure
radio Direction Finding Extension to transmit CTE for periodic
advertising.
Some of the new Radio API functions are provided as separate
functions changing the same Radio peripheral registers, e.g.
radio_df_mode_set_aoa, radio_df_mode_set_aod. This is done on
purpose and is related with lack of DFE in nrf52_bsim.
To avoid use of conditionally compiled constants to represent
e.g. CTE mode; separate functions were introduced.
Thanks to that DF unit tests are able to compile successfully
without changes in nrf52_bsim platform. Also if DFE is added
to nrf52_bsim there is no need to change the code until it is
desired.
Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
New test that verifies CoAP Acknowledgement initialization function
that create a response packet for given request. Both request and
expected response packets are given in the test as PDU.
Signed-off-by: Hubert Miś <hubert.mis@nordicsemi.no>
Clear Floating Point Status and Control Register (FPSCR),
to prevent from having the interrupt line set to pending again,
in case FPU IRQ is selected by the test as "Available IRQ line"
Fixes#31982
Signed-off-by: Alexandre Bourdiol <alexandre.bourdiol@st.com>
A fairly common idiom in our test code is to put test-local data
structures onto the stack, even when they are to be used from another
thread. But stacks are incoherent memory on some platforms, which
means that such things may not get a consistent view of memory between
threads.
Just make these things static. A few of these spots were causing test
failures on intel_adsp_cavs15. More were found by inspection while
hunting for mistakes.
Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
Thread stack memory on coherence platforms needs to be linked into a
special section (so it can be cached).
Also, the test_idle_stack case just can't work with coherence. It's
measuring the CPU's idle stack's unused data, which was initialized at
boot from CPU0, and not necessarily the CPU on which the test is
running. In practice on intel_adsp_cavs15, our CPU has stale zeroes
in the cache for its unused stack area (presumably from a firmware
memory clear at boot or something?). Making this work would require a
cache invalidate on all CPUs at boot time before the idle threads
start, we can't do it here in the test because we don't know where the
idle stack pointer is.
Too much work for an esoteric stack size test, basically. Just
disable on these platforms.
Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
ATT channels do support queueing buffer so it no longer need to block
waiting the tx_sem besides the buffer allocation already serves the
same purpose as the application will not be able to have more requests
than there are buffers available.
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
If the prescaler is zero in the test, a div by zero would happen.
Add an assert to check for zero prescaler.
Fix CID 216790
Signed-off-by: Alexander Wachter <alexander@wachter.cloud>
There are several different issues when trying to build the icm42605
sensor driver:
* Missing entry in drivers/sensor/CMakeLists.txt
* Issues with #ifndef in header files
* Issues with const usage
* Missing function prototypes in headers
* Fix use of LOG_MODULE_REGISTER v LOG_MODULE_DECLARE
* Add missing dts node to tests/drivers/build_all/spi.dtsi
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
Zephyr does not currently allow deviation from standard terminology
for a technology even if it is non-inclusive, until the corresponding
standards body has confirmed intent to change that terminology. The
terms used in a previous attempt to be inclusive do not match the
expected forthcoming standard terms.
Revert to standard terms until the new ones have been announced and
the switch made throughout Zephyr.
Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
It was discovered that TLS data/bss in stack need to be
aligned correctly or else incorrect variables would be
accessed. This makes tdata and tbss sections to have
odd sizes to make sure everything still works.
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
Two .conf files had enabled the CONFIG_BT_AUDIO_UNICAST config, but
without the CONFIG_BT_AUDIO which is a dependecy.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Fixes problem when fs_opendir invoked on fs_dir_t object,
which is already holding information on opened directory,
overwrites references to other memory objects within
the fs_dir_t object causing resource leak.
If fs_opendir is invoked on already used fs_dir_t object,
it will return
-EBUSY.
Note: The change requires that all fs_dir_t objects should be
initialized to 0.
Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
That whether a FS implementation allow to open
same directory multiple time is FS implementation
dependent. It shouldn't be tested. Such test was removed.
However need to test whether API transfers failures from
underlying FS properly.
Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
The commit adds initializations of fs_dir_t variables in preparation
for fs_opendir function change that will require fs_dir_t object, passed
to the function, to be initialized before first usage.
Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
The commit adds initializations of fs_dir_t variables in preparation
for fs_opendir function change that will require fs_dir_t object, passed
to the function, to be initialized before first usage.
Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
The commit adds initializations of fs_dir_t variables in preparation
for fs_opendir function change that will require fs_dir_t object, passed
to the function, to be initialized before first usage.
Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
The commit adds initializations of fs_dir_t variables in preparation
for fs_opendir function change that will require fs_dir_t object, passed
to the function, to be initialized before first usage.
Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
The commit adds initializations of fs_dir_t variables in preparation
for fs_opendir function change that will require fs_dir_t object, passed
to the function, to be initialized before first usage.
Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
The fs_dir_t_init() function has been added that should be used
for initialization of fs_dir_t structures before passing them
to fs_open and other functions.
Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
Enlarge the test thread stack size, to fix test case fail
in some board which need more stack size for testing, when
CONFIG_EXCEPTION_DEBUG is enabled.
Signed-off-by: Enjia Mai <enjiax.mai@intel.com>
Start using DTS values for PCI Vendor ID and PCI BDF. For the PCI
Device ID we do not use DTS since this would require changing overlay
for different SKU board.
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
Fix issue #31339 and #31419, test case fail due to access NULL did not
trigger a fatal error in some platform such as nsim_em and iotdk.
Signed-off-by: Enjia Mai <enjiax.mai@intel.com>
The deadline scheduler as of commit ef626571b2 ("kernel/sched:
Optimize deadline comparison") got an optimization that requires that
the the cycle difference of the deadline time of the "first" and
"last" runnable thread never be higher than 2^31.
The test code here was masking off the bottom 31 bits of the generated
deadlines, so it looked OK. But because the actual setting of the
deadline values takes time too, it was still possible to select values
that would roll over. The window was VERY small, but the RNG on one
platform (up_squared) hit it.
Shrink the selected deadlines to live in a 30 bit space for safety.
Fixes#31508
Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
This reverts commit 79d73063af.
The issue #31333 is fixed so this can be reverted to
enable tests/kernel/context to run with demand paging enabled.
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
The definition for realloc() says that it should return a pointer
to the allocated memory which is suitably aligned for any built-in
type.
Turn sys_heap_realloc() into a sys_heap_aligned_realloc() and use it
with __alignof__(z_max_align_t) to implement realloc() with proper
memory alignment for any platform.
Signed-off-by: Nicolas Pitre <npitre@baylibre.com>