<?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>How to enable UARTE in nRF52840</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/21103/how-to-enable-uarte-in-nrf52840</link><description>Hi, 
 I need to use two uarts for the project requirement. UART0 is enabled and working successfully. And I am trying to initialize UARTE, but I am not getting any output on the pins if I probe. Here is my code: 
 #define U_RXD ((1 &amp;lt;&amp;lt; 5) | (3 &amp;amp; 0x1F</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 06 Aug 2021 07:10:41 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/21103/how-to-enable-uarte-in-nrf52840" /><item><title>RE: How to enable UARTE in nRF52840</title><link>https://devzone.nordicsemi.com/thread/323646?ContentTypeID=1</link><pubDate>Fri, 06 Aug 2021 07:10:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:16604feb-dccc-460c-9b85-969facaab54b</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;It&amp;#39;s not possible to operate 3 UART interfaces concurrently as there are only 2 physical interfaces, but it should be possible to multiplex one of the instances like you said.&lt;/p&gt;
&lt;p&gt;I think it might be easier to just use the same UARTE driver for all three. You can set the DMA receive buffers to 1 byte to make it behave more like the legacy driver (i.e. trigger RX event for every byte).&lt;/p&gt;
[quote user="idavenport"]Our SDK is version&amp;nbsp;17.0.2,[/quote][quote user="idavenport"]The code fails in nrfx_uart.h at line 198[/quote]
&lt;p&gt;I do not see any code or pre-proccessor checks at this line in nrfx_uart.h:&lt;/p&gt;
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/pastedimage1628233673059v1.png" alt=" " /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to enable UARTE in nRF52840</title><link>https://devzone.nordicsemi.com/thread/323612?ContentTypeID=1</link><pubDate>Thu, 05 Aug 2021 21:49:13 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6586aea7-4c28-442f-99c5-47c336a745ca</guid><dc:creator>idavenport</dc:creator><description>&lt;p&gt;Thanks for the tips on CMSIS.&amp;nbsp; We did try both the legacy and the nrfx drivers, but neither would let us use the old simple uart and the two enhanced uarts to get 3 uarts at a time.&amp;nbsp; So we will have to multiplex one of the uarts on to different pairs of pins to serve all three uart interfaces desired on our board.&amp;nbsp;&amp;nbsp;&lt;br /&gt;&lt;br /&gt;Our SDK is version&amp;nbsp;17.0.2,&lt;/p&gt;
&lt;div class="c-virtual_list__item" id="1628188448.000900"&gt;
&lt;div class="c-message_kit__background p-message_pane_message__message c-message_kit__message"&gt;
&lt;div class="c-message_kit__hover"&gt;
&lt;div class="c-message_kit__actions c-message_kit__actions--default"&gt;
&lt;div class="c-message_kit__gutter"&gt;
&lt;div class="c-message_kit__gutter__right"&gt;
&lt;div class="c-message_kit__blocks c-message_kit__blocks--rich_text"&gt;
&lt;div class="c-message__message_blocks c-message__message_blocks--rich_text"&gt;
&lt;div class="p-block_kit_renderer"&gt;
&lt;div class="p-block_kit_renderer__block_wrapper p-block_kit_renderer__block_wrapper--first"&gt;
&lt;div class="p-rich_text_block" dir="auto"&gt;
&lt;div class="p-rich_text_section"&gt;Nordic -&amp;gt; /home/dgo/Nordic/nRF5_SDK_17.0.2_d674dde which looks like it is the most current version.&amp;nbsp; We also use&amp;nbsp;Segger Embedded Studio 5.50d, the most current version.&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="c-virtual_list__item" id="1628188713.001500"&gt;
&lt;div class="c-message_kit__background p-message_pane_message__message c-message_kit__message"&gt;
&lt;div class="c-message_kit__hover"&gt;
&lt;div class="c-message_kit__actions c-message_kit__actions--above"&gt;
&lt;div class="c-message_kit__gutter"&gt;
&lt;div class="c-message_kit__gutter__right"&gt;
&lt;div class="c-message_kit__blocks c-message_kit__blocks--rich_text"&gt;
&lt;div class="c-message__message_blocks c-message__message_blocks--rich_text"&gt;
&lt;div class="p-block_kit_renderer"&gt;
&lt;div class="p-block_kit_renderer__block_wrapper p-block_kit_renderer__block_wrapper--first"&gt;
&lt;div class="p-rich_text_block" dir="auto"&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&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: How to enable UARTE in nRF52840</title><link>https://devzone.nordicsemi.com/thread/323314?ContentTypeID=1</link><pubDate>Wed, 04 Aug 2021 12:15:46 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:623600d7-fecc-43c8-ac93-9e2fabfe1b25</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;You can use the the CMSIS configuarition wizard to parse the sdk_config file (&lt;span&gt;&lt;a title="SDK configuration header file" href="https://infocenter.nordicsemi.com/topic/sdk_nrf5_v17.0.2/sdk_config.html?cp=8_1_1_6"&gt;SDK configuration header file&lt;/a&gt;&lt;/span&gt;), but this tool is more for visualising the various configuration settings, it does not automate anything. That said, I see you are using the NRFX_* configurations, did you try to the legacy configurations instead (e.g. UART1_ENABLED&amp;nbsp; instead of NRFX_UARTE1_ENABLED?&lt;/p&gt;
&lt;p&gt;I don&amp;#39;t see any ASSERTion check at line 198 when I check the&amp;nbsp;nrfx_uart.h hrader in SDK 17. What SDK version is your project based on?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to enable UARTE in nRF52840</title><link>https://devzone.nordicsemi.com/thread/323189?ContentTypeID=1</link><pubDate>Tue, 03 Aug 2021 21:57:57 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:685a29af-bd41-413f-a8ee-54a8210a784d</guid><dc:creator>idavenport</dc:creator><description>&lt;p&gt;We are using the nRF52833 running FreeRTOS.&amp;nbsp; We don&amp;#39;t have the softdevice linked in yet as we aren&amp;#39;t using BLE in our product just yet, but will be soon.&amp;nbsp; &amp;nbsp;We have one simple uart and two enhanced uarts.&amp;nbsp;&amp;nbsp;I see now that the simple UART is depracated and shares a base address with the first enhanced UARTE.&amp;nbsp; I expect that is why my code fails to compile.&lt;br /&gt;&lt;br /&gt;&lt;pre class="ui-code" data-mode="text"&gt;// &amp;lt;e&amp;gt; NRFX_UARTE_ENABLED - nrfx_uarte - UARTE peripheral driver
//==========================================================
#ifndef NRFX_UARTE_ENABLED
#define NRFX_UARTE_ENABLED 1
#else
#warning &amp;quot;NRFX_UARTE_ENABLED previously defined!&amp;quot;
#endif

