Commit Graph

109 Commits

Author SHA1 Message Date
Francois Ramu 75c76fef36 tests: drivers: uart async with DMA on stm32fx nucleo144 boards
It enables the usart6 to run the testcase with a DMA
tests/drivers/uart/uart_async_api. DMA2 (of type V1)
is configured on channel 5 (request) streams 7 & 2.
USART Tx and Rx PG14 - PG9 pins (14 & 16 of CN10)
are connected to PASS the test.

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2021-08-26 06:56:49 -04:00
Johann Fischer 97ffcc8a7a tests: uart_basic_api: add support for CDC ACM UART
Add support for CDC ACM UART.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2021-08-23 18:53:47 -04:00
Johann Fischer dd465c48cb tests: uart_basic_api: allow USB workqueue/thread to work
Allow UART driver that offload interrupt processing
to workuqueue, like CDC ACM UART to work.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2021-08-23 18:53:47 -04:00
Johann Fischer d6ca3fd4da tests: uart: remove CONFIG_UART_CONSOLE_ON_DEV_NAME usage
Use DT_CHOSEN(zephyr_console) instead of
CONFIG_UART_CONSOLE_ON_DEV_NAME Kconfig option.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2021-08-23 18:53:47 -04:00
Francois Ramu 6b6aa2714f soc: arm: stm32h7 do not use data cache with DMA
This remove the data cache when the dma is nabled
This is done with the NOCACHE_MEMORY flag

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2021-08-20 06:28:32 -04:00
Francois Ramu 92a6568d63 tests: drivers: uart stm32 run uart_async_api on stm32h723
This sets the dts of DMA for using pn the uart 2 i.
The stm32h723 has a DMAMUX and request are 44 and 43 for usart2
The Tx&Rx pins PD5 and PD6 of the usart2 are connected
on the nucleo_h723zg board to pass the test

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2021-08-20 06:28:32 -04: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
Francois Ramu 3aa14676db tests: drivers: uart async test on the stm32l152re nucleo
Add configuration for testing the usart3 through the dma1
on the nucleo_l152re target.This test requires the Tx pin
to be connected to the RX pin on the board.
Pin definition is added for this usart instance.

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2021-08-16 19:35:36 +02:00
Gerard Marull-Paretas d41dadc569 pm: rename PM_DEVICE_STATE_SUSPEND to PM_DEVICE_STATE_SUSPENDED
The verb tense for the suspended state was not consistent with other
states. The likely reason: state was being used as a command/action.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2021-08-04 08:23:01 -04:00
Gerard Marull-Paretas 56a35e5682 pm: converge to suspend state for low power modes
The difference between low power and suspend states is a thin blur line
that is is not clear and most drivers have used indistinctly. This patch
converges to the usage of the suspend state for low power, since
contrary to the low power state, it is used by both system and runtime
device PM. The low power state is still kept, but its future is unclear
and needs some discussion.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2021-08-04 08:23:01 -04:00
Francois Ramu 9f840b8c75 tests: uart: uart async test running on the stm32l5xx boards
add support of the dma  (V2bis) for the stm32l5 for uart transfers.
on all available target boards

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2021-07-22 04:52:53 -04:00
Francois Ramu bd9182887a tests: drivers: uart asynch test with overlay for each stm32 board
Based on the new bindings for the stm32 dma feature,
the overlay for enabling the dma on uart client is modified.

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2021-07-22 04:52:53 -04:00
Gerard Marull-Paretas 26ad8376bd pm: remove callback from control function
The callback is not used anymore, so just delete it from the pm_control
callback signature.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2021-07-13 09:36:45 -04:00
Krishna Mohan Dani 728ff9d267 tests/drivers: nucleo_l552ze_q: uart_async_api test
This commit configures usart3 to use dma in uart_async_api test
on nucleo_l552ze_q platform.

Signed-off-by: Krishna Mohan Dani <krishnamohan.d@hcl.com>
2021-07-10 12:43:19 -04:00
Krishna Mohan Dani ae085082d1 tests/drivers: stm32l562e_dk: uart_async_api test
This commit configures usart3 to use dma in uart_async_api test
on stm32l562e_dk platform. Short pin2(PC10) & pin 3 (PC11) of usart3
in CN4 connector on stm32l562e_dk platform.

