Commit Graph

218 Commits

Author SHA1 Message Date
Krzysztof Chruściński
1ec05c4431 tests: drivers: Add dependency to UART runtime configuration
Force enabling of the UART runtime configuration in UART tests.

Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
2023-11-15 10:02:18 +01:00
Emil Gydesen
15cbe0f890 tests: Remove use of CONFIG_ZTEST_NEW_API
The test was enabling CONFIG_ZTEST_NEW_API which
was recently removed.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2023-11-14 11:14:10 +01:00
Krzysztof Chruściński
8ba4249ef7 tests: drivers: uart: Add test for uart_async_rx
Add test for helper module for handling asynchronous RX.

Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
2023-11-14 09:21:46 +01:00
Andriy Gelman
6db785404a tests: drivers: uart_async_api: Be more robust to early buf release
Commit eb44414af9 modified
test_single_read for early rx buf release.

The commit assumed that tdata.last_rx_buf points to either &tdata.rx_buf[0]
if the driver releases the first buffer or at &rx_buf[5] if the first
buffer is not released. However, where tdata.last_rx_buf points to depends
on the timeout given to uart_rx_enable(), making the test flaky.

This commit modifies the test by keeping track how many bytes have been
received in the first and second buffers.
The function tdata_check_recv_buffer() validates that the sent data
matches the received bytes which may have been split between first and
second buffer.

This fixes the uart_async_api test on the xmc45_relax_kit.

Signed-off-by: Andriy Gelman <andriy.gelman@gmail.com>
2023-11-13 09:41:49 +01:00
Benjamin Deuter
329ef222dd tests: drivers: serial: async: Add support for stm32h735g_disco
On the STM32H735G-DK Discovery kit, when connecting a UART from
pin PF7 to PF6, the test uart_async_api passes now.

Signed-off-by: Benjamin Deuter <benjamin.deuter@gmail.com>
2023-11-10 10:41:23 +01:00
Bjarki Arge Andreasen
b290ba806d tests: serial: uart: emul: Update isr rx/tx tests
The tests for ISR rx/tx must now be updated to send and
receive bytes in smaller chunks.

Signed-off-by: Bjarki Arge Andreasen <bjarkix123@gmail.com>
2023-11-03 11:44:12 +01:00
Bjarki Arge Andreasen
d89cef7e19 tests: drivers: serial: emul: Synchronize UART ISR tx/rx
Add synchronization using semaphores for the UART ISR tx/rx
tests, instead of relying on a single k_yield() call to
ensure all UART ISR work can be completed before validating
the result.

Signed-off-by: Bjarki Arge Andreasen <bjarkix123@gmail.com>
2023-11-03 11:44:12 +01:00
Bjarki Arge Andreasen
54378c18e0 tests: drivers: serial: emul: Store buffers in fixture
Most tests define a buffer for UART data on the stack,
including the tests testing UART IRQ. Move buffers to
static memory, within the test fixture, which can then
be passed as the user_data to the UART IRQ callback.

Signed-off-by: Bjarki Arge Andreasen <bjarkix123@gmail.com>
2023-11-03 11:44:12 +01:00
Nick Kraus
0f50df41f1 drivers: uart_emul: Add Emulated Errors
Allows test code to set UART errors, for driver code wanting
to test proper error handling.

Signed-off-by: Nick Kraus <nick@nckraus.com>
2023-10-20 15:10:27 +02:00
Nick Kraus
aeb85db627 drivers: uart_emul: Add IRQ Based TX
Added an interrupt based transmit routine and interrupt based
uart_emul tests.

Signed-off-by: Nick Kraus <nick@nckraus.com>
2023-10-20 15:10:27 +02:00
Erwan Gouriou
7b50c38ec9 tests: drivers: serial: async: Add configuration for STM32WBA tests
Add STM32WBA test configuration to enable async API serial tests.

Signed-off-by: Erwan Gouriou <erwan.gouriou@st.com>
2023-10-20 15:05:59 +02:00
Anas Nashif
345735d0a8 tests: remove CONFIG_ZTEST_NEW_API in all tests
Remove all usage of CONFIG_ZTEST_NEW_API from tests and sample as this
is now enabled by default.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2023-10-20 15:04:29 +02:00
Anas Nashif
4373f250bf tests: uart: fix test meta data and components
Fix meta data and standarize components in test identifiers.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2023-10-11 14:19:40 +03:00
Flavio Ceolin
e7bd10ae71 random: Rename random header
rand32.h does not make much sense, since the random subsystem
provides more APIs than just getting a random 32 bits value.

