Skip to content

Commit 9ebb9ab

Browse files
gmarullcarlescufi
authored andcommitted
boards: nrf52833dk|nrf21540dk: fix UART1 pinctrl instructions
nRF52840DK documentation was updated with details on how to change UART1 pins. nRF52833DK and nRF21540 boards has the same incorrect instructions and were not fixed. Do it now. Signed-off-by: Gerard Marull-Paretas <[email protected]>
1 parent 687330a commit 9ebb9ab

File tree

2 files changed

+22
-26
lines changed

2 files changed

+22
-26
lines changed

boards/arm/nrf21540dk_nrf52840/doc/index.rst

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -175,25 +175,25 @@ You can build and flash the examples to make sure Zephyr is running correctly on
175175
your board. The button and LED definitions can be found in
176176
:zephyr_file:`boards/arm/nrf21540dk_nrf52840/nrf21540dk_nrf52840.dts`.
177177

178-
Using UART1
179-
***********
178+
Changing UART1 pins
179+
*******************
180180

181-
The following approach can be used when an application needs to use
182-
more than one UART for connecting peripheral devices:
181+
The following approach can be used when an application needs to use another set
182+
of pins for UART1:
183183

184184
1. Add devicetree overlay file to the main directory of your application:
185185

186186
.. code-block:: devicetree
187187
188188
&pinctrl {
189-
uart1_default: uart1_default {
189+
uart1_default_alt: uart1_default_alt {
190190
group1 {
191191
psels = <NRF_PSEL(UART_TX, 0, 14)>,
192192
<NRF_PSEL(UART_RX, 0, 16)>;
193193
};
194194
};
195195
/* required if CONFIG_PM_DEVICE=y */
196-
uart1_sleep: uart1_sleep {
196+
uart1_sleep_alt: uart1_sleep_alt {
197197
group1 {
198198
psels = <NRF_PSEL(UART_TX, 0, 14)>,
199199
<NRF_PSEL(UART_RX, 0, 16)>;
@@ -203,18 +203,16 @@ more than one UART for connecting peripheral devices:
203203
};
204204
205205
&uart1 {
206-
compatible = "nordic,nrf-uarte";
207-
current-speed = <115200>;
208-
status = "okay";
209-
pinctrl-0 = <&uart1_default>;
210-
pinctrl-1 = <&uart1_sleep>;
206+
pinctrl-0 = <&uart1_default_alt>;
207+
/* if sleep state is not used, use /delete-property/ pinctrl-1; and
208+
* skip the "sleep" entry.
209+
*/
210+
pinctrl-1 = <&uart1_sleep_alt>;
211211
pinctrl-names = "default", "sleep";
212212
};
213213
214214
In the overlay file above, pin P0.16 is used for RX and P0.14 is used for TX
215215

216-
2. Use the UART1 as ``DEVICE_DT_GET(DT_NODELABEL(uart1))``
217-
218216
See :ref:`set-devicetree-overlays` for further details.
219217

220218
Selecting the pins

boards/arm/nrf52833dk_nrf52833/doc/index.rst

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -157,25 +157,25 @@ You can build and flash the examples to make sure Zephyr is running correctly on
157157
your board. The button and LED definitions can be found in
158158
:zephyr_file:`boards/arm/nrf52833dk_nrf52833/nrf52833dk_nrf52833.dts`.
159159

160-
Using UART1
161-
***********
160+
Changing UART1 pins
161+
*******************
162162

163-
The following approach can be used when an application needs to use
164-
more than one UART for connecting peripheral devices:
163+
The following approach can be used when an application needs to use another set
164+
of pins for UART1:
165165

166166
1. Add devicetree overlay file to the main directory of your application:
167167

168168
.. code-block:: devicetree
169169
170170
&pinctrl {
171-
uart1_default: uart1_default {
171+
uart1_default_alt: uart1_default_alt {
172172
group1 {
173173
psels = <NRF_PSEL(UART_TX, 0, 14)>,
174174
<NRF_PSEL(UART_RX, 0, 16)>;
175175
};
176176
};
177177
/* required if CONFIG_PM_DEVICE=y */
178-
uart1_sleep: uart1_sleep {
178+
uart1_sleep_alt: uart1_sleep_alt {
179179
group1 {
180180
psels = <NRF_PSEL(UART_TX, 0, 14)>,
181181
<NRF_PSEL(UART_RX, 0, 16)>;
@@ -185,18 +185,16 @@ more than one UART for connecting peripheral devices:
185185
};
186186
187187
&uart1 {
188-
compatible = "nordic,nrf-uarte";
189-
current-speed = <115200>;
190-
status = "okay";
191-
pinctrl-0 = <&uart1_default>;
192-
pinctrl-1 = <&uart1_sleep>;
188+
pinctrl-0 = <&uart1_default_alt>;
189+
/* if sleep state is not used, use /delete-property/ pinctrl-1; and
190+
* skip the "sleep" entry.
191+
*/
192+
pinctrl-1 = <&uart1_sleep_alt>;
193193
pinctrl-names = "default", "sleep";
194194
};
195195
196196
In the overlay file above, pin P0.16 is used for RX and P0.14 is used for TX
197197

198-
2. Use the UART1 as ``DEVICE_DT_GET(DT_NODELABEL(uart1))``
199-
200198
See :ref:`set-devicetree-overlays` for further details.
201199

202200
Selecting the pins

0 commit comments

Comments
 (0)