<?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 use libuarte</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/123974/how-to-use-libuarte</link><description>I want to use the async driver,but did not find the example or explanation. 
 I have looked for the whole examples with &amp;quot;nrf_libuarte_async.h&amp;quot;, found nothing,a little strange,I guess the NRF_LOG should useed this lib,but not check yet.</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 01 Sep 2025 18:59:14 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/123974/how-to-use-libuarte" /><item><title>RE: how to use libuarte</title><link>https://devzone.nordicsemi.com/thread/547375?ContentTypeID=1</link><pubDate>Mon, 01 Sep 2025 18:59:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:bf06f0e3-feba-4f49-bce9-42300b6601d2</guid><dc:creator>Hieu</dc:creator><description>[quote user="OldXiao"] I just delete one of the RTC1_IRQHandler definition?[/quote]
&lt;p&gt;No. The error means that&amp;nbsp;there are two RTC1 driver being enabled at the same time. What are the RTC related configs enabled in your sdk_config.h, and what RTC related driver .c files are included in your project?&lt;/p&gt;
&lt;p&gt;Are you using app_timer?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: how to use libuarte</title><link>https://devzone.nordicsemi.com/thread/547160?ContentTypeID=1</link><pubDate>Fri, 29 Aug 2025 09:16:28 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:daab7e3d-bd40-40a2-8f8c-c9669347fa04</guid><dc:creator>OldXiao</dc:creator><description>&lt;p&gt;Solved.&lt;/p&gt;
&lt;p&gt;In order to use the Macro&amp;nbsp;NRF_LIBUARTE_ASYNC_DEFINE,you have to confirm:&lt;/p&gt;
&lt;p&gt;1) include all files needed:&lt;/p&gt;
&lt;p&gt;nrfx_ppi.c&lt;/p&gt;
&lt;p&gt;nrfx_timer.c&lt;/p&gt;
&lt;p&gt;nrf_libuarte_drv.c&lt;/p&gt;
&lt;p&gt;nrf_libuarte_async.c&lt;/p&gt;
&lt;p&gt;(there is problem if you try to use RTC timer)&lt;/p&gt;
&lt;p&gt;2)enable these drivers in sdk_config.h;&lt;/p&gt;
&lt;p&gt;This is the main source of error.&lt;/p&gt;
&lt;p&gt;As my case:&lt;/p&gt;
&lt;p&gt;NRF_LIBUARTE_ASYNC_DEFINE(m_libuarte, 0, 1,&amp;nbsp; &amp;nbsp; NRF_LIBUARTE_PERIPHERAL_NOT_USED, 2,&amp;nbsp; NRF_SDH_BLE_GATT_MAX_MTU_SIZE * 2, 3);&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I use UARTE0,TIMER1,TIMER2.&lt;/p&gt;
&lt;p&gt;You should not just enbale NRFX drivers, you have to enable legacy TIMER1 &amp;amp; TIMER2 driver.&lt;/p&gt;
&lt;p&gt;Problems come mainly from here.&lt;/p&gt;
&lt;p&gt;&lt;img style="max-height:246px;max-width:300px;" alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/600x492/__key/communityserver-discussions-components-files/4/pastedimage1756458433493v1.png" /&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;img style="max-height:200px;max-width:300px;" alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/600x400/__key/communityserver-discussions-components-files/4/pastedimage1756458552088v2.png" /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img style="max-height:200px;max-width:300px;" alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/600x400/__key/communityserver-discussions-components-files/4/pastedimage1756458598045v3.png" /&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;The Macro does not think the TIMERx is enabled if you did not enable legacy drivers,and the tip info provided by&amp;nbsp;&lt;span&gt;NRF_LIBUARTE_ASYNC_DEFINE is meaningless.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;These kind of info should include into the official explaination,I spend many hours to try error.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: how to use libuarte</title><link>https://devzone.nordicsemi.com/thread/547121?ContentTypeID=1</link><pubDate>Fri, 29 Aug 2025 00:05:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d9cccc27-199e-4f40-a094-f7cedca6d5f9</guid><dc:creator>OldXiao</dc:creator><description>&lt;p&gt;Or I just delete one of the RTC1_IRQHandler definition?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: how to use libuarte</title><link>https://devzone.nordicsemi.com/thread/547120?ContentTypeID=1</link><pubDate>Fri, 29 Aug 2025 00:04:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:37478c1d-b9ae-46da-a817-7b90d9f16d08</guid><dc:creator>OldXiao</dc:creator><description>&lt;p&gt;Thanks for guides.&lt;/p&gt;
&lt;p&gt;I missed some file, the &amp;quot;_IDX&amp;quot; problem disappeared after added them and delete the symbols I added in sdk_confg.h (some &amp;quot;_IDX&amp;quot; definition).&lt;/p&gt;
&lt;p&gt;But&amp;nbsp; a problem raised again,and I don&amp;#39;t know how to work around.&lt;/p&gt;
&lt;p&gt;Current config:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;NRF_LIBUARTE_ASYNC_DEFINE(m_libuarte, 0, 1,    1, NRF_LIBUARTE_PERIPHERAL_NOT_USED,  NRF_SDH_BLE_GATT_MAX_MTU_SIZE * 2, 3);&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;error:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;.\_build\UART2BLEnrf52810_xxaa.axf: Error: L6200E: Symbol RTC1_IRQHandler multiply defined (by drv_rtc.o and nrfx_rtc.o).&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;I have tried many parameter composition&amp;nbsp;for NRF_LIBUARTE_ASYNC_DEFINE, there are always errors,and current config&amp;nbsp;with&amp;nbsp;least error count.&lt;/p&gt;
&lt;p&gt;I browsed this web,found 1 post related,but I did not get the meaning, you suggest remove the related files,remove nrfx_rtc.c &amp;amp; drv_rtc.c? then what to do?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: how to use libuarte</title><link>https://devzone.nordicsemi.com/thread/547072?ContentTypeID=1</link><pubDate>Thu, 28 Aug 2025 11:34:03 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:84855346-2456-4fe9-850c-4fedf6a876c3</guid><dc:creator>Hieu</dc:creator><description>&lt;p&gt;Hi OldXiao,&lt;/p&gt;
&lt;p&gt;First of all, the nRF5 SDK is in &lt;a href="https://devzone.nordicsemi.com/nordic/nordic-blog/b/blog/posts/nrf-connect-sdk-and-nrf5-sdk-statement"&gt;maintenance mode&lt;/a&gt; and is not recommended for new project. If you are working on a new project, I strongly recommend using the &lt;a href="https://docs.nordicsemi.com/bundle/ncs-latest/page/nrf/index.html"&gt;nRF Connect SDK&lt;/a&gt;&amp;nbsp;(NCS), where&amp;nbsp;setting up complex features is a lot faster. We provide online course here to help you ramp up quickly with NCS:&amp;nbsp;&lt;a href="https://academy.nordicsemi.com/"&gt;Nordic Semiconductor Online Learning Platform - Nordic Developer Academy&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;If for some reason you must use the nRF5 SDK:&lt;/p&gt;
&lt;p&gt;I cannot comment on the result that Gemini give you as I don&amp;#39;t understand the text.&lt;/p&gt;
&lt;p&gt;Rather than diving into the code and trying to figure it out, I recommend you go over the documentation instead:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://docs.nordicsemi.com/bundle/sdk_nrf5_v17.1.0/page/lib_libuarte.html"&gt;nRF5 SDK v17.1.0: Libuarte - advanced UARTE driver&lt;/a&gt;&lt;br /&gt;&lt;a href="https://docs.nordicsemi.com/bundle/sdk_nrf5_v17.1.0/page/group_nrf_libuarte_async.html"&gt;nRF5 SDK v17.1.0: libUARTE asynchronous library&lt;br /&gt;&lt;/a&gt;&lt;a href="https://docs.nordicsemi.com/bundle/sdk_nrf5_v17.1.0/page/group_nrf_libuarte_drv.html"&gt;nRF5 SDK v17.1.0: libUARTE driver&lt;br /&gt;&lt;/a&gt;&lt;a href="https://docs.nordicsemi.com/bundle/sdk_nrf5_v17.1.0/page/libuarte_example.html"&gt;nRF5 SDK v17.1.0: Libuarte Example&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;From the API documentation and the codes you provided, it seems the size of the&amp;nbsp;RX buffer was not enough. Please try increasing it.&lt;/p&gt;
&lt;p&gt;In general, I would suggest trying to keep the parameters exactly the same as the example and have things working first.&amp;nbsp;You would also want to go over the documentation and understand the general concepts as well as any API of interest before tweaking the configurations.&lt;/p&gt;
&lt;p&gt;Hieu&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: how to use libuarte</title><link>https://devzone.nordicsemi.com/thread/546993?ContentTypeID=1</link><pubDate>Thu, 28 Aug 2025 04:00:22 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:dab38da7-8ffd-4254-b304-df37f7b5efe8</guid><dc:creator>OldXiao</dc:creator><description>&lt;p&gt;get reply from gemini:&lt;/p&gt;
&lt;p&gt;_uarte_idx:&lt;/p&gt;
&lt;p&gt;用途: 指定要使用的 UARTE 硬件实例的索引。&lt;/p&gt;
&lt;p&gt;安全值: 在 nRF52810 上，只有一个 UARTE 外设，所以该值必须是 0。&lt;/p&gt;
&lt;p&gt;_timer0_idx:&lt;/p&gt;
&lt;p&gt;用途: 这是底层 nrf_libuarte_drv 驱动内部使用的定时器。它用于管理 EasyDMA 传输和缓冲区切换。&lt;/p&gt;
&lt;p&gt;安全值: SoftDevice 会使用 TIMER0，因此你不能使用 0。你应该选择一个空闲的定时器，例如 1 或 2。&lt;/p&gt;
&lt;p&gt;_rtc1_idx 和 _timer1_idx:&lt;/p&gt;
&lt;p&gt;用途: 这两个参数用于异步超时机制。库会根据你的 sdk_config.h 配置选择一个作为超时计时器。它会从 TIMER1、RTC1 和 App Timer 中选择一个。&lt;/p&gt;
&lt;p&gt;安全值: RTC0 通常被 SoftDevice 占用，所以 RTC1 是一个安全的选择。TIMER1 和 TIMER2 通常也是可用的。&lt;/p&gt;
&lt;p&gt;如何选择:&lt;/p&gt;
&lt;p&gt;如果你想使用 TIMER1 作为超时计时器，将 _timer1_idx 设置为 1，并将 _rtc1_idx 设置为 NRF_LIBUARTE_PERIPHERAL_NOT_USED。&lt;/p&gt;
&lt;p&gt;如果你想使用 RTC1 作为超时计时器，将 _rtc1_idx 设置为 1，并将 _timer1_idx 设置为 NRF_LIBUARTE_PERIPHERAL_NOT_USED。&lt;/p&gt;
&lt;p&gt;如果你想使用 app_timer，则将 _rtc1_idx 和 _timer1_idx 都设置为 NRF_LIBUARTE_PERIPHERAL_NOT_USED。&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I defined like this :&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;NRF_LIBUARTE_ASYNC_DEFINE(m_libuarte, 0, 1,    NRF_LIBUARTE_PERIPHERAL_NOT_USED,2,    NRF_SDH_BLE_GATT_MAX_MTU_SIZE,3);&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;It report error &lt;span class="emoticon" data-url="https://devzone.nordicsemi.com/cfs-file/__key/system/emoji/1f4af.svg" title="100"&gt;&amp;#x1f4af;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;..\..\..\app_uarte.c(14): error:  #94: the size of an array must be greater than zero
  NRF_LIBUARTE_ASYNC_DEFINE(m_libuarte, 0, 1,    NRF_LIBUARTE_PERIPHERAL_NOT_USED,2,    NRF_SDH_BLE_GATT_MAX_MTU_SIZE,3);&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;this is the extend result of&amp;nbsp;NRF_LIBUARTE_ASYNC_DEFINE:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;