Rename it to random.h and get consistently with other
subsystems.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2023-10-10 14:23:50 +03:00
Dat Nguyen Duy
d4cab4474b tests: drivers: uart_async_api: enable test for mr_canhubk3
Run this test on lpuart10 with internal loopback enabled.
Use DTCM region for this test because in some local
variables are used for dma buffer which requires
non-cacheable

Signed-off-by: Dat Nguyen Duy <dat.nguyenduy@nxp.com>
2023-09-29 09:47:57 +02:00
Anas Nashif
59a15818e3 tests: uart_emul: remove hardware dependency
Remove depends_on in test, this is not needed and not part of any board.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2023-09-25 18:42:05 -04:00
YuLong Yao
1a2a8fd49b tests: drivers: uart: add esp32s3_luatos_core
add overlay and conf for esp32s3_luatos_core board

Signed-off-by: YuLong Yao <feilongphone@gmail.com>
2023-09-22 15:58:11 +02:00
Marc Desvaux
59153afe09 tests: drivers: uart: uart_basic_api: basic_api.wide issue
The test drivers.uart.basic_api.wide
can't work without keyboard
add harness: keyboard for this test


Signed-off-by: Marc Desvaux <marc.desvaux-ext@st.com>
2023-09-20 20:24:10 +01:00
YuLong Yao
641a70f3b8 tests: drivers: uart: add esp32c3_luatos_core
add overlay and conf for esp32c3_luatos_core board

Signed-off-by: YuLong Yao <feilongphone@gmail.com>
2023-09-15 14:17:50 +02:00
Jeroen van Dooren
772e6fd423 tests: drivers: uart: Adding wide data async tests
Extending async tests with wide data support.

Signed-off-by: Jeroen van Dooren <jeroen.van.dooren@nobleo.nl>
2023-08-30 10:17:17 +02:00
Jeroen van Dooren
930edd8ed4 tests: drivers: uart: Resetting uart state
Resetting uart state before every testcase.

Signed-off-by: Jeroen van Dooren <jeroen.van.dooren@nobleo.nl>
2023-08-30 10:17:17 +02:00
Jeroen van Dooren
c3a1730c99 tests: drivers: uart: Adding wide data cfg tests
Extending configuration tests with wide data support.

Signed-off-by: Jeroen van Dooren <jeroen.van.dooren@nobleo.nl>
2023-08-30 10:17:17 +02:00
Jeroen van Dooren
41339562c6 tests: drivers: uart: moving struct declaration
Moving struct in preparation of wide test.

Signed-off-by: Jeroen van Dooren <jeroen.van.dooren@nobleo.nl>
2023-08-30 10:17:17 +02:00
Marc Desvaux
2580728033 tests: drivers: uart: uart_async_api change pin nucleo_l152re
change pins for the test uart_async_api loopback because the old pins
pb10/pb11 are now used for the I2C loopback test.

Signed-off-by: Marc Desvaux <marc.desvaux-ext@st.com>
2023-08-22 18:11:32 +02:00
Gerson Fernando Budke
cdd949325b uart_sam0: extend async serial tests to more atsamxxx_xpro boards.
This includes new overlays for boards supporting DMA, and one more test
to verify M0 boards both with and without DMA can be built when
requesting CONFIG_UART_ASYNC_API.

Signed-off-by: Diego Elio Pettenò <flameeyes@meta.com>
Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
2023-08-21 17:15:29 +02:00
Diego Elio Pettenò
4cada3ecaf uart_sam0: don't consume CONFIG_UART_ASYNC_API directly.
There are situations in which the async API for uart can be provided
by another driver (case in point, uart_rtt), and thus there is no valid
DMA controller for the uart_sam0 driver to talk with.

By separating the configuration, there's no need to exclude samd20-based
boards (that have no DMA peripheral) from the uart_async_api tests.

