<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://devzone.nordicsemi.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Drive Strength of UART pins</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/89474/drive-strength-of-uart-pins</link><description>I need to use High Drive Strength of pin used as TX of UART. How may it be done using zephyr ?</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 15 Dec 2022 09:18:41 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/89474/drive-strength-of-uart-pins" /><item><title>RE: Drive Strength of UART pins</title><link>https://devzone.nordicsemi.com/thread/400766?ContentTypeID=1</link><pubDate>Thu, 15 Dec 2022 09:18:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:97fb64f2-c072-427d-aab4-21892664f842</guid><dc:creator>Sigurd Hellesvik</dc:creator><description>&lt;p&gt;Try to get the pin number like this:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;DT_PROP(DT_NODELABEL(uart0), tx_pin)&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Regards,&lt;br /&gt;Sigurd Hellesvik&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Drive Strength of UART pins</title><link>https://devzone.nordicsemi.com/thread/400564?ContentTypeID=1</link><pubDate>Wed, 14 Dec 2022 10:10:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5251ce30-5efd-4e2e-a00a-b42124a0fa5a</guid><dc:creator>mexco</dc:creator><description>&lt;p&gt;SDK1.9.1.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Drive Strength of UART pins</title><link>https://devzone.nordicsemi.com/thread/400375?ContentTypeID=1</link><pubDate>Tue, 13 Dec 2022 12:30:12 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1390be50-5b08-4201-97da-3bc17fe1336e</guid><dc:creator>Sigurd Hellesvik</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Which version of the nRF Connect SDK do you use?&lt;/p&gt;
&lt;p&gt;Regards,&lt;br /&gt;Sigurd Hellesvik&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Drive Strength of UART pins</title><link>https://devzone.nordicsemi.com/thread/400049?ContentTypeID=1</link><pubDate>Mon, 12 Dec 2022 06:10:24 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:13aaa4a8-4f03-405d-8a71-05f3226a7172</guid><dc:creator>mexco</dc:creator><description>&lt;p&gt;Hi.. I need same again but without using pinctrl. I need to use following style to set drive strentgh.&lt;/p&gt;
&lt;div&gt;
&lt;div&gt;&lt;span&gt;&amp;amp;&lt;/span&gt;&lt;span&gt;uart2&lt;/span&gt;&lt;span&gt;{&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span&gt;current-speed&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;=&lt;/span&gt;&lt;span&gt; &amp;lt; &lt;/span&gt;&lt;span&gt;115200&lt;/span&gt;&lt;span&gt; &amp;gt;;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span&gt;tx-pin&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;=&lt;/span&gt;&lt;span&gt; &amp;lt;&lt;/span&gt;&lt;span&gt;2&lt;/span&gt;&lt;span&gt;&amp;gt;;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span&gt;rx-pin&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;=&lt;/span&gt;&lt;span&gt; &amp;lt;&lt;/span&gt;&lt;span&gt;3&lt;/span&gt;&lt;span&gt;&amp;gt;;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span&gt;status&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;=&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;&amp;quot;okay&amp;quot;&lt;/span&gt;&lt;span&gt;;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;};&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;How , may it be done ?&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;Meanwhile, I temporarily added following&amp;nbsp; function and called it in uart_init() function by manually writing Pin Number as below:&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;
&lt;div&gt;&lt;span style="color:#ff6600;"&gt;NRF_STATIC_INLINE void nrf_gpio_cfg_output_strong(uint32_t pin_number)&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="color:#ff6600;"&gt;{&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="color:#ff6600;"&gt;&amp;nbsp; &amp;nbsp; nrf_gpio_cfg(&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="color:#ff6600;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; pin_number,&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="color:#ff6600;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; NRF_GPIO_PIN_DIR_OUTPUT,&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="color:#ff6600;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; NRF_GPIO_PIN_INPUT_DISCONNECT,&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="color:#ff6600;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; NRF_GPIO_PIN_NOPULL,&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="color:#ff6600;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; NRF_GPIO_PIN_H0H1,&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="color:#ff6600;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; NRF_GPIO_PIN_NOSENSE);&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="color:#ff6600;"&gt;}&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="color:#0000ff;"&gt;void uart_init()&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="color:#0000ff;"&gt;{&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="color:#0000ff;"&gt;&amp;nbsp; ...&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="color:#0000ff;"&gt;&amp;nbsp;&amp;nbsp;nrf_gpio_cfg_output_strong(2); // used Tx pin of UART2&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="color:#0000ff;"&gt;&amp;nbsp; ......&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="color:#0000ff;"&gt;}&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;Though above method worked very well, but is not recommendable, because Pin Number got fixed. How to get Pin Number as set in overlay file instead of fixed, I don&amp;#39;t know ?&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Drive Strength of UART pins</title><link>https://devzone.nordicsemi.com/thread/375573?ContentTypeID=1</link><pubDate>Tue, 05 Jul 2022 13:08:17 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:750fde87-ed23-4409-a58e-c15db42835eb</guid><dc:creator>Simon</dc:creator><description>&lt;p&gt;Add the following to an overlay file nrf9160dk_nrf9160_ns.overlay:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;&amp;amp;pinctrl {
    uart0_default: uart0_default {
        group1 {
            psels = &amp;lt;NRF_PSEL(UART_TX, 0, 29)&amp;gt;,
                &amp;lt;NRF_PSEL(UART_RTS, 0, 27)&amp;gt;;
                nordic,drive-mode = &amp;lt;NRF_DRIVE_H0H1&amp;gt;;
        };
        group2 {
            psels = &amp;lt;NRF_PSEL(UART_RX, 0, 28)&amp;gt;,
                &amp;lt;NRF_PSEL(UART_CTS, 0, 26)&amp;gt;;
            bias-pull-up;
            nordic,drive-mode = &amp;lt;NRF_DRIVE_H0H1&amp;gt;;
        };
    };
};
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;I tested this with the hello world sample attached below:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/hello_5F00_world_5F00_high_5F00_drive.zip"&gt;devzone.nordicsemi.com/.../hello_5F00_world_5F00_high_5F00_drive.zip&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;I built it with NCS v2.0.0 and the board nrf9160dk_nrf9160_ns. After flashing it to the board, I read the PIN_CNF of P0.29 (uart TX), and got the following result:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;@$ nrfjprog --memrd 0x40842774 --n 4
0x40842774: 00000303                              |....|
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;0x303 is&amp;nbsp;0011 0000 0011 in binary, and if you look at&amp;nbsp;&lt;a href="https://infocenter.nordicsemi.com/topic/ps_nrf9160/gpio.html?cp=2_0_0_5_3_3_10#register.PIN_CNF"&gt;PIN_CNF&lt;/a&gt;, you can see that 11 (3 in decimal) on position 8 and 9 corresponds to H0H1:&lt;/p&gt;
&lt;p&gt;&lt;img style="max-height:240px;max-width:320px;" src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/pastedimage1657026486197v1.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Simon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Drive Strength of UART pins</title><link>https://devzone.nordicsemi.com/thread/375380?ContentTypeID=1</link><pubDate>Mon, 04 Jul 2022 15:12:31 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6154da40-33e5-406c-9371-5632b7646cf3</guid><dc:creator>mexco</dc:creator><description>&lt;p&gt;pls explain how to write in overlay ?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Drive Strength of UART pins</title><link>https://devzone.nordicsemi.com/thread/375281?ContentTypeID=1</link><pubDate>Mon, 04 Jul 2022 09:51:04 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d451606d-944b-40c7-9052-baecca7dab67</guid><dc:creator>Simon</dc:creator><description>&lt;p&gt;I think it should be enough setting it in the overlay, then I think the uart driver will set the drive through uart_nrfx_uarte.c--&amp;gt;pinctrl_apply_state()--&amp;gt;pinctrl_configure_pins() at boot.&lt;/p&gt;
&lt;p&gt;Try reading the&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;a href="https://infocenter.nordicsemi.com/topic/ps_nrf9160/gpio.html?cp=2_0_0_5_3_3_10#register.PIN_CNF"&gt;PIN_CNF--&amp;gt;DRIVE register&lt;/a&gt;&amp;nbsp;after booting up and see if it&amp;#39;s set correctly.&amp;nbsp;You can read it from main() or just through nrfjprog.&lt;/p&gt;
&lt;p&gt;For example if you&amp;#39;re reading GPIO pin 0 (nonsecure), you read from address&amp;nbsp;0x40842500 (nonsecure) +&amp;nbsp;&lt;span&gt;0x200 + (0 (P0.0) × 0x4) =&amp;nbsp;0x40842700&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;nrfjprog --memrd 0x40842700 --n 4&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Simon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Drive Strength of UART pins</title><link>https://devzone.nordicsemi.com/thread/374955?ContentTypeID=1</link><pubDate>Thu, 30 Jun 2022 15:08:49 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:38964b14-18d8-4615-a8d7-fc0146ae193c</guid><dc:creator>mexco</dc:creator><description>&lt;p&gt;is it to be set in Overlay file or at the time of Initialization of pin using DT_GET_.... ? Please, write as per example&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Drive Strength of UART pins</title><link>https://devzone.nordicsemi.com/thread/374950?ContentTypeID=1</link><pubDate>Thu, 30 Jun 2022 14:49:12 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:308d3567-fe60-45ce-8c14-6320e41bffd7</guid><dc:creator>Simon</dc:creator><description>&lt;p&gt;Try using the field &lt;a href="https://github.com/nrfconnect/sdk-zephyr/blob/v3.0.99-ncs1/dts/bindings/pinctrl/nordic%2Cnrf-pinctrl.yaml#L103"&gt;nordic,drive-mode&lt;/a&gt; like it&amp;#39;s done in&amp;nbsp;&lt;a href="https://github.com/nrfconnect/sdk-nrf/blob/v2.0.0/boards/arm/nrf5340_audio_dk_nrf5340/nrf5340_audio_dk_nrf5340_cpuapp_common-pinctrl.dtsi#L75"&gt;nrf/boards/arm/nrf5340_audio_dk_nrf5340/nrf5340_audio_dk_nrf5340_cpuapp_common-pinctrl.dtsi&lt;/a&gt;. Set it to any of the &lt;a href="https://github.com/nrfconnect/sdk-zephyr/blob/v3.0.99-ncs1/include/zephyr/dt-bindings/pinctrl/nrf-pinctrl.h#L138-L155"&gt;modes defined in nrf-pinctrl.h&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Simon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>