Adds a disk driver test, intended for the NXP USDHC driver but valid for
any disk device. The test performs multiple reads and writes to the
disk, and verifies that the driver does not write out of bounds to the
provided buffer.
Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
RT1xxx SOCs using the GPT timer require a custom ISR table for the arm
irq_vector_table test, since they use a custom system timer implemented
using the GPT peripheral. Implement the required vector tables within
the irq_vector_table test to enable it to run.
Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
Thread APIs test for k_busy_wait incorrectly asserted that a delay of
100 us should produce a delay in cycles less than or equal to to 100 cycles
of the hardware clock. Since most hardware clocks are fast, this assertion
was valid, but it does not test for the actual delay.
Fix the assertion to verify that a delay of 100 us produces a delay in
cycles less than or equal to 100 us worth of hardware clock cycles.
Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
The coredump tests output quite a large amount of data into
the console. However, the ACRN console only has very limited
history (comparatively), such that twister is unable to
match the necessary strings to consider the tests passed.
So skip those tests on acrn_ehl_crb.
Fixes#40887
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
Prepare the driver to upcoming support of more mux references.
Rename all TCA9546A related files to TCA954x.
Keep ti,tca9546a and ti,tca9546a-channel compatible
for backward compatibility reasons.
New tca954x-base binding embedding common properties,
tca9546a binding inherits from it and define its own compatibles fields.
Signed-off-by: Aymeric Aillet <aymeric.aillet@iot.bzh>
Replace deprecated macro USBD_CFG_DATA_DEFINE by
USBD_DEFINE_CFG_DATA which places usb_cfg_data structures
in specific iterable section.
Replace __usb_data_start, __usb_data_end usage patterns
size_t size = (__usb_data_end - __usb_data_start);
for (size_t i = 0; i < size; i++) {...}
by
STRUCT_SECTION_FOREACH(usb_cfg_data, ...) {...}
Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
The warning below appears once -Waddress-of-packed-mem is enabled:
/__w/zephyr/zephyr/tests/lib/mpsc_pbuf/src/main.c: In function
'item_put_data_overwrite':
/__w/zephyr/zephyr/tests/lib/mpsc_pbuf/src/main.c:497:3: error:
converting a packed 'struct test_data_ext' pointer (alignment 1) to a
'uint32_t' {aka 'const unsigned int'} pointer (alignment 4) may result
in an unaligned pointer value [-Werror=address-of-packed-member]
497 | mpsc_pbuf_put_data(&buffer, (uint32_t *)&item, len);
To avoid the warning, as well as several others related to the same
problem, use an intermediate void * variable.
More info in #16587.
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
The warning below appears once -Waddress-of-packed-mem is enabled:
/__w/zephyr/zephyr/tests/kernel/mem_protect/userspace/src/main.c: In
function 'test_main':
/__w/zephyr/zephyr/tests/kernel/mem_protect/userspace/src/main.c:1024:17:
error: converting a packed 'k_thread_stack_t' {aka 'struct
z_thread_stack_element'} pointer (alignment 1) to a 'struct
z_x86_thread_stack_header' pointer (alignment 4096) may result in an
unaligned pointer value [-Werror=address-of-packed-member]
1024 | hdr = ((struct z_x86_thread_stack_header *)ztest_thread_stack);
To avoid the warning, use an intermediate void * variable.
More info in #16587.
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
Failed to build tests/kernel/mem_protect/syscalls on fvp_baser_aemv8r_smp
because the default value of CONFIG_MAX_THREAD_BYTES is too low.
So manually set the value to 5 in test case's prj.conf file.
Signed-off-by: Lixin Guo <lixinx.guo@intel.com>
Add a test suite to check various clocks configurations.
Test is based on HAL functions that read clock configuration
from registers.
One test is build only, as there is no available hw to test it today.
Others can be tested on target.
More configurations and test points could be added in future.
Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
Deprecate the use of CAN-specific error return values and replace them
with standard errno values.
Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
There shall be no special case for inverted PWM pulse when checking
if the captured value is correct.
The output signal inversion is done in HW (at least for stm32h7xx)
SoC. The measured value of the pulse shall be the same - no matter
if we invert the signal or not (as measuring also takes into account
the inversion of the output/input signal).
Signed-off-by: Lukasz Majewski <lukma@denx.de>
Without this change the information about PWM polarity is lost when
flags are passed, as the out.flags is set according to PWM description
in the DTS.
For example in: pwms = <&pwm2 2 0 PWM_POLARITY_NORMAL> the out.flags
is always set to PWM_POLARITY_NORMAL.
However, some tests - like 'test_pulse_capture_inverted' require testing
if PWM driver is able to invert the generated signal.
After this change, the generated waveform (from the TIMx pin) is
inverted.
Tested on: Nucleo 'nucleo_h743zi' board (TIM2 ch2 -> out, TIM5 ch1 <- in)
Signed-off-by: Lukasz Majewski <lukma@denx.de>
This commit allows testing the PWM (timers) on the
nucleo_h743zi development board.
The HW setup for testing:
Timer2 (channel 2) as PWM signal generator -> CN11 connector
(PIN 30)
Timer5 (channel1) in Capture mode to measure the pulse
duration -> CN11 connector (PIN28)
Such setup allows easy HW loopback connection (just short cut two
consecutive pins/soldering vias on the devel board's PCB).
Signed-off-by: Lukasz Majewski <lukma@denx.de>
Add a new application for testing non-core devicetree functionality.
Add tests for the default and fallback case of
`LINKER_DT_NODE_REGION_NAME`.
Signed-off-by: Jordan Yates <jordan.yates@data61.csiro.au>
Refactor the mcp230xx driver to generically also support
SPI IO expanders, renaming it to mcp23xxx in the process.
Signed-off-by: Peter Johanson <peter@peterjohanson.com>
DMA controller is enabled and tested for cortex M7 core. The M7 core was
tested on the loop and channel link transfer tests.
Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
DMA controller is enabled and tested for cortex M7 core. The M7 core was
tested on the loop and channel link transfer tests.
Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
Test verifies that i2c pmic regulator can be disabled or enabled using
the regulator API. Verifies PMIC output voltage using ADC.
Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
This commit reworks the CMOS test to a generic seconds
counter test.
And it adds a test case for the iMX RT1064 SNVS RTC.
Tested with mimxrt1064_evk
Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
Update the configuration file to use BT_FILTER_ACCEPT_LIST
instead of the deprecated BT_WHITELIST.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Mounting FAT FS will set FS_MOUNT_FLAG_USE_DISK_ACCESS to the flags
of an object serving the mount point.
Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
Rename PM_STATE_DT_ITEMS_LEN to DT_NUM_CPU_POWER_STATES to make its
purpose more clear. This macro could be made part of a Devicetree API
for PM in the future.
Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
Rename the PM_STATE_DT_ITEMS_LIST macro to PM_STATE_LIST_FROM_DT_CPU to
make its purpose more clear. Similar naming scheme is found e.g. in the
GPIO API.
Associated internal macros and docstrings have been adjusted, too.
Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
Rename the PM_STATE_INFO_DT_ITEMS_LIST macro to
PM_STATE_INFO_LIST_FROM_DT_CPU to make its purpose more clear. Similar
naming scheme is found e.g. in the GPIO API.
Associated internal macros and docstrings have been adjusted, too.
Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
Clang 12.0.0 complains about
"cast to smaller integer type 'enum control_method' from 'void *'
[-Werror,-Wvoid-pointer-to-enum-cast]".
Cast it to intptr_t type first.
Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
logging.log_msg2_64b_timestamp and logging.log_msg2_fp_64b_timestamp are
currently failing on qemu_cortex_a9 due to #39978. Disable them on that
platform until the issue is fixed.
Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
As described in #39978, an issue is currently preventing those tests
from executing correctly. Disable them until a fix is found.
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
Add a test case for the device PM busy API (previously part of kernel
device tests).
Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
The PM subsystem is tested in tests/subsys/pm, the removed tests were
not relevant for devices. The test_build_suspend_device_list test has
been renamed to test_device_list since the API is not strictly related
to PM (and does not depend on it).
Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
This commit sets the minimum RAM requirement for the full newlib test
(`cpp.libcxx.newlib`) to 24 KiB so that only the target platforms that
can provide sufficient RAM area for the newlib heap are selected.
In case of the newlib full variant, the minimum required newlib heap
size, specified by CONFIG_NEWLIB_LIBC_MIN_REQUIRED_HEAP_SIZE, is 8192.
Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
Arduino compatible boards should have a working UART on pin 0 & 1.
On frdm_k64f this is handled by uart3
Unfortunately pinmuxing of uart3 was destroyed when enabling NETWORKING,
because the uart3 RX/TX pins was reconfigured for 1588 timers.
1588 timers are enabled by the enet child node, ptp which by some reason
is enabled by default.
1588 timers aren't needed in most cases when ethernet is being used,
so this fix ensures ptp is by default disabled. Likewise pinmuxing of
the 1588 timer functionality is now dependant of ptp being active
Signed-off-by: Kim Bøndergaard <kim.boendergaard@escoglobal.com>
Add support for LPSPI DMA mode on RT1064, RT1060, RT1050, RT1024,
RT1020, RT1015, and RT1010 evaluation boards. Update tests to match.
Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
The test is wrongly assuming that all the archs have #address-cells =
<1> and #size-cells = <1> at the DT root. This is not always true, and
it makes the test failing for AArch64. Fix the wrong assumption.
Signed-off-by: Carlo Caione <ccaione@baylibre.com>
This platform is slow on some tests and times out on non-hardware
related tests, so exclude it or increase timeout for some of the tests
to avoid false negatives in the test results due to timeouts.
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Add some basic custom 802154 L2 tests, verifying that a custom L2 can be
integrated with Zephyr properly.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
These two test cases both are fault injection test cases,
and there are designed for testing some negative branches
to improve code coverage. But I find that this branch
shouldn't be tested, because the spinlock will be locked
before a procedure performs here, and then it will trigger
an assert error and the process will be rescheduled to the
handler function, and terminated the current test case,
so spinlock will never be unlocked. And it will impact
the next test case in the same test suite(the next testcase
will be never get spinlock).
Signed-off-by: NingX Zhao <ningx.zhao@intel.com>