extern char (*_do_assert(void)) [sizeof(char[1 - 2* !(3 &amp;gt;= 3)])]; 
extern char (*_do_assert(void)) [sizeof(char[1 - 2* !(!((1 == 0) &amp;amp;&amp;amp; (255 == 255) &amp;amp;&amp;amp; (2 == 255)))])]; 
extern char (*_do_assert(void)) [sizeof(char[1 - 2* !(0 &amp;lt; 1)])]; 
extern char (*_do_assert(void)) [sizeof(char[1 - 2* !(1 == 1)])]; 
extern char (*_do_assert(void)) [sizeof(char[1 - 2* !(0 == 1)])]; 

static nrf_libuarte_drv_ctrl_blk_t m_libuarte_libuartectrl_blk; 
static const nrf_libuarte_drv_t m_libuarte_libuarte = { 
. ctrl_blk = &amp;amp;m_libuarte_libuartectrl_blk, 
. timer = { . p_reg = ((NRF_TIMER_Type*) 0x40009000UL), 
. instance_id = 1, . cc_channel_count = 4, }, 
. uarte = ((NRF_UARTE_Type*) 0x40002000UL), }; 

static uint8_t * m_libuarte_rxdata_queue_nrf_queue_buffer[(3) + 1]; 
static nrf_queue_cb_t m_libuarte_rxdata_queue_nrf_queue_cb; 
; 
const nrf_queue_t m_libuarte_rxdata_queue __attribute__ ((section(&amp;quot;nrf_queue&amp;quot;))) __attribute__((used)) = { 
. p_cb = &amp;amp;m_libuarte_rxdata_queue_nrf_queue_cb, 
. p_buffer = m_libuarte_rxdata_queue_nrf_queue_buffer, 
. size = (3), . element_size = sizeof(uint8_t *), 
. mode = NRF_QUEUE_MODE_NO_OVERFLOW,   }; 