// &amp;lt;o&amp;gt; NRFX_UARTE0_ENABLED - Enable UARTE0 instance
#ifndef NRFX_UARTE0_ENABLED
#define NRFX_UARTE0_ENABLED 0
#else
#warning &amp;quot;NRFX_UARTE0_ENABLED previously defined!&amp;quot;
#endif

// &amp;lt;o&amp;gt; NRFX_UARTE1_ENABLED - Enable UARTE1 instance
#ifndef NRFX_UARTE1_ENABLED
#define NRFX_UARTE1_ENABLED 1
#else
#warning &amp;quot;NRFX_UARTE1_ENABLED previously defined!&amp;quot;
#endif

// &amp;lt;o&amp;gt; NRFX_UARTE_DEFAULT_CONFIG_HWFC  - Hardware Flow Control

// &amp;lt;0=&amp;gt; Disabled
// &amp;lt;1=&amp;gt; Enabled

#ifndef NRFX_UARTE_DEFAULT_CONFIG_HWFC
#define NRFX_UARTE_DEFAULT_CONFIG_HWFC 0
#else
#warning &amp;quot;NRFX_UARTE_DEFAULT_CONFIG_HWFC previously defined!&amp;quot;
#endif&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;The code fails in nrfx_uart.h at line 198.&lt;/p&gt;
&lt;p&gt;Is there a config tool that automates the #define configurations somehow?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to enable UARTE in nRF52840</title><link>https://devzone.nordicsemi.com/thread/323012?ContentTypeID=1</link><pubDate>Tue, 03 Aug 2021 07:55:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5869f74c-1c8e-4b21-ae84-2e9e3c67e851</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;When you say 3 instances, I assume you mean 3 physical UART interfaces? Please note that there are only 2 on the nRF52840, UART0/UARTE0 and UART1/UARTE1.&lt;/p&gt;
[quote user="idavenport"]apply_config is disabling the 2nd &amp;amp; 3rd instances in part of the code, but not all of it everywhere.&amp;nbsp; We have been struggling with the nRF and nRFx libraries. We are digging into the documentation to see what we missed.&amp;nbsp; &amp;nbsp;It appears what we are configuring is correct, but is then being mangled.[/quote]
&lt;p&gt;&amp;nbsp;To avoid your configuration setting from getting overridden by apply_config,&amp;nbsp; please make sure you apply your changes to the nrf_drv_uart settings and not the corresponding nrfx_uarte settings. As an example, to enable the UARTE1 instance, you should set UART1_ENABLED and not NRFX_UARTE1_ENABLED.&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Excerpt from the &lt;a title="Migration guide for nrfx drivers" href="https://infocenter.nordicsemi.com/topic/sdk_nrf5_v17.0.2/nrfx_migration_user_guide.html?cp=8_1_2_7"&gt;Migration guide for nrfx drivers&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="padding-left:30px;"&gt;&lt;em&gt;&lt;strong&gt;Continue using nrf_drv drivers&lt;/strong&gt;&lt;/em&gt;&lt;br /&gt;&lt;em&gt;If you want to continue using the nrf_drv drivers, no changes are required. You can use the drivers as before, but without taking advantage of any new functionalities introduced to the nrfx drivers.&lt;/em&gt;&lt;/p&gt;
&lt;p style="padding-left:30px;"&gt;&lt;em&gt;The old configuration entries are translated to the new NRFX_* format in the apply_old_config.h file located in integration/nrfx/legacy. In case you continue using the nrf_drv drivers, &lt;strong&gt;if you use any of the new NRFX_* entries in your configuration file that also contains old entries, the old entry settings take precedence. &lt;br /&gt;&lt;/strong&gt;&lt;/em&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to enable UARTE in nRF52840</title><link>https://devzone.nordicsemi.com/thread/322942?ContentTypeID=1</link><pubDate>Mon, 02 Aug 2021 15:54:08 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:fbb90d9e-6af1-4834-9cdf-d442626e845e</guid><dc:creator>idavenport</dc:creator><description>&lt;p&gt;I was hoping to have FIFO functionality on top of the libuarte driver on two easy DMA uarts as well as one traditional uart for debug.&amp;nbsp; But it sounds like I would need to rewrite&amp;nbsp;&lt;span&gt;app_uart_fifo to support more than one instance.&lt;br /&gt;There is a clue in the doc you linked, regarding the simpler configuration, and why my configuration is being corrupted by apply_config.h which basically takes what we have configured and changes it.&lt;br /&gt;&lt;br /&gt;We are currently working to re-factor the app_uart_fifo.c to allow for three instances. The build error after enabling the other two instances is that the first channel is being instantiated correctly, 2nd &amp;amp; 3rd not; looking at configuration, apply_config is disabling the 2nd &amp;amp; 3rd instances in part of the code, but not all of it everywhere.&amp;nbsp; We have been struggling with the nRF and nRFx libraries. We are digging into the documentation to see what we missed.&amp;nbsp; &amp;nbsp;It appears what we are configuring is correct, but is then being mangled.&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to enable UARTE in nRF52840</title><link>https://devzone.nordicsemi.com/thread/322691?ContentTypeID=1</link><pubDate>Fri, 30 Jul 2021 14:03:23 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8c8b3ca7-bef6-4ebf-a109-2dd986cdd9fd</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;&lt;span&gt;app_uart_fifo &lt;/span&gt;is actaully another library that you can use on top of the UARTE driver (this is the library used in the ble_app_uart sample). But you are right in that &lt;span class="item"&gt;&lt;a class="" title="Libuarte - advanced UARTE driver" href="https://infocenter.nordicsemi.com/topic/sdk_nrf5_v17.0.2/lib_libuarte.html?cp=8_1_3_28"&gt;Libuarte&lt;/a&gt; library replaced the serial library, and this library does not limit you to one UART instance either.&lt;/span&gt;&lt;span class="item"&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span class="item"&gt;You may also consider using the driver directly if you don&amp;#39;t need additional features offered by libuarte. Instructions on how to use the driver APIs can be found in the SDK documentation here: &lt;a class="" title="UART" href="https://infocenter.nordicsemi.com/topic/sdk_nrf5_v17.0.2/hardware_driver_uart.html?cp=8_1_2_0_19"&gt;UART&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span class="item"&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to enable UARTE in nRF52840</title><link>https://devzone.nordicsemi.com/thread/322114?ContentTypeID=1</link><pubDate>Tue, 27 Jul 2021 20:52:31 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c1ee253a-52cd-4369-a9d6-1ff7292a8ea9</guid><dc:creator>idavenport</dc:creator><description>&lt;p&gt;I see that the&amp;nbsp;&lt;span&gt;examples/peripheral/serial code in the SDK has been removed.&amp;nbsp; Is that replaced by the&amp;nbsp;examples/peripheral/libuarte project?&amp;nbsp; If so, it seems we have the same problem with&amp;nbsp;app_uart_fifo only supporting one instance.&amp;nbsp; I didn&amp;#39;t find a library named serial either in&amp;nbsp;components/libraries/ just the libuarte library again which seems to get limited by&amp;nbsp;app_uart_fifo&amp;#39;s only working with one instance.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to enable UARTE in nRF52840</title><link>https://devzone.nordicsemi.com/thread/82550?ContentTypeID=1</link><pubDate>Mon, 09 Oct 2017 09:31:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b7b4a657-38ad-44e8-90ed-81dc75db18b2</guid><dc:creator>Sigurd</dc:creator><description>&lt;p&gt;Hi Atlas,&lt;/p&gt;
&lt;p&gt;When you call the function &lt;a href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.sdk5.v14.0.0/group__nrf__serial.html?cp=4_0_0_6_10_38_20#ga3402c8874c264174a54fd966e8a7d9d3"&gt;nrf_serial_read(...)&lt;/a&gt; you can set the timeout(&lt;code&gt;timeout_ms&lt;/code&gt;) you want. You can pass 0 to operate in non blocking mode.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to enable UARTE in nRF52840</title><link>https://devzone.nordicsemi.com/thread/82549?ContentTypeID=1</link><pubDate>Fri, 06 Oct 2017 14:45:30 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1bec18a2-e193-47ea-a9a8-d4b1887de0fd</guid><dc:creator>Atlas</dc:creator><description>&lt;p&gt;Hi Sigurd
The serial sample code is a not good code to control 2 UART.
Because the code will entry while loop in nrf_serial_read();
It means if I used nrf_serial_read(0,x,x); and nrf_serial_read(1,x,x);in this code., it will entry nrf_serial_read(0,x,x); and wait data from UARTE0. When Get data from UARTE0 then run nrf_serial_read(1,x,x); then wait data from UARTE1.&lt;/p&gt;
&lt;p&gt;If it wait data from UARTE0 but get data from UARTE1, this data will keep in buffer and cannot write to UARTE1 port because the code is still in while loop of nrf_serial_read(0,x,x).&lt;/p&gt;
&lt;p&gt;Is it right?&lt;/p&gt;
&lt;p&gt;Thanks.
Atlas&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to enable UARTE in nRF52840</title><link>https://devzone.nordicsemi.com/thread/82547?ContentTypeID=1</link><pubDate>Mon, 21 Aug 2017 08:17:48 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f5f3e778-6fcb-4b3f-8413-7502686583c4</guid><dc:creator>Sigurd</dc:creator><description>&lt;p&gt;Note that we have added a new library called serial that solves this problem.&lt;/p&gt;
&lt;p&gt;From release notes:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Serial port library: Module for
handling UART communication. It
supports multibyte transfers, time-outs, and buffering of data.
The module is a replacement for app_uart.
See the usage example in examples/peripheral/serial&lt;/p&gt;
&lt;/blockquote&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to enable UARTE in nRF52840</title><link>https://devzone.nordicsemi.com/thread/82548?ContentTypeID=1</link><pubDate>Tue, 15 Aug 2017 12:20:08 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:11431992-f0ad-4177-8927-a8ae87ffe468</guid><dc:creator>Sigurd</dc:creator><description>&lt;p&gt;Looks like &lt;code&gt;app_uart_fifo&lt;/code&gt; only supports running one of the UART instances at the same time. I.e. it will always use the &lt;code&gt;APP_UART_DRIVER_INSTANCE&lt;/code&gt; that is configured in sdk_config.h&lt;/p&gt;
&lt;p&gt;code snippet from app_uart_fifo.c:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;static nrf_drv_uart_t app_uart_inst = NRF_DRV_UART_INSTANCE(APP_UART_DRIVER_INSTANCE);
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The underlying driver(nrf_drv_uart) supports multiple UART instances at the same time, but app_uart_fifo will need some modification to support running both UART instances at the same time.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to enable UARTE in nRF52840</title><link>https://devzone.nordicsemi.com/thread/82545?ContentTypeID=1</link><pubDate>Wed, 09 Aug 2017 13:44:49 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e6c66002-3951-4bc3-87d6-1ff40c6be6ea</guid><dc:creator>Sigurd</dc:creator><description>&lt;p&gt;The 2 UART Peripherals each have its separate instance. See the Instantiation table &lt;a href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.nrf52840.ps/memory.html?cp=2_0_0_7_3#topic"&gt;here&lt;/a&gt;.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to enable UARTE in nRF52840</title><link>https://devzone.nordicsemi.com/thread/82541?ContentTypeID=1</link><pubDate>Tue, 04 Apr 2017 17:54:24 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a4d19fea-e6a6-443c-97b9-a1b38c38f0d7</guid><dc:creator>Sigurd</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;The nRF52840 have 2 UART Peripherals. The first one can be configured to be used either with or without EasyDMA(either as UARTE0 or UART0), while the second one can only be configured with EasyDMA (UARTE1).&lt;/p&gt;
&lt;hr /&gt;
&lt;p&gt;I would strongly recommend you to you use the UART drivers in the SDK. You can find an example on how to use it in the folder &lt;code&gt;SDK_folder\examples\peripheral\uart\&lt;/code&gt;. Remember to enable both UART instances in &lt;code&gt;sdk_config.h&lt;/code&gt; if you want to use both peripherals. The latest SDK version can be downloaded from &lt;a href="http://developer.nordicsemi.com/nRF5_SDK/nRF5_SDK_v13.x.x/"&gt;here&lt;/a&gt;.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>