Signed-off-by: Diego Elio Pettenò <flameeyes@meta.com>
Co-authored-by: Gerson Fernando Budke <nandojve@gmail.com>
2023-08-21 17:15:29 +02:00
Andriy Gelman
524fe7698b boards: arm: xmc47_relax_kit: Configure usic1ch1 as i2c node
It is the arduino_i2c node on the board.
Also remove comment from arduino_r3_connector as the arduino_i2c
node can be used.

Signed-off-by: Andriy Gelman <andriy.gelman@gmail.com>
2023-08-16 20:43:50 +02:00
Daniel Leung
121b4d2d62 tests: drivers: rename shadow variables
Renames shadow variables found by -Wshadow.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2023-08-10 08:14:12 +00:00
Diego Elio Pettenò
762a1f8b42 ev11l78a: initial import of the UPD301C Basic Sink board.
This board is a relatively inexpensive development kit for USB-PD
controllers, using an UPD301C controller.

This Zephyr config includes support for:

 * UART (present on he debug header of the board), tested with the
   hello_world sample application;
 * the one standalone LED (CAP_MIS), tested with the blinky sample
   application;
 * the rotary encoder (PDO_SEL), via ADC, tested with the adc sample
   application;
 * the current sense amplifier (I_SENSE), currently untested;
 * the SPI bus, connected internally in the UPD301C to the UPD350;
 * the I2C bus, exposed on the debug header, currently untested.

Note that the drivers.uart.async_api.rtt has to be disabled, as it is
for other m0 boards with no dma or it fails to build.

Signed-off-by: Diego Elio Pettenò <flameeyes@meta.com>
2023-08-08 19:02:15 +00:00
Marek Matej
6b57b3b786 soc: xtensa,riscv: esp32xx: refactor folder structure
Refactor the ESP32 target SOCs together with
all related boards. Most braking changes includes:

- changing the CONFIG_SOC_ESP32* to refer to
  the actual soc line (esp32,esp32s2,esp32s3,esp32c3)
- replacing CONFIG_SOC with the CONFIG_SOC_SERIES
- creating CONFIG_SOC_FAMILY_ESP32 to embrace all
  the ESP32 across all used architectures
- introducing CONFIG_SOC_PART_NUMBER_* to
  provide a SOC model config
- introducing the 'common' folder to hide all
  commonly used configs and files.
- updating west.yml to reflect previous changes in hal

Signed-off-by: Marek Matej <marek.matej@espressif.com>
2023-07-25 18:12:33 +02:00
Lucas Tamborrino
ea949d0399 tests: drivers: uart: async: esp32c3: use internal loopback
Use internal loopback for esp32c3 board, avoiding the use of
external wiring.

Signed-off-by: Lucas Tamborrino <lucas.tamborrino@espressif.com>
2023-06-22 08:13:36 +00:00
Lucas Tamborrino
8cbf1be28e tests: drivers: uart: uart async: Add esp32s3 overlay
Add esp32s3 support for uart async tests.

Signed-off-by: Lucas Tamborrino <lucas.tamborrino@espressif.com>
2023-06-17 08:00:31 -04:00
Krzysztof Chruscinski
eb44414af9 tests: drivers: uart: async_api: Align test to early RX buffer release
Modify the test to not rely on assumption that RX buffer is released
when it is fully released. RX buffer maybe released after any RX_RDY
event within the buffer, e.g. after each timeout driver may be
switching to the new buffer.

Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
2023-06-01 06:34:53 -04:00
Anas Nashif
04827ba71f tests/samples: use integration_platforms more where it makes sense
Use integration platforms to limit churn and build time in PR CI .

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2023-05-26 17:52:02 -04:00
Declan Snyder
dc40131a0e tests: uart_async_api: Support RTXXX
Support mimxrt595_evk_cm33 and mimxrt685_evk_cm33
on the uart_async_api test with a board overlay

Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
2023-05-26 13:15:24 -05:00
Francois Ramu
4d4900c311 tests: drivers: uart async testing on the stm32f103 nucleo
Configure the overlay to have DMA transfer with high priority
when running the tests/drivers/uart/uart_async_api on nucleo_f103rb.

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2023-05-16 13:26:28 +00: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
Andriy Gelman
5fd71e35a1 tests: drivers: uart_async_api: Add xmc47_relax_kit overlay/conf
Adds overlay and conf files to run the test with the xmc47_relax_kit.

