Skip to content

Commit b903dff

Browse files
ajarmouni-stnashif
authored andcommitted
tests: drivers: uart_async: stm32: add test cases with DCache enabled
Add test cases/configs for async DMA uart with DCache on STM32F7/H7 boards Signed-off-by: Abderrahmane Jarmouni <abderrahmane.jarmouni-ext@st.com>
1 parent fdb3457 commit b903dff

File tree

5 files changed

+79
-3
lines changed

5 files changed

+79
-3
lines changed
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
/*
2+
* Copyright (c) 2024 STMicroelectronics
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
#include <zephyr/dt-bindings/memory-attr/memory-attr-arm.h>
8+
9+
/ {
10+
/* The async_api.nocache_mem_dt test case expects a non-cachable RAM region */
11+
sram_nocache: memory@2004c000 {
12+
compatible = "zephyr,memory-region", "mmio-sram";
13+
reg = <0x2004c000 DT_SIZE_K(16)>;
14+
zephyr,memory-region = "RAM_NOCACHE";
15+
zephyr,memory-attr = <DT_MEM_ARM_MPU_RAM_NOCACHE>;
16+
};
17+
};

tests/drivers/uart/uart_async_api/boards/nucleo_h723zg.overlay

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,18 @@
11
/*
2+
* Copyright (c) 2024 STMicroelectronics
3+
*
24
* SPDX-License-Identifier: Apache-2.0
35
*/
46

5-
dut: &usart2 {
6-
dmas = <&dmamux1 2 44 STM32_DMA_PERIPH_TX>,
7-
<&dmamux1 3 43 STM32_DMA_PERIPH_RX>;
7+
/* Arduino Header pins: Tx:D9, Rx:D10 */
8+
dut: &uart9 {
9+
pinctrl-0 = <&uart9_tx_pd15 &uart9_rx_pd14>;
10+
pinctrl-names = "default";
11+
current-speed = <115200>;
12+
dmas = <&dmamux1 2 117 STM32_DMA_PERIPH_TX>,
13+
<&dmamux1 3 116 STM32_DMA_PERIPH_RX>;
814
dma-names = "tx", "rx";
15+
status = "okay";
916
};
1017

1118
&dma1 {
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
/*
2+
* Copyright (c) 2024 STMicroelectronics
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
#include <zephyr/dt-bindings/memory-attr/memory-attr-arm.h>
8+
9+
&sram1 {
10+
zephyr,memory-attr = <DT_MEM_ARM_MPU_RAM_NOCACHE>;
11+
zephyr,memory-region = "RAM_NOCACHE";
12+
};
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
CONFIG_DCACHE=y
2+
CONFIG_DT_DEFINED_NOCACHE=y
3+
CONFIG_DT_DEFINED_NOCACHE_NAME="RAM_NOCACHE"
4+
CONFIG_USERSPACE=n

tests/drivers/uart/uart_async_api/testcase.yaml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,3 +74,39 @@ tests:
7474
- CONFIG_UART_SAM0_ASYNC=y
7575
- CONFIG_DMA=y
7676
build_only: true
77+
drivers.uart.async_api.nocache_mem:
78+
# nocache memory region is defined by the linker
79+
filter: CONFIG_SERIAL_SUPPORT_ASYNC and CONFIG_CPU_HAS_DCACHE
80+
harness: ztest
81+
harness_config:
82+
fixture: gpio_loopback
83+
depends_on: gpio
84+
platform_allow:
85+
- nucleo_f746zg
86+
- nucleo_h723zg
87+
extra_configs:
88+
- CONFIG_DCACHE=y
89+
- CONFIG_NOCACHE_MEMORY=y
90+
- CONFIG_USERSPACE=n
91+
drivers.uart.async_api.nocache_mem_dt.nucleo_f746zg:
92+
# nocache memory region is defined in DT
93+
harness: ztest
94+
harness_config:
95+
fixture: gpio_loopback
96+
depends_on: gpio
97+
platform_allow:
98+
- nucleo_f746zg
99+
extra_args:
100+
- DTC_OVERLAY_FILE="boards/nucleo_f746zg.overlay;boards/nucleo_f746zg_nocachemem.overlay"
101+
- EXTRA_CONF_FILE=stm32_nocache_mem_dt.conf
102+
drivers.uart.async_api.nocache_mem_dt.nucleo_h723zg:
103+
# nocache memory region is defined in DT
104+
harness: ztest
105+
harness_config:
106+
fixture: gpio_loopback
107+
depends_on: gpio
108+
platform_allow:
109+
- nucleo_h723zg
110+
extra_args:
111+
- DTC_OVERLAY_FILE="boards/nucleo_h723zg.overlay;boards/nucleo_h723zg_nocachemem.overlay"
112+
- EXTRA_CONF_FILE=stm32_nocache_mem_dt.conf

0 commit comments

Comments
 (0)