Commit Graph

62 Commits

Author SHA1 Message Date
Hake Huang f2e9f67db5 test: i2s_api: exclude NXP rtxxx platform
as NXP rtxxx series i2s driver using a ping-pong
buffer, which is not supported by this test, and
use the i2s_speed only to test on those platform

Signed-off-by: Hake Huang <hake.huang@oss.nxp.com>
2023-05-26 09:54:07 -04:00
Gerard Marull-Paretas dacb3dbfeb iterable_sections: move to specific header
Until now iterable sections APIs have been part of the toolchain
(common) headers. They are not strictly related to a toolchain, they
just rely on linker providing support for sections. Most files relied on
indirect includes to access the API, now, it is included as needed.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2023-05-22 10:42:30 +02:00
Yves Vandervennet 0f87666126 i2s : mimxrt595_evk_cm33: enablement of driver
board:

 - update device tree to use flexcomm devices to the chip design
 - enable clocks (soc init file)
 - setup connections for loopback test in system controller (board init
   file)

tests:

 - update board files (overlay, conf)

Signed-off-by: Yves Vandervennet <yves.vandervennet@nxp.com>
2023-05-12 13:50:33 -05:00
Gerard Marull-Paretas 93b63df762 samples, tests: convert string-based twister lists to YAML lists
Twister now supports using YAML lists for all fields that were written
as space-separated lists. Used twister_to_list.py script. Some artifacts
on string length are due to how ruamel dumps content.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2023-05-10 09:52:37 +02:00
Andrzej Głąbek 5d240edc17 tests: drivers: i2s_api: Fix initialization of the test
- replace device_get_binding() calls that were searching for no longer
  existing I2S device labels with proper DEVICE_DT_GET_OR_NULL() calls
- move initialization of I2S devices that was previously performed
  in the test cases that were executed as first (what is no longer
  valid after moving to the new ztest API) to functions that are called
  before running each test in a given test suite

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2023-04-03 12:32:34 -04:00
Andrzej Głąbek aea674e583 tests: drivers: i2s_api: Add DT aliases i2s-node0 and i2s-node1
Add DT aliases that specify I2S devices to be used in the test.
Add new overlays as in fdad738cff
and modify existing ones accordingly.

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2023-04-03 12:32:34 -04:00
Andrzej Głąbek bfae6449a1 tests: i2s: Use Kconfig defaults instead of overlays for nRF I2S
... so that it is not needed to provide a .conf file for every board
based on an nRF SoC that features I2S.

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2023-04-03 12:32:34 -04:00
Andrzej Głąbek 9bb3ccd28f tests: drivers: i2s_speed: Do not enable debug level logging
Follow-up to commit 7f1f2385d2.

For consistency with the i2s_api test, use the default logging
settings.

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2023-04-03 12:32:34 -04:00
Gerson Fernando Budke bf46696057 drivers: dma: sam: Update to use clock control
This update Atmel SAM xdmac driver to use clock control driver.

Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
2023-03-21 14:12:25 -07:00
Anas Nashif d45788f869 tests: i2s_api: convert to new ztest API
Move test to new ztest API.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2023-02-28 11:43:37 +01:00
Andrzej Głąbek 6708b139ab tests: drivers: i2s: Mark gpio_loopback cases as dependent on gpio
Add dependency on gpio in test cases that require the gpio_looback
fixture.

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2023-01-27 19:21:19 +09:00
Andrzej Głąbek 54648142f7 tests: drivers: i2s: Align nRF pinctrl with other gpio_loopback users
For nRF boards and lines that need to be connected with an external
loopback (SDOUT and SDIN), use the same pins as in other tests that
use the gpio_loopback fixture (like uart_async_api or regulator/fixed)
so that a common wiring can be used for all those cases.

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2023-01-27 19:21:19 +09:00
Andrzej Głąbek b4fb5300da boards: nrf52840dk_nrf52840: Do not enable arduino_serial by default
This is a follow-up to commit 25d7a09aa5.