Signed-off-by: Andriy Gelman <andriy.gelman@gmail.com>
2023-05-02 12:34:55 +02:00
Andriy Gelman
f8f09300c1 boards: arm: Add xmc47_relax_kit
Adds Infineon xmc47_relax_kit board.

Signed-off-by: Andriy Gelman <andriy.gelman@gmail.com>
2023-05-02 12:34:55 +02:00
Andriy Gelman
7a9490b316 tests: uart: uart_async_api: Re-enable tests on xmc45_relax_kit
drivers.uart.async_api.rtt test started failing on xmc45_relax_kit
after f423ec255f which set
CONFIG_SERIAL_SUPPORT_ASYNC=y if uart rtt is enabled. This conflicts
with the xmc4xxx uart driver which sets the same symbol conditionally
if the dma is enabled in the device tree. The conflict created some
warning during compilation causing the CI to fail.

All the uart_async tests were disabled in
71d0394752. This commit re-enables the
test on xmc45_relax_kit and only excludes the rtt test that's failing.

Signed-off-by: Andriy Gelman <andriy.gelman@gmail.com>
2023-04-12 08:59:20 +02:00
Kamil Serwus
71d0394752 sam: atsamc2x: dmac enable, fix uart-async
Enable dmac driver for C2x in dtsi file.
Fix tests for atsamc21n_xpro board by adding
overlay.

Signed-off-by: Kamil Serwus <kserwus@gmail.com>
2023-04-07 18:58:24 +02:00
Fabian Blatz
1a132fabc0 tests: drivers: uart: add uart_emul test
Add test of the uart emulator polling API.

Signed-off-by: Fabian Blatz <fabianblatz@gmail.com>
2023-03-27 09:50:44 +02:00
Andrzej Głąbek
8cba27aab3 tests: drivers: uart_pm: Fix testing of no-RX case
Instead of checking the `rx-pin` property that got deprecated and
removed, the test needs to check the `disable-rx` property.

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2023-03-23 09:40:11 +01:00
Andrzej Głąbek
2cbe097b29 tests: drivers: uart: Use "dut" node label to select UART to be tested
... to limit #if chains in these tests and make it easier to add new
boards.

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2023-03-23 09:40:11 +01:00
Andrzej Głąbek
28d0789c37 tests: uart_mix_fifo_poll: Use "counter_dev" node label
This test needs a counter device. Introduce a node label that allows
selecting one in dts overlays instead of using hard-coded `timer0`.

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2023-03-22 21:21:06 +01:00
Krzysztof Chruscinski
656b0e6426 drivers: counter: Adapt to use device tree
Modifying counter drivers (rtc and timer) to rely completely on
device tree and not on Kconfig of MDK flags.

Adapting dtsi for all SoCs and adapting test configuration.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2023-03-20 16:59:40 +01:00
Katarzyna Giądła
0a16558289 tests: drivers: uart: uart_pm: Unify set of pins on nrf52840dk_nrf52840
Unify set of the pins on `nrf52840dk_nrf52840`, which is used by
`gpio_loopback` fixture.

Signed-off-by: Katarzyna Giądła <katarzyna.giadla@nordicsemi.no>
2023-03-14 10:50:27 +01:00
Joel Guittet
63e9e37fc3 boards: Add support for Wio Terminal
Add support for the Wio Terminal board, including support of its
sensors, MicroSD and LCD. Tested with samples already available.

Signed-off-by: Joel Guittet <joelguittet@gmail.com>
2023-03-09 15:18:25 -06:00
Andriy Gelman
eb5fd177d1 tests: drivers: uart_async_api_api: Add overlay for xmc45_relax_kit
Adds overlay and config for xmc45_relax_kit.
The Kconfig entry CONFIG_SPEED_OPTIMIZATIONS=y must be set
to pass the test at baudrate 921600 bps.

Signed-off-by: Andriy Gelman <andriy.gelman@gmail.com>
2023-02-21 21:15:53 +01:00
Francois Ramu
6ff19d77ce tests: drivers: use stm32 dma driver binding macro to configure channel
Use the macro as defined by the
include/zephyr/dt-bindings/dma/stm32_dma.h to configure the
dma channel.
Use the STM32_DMA_PERIPH_TX or STM32_DMA_PERIPH_RX value.

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2023-01-23 09:15:21 -06:00