Signed-off-by: Krishna Mohan Dani <krishnamohan.d@hcl.com>
2021-07-10 12:43:19 -04:00
Gerard Marull-Paretas cc2f0e9c08 pm: use enum for device PM states
Move all PM_DEVICE_STATE_* definitions to an enum. The
PM_DEVICE_STATE_SET and PM_DEVICE_STATE_GET definitions have been kept
out of the enum since they do not represent any state. However, their
name has not been changed since they will be removed soon.

All drivers and tests have been adjusted accordingly.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2021-07-07 14:13:12 -04:00
Hake Huang 622a8e8256 usrt: basic_test: NOSYS return update for cases
NOSYS represent not support, so update case check

Signed-off-by: Hake Huang <hake.huang@oss.nxp.com>
2021-06-11 17:39:42 +02:00
Krzysztof Chruscinski eb949d01d3 tests: drivers: uart: Add test for uart power management
Added test which validates that uart device correctly handles
going to and from low power state.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2021-05-21 04:53:19 -05:00
Thomas Stranger edca247dbd tests: uart_async_api: add nucleo_g474re board
Adds nucleo_g474re board to the uart_async_api test.

Signed-off-by: Thomas Stranger <thomas.stranger@outlook.com>
2021-05-06 09:28:33 -05:00
Thomas Stranger 4cce172f27 tests: uart_async_api: add nucleo_g071rb board
Adds nucleo_g071rb board to the uart_async_api test.
Therefore additionally add usart1 in board definitions.

Signed-off-by: Thomas Stranger <thomas.stranger@outlook.com>
2021-04-26 14:16:03 -04:00
Gustavo Romero 34ca6d25bc tests: Add test to check uart_irq_is_pending
Add test to check if uart_irq_is_pending() correctly returns 0 (meaning
there are no more RX and TX pending interrupts) when all RX and TX data
is processed.

Signed-off-by: Gustavo Romero <gustavo.romero@linaro.org>
2021-03-26 08:39:33 -04:00
Kumar Gala f4c5bdf008 tests: uart_async_api: exclude atmel sam0 boards
The SAM0 uart driver requires dma configured for async support and
the uart async support assumes all UARTs support async.  None of the
atmel SAM0 boards are configured this way and thus the tests will
not currently build for these boards.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2021-03-16 17:01:15 -05:00
Krzysztof Chruscinski e82f79ffbe tests: drivers: uart: uart_mix_fifo_poll: Add low power configuration
Added low power configuration to testcase.yaml. In this mode
UARTE is disabled when RX and TX is not used.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2021-03-08 12:51:50 +01:00
Krzysztof Chruscinski 614e14c629 tests: drivers: uart: uart_mix_fifo_poll: Randomize test
Add random back-off periods between calls to uart.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2021-03-08 12:51:50 +01:00
Francois Ramu ef148f5385 tests: drivers: uart stm32 run uart_async api on l475 disco
This sets the dts of dma for using the uart asynch api.
The stm32l475 has a dmamux with request 2 for Tx/Rx usart4
The Tx&Rx pins (PA0, PA1) of the usart4 are connected
on the disco_l475_iot1 board to pass the test.


Signed-off-by: Francois Ramu <francois.ramu@st.com>
2021-03-04 12:58:50 +01:00
Kumar Gala a27751eca5 tests: uart_basic_api: set integration_platforms to mps2_an385
Set integration_platforms on these tests to just mps2_an385.  This
should be sufficient to make sure these tests build and run.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2021-03-03 09:19:24 -06:00
Anas Nashif 0426a5a682 drivers: edac: CONFIG_LOG_MINIMAL -> CONFIG_LOG_MODE_MINIMAL
CONFIG_LOG_MINIMAL is promptless, use CONFIG_LOG_MODE_MINIMAL.

Fixes build failure in test.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2021-01-26 09:06:55 -05:00
Shlomi Vaknin d69b4012b3 tests: uart_async_api: Support nucleo_l4r5zi board
This commit adds the asynchronous UART API testing support on the
nucleo_l4r5zi board.

The usart3 module is used as the secondary loop-back UART, which is
required to run this test.