The arduino_serial/uart1 node should not be enabled by default because
even if an application does not use it, the default CONFIG_SERIAL=y
setting causes that it is anyway initialized, so the UARTE peripheral
acquires its assigned pins (and they cannot be used in other way) and
its enabled receiver causes increased current consumption (by ~500 uA)
when the CPU is sleeping. This affects e.g. the boards/nrf/system_off
sample.
Applications that actually need to use this UART or shields that use
the arduino_serial node should enable the node explicitly.

Keep this node disabled by default for the nrf52840dk_nrf52840 board
and also for boards whose definitions are mostly copies of the above:
nrf52833dk_nrf52833 and nrf21540dk_nrf52840.

Update also accordingly a few overlay files in tests/ that were
disabling this node because of the pins it undesirably acquired.

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2023-01-16 09:26:10 +01:00
Emilio Benavente 9b1b68657c tests: drivers: i2s: Combined merged the test files into main
Since main was only registering the Test Suite, it made since
to combine the actual tests into one file instead of having
an empty file to initialize the test.

Signed-off-by: Emilio Benavente <emilio.benavente@nxp.com>
2023-01-06 10:34:45 +00:00
Emilio Benavente 3ffc64a92d tests: drivers: i2s: ZTest ordering issue fix
The test was executing the expected functions
out of order. I have created a config functions
and explicitly declared them to be setup functions
for this ZTest framework.

Signed-off-by: Emilio Benavente <emilio.benavente@nxp.com>
2023-01-06 10:34:45 +00:00
Emilio Benavente d4cfc35b8d tests: drivers: i2s: Fix Label Property issue
The I2S Speed test attempted to find a device
via the Label Property of the node. I have updated
the code to search for the nodelabel instead.

Signed-off-by: Emilio Benavente <emilio.benavente@nxp.com>
2023-01-06 10:34:45 +00:00
Emilio Benavente fdad738cff tests: drivers: i2s: Adding overlays to I2S supported boards
Adding overlay files that give an alias name to the
i2s node that is equivalent to the alias in the
i2s speed test.

Signed-off-by: Emilio Benavente <emilio.benavente@nxp.com>
2023-01-06 10:34:45 +00:00
Hu Zhenyu 9fd919a466 tests: drivers: i2s: i2s_speed: move to new ztest API
Move drivers i2s_speed tests to use new ztest API

Signed-off-by: Hu Zhenyu <zhenyu.hu@intel.com>
2022-09-16 08:35:36 +00:00
Michał Barnaś dae8efa692 ztest: remove the obsolete NULL appended to zassert macros
This commit removes the usage of NULL parameter as message in
zassert_* macros after making it optional

Signed-off-by: Michał Barnaś <mb@semihalf.com>
2022-09-09 07:05:38 -04:00
Gerard Marull-Paretas 79e6b0e0f6 includes: prefer <zephyr/kernel.h> over <zephyr/zephyr.h>
As of today <zephyr/zephyr.h> is 100% equivalent to <zephyr/kernel.h>.
This patch proposes to then include <zephyr/kernel.h> instead of
<zephyr/zephyr.h> since it is more clear that you are including the
Kernel APIs and (probably) nothing else. <zephyr/zephyr.h> sounds like a
catch-all header that may be confusing. Most applications need to
include a bunch of other things to compile, e.g. driver headers or
subsystem headers like BT, logging, etc.

The idea of a catch-all header in Zephyr is probably not feasible
anyway. Reason is that Zephyr is not a library, like it could be for
example `libpython`. Zephyr provides many utilities nowadays: a kernel,
drivers, subsystems, etc and things will likely grow. A catch-all header
would be massive, difficult to keep up-to-date. It is also likely that
an application will only build a small subset. Note that subsystem-level
headers may use a catch-all approach to make things easier, though.

