Skip to content

Commit 26ce4e2

Browse files
MarkusLassilanordicjm
authored andcommitted
samples: cellular: slm_shell: Enable hw-flow-control for UART
Enable hw-flow-control by default for the UART between SLM shell and SLM. Signed-off-by: Markus Lassila <[email protected]>
1 parent bccf184 commit 26ce4e2

File tree

5 files changed

+62
-14
lines changed

5 files changed

+62
-14
lines changed

samples/cellular/slm_shell/README.rst

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,15 @@ See more information on the functionality of this sample from the :ref:`lib_mode
1414
Requirements
1515
************
1616

17-
The SLM application should be configured to use UART_2 on the nRF91 Series DK side with no hardware flow control.
17+
The SLM application should be configured to use UART2 on the nRF91 Series DK side with hardware flow control.
1818

1919
The sample supports the following development kits:
2020

2121
.. table-from-sample-yaml::
2222

2323
Connect the DK with an nRF91 Series DK based on the pin configuration in DTS overlay files of both sides.
2424

25-
The following table shows how to connect UART_1 of the DK to the nRF91 Series DK's UART_2 for communication through UART:
25+
The following table shows how to connect UART1 of the DK to the nRF91 Series DK's UART2 for communication through UART:
2626

2727
.. tabs::
2828

@@ -37,6 +37,10 @@ The following table shows how to connect UART_1 of the DK to the nRF91 Series DK
3737
- UART RX P0.11
3838
* - UART RX P1.01
3939
- UART TX P0.10
40+
* - UART CTS P1.06
41+
- UART RTS P0.12
42+
* - UART RTS P1.07
43+
- UART CTS P0.13
4044
* - GPIO OUT P0.11 (Button1)
4145
- GPIO IN P0.31
4246
* - GPIO IN P0.13 (LED1 optional)
@@ -62,6 +66,10 @@ The following table shows how to connect UART_1 of the DK to the nRF91 Series DK
6266
- UART RX P0.11
6367
* - UART RX P1.05
6468
- UART TX P0.10
69+
* - UART CTS P1.06
70+
- UART RTS P0.12
71+
* - UART RTS P1.07
72+
- UART CTS P0.13
6573
* - GPIO OUT P0.23 (Button1)
6674
- GPIO IN P0.31
6775
* - GPIO IN P0.28 (LED1 optional)
@@ -87,6 +95,10 @@ The following table shows how to connect UART_1 of the DK to the nRF91 Series DK
8795
- UART RX P0.11
8896
* - UART RX P1.05
8997
- UART TX P0.10
98+
* - UART CTS P1.06
99+
- UART RTS P0.12
100+
* - UART RTS P1.07
101+
- UART CTS P0.13
90102
* - GPIO OUT P0.31
91103
- GPIO IN P0.31
92104
* - GPIO IN P0.30 (optional)

samples/cellular/slm_shell/boards/nrf52840dk_nrf52840.overlay

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,18 @@
1111
};
1212
};
1313

14+
/* Shell UART */
15+
&uart0 {
16+
current-speed = <115200>;
17+
status = "okay";
18+
};
19+
20+
/* SLM Shell <-> SLM UART */
1421
&uart1 {
1522
compatible = "nordic,nrf-uarte";
1623
current-speed = <115200>;
1724
status = "okay";
25+
hw-flow-control;
1826

1927
pinctrl-0 = <&uart1_default>;
2028
pinctrl-1 = <&uart1_sleep>;
@@ -24,18 +32,22 @@
2432
&pinctrl {
2533
uart1_default: uart1_default {
2634
group1 {
27-
psels = <NRF_PSEL(UART_RX, 1, 1)>;
28-
bias-pull-up;
35+
psels = <NRF_PSEL(UART_TX, 1, 2)>,
36+
<NRF_PSEL(UART_RTS, 1, 6)>;
2937
};
3038
group2 {
31-
psels = <NRF_PSEL(UART_TX, 1, 2)>;
39+
psels = <NRF_PSEL(UART_RX, 1, 1)>,
40+
<NRF_PSEL(UART_CTS, 1, 7)>;
41+
bias-pull-up;
3242
};
3343
};
3444

3545
uart1_sleep: uart1_sleep {
3646
group1 {
3747
psels = <NRF_PSEL(UART_RX, 1, 1)>,
38-
<NRF_PSEL(UART_TX, 1, 2)>;
48+
<NRF_PSEL(UART_TX, 1, 2)>,
49+
<NRF_PSEL(UART_RTS, 1, 6)>,
50+
<NRF_PSEL(UART_CTS, 1, 7)>;
3951
low-power-enable;
4052
};
4153
};

samples/cellular/slm_shell/boards/nrf5340dk_nrf5340_cpuapp.conf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
55
#
66

7-
# Configuration file for nRF53400DK.
7+
# Configuration file for nRF5340DK.
88
# This file is merged with prj.conf in the application folder, and options
99
# set here will take precedence if they are present in both files.
1010

samples/cellular/slm_shell/boards/nrf5340dk_nrf5340_cpuapp.overlay

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,18 @@
1111
};
1212
};
1313

14+
/* Shell UART */
15+
&uart0 {
16+
current-speed = <115200>;
17+
status = "okay";
18+
};
19+
20+
/* SLM Shell <-> SLM UART */
1421
&uart2 {
1522
compatible = "nordic,nrf-uarte";
1623
current-speed = <115200>;
1724
status = "okay";
18-
25+
hw-flow-control;
1926
pinctrl-0 = <&uart2_default>;
2027
pinctrl-1 = <&uart2_sleep>;
2128
pinctrl-names = "default", "sleep";
@@ -24,18 +31,22 @@
2431
&pinctrl {
2532
uart2_default: uart2_default {
2633
group1 {
27-
psels = <NRF_PSEL(UART_TX, 1, 4)>;
34+
psels = <NRF_PSEL(UART_TX, 1, 4)>,
35+
<NRF_PSEL(UART_RTS, 1, 6)>;
2836
};
2937
group2 {
30-
psels = <NRF_PSEL(UART_RX, 1, 5)>;
38+
psels = <NRF_PSEL(UART_RX, 1, 5)>,
39+
<NRF_PSEL(UART_CTS, 1, 7)>;
3140
bias-pull-up;
3241
};
3342
};
3443

3544
uart2_sleep: uart2_sleep {
3645
group1 {
3746
psels = <NRF_PSEL(UART_TX, 1, 4)>,
38-
<NRF_PSEL(UART_RX, 1, 5)>;
47+
<NRF_PSEL(UART_RX, 1, 5)>,
48+
<NRF_PSEL(UART_RTS, 1, 6)>,
49+
<NRF_PSEL(UART_CTS, 1, 7)>;
3950
low-power-enable;
4051
};
4152
};

samples/cellular/slm_shell/boards/nrf7002dk_nrf5340_cpuapp.overlay

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,18 @@
1111
};
1212
};
1313

14+
/* Shell UART */
15+
&uart0 {
16+
current-speed = <115200>;
17+
status = "okay";
18+
};
19+
20+
/* SLM Shell <-> SLM UART */
1421
&uart2 {
1522
compatible = "nordic,nrf-uarte";
1623
current-speed = <115200>;
1724
status = "okay";
25+
hw-flow-control;
1826

1927
pinctrl-0 = <&uart2_default>;
2028
pinctrl-1 = <&uart2_sleep>;
@@ -24,18 +32,23 @@
2432
&pinctrl {
2533
uart2_default: uart2_default {
2634
group1 {
27-
psels = <NRF_PSEL(UART_TX, 1, 4)>;
35+
psels = <NRF_PSEL(UART_TX, 1, 4)>,
36+
<NRF_PSEL(UART_RTS, 1, 6)>;
37+
2838
};
2939
group2 {
30-
psels = <NRF_PSEL(UART_RX, 1, 5)>;
40+
psels = <NRF_PSEL(UART_RX, 1, 5)>,
41+
<NRF_PSEL(UART_CTS, 1, 7)>;
3142
bias-pull-up;
3243
};
3344
};
3445

3546
uart2_sleep: uart2_sleep {
3647
group1 {
3748
psels = <NRF_PSEL(UART_TX, 1, 4)>,
38-
<NRF_PSEL(UART_RX, 1, 5)>;
49+
<NRF_PSEL(UART_RX, 1, 5)>,
50+
<NRF_PSEL(UART_RTS, 1, 6)>,
51+
<NRF_PSEL(UART_CTS, 1, 7)>;
3952
low-power-enable;
4053
};
4154
};

0 commit comments

Comments
 (0)