extern char (*_do_assert(void)) [sizeof(char[1 - 2* !((3) &amp;lt;= 255)])]; 
static uint8_t m_libuarte_rx_pool_nrf_balloc_pool_stack[(3)]; 
static uint32_t m_libuarte_rx_pool_nrf_balloc_pool_mem [((((52)) - 1) + (sizeof(uint32_t)) - ((((52)) - 1) % (sizeof(uint32_t)))) * (3) / sizeof(uint32_t)]; 
static nrf_balloc_cb_t m_libuarte_rx_pool_nrf_balloc_cb; ; 
const nrf_balloc_t m_libuarte_rx_pool __attribute__ ((section(&amp;quot;nrf_balloc&amp;quot;))) __attribute__((used)) = { 
. p_cb = &amp;amp;m_libuarte_rx_pool_nrf_balloc_cb, 
. p_stack_base = m_libuarte_rx_pool_nrf_balloc_pool_stack, 
. p_stack_limit = m_libuarte_rx_pool_nrf_balloc_pool_stack + (3), 
. p_memory_begin = m_libuarte_rx_pool_nrf_balloc_pool_mem, 
. block_size = ((((52)) - 1) + (sizeof(uint32_t)) - ((((52)) - 1) % (sizeof(uint32_t)))),    };   
; 
static app_timer_t m_libuarte_app_timer_data = { . end_val = 0xFFFFFFFFFFFFFFFFULL, }; 
static const app_timer_id_t m_libuarte_app_timer = &amp;amp;m_libuarte_app_timer_data; nrf_libuarte_app_timer_ctrl_blk_t m_libuarte_app_timer_ctrl_blk; 
static nrf_libuarte_async_ctrl_blk_t m_libuartectrl_blk;  
static const nrf_libuarte_async_t m_libuarte = { 
. p_rx_pool = &amp;amp;m_libuarte_rx_pool, 
. p_rx_queue = &amp;amp;m_libuarte_rxdata_queue, 
. p_rtc = 0, 
. p_timer = 0, 
. p_app_timer = &amp;amp;m_libuarte_app_timer, 
. p_app_timer_ctrl_blk = &amp;amp;m_libuarte_app_timer_ctrl_blk, 
. p_libuarte = &amp;amp;m_libuarte_libuarte, 
. p_ctrl_blk = &amp;amp;m_libuartectrl_blk, 
. rx_buf_size = 52,  }; 
;&lt;/pre&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;this is false, but what triggered this?&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;extern char (*_do_assert(void)) [sizeof(char[1 - 2* !(0 == 1)])]; &lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;I&amp;#39;m useing nrf52810,nrf52 SDK 17.1,S113.&lt;/p&gt;
&lt;p&gt;BLE peripheral, use UARTE + BLE SD to bridge between my MCU &amp;amp; Server instead of NUS.&lt;/p&gt;
&lt;p&gt;I have disabled LOG,so no conflict on UARTE.&lt;/p&gt;
&lt;p&gt;TIMER1 &amp;amp; TIMER2 enabled.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: how to use libuarte</title><link>https://devzone.nordicsemi.com/thread/546986?ContentTypeID=1</link><pubDate>Thu, 28 Aug 2025 00:43:24 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e80ddabf-4e01-4db7-8e08-d061050ae465</guid><dc:creator>OldXiao</dc:creator><description>&lt;p&gt;found one:nRF5_SDK_17.1.0_ddde560\examples\peripheral\libuarte.&lt;/p&gt;
&lt;p&gt;defined :&lt;/p&gt;
&lt;p&gt;NRF_LIBUARTE_ASYNC_DEFINE(m_libuarte, 0, 0,0,NRF_LIBUARTE_PERIPHERAL_NOT_USED, NRF_SDH_BLE_GATT_MAX_MTU_SIZE, 2)&lt;/p&gt;
&lt;p&gt;error:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;Build target &amp;#39;UART2BLEnrf52810_xxaa&amp;#39;
compiling app_uarte.c...
..\..\..\app_uarte.c(7): error:  #94: the size of an array must be greater than zero
  NRF_LIBUARTE_ASYNC_DEFINE(m_libuarte, 0, 0,0,NRF_LIBUARTE_PERIPHERAL_NOT_USED, NRF_SDH_BLE_GATT_MAX_MTU_SIZE, 2)