NOTE: This patch is **NOT** removing the header, just removing its usage
in-tree. I'd advocate for its deprecation (add a #warning on it), but I
understand many people will have concerns.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-09-05 16:31:47 +02:00
Kumar Gala 2030f658b5 I2S: remove defconfig/proj setting of I2S drivers
Now that I2S drivers are enabled based on devicetree we can
remove any cases of them getting enabled by *.conf files.

Signed-off-by: Kumar Gala <galak@kernel.org>
2022-08-25 15:03:11 -05:00
Fabio Baltieri def230187b test: fix more legacy #include paths
Add a bunch of missing "zephyr/" prefixes to #include statements in
various test and test framework files.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2022-08-02 16:41:41 +01:00
Kumar Gala b97a9ee21c tests: drivers: Remove label property from devicetree overlays
"label" properties are not required.  Remove them from tests.

Signed-off-by: Kumar Gala <galak@kernel.org>
2022-07-22 16:44:08 +00:00
Gerard Marull-Paretas ade7ccb918 tests: migrate includes to <zephyr/...>
In order to bring consistency in-tree, migrate all tests to the new
prefix <zephyr/...>. Note that the conversion has been scripted, refer
to #45388 for more details.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-05-06 20:02:14 +02:00
Derek Snell 6115cf0a4d tests: drivers: i2s_speed: enable testing on mimxrt1170_evk board
Readme instructions for connecting SAI4 as TX to SAI1 as RX on this
board.  Also includes overlay and Kconfig settings to run this test
on the board.

Signed-off-by: Derek Snell <derek.snell@nxp.com>
2022-04-28 14:18:00 +02:00
Derek Snell 0356a70397 tests: drivers: i2s_speed: place mem_slab's in non-cacheable region
If platform supports non-cacheable region, place mem_slab's for I2S
driver buffers there.  This enables drivers using DMA without cache
coherency issues.

Signed-off-by: Derek Snell <derek.snell@nxp.com>
2022-04-28 14:18:00 +02:00
Gerard Marull-Paretas 18859fe6ff tests: drivers: i2s: use pinctrl for nrf board overlay
nRF boards now require usage of pinctrl, migrate them.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-03-21 15:09:28 +01:00
Mahesh Mahadevan c3379a8264 tests: i2s: Add support for LPCXpresso55S69
Update I2S tests for LPCXpresso55S69

Signed-off-by: Mahesh Mahadevan <mahesh.mahadevan@nxp.com>
2021-09-01 14:39:03 -04:00
Mahesh Mahadevan 8b13046cb6 tests: i2s: Fix i2s_states_test
The device used for TX stream in the test_i2s_state_ready_neg()
function is incorrect.

Signed-off-by: Mahesh Mahadevan <mahesh.mahadevan@nxp.com>
2021-08-27 15:02:09 -05:00
Torsten Rasmussen 1cccc8a8fe cmake: increase minimal required version to 3.20.0
Move to CMake 3.20.0.

At the Toolchain WG it was decided to move to CMake 3.20.0.

The main reason for increasing CMake version is better toolchain
support.

Better toolchain support is added in the following CMake versions:
- armclang, CMake 3.15
- Intel oneAPI, CMake 3.20
- IAR, CMake 3.15 and 3.20

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2021-08-20 09:47:34 +02:00
Andrzej Głąbek 0f949caee1 tests: drivers: i2s_speed: Allow testing on nRF52840 DK and nRF5340 DK
This is a follow-up to commit 954dfa755b.

Apply adjustments made in the i2s_api test to the i2s_speed one so that
it can also be executed successfully on the nRF DK boards.

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2021-08-11 13:54:12 +02:00
Andrzej Głąbek 954dfa755b tests: drivers: i2s_api: Allow testing on nRF52840 DK and nRF5340 DK
Provide configurations for the nRF52840 DK and nRF5340 DK boards.
Adjust the test to cover specifics of I2S peripherals on nRF SoCs
(need of starting RX and TX simultaneously, lack of internal loopback).

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2021-07-28 18:41:26 -04:00
Mahesh Mahadevan a02704bacf tests: i2s_speed: Increase the RX buffer count
The NXP I2S driver queues 2 receive buffers to avoid receive overflows.
Allocate an extra block so we do not see test failures due to allocate
failures