Signed-off-by: Shlomi Vaknin <shlomi.39sd@gmail.com>
2021-01-18 19:07:29 +01:00
Shlomi Vaknin 13a8d1c1c2 tests: uart_async_api: flush reception in read_abort
After finish transmitting some bytes might be in the
peripheral receive register, since the transmition
is still happening after reception disabled.
This patch ensures that the peripheral has no
bytes in its internal state.

Signed-off-by: Shlomi Vaknin <shlomi.39sd@gmail.com>
2021-01-18 19:07:29 +01:00
Krzysztof Chruscinski 96c027a02b tests: drivers: uart: Add gpio_loopback harness to test config
Added gpio_loopback to indicate that test requires pins to be
shorten. This allows to filter out tests on setup which does
not have pin setup.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2021-01-10 15:38:21 -05:00
Andrzej Głąbek 0ff24a3751 tests: uart_async_api: Catch extra RX_RDY events in test_single_read
Extend the test_single_read test case to catch RX_RDY events that are
not expected to appear.

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2020-10-21 17:55:18 +02:00
Krzysztof Chruscinski 00edf738c5 tests: drivers: uart: Add test suite for preemption resilience
Added test which is calling uart_poll_out from various contexts and
asynchronous/interrupt driven API. Test is validating that calls
can be preempted at any moment and no data is lost.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2020-10-14 14:06:25 +02:00
Peter Bigot 4a0a196f57 tests: uart_async_api: fix fault accessing cached device pointer
The cached device pointer must be placed in memory that allows user
mode invocation of the test functions to access it.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-10-13 20:01:08 +02:00
Jordan Yates c4d0c1ee90 tests: uart_async_api: build segger rtt driver
Add a build only test to validate correct compilation of the uart_rtt
driver. No harness that connects to RTT is defined, and therefore the
test can't be run by CI.

Signed-off-by: Jordan Yates <jordan.yates@data61.csiro.au>
2020-09-03 21:51:28 +02:00
Tomasz Bursztyka 26cbd6a58c tests: uart_asyn: Simplify how the UART device is provided
Just get it once as device_get_binding() is a bit greedy.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2020-09-02 13:48:13 +02: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
Tomasz Bursztyka 7d1af02410 uart: Fix uart_irq_callback_set usage
It was already using uart_irq_callback_user_data_set below, now it also
uses uart_irq_callback_user_data_t as callback type, so let's normalize
the callbacks.

Fixes #26923

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2020-07-30 09:43:12 +02:00
Tomasz Bursztyka 4c78d0e35b tests: uart: Fix uart_callback_set usage
The device pointer is now provided to the callback, there is no need to
call uart_callback_set() with the device being set a user data.

Fixes #26923

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2020-07-30 09:43:12 +02:00
Krzysztof Chruscinski 34baec32ce tests: drivers: uart: Update uart_async read_abort test
Updated test to reflect API change.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2020-06-16 19:11:57 +02: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
Kumar Gala cbd9c86b5c tests: uart_basic_api: Don't FAIL non-implemented APIs
A number of uart drivers may not implement the uart_configure and
uart_config_get APIs, if we get -ENOTSUP treat that as a skip.

Fixes #24355

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-05-06 12:21:25 -05:00
Stephanos Ioannidis 974b44e9e5 tests: uart_async_api: Support atsame54_xpro board
This commit adds the asynchronous UART API testing support on the SAM
E54 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; 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>
2020-05-05 13:53:49 -05:00
Kumar Gala 42a2d99a1a tests: uart_async_api: Convert to use new dts macros
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>
2020-05-04 09:08:59 -05:00
Peter Bigot 52885d0576 coccinelle: run ms_timeout conversion semantic patch
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>
2020-04-30 18:26:26 +02:00
Stephanos Ioannidis 547a5e9eb0 tests: uart_async_api: Support atsamr21_xpro board
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>
2020-04-23 16:19:35 -05:00
Stephanos Ioannidis efa0e4b17b tests: uart_async_api: Support atsamd21_xpro board
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>
2020-04-23 08:50:18 -05:00
Andrzej Głąbek 97b07b943a drivers/serial/Kconfig.nrfx: Choose driver type basing on DT compatible
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>
2020-04-03 14:47:32 +02:00
Ioannis Glaropoulos e0b8158ca1 boards: arm: nrf9160_pca10090: rename board to nrf9160dk_nrf9160
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>
2020-03-31 15:16:08 +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