Skip to content

Commit 7041a95

Browse files
Hi-Im-Davidnordic-piks
authored andcommitted
tests: drivers: uart: add from zephyr, support nrf7120
Support of zephyr uarts tests in ncs repo. Signed-off-by: David Jewsbury <[email protected]>
1 parent 02abb22 commit 7041a95

22 files changed

+472
-0
lines changed
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#
2+
# Copyright (c) 2025 Nordic Semiconductor ASA
3+
#
4+
# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
5+
#
6+
7+
cmake_minimum_required(VERSION 3.20.0)
8+
find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE})
9+
project(uart_high_level_api)
10+
11+
FILE(GLOB app_sources ${ZEPHYR_BASE}/tests/drivers/uart/uart_async_api/src/main.c ${ZEPHYR_BASE}/tests/drivers/uart/uart_async_api/src/test_uart_async.c)
12+
target_sources(app PRIVATE ${app_sources})
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
source "tests/drivers/uart/uart_async_api/Kconfig"
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
This sample extends the same-named Zephyr sample to verify it
2+
with Nordic development kits.
3+
4+
Source code and basic configuration files can be found in the corresponding folder structure in zephyr/tests/drivers/uart/uart_async_api.
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
/*
2+
* Copyright (c) 2025 Nordic Semiconductor ASA
3+
*
4+
* SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
5+
*/
6+
7+
&pinctrl {
8+
uart21_default_alt: uart21_default_alt {
9+
group1 {
10+
psels = <NRF_PSEL(UART_TX, 1, 10)>,
11+
<NRF_PSEL(UART_RX, 1, 11)>;
12+
};
13+
};
14+
15+
uart21_sleep_alt: uart21_sleep_alt {
16+
group1 {
17+
psels = <NRF_PSEL(UART_TX, 1, 10)>,
18+
<NRF_PSEL(UART_RX, 1, 11)>;
19+
low-power-enable;
20+
};
21+
};
22+
};
23+
24+
dut: &uart21 {
25+
status = "okay";
26+
pinctrl-0 = <&uart21_default_alt>;
27+
pinctrl-1 = <&uart21_sleep_alt>;
28+
pinctrl-names = "default", "sleep";
29+
current-speed = <115200>;
30+
};
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
#include "nrf7120pdk_nrf7120_cpuapp.overlay"
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
CONFIG_SERIAL=y
2+
CONFIG_UART_ASYNC_API=y
3+
CONFIG_UART_USE_RUNTIME_CONFIGURE=y
4+
CONFIG_ZTEST=y
5+
CONFIG_TEST_USERSPACE=y
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
common:
2+
tags:
3+
- drivers
4+
- uart
5+
- ci_tests_zephyr_drivers_uart
6+
tests:
7+
nrf.extended.drivers.uart.async_api:
8+
platform_allow:
9+
- nrf7120pdk/nrf7120/cpuapp
10+
filter: CONFIG_SERIAL_SUPPORT_ASYNC and not CONFIG_UART_MCUX_LPUART
11+
harness: ztest
12+
harness_config:
13+
fixture: gpio_loopback
14+
depends_on: gpio
15+
nrf.extended.drivers.uart.async_api.rtt:
16+
platform_allow:
17+
- nrf7120pdk/nrf7120/cpuapp
18+
filter: CONFIG_SERIAL_SUPPORT_ASYNC and CONFIG_HAS_SEGGER_RTT
19+
and not CONFIG_UART_MCUX_LPUART and not CONFIG_UART_MCUX_FLEXCOMM
20+
extra_args: |
21+
DTC_OVERLAY_FILE=${ZEPHYR_BASE}/tests/drivers/uart/uart_async_api/boards/segger_rtt.overlay
22+
extra_configs:
23+
- CONFIG_USE_SEGGER_RTT=y
24+
- CONFIG_UART_RTT=y
25+
build_only: true
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
/*
2+
* Copyright (c) 2025 Nordic Semiconductor ASA
3+
*
4+
* SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
5+
*/
6+
7+
&pinctrl {
8+
uart21_default: uart21_default {
9+
group1 {
10+
psels = <NRF_PSEL(UART_TX, 1, 10)>,
11+
<NRF_PSEL(UART_RX, 1, 11)>,
12+
<NRF_PSEL(UART_RTS, 1, 8)>,
13+
<NRF_PSEL(UART_CTS, 1, 9)>;
14+
};
15+
};
16+
17+
uart21_sleep: uart21_sleep {
18+
group1 {
19+
psels = <NRF_PSEL(UART_TX, 1, 10)>,
20+
<NRF_PSEL(UART_RX, 1, 11)>,
21+
<NRF_PSEL(UART_RTS, 1, 8)>,
22+
<NRF_PSEL(UART_CTS, 1, 9)>;
23+
low-power-enable;
24+
};
25+
};
26+
};
27+
28+
dut: &uart21 {
29+
status = "okay";
30+
current-speed = <115200>;
31+
pinctrl-0 = <&uart21_default>;
32+
pinctrl-1 = <&uart21_sleep>;
33+
pinctrl-names = "default", "sleep";
34+
hw-flow-control;
35+
};
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
/*
2+
* Copyright (c) 2025 Nordic Semiconductor ASA
3+
*
4+
* SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
5+
*/
6+
7+
&pinctrl {
8+
uart21_default: uart21_default {
9+
group1 {
10+
psels = <NRF_PSEL(UART_TX, 1, 10)>,
11+
<NRF_PSEL(UART_RX, 1, 8)>;
12+
bias-pull-up;
13+
};
14+
};
15+
16+
uart21_sleep: uart21_sleep {
17+
group1 {
18+
psels = <NRF_PSEL(UART_TX, 1, 10)>,
19+
<NRF_PSEL(UART_RX, 1, 8)>;
20+
low-power-enable;
21+
};
22+
};
23+
24+
uart22_default: uart22_default {
25+
group1 {
26+
psels = <NRF_PSEL(UART_TX, 1, 9)>,
27+
<NRF_PSEL(UART_RX, 1, 11)>;
28+
bias-pull-up;
29+
};
30+
};
31+
32+
uart22_sleep: uart22_sleep {
33+
group1 {
34+
psels = <NRF_PSEL(UART_TX, 1, 9)>,
35+
<NRF_PSEL(UART_RX, 1, 11)>;
36+
low-power-enable;
37+
};
38+
};
39+
};
40+
41+
dut: &uart21 {
42+
status = "okay";
43+
current-speed = <115200>;
44+
pinctrl-0 = <&uart21_default>;
45+
pinctrl-1 = <&uart21_sleep>;
46+
pinctrl-names = "default", "sleep";
47+
};
48+
49+
dut_aux: &uart22 {
50+
status = "okay";
51+
current-speed = <115200>;
52+
pinctrl-0 = <&uart22_default>;
53+
pinctrl-1 = <&uart22_sleep>;
54+
pinctrl-names = "default", "sleep";
55+
};
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
/*
2+
* Copyright (c) 2025 Nordic Semiconductor ASA
3+
*
4+
* SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
5+
*/
6+
7+
&pinctrl {
8+
uart21_default: uart21_default {
9+
group1 {
10+
psels = <NRF_PSEL(UART_TX, 1, 10)>,
11+
<NRF_PSEL(UART_RX, 1, 11)>,
12+
<NRF_PSEL(UART_RTS, 1, 8)>,
13+
<NRF_PSEL(UART_CTS, 1, 9)>;
14+
};
15+
};
16+
17+
uart21_sleep: uart21_sleep {
18+
group1 {
19+
psels = <NRF_PSEL(UART_TX, 1, 10)>,
20+
<NRF_PSEL(UART_RX, 1, 11)>,
21+
<NRF_PSEL(UART_RTS, 1, 8)>,
22+
<NRF_PSEL(UART_CTS, 1, 9)>;
23+
low-power-enable;
24+
};
25+
};
26+
};
27+
28+
dut: &uart21 {
29+
status = "okay";
30+
current-speed = <115200>;
31+
pinctrl-0 = <&uart21_default>;
32+
pinctrl-1 = <&uart21_sleep>;
33+
pinctrl-names = "default", "sleep";
34+
hw-flow-control;
35+
};

0 commit comments

Comments
 (0)