Signed-off-by: Mahesh Mahadevan <mahesh.mahadevan@nxp.com>
2021-06-03 14:14:24 -05:00
Andrzej Głąbek ea7d95a596 tests: drivers: i2s_api: Fix MPU fault in user mode
Use ZTEST_DMEM macro to place the buffers containing sample values
in the ztest memory partition that can be accessed from userspace.

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2021-05-25 12:57:38 -05:00
Mahesh Mahadevan 96fd76edda tests: i2s: Fix i2s_states_test test suite
1. Update the way test_i2s_state_error_neg test handles
RX overflow.
2. Clean up after test_i2s_state_stopping_neg test in case the
receiving channel is stuck in the STOPPING State if the data
was received prior to calling the STOP trigger.

Signed-off-by: Mahesh Mahadevan <mahesh.mahadevan@nxp.com>
2021-04-30 12:02:55 -05:00
Mahesh Mahadevan 06c1020304 tests: i2s: Update i2s_speed test
1. Allow loopback over different I2S ports
2. Add a config option to indicate if the ports
   are separate

Signed-off-by: Mahesh Mahadevan <mahesh.mahadevan@nxp.com>
2021-04-30 12:02:55 -05:00
Mahesh Mahadevan 3df8733276 tests: i2s: Update i2s_api test
1. Provide an option to loopback over separate I2S ports
2. Increase the buffer count in the loopback test to 4
3. Update test_i2s_transfer_rx_overrun test on how to
   handle RX overrun failures

Signed-off-by: Mahesh Mahadevan <mahesh.mahadevan@nxp.com>
2021-04-30 12:02:55 -05:00
Tomasz Bursztyka e18fcbba5a device: Const-ify all device driver instance pointers
Now that device_api attribute is unmodified at runtime, as well as all
the other attributes, it is possible to switch all device driver
instance to be constant.

A coccinelle rule is used for this:

@r_const_dev_1
  disable optional_qualifier
@
@@
-struct device *
+const struct device *

@r_const_dev_2
 disable optional_qualifier
@
@@
-struct device * const
+const struct device *

Fixes #27399

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2020-09-02 13:48:13 +02:00
Anas Nashif 0798b85d1c tests: remove obsolete doxygen boilerplate
An old doxygen biolerplate was being copied all over the tests. The
defined groups are not being used anywhere and it does not follow how we
document tests for example in the kernel and other places.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2020-07-28 08:14:23 -05:00
Kumar Gala a1b77fd589 zephyr: replace zephyr integer types with C99 types
git grep -l 'u\(8\|16\|32\|64\)_t' | \
		xargs sed -i "s/u\(8\|16\|32\|64\)_t/uint\1_t/g"
	git grep -l 's\(8\|16\|32\|64\)_t' | \
		xargs sed -i "s/s\(8\|16\|32\|64\)_t/int\1_t/g"

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-06-08 08:23:57 -05:00
Marc Herbert debade9121 tests: make find_package(Zephyr...) REQUIRED
... because it is (required).

This makes a difference when building with CMake and forgetting
ZEPHYR_BASE or not registering Zephyr in the CMake package registry.

In this particular case, REQUIRED turns this harmless looking log
statement:

-- Could NOT find Zephyr (missing: Zephyr_DIR)
-- The C compiler identification is GNU 9.3.0
-- The CXX compiler identification is GNU 9.3.0
-- Check for working C compiler: /usr/bin/cc
-- ...
-- ...
-- ...
-- Detecting CXX compile features
-- Detecting CXX compile features - done
CMake Error at CMakeLists.txt:8 (target_sources):
  Cannot specify sources for target "app" which is not built by
  this project.

... into this louder, clearer, faster and (last but not least) final
error:

CMake Error at CMakeLists.txt:5 (find_package):
  Could not find a package configuration file provided by "Zephyr" with
  any of the following names:

    ZephyrConfig.cmake
    zephyr-config.cmake

  Add the installation prefix of "Zephyr" to CMAKE_PREFIX_PATH or set
  "Zephyr_DIR" to a directory containing one of the above files.  If
  "Zephyr" provides a separate development package or SDK, be sure it
  has been installed.

-- Configuring incomplete, errors occurred!

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2020-05-29 10:47:25 +02:00
Henrik Brix Andersen 6f5af9efa5 tests: i2s: api: fix compilation with new timeout api
Fix compilation of the I2S API tests with the new timeout API.

Remove the defines for sleep periods and embed them directly into the
code to improve consistency.

Signed-off-by: Henrik Brix Andersen <henrik@brixandersen.dk>
2020-05-11 21:34:18 +02:00
Torsten Rasmussen 407b49b35c cmake: use find_package to locate Zephyr
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>
2020-03-27 16:23:46 +01:00
Anas Nashif 70758c4374 tests: fix test identifiers
The seasonal overhaul of test identifiers aligning the terms being used
and creating a structure. This is hopefully the last time we do this,
plan is to document the identifiers and enforce syntax.

The end-goal is to be able to generate a testsuite description from the
existing tests and sync it frequently with the testsuite in Testrail.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-12-09 15:53:44 -05:00
Song Qiang 85a0cc8f9a boards: arm: 96b_argonkey: Update dma defconfig for tests
Previous defconfig for dma is DMA_STM32F4X in this board, while the new
generic driver uses DMA_STM32 to enable DMA support, and also dma driver
of stm32 now needs HEAP_MEM_POOL_SIZE to be big enough to hold dma
stream instances.

Additional .conf files are added for also adding HEAP_MEM_POOL_SIZE
configuration to two test cases.

Signed-off-by: Song Qiang <songqiang1304521@gmail.com>
2019-11-06 14:14:39 +01:00
Peter Bigot 6e5db350b2 coccinelle: standardize k_sleep calls with integer timeouts
Re-run with updated script to convert integer literal delay arguments to
k_sleep to use the standard timeout macros.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2019-10-09 08:38:10 -04:00
Anas Nashif f2e35134b0 cleanup: include/: move i2s.h to drivers/i2s.h
move i2s.h to drivers/i2s.h and
create a shim for backward-compatibility.

No functional changes to the headers.
A warning in the shim can be controlled with CONFIG_COMPAT_INCLUDES.

Related to #16539

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-06-27 22:55:49 -04:00
Anas Nashif 3ae52624ff license: cleanup: add SPDX Apache-2.0 license identifier
Update the files which contain no license information with the
'Apache-2.0' SPDX license identifier.  Many source files in the tree are
missing licensing information, which makes it harder for compliance
tools to determine the correct license.

By default all files without license information are under the default
license of Zephyr, which is Apache version 2.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-04-07 08:45:22 -04:00
Andrew Boie 7b1ee5cf13 tests: CONFIG_TEST_USERSPACE now off by default
Unlike CONFIG_HW_STACK_PROTECTION, which greatly helps
expose stack overflows in test code, activating
userspace without putting threads in user mode is of
very limited value.

Now CONFIG_TEST_USERSPACE is off by default. Any test
which puts threads in user mode will need to set
CONFIG_TEST_USERSPACE.

This should greatly increase sanitycheck build times
as there is non-trivial build time overhead to
enabling this feature. This also allows some tests
which failed the build on RAM-constrained platforms
to compile properly.

tests/drivers/build_all is a special case; it doesn't
put threads in user mode, but we want to ensure all
the syscall handlers compile properly.

Fixes: #15103 (and probably others)

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2019-04-06 14:30:42 -04:00
Andrew Boie 027b6aaf89 tests: set userspace tag for all tests that use it
This lets us quickly filter tests that exercise userspace
when developing it.

Some tests had a whitelist with qemu_cortex_m3; change
this to mps2_an385, which is the QEMU target with an
MPU enabled.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2019-04-06 14:30:42 -04:00