..\..\..\app_uarte.c(7): error:  #94: the size of an array must be greater than zero
  NRF_LIBUARTE_ASYNC_DEFINE(m_libuarte, 0, 0,0,NRF_LIBUARTE_PERIPHERAL_NOT_USED, NRF_SDH_BLE_GATT_MAX_MTU_SIZE, 2)
..\..\..\app_uarte.c(7): error:  #20: identifier &amp;quot;NRFX_TIMER0_INST_IDX&amp;quot; is undefined
  NRF_LIBUARTE_ASYNC_DEFINE(m_libuarte, 0, 0,0,NRF_LIBUARTE_PERIPHERAL_NOT_USED, NRF_SDH_BLE_GATT_MAX_MTU_SIZE, 2)
..\..\..\app_uarte.c: 0 warnings, 3 errors
&amp;quot;.\_build\UART2BLEnrf52810_xxaa.axf&amp;quot; - 3 Error(s), 0 Warning(s).&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;It is hard to understand the detail information:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;/**
 * @brief Macro for creating instance of libuarte_async.
 *
 * Libuarte_async requires one timer-like peripheral (RTC or TIMER) for triggering RX timeout.
 * Macro will create instance only for peripheral which is used.
 *
 * @param _name        Instance name.
 * @param _uarte_idx   UARTE instance used.
 * @param _timer0_idx  TIMER instance used by libuarte for bytes counting.
 * @param _rtc1_idx    RTC instance used for timeout. If set to NRF_LIBUARTE_PERIPHERAL_NOT_USED
 *                     then TIMER instance is used or app_timer instance if _timer1_idx is also set
 *                     to NRF_LIBUARTE_PERIPHERAL_NOT_USED.
 * @param _timer1_idx  TIMER instance used for timeout. If set to NRF_LIBUARTE_PERIPHERAL_NOT_USED
 *                     then RTC instance is used or app_timer instance if _rtc1_idx is also set
 *                     to NRF_LIBUARTE_PERIPHERAL_NOT_USED.
 * @param _rx_buf_size Size of single RX buffer. Size impacts accepted latency between buffer
 *                     request and providing next buffer. Next must be provided within before
 *                     _rx_buf_size bytes is received.
 * @param _rx_buf_cnt  Number of buffers in the RX buffer pool. Size impacts accepted latency
 *                     between NRF_LIBUARTE_ASYNC_EVT_RX_DATA event and
 *                     @ref nrf_libuarte_async_rx_free.
 */
#define NRF_LIBUARTE_ASYNC_DEFINE(_name, _uarte_idx, _timer0_idx,\
                                  _rtc1_idx, _timer1_idx,\
                                  _rx_buf_size, _rx_buf_cnt) \
      STATIC_ASSERT(_rx_buf_cnt &amp;gt;= 3, &amp;quot;Wrong number of RX buffers&amp;quot;);\
      STATIC_ASSERT(!((NRF_LIBUARTE_ASYNC_WITH_APP_TIMER == 0) &amp;amp;&amp;amp; \
                    (_rtc1_idx == NRF_LIBUARTE_PERIPHERAL_NOT_USED) &amp;amp;&amp;amp; \
                    (_timer1_idx == NRF_LIBUARTE_PERIPHERAL_NOT_USED)), \
                    &amp;quot;App timer support disabled&amp;quot;);\
      NRF_LIBUARTE_DRV_DEFINE(CONCAT_2(_name, _libuarte), _uarte_idx, _timer0_idx);\
      NRF_QUEUE_DEF(uint8_t *, CONCAT_2(_name,_rxdata_queue), _rx_buf_cnt, NRF_QUEUE_MODE_NO_OVERFLOW);\
      NRF_BALLOC_DEF(CONCAT_2(_name,_rx_pool), _rx_buf_size, _rx_buf_cnt);\
      /* Create TIMER instance only if _timer1_idx != NRF_LIBUARTE_PERIPHERAL_NOT_USED */ \
      _LIBUARTE_ASYNC_EVAL(\
              NRFX_CONCAT_3(NRFX_TIMER, _timer1_idx, _ENABLED),\
              (STATIC_ASSERT((_timer1_idx == NRF_LIBUARTE_PERIPHERAL_NOT_USED) || (CONCAT_3(NRFX_TIMER,_timer1_idx, _ENABLED) == 1), &amp;quot;TIMER instance not enabled&amp;quot;);\
               static const nrfx_timer_t CONCAT_2(_name, _timer) = NRFX_TIMER_INSTANCE(_timer1_idx);),\
              (/* empty */))\
      /* Create RTC instance only if _timer1_idx != NRF_LIBUARTE_PERIPHERAL_NOT_USED */ \
      _LIBUARTE_ASYNC_EVAL(\
              NRFX_CONCAT_3(NRFX_RTC, _rtc1_idx, _ENABLED),\
              (STATIC_ASSERT((_rtc1_idx == NRF_LIBUARTE_PERIPHERAL_NOT_USED) || (CONCAT_3(NRFX_RTC,_rtc1_idx, _ENABLED) == 1), &amp;quot;RTC instance not enabled&amp;quot;);\
               static const nrfx_rtc_t CONCAT_2(_name, _rtc) = NRFX_RTC_INSTANCE(_rtc1_idx);),\
              (/* empty */))\
      _LIBUARTE_ASYNC_EVAL(NRFX_CONCAT_3(NRFX_TIMER, _timer1_idx, _ENABLED),\
              (/* empty */),\
              (_LIBUARTE_ASYNC_EVAL(NRFX_CONCAT_3(NRFX_RTC, _rtc1_idx, _ENABLED),(/* empty */), \
                   (APP_TIMER_DEF(CONCAT_2(_name,_app_timer)); \
                   nrf_libuarte_app_timer_ctrl_blk_t CONCAT_2(_name,_app_timer_ctrl_blk);))) \
      )\
      static nrf_libuarte_async_ctrl_blk_t CONCAT_2(_name, ctrl_blk);\
      _LIBUARTE_ASYNC_EVAL(\
              NRFX_CONCAT_3(NRFX_RTC, _rtc1_idx, _ENABLED), \
              (static void CONCAT_2(_name, _rtc_handler)(nrfx_rtc_int_type_t int_type);),\
              (/* empty */)) \
      \
      static const nrf_libuarte_async_t _name = {\
              .p_rx_pool = &amp;amp;CONCAT_2(_name,_rx_pool),\
              .p_rx_queue =  &amp;amp;CONCAT_2(_name,_rxdata_queue),\
              /* If p_rtc is not NULL it means that RTC is used for RX timeout */ \
              .p_rtc = _LIBUARTE_ASYNC_EVAL(NRFX_CONCAT_3(NRFX_RTC, _rtc1_idx, _ENABLED), (&amp;amp;CONCAT_2(_name, _rtc)), (NULL)),\
              /* If p_timer is not NULL it means that RTC is used for RX timeout */ \
              .p_timer = _LIBUARTE_ASYNC_EVAL(NRFX_CONCAT_3(NRFX_TIMER, _timer1_idx, _ENABLED), (&amp;amp;CONCAT_2(_name, _timer)), (NULL)),\
              /* If p_time and p_rtc is NULL it means that app_timer is used for RX timeout */ \
              .p_app_timer = _LIBUARTE_ASYNC_EVAL(NRFX_CONCAT_3(NRFX_TIMER, _timer1_idx, _ENABLED),\
	                    (NULL),\
	                    (_LIBUARTE_ASYNC_EVAL(NRFX_CONCAT_3(NRFX_RTC, _rtc1_idx, _ENABLED),(NULL), \
	                         (&amp;amp;CONCAT_2(_name,_app_timer)))) \
	            ),\
              .p_app_timer_ctrl_blk = _LIBUARTE_ASYNC_EVAL(NRFX_CONCAT_3(NRFX_TIMER, _timer1_idx, _ENABLED),\
	                    (NULL),\
	                    (_LIBUARTE_ASYNC_EVAL(NRFX_CONCAT_3(NRFX_RTC, _rtc1_idx, _ENABLED),(NULL), \
	                         (&amp;amp;CONCAT_2(_name,_app_timer_ctrl_blk)))) \
	            ),\
              .p_libuarte = &amp;amp;CONCAT_2(_name, _libuarte),\
              .p_ctrl_blk = &amp;amp;CONCAT_2(_name, ctrl_blk),\
              .rx_buf_size = _rx_buf_size,\
              _LIBUARTE_ASYNC_EVAL(\
                  NRFX_CONCAT_3(NRFX_RTC, _rtc1_idx, _ENABLED),\
                  (.rtc_handler =CONCAT_2(_name, _rtc_handler)),\
                  ()\
              )\
      };\
      /* RTC compare event is not periodic but need to be enabled again in the callback. */ \
      _LIBUARTE_ASYNC_EVAL(\
          NRFX_CONCAT_3(NRFX_RTC, _rtc1_idx, _ENABLED),\
          (\
             static void CONCAT_2(_name, _rtc_handler)(nrfx_rtc_int_type_t int_type)\
             { \
               (void)nrfx_rtc_cc_set(_name.p_rtc, 0, _name.p_ctrl_blk-&amp;gt;timeout_us/32, true);\
               nrf_libuarte_async_timeout_handler(&amp;amp;_name);\
             }\
          ),\
          ()\
      )&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;I should define these instance first?&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt; * @param _uarte_idx   UARTE instance used.
 * @param _timer0_idx  TIMER instance used by libuarte for bytes counting.
 * @param _rtc1_idx    RTC instance used for timeout. If set to NRF_LIBUARTE_PERIPHERAL_NOT_USED
 *                     then TIMER instance is used or app_timer instance if _timer1_idx is also set
 *                     to NRF_LIBUARTE_PERIPHERAL_NOT_USED.
 * @param _timer1_idx  TIMER instance used for timeout. If set to NRF_LIBUARTE_PERIPHERAL_NOT_USED
 *                     then RTC instance is used or app_timer instance if _rtc1_idx is also set
 *                     to NRF_LIBUARTE_PERIPHERAL_NOT_USED.&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>