<?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>UARTE crash</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/102304/uarte-crash</link><description>Hi all, 
 When I use UARTE to transmit packet, I get the error like this. 
 
 The problematic code is as follows. 
 
 Since the question appears when debugging the whole machine, I can&amp;#39;t debug with Keil, just can get logs. 
 The action when the problem</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 03 Aug 2023 08:48:25 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/102304/uarte-crash" /><item><title>RE: UARTE crash</title><link>https://devzone.nordicsemi.com/thread/439633?ContentTypeID=1</link><pubDate>Thu, 03 Aug 2023 08:48:25 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:da9d2e2b-8bac-45e9-a05e-6e38eb64091c</guid><dc:creator>Lurn_Z</dc:creator><description>&lt;p&gt;OK, I will try it, thanks a lot.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: UARTE crash</title><link>https://devzone.nordicsemi.com/thread/439610?ContentTypeID=1</link><pubDate>Thu, 03 Aug 2023 07:13:56 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:04a19fbf-887a-4645-bc72-b214de4aff0d</guid><dc:creator>Susheel Nuguru</dc:creator><description>[quote user="Lurn_Z"]That is my bad, thanks for pointing this out. Maybe I should define a &amp;quot;RTC_TICKS_TO_US/MS&amp;quot;?[/quote]
&lt;p&gt;I think you should just use the RTC counter value..Tick is nothing else but an event generated at every increment of the counter. If you have configured the prescaler same for blink_rx_rtc and rtos_rtc , then the counter value and the rtos tick should be the same.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: UARTE crash</title><link>https://devzone.nordicsemi.com/thread/439430?ContentTypeID=1</link><pubDate>Wed, 02 Aug 2023 08:08:45 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:89757b09-4cb2-444f-bbe2-7a91411f72ab</guid><dc:creator>Lurn_Z</dc:creator><description>[quote userid="6207" url="~/f/nordic-q-a/102304/uarte-crash/439426"]Are you using some FIFO for uart buffers or are your tying to send the uart data synchronously one by one. It is understandable that if you try to send another packet while the first one is not processed (due to probably processing delays on your system, priority of uart driver etc) then the second one shows busy.[/quote]
&lt;p&gt;Yes, I realized the problem&amp;nbsp;yesterday, the best way is send the uart data synchronously one by one, but now &lt;span&gt;it throws error, and I&amp;#39;m using fifo to test it.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
[quote userid="6207" url="~/f/nordic-q-a/102304/uarte-crash/439426"]I am not sure what the prescaler here is. [/quote]
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;I am using the default RTC configuration.&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;#define NRFX_RTC_DEFAULT_CONFIG                                                     \
{                                                                                   \
    .prescaler          = RTC_FREQ_TO_PRESCALER(NRFX_RTC_DEFAULT_CONFIG_FREQUENCY), \
    .interrupt_priority = NRFX_RTC_DEFAULT_CONFIG_IRQ_PRIORITY,                     \
    .tick_latency       = NRFX_RTC_US_TO_TICKS(NRFX_RTC_MAXIMUM_LATENCY_US,         \
                                               NRFX_RTC_DEFAULT_CONFIG_FREQUENCY),  \
    .reliable           = NRFX_RTC_DEFAULT_CONFIG_RELIABLE,                         \
}&lt;/pre&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
[quote userid="6207" url="~/f/nordic-q-a/102304/uarte-crash/439426"]But using RTC_US_TO_TICKS is wrong when you are getting the rtc raw counter as the first argument.[/quote]
&lt;p&gt;&lt;span&gt;&lt;span&gt;&lt;span&gt;That is my bad, thanks for pointing this out. Maybe I should define a &amp;quot;RTC_TICKS_TO_US/MS&amp;quot;?&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: UARTE crash</title><link>https://devzone.nordicsemi.com/thread/439426?ContentTypeID=1</link><pubDate>Wed, 02 Aug 2023 07:49:02 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:111fd0e6-93e0-40bb-a619-1db92f903f8e</guid><dc:creator>Susheel Nuguru</dc:creator><description>[quote user="Lurn_Z"]&lt;blockquote&gt;&lt;div&gt;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/102304/uarte-crash/438874"&gt;Lurn_Z said:&lt;/a&gt;&lt;/div&gt;&lt;div&gt;it should be good in 32bytes per 1ms, but sometimes I will get error=17 (busy), and I will get a lot error = 17 in 64bytes per 1ms it should be good too, I don&amp;#39;t know why&lt;/div&gt;&lt;/blockquote&gt;&lt;div&gt;&lt;/div&gt;
&lt;p&gt;Can you consider what would affect it?&lt;/p&gt;[/quote]
&lt;p&gt;Are you using some FIFO for uart buffers or are your tying to send the uart data synchronously one by one. It is understandable that if you try to send another packet while the first one is not processed (due to probably processing delays on your system, priority of uart driver etc) then the second one shows busy.&lt;/p&gt;
&lt;p&gt;I would also double check the uart interrupt priorities and would use the max priority allowed for the application if throughput is most important for your use case.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;    NRF_LOG_DEBUG(&amp;quot;blink_rx_rtc = %d.&amp;quot;, RTC_US_TO_TICKS(nrf_drv_rtc_counter_get(&amp;amp;m_rtc), RTC_DEFAULT_CONFIG_FREQUENCY));&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;I am not sure what the prescaler here is. But using RTC_US_TO_TICKS is wrong when you are getting the rtc raw counter as the first argument.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: UARTE crash</title><link>https://devzone.nordicsemi.com/thread/438936?ContentTypeID=1</link><pubDate>Mon, 31 Jul 2023 09:22:40 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b6e72bf7-1502-49a5-8d21-e91e89dccc0b</guid><dc:creator>Lurn_Z</dc:creator><description>[quote userid="6207" url="~/f/nordic-q-a/102304/uarte-crash/438930"]You need to use the HWFC by using two extra pins (RTS/CTS) on both devices.[/quote]
&lt;p&gt;Sorry to say that another didn&amp;#39;t support HWFC. So I can&amp;#39;t use the HWFC&lt;/p&gt;
[quote userid="123170" url="~/f/nordic-q-a/102304/uarte-crash/438874"]it should be good in 32bytes per 1ms, but sometimes I will get error=17 (busy), and I will get a lot error = 17 in 64bytes per 1ms it should be good too, I don&amp;#39;t know why[/quote]
&lt;p&gt;Can you consider what would affect it?&lt;/p&gt;
&lt;p&gt;About the RTC interval, in &lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/99839/rtc-in-nrf52832"&gt;this link&lt;/a&gt;&amp;nbsp;I was said the different RTC have different interval, and you suggested me to start the RTC at same time, but&amp;nbsp;I forgot about this due to something,&amp;nbsp;Now I&amp;#39;m back on this question because of a sync issue.&lt;/p&gt;
&lt;p&gt;I used FreeRTOS, the FreeRTOS use the RTC1 in default. Now I use this code to config the RTC2 for test.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;static void blink_rx_rtc_handler(nrf_drv_rtc_int_type_t int_type)
{
    ret_code_t err_code;
    NRF_LOG_DEBUG(&amp;quot;blink_rx_rtc = %d.&amp;quot;, RTC_US_TO_TICKS(nrf_drv_rtc_counter_get(&amp;amp;m_rtc), RTC_DEFAULT_CONFIG_FREQUENCY));
    NRF_LOG_DEBUG(&amp;quot;rtos tick = %d.&amp;quot;, xTaskGetTickCountFromISR());
    err_code = nrf_drv_rtc_cc_set(&amp;amp;m_rtc, BLINK_RTC_CC, BLINK_RTC_TICKS, true);
    nrf_drv_rtc_counter_clear(&amp;amp;m_rtc);
    APP_ERROR_CHECK(err_code);
}

void ppi_get_radio_init(void)
{
    ret_code_t err_code;

    err_code = nrf_drv_rtc_init(&amp;amp;m_rtc, &amp;amp;m_rtc_config, blink_rx_rtc_handler);
    APP_ERROR_CHECK(err_code);
    nrf_gpio_cfg_output(18);
    err_code = nrf_drv_rtc_cc_set(&amp;amp;m_rtc, BLINK_RTC_CC, BLINK_RTC_TICKS, true);
    APP_ERROR_CHECK(err_code);
    nrf_drv_rtc_enable(&amp;amp;m_rtc);
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;In the callback handler, the log shows like this. The interval is 100ms.&lt;/p&gt;
&lt;p&gt;&lt;img style="max-height:240px;max-width:320px;" alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/pastedimage1690795088220v1.png" /&gt;&lt;/p&gt;
&lt;p&gt;So logs shows the rtos tick interval is 99~100 ms, but the interval of RTC2 is 107.&lt;span&gt;Do I need to do some conversions?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;And&amp;nbsp;I don&amp;#39;t think turning on the RTC at the same time will have any effect. Because&amp;nbsp;all values are for time intervals.&lt;/p&gt;
&lt;p&gt;How to calibrate(maybe ?) the RTC2?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: UARTE crash</title><link>https://devzone.nordicsemi.com/thread/438930?ContentTypeID=1</link><pubDate>Mon, 31 Jul 2023 09:05:55 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4c81b25b-afe6-42fe-844d-83138a67cfcf</guid><dc:creator>Susheel Nuguru</dc:creator><description>[quote user="Lurn_Z"]If use the HWFC, should I do any modify in hardware? And What configuration do I need to modify? Except change .hwfc&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = NRF_UARTE_HWFC_DISABLED to enable.[/quote]
&lt;p&gt;You need to use the HWFC by using two extra pins (RTS/CTS) on both devices. These pin numbers needs to be configured when initializing UART.&amp;nbsp; And else you need to change hwfc from disabled to enabled.&lt;/p&gt;
[quote user="Lurn_Z"]Can I use the PPI to trigger only once evnet? like when I get the event then I will enable the RTC2 via PPI. But just to enable it once time.[/quote]
&lt;p&gt;No, you cannot make a hardwired PPI connection trigger only once. If the timing between the event generated and enabling RTC2 is not super critical to you, then I would suggest you enable the interrupt for that event and in the interrupt handler you enable the RTC2 on the first trigger. After this you can disable the interrupt generation for that event to avoid re-enabling RTC2 for every event generation.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: UARTE crash</title><link>https://devzone.nordicsemi.com/thread/438874?ContentTypeID=1</link><pubDate>Mon, 31 Jul 2023 01:33:36 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:16ecba7e-151d-411b-9c6b-168a1c8da399</guid><dc:creator>Lurn_Z</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Yes, it should be good in 32bytes per 1ms, but sometimes I will get error=17 (busy), and I will get a lot error = 17 in 64bytes per 1ms it should be good too, I don&amp;#39;t know why. And I didn&amp;#39;t use the HWFC.&lt;/p&gt;
&lt;p&gt;If use the HWFC, should I do any modify in hardware? And What configuration do I need to modify? Except change .hwfc&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = NRF_UARTE_HWFC_DISABLED to enable.&lt;/p&gt;
&lt;p&gt;Update:&lt;/p&gt;
&lt;p&gt;Q2:&lt;/p&gt;
&lt;p&gt;Can I use the PPI to trigger only once evnet? like when I get the event then I will enable the RTC2 via PPI. But just to enable it once time.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: UARTE crash</title><link>https://devzone.nordicsemi.com/thread/438865?ContentTypeID=1</link><pubDate>Sun, 30 Jul 2023 13:29:40 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7369531d-1af4-4913-bbda-1d12fc88a16b</guid><dc:creator>Susheel Nuguru</dc:creator><description>[quote user="Lurn_Z"]&lt;p&gt;Q1:&lt;/p&gt;
&lt;div&gt;&lt;/div&gt;&lt;blockquote&gt;&lt;div&gt;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/102304/uarte-crash/438646"&gt;Lurn_Z said:&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;p&gt;Another question, did you have some suggestion to improve the speed to handle the packet when I send it via UARTE, or&amp;nbsp;&lt;span&gt;reduce delay in&amp;nbsp;sending or receiving data?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;Because I found that when I send 32bytes every 1ms, sometimes I will get the error = 17.&lt;/p&gt;
&lt;p&gt;&lt;span&gt;err_code&lt;/span&gt;&lt;span&gt; = &lt;/span&gt;&lt;span&gt;nrf_libuarte_async_tx&lt;/span&gt;&lt;span&gt;(&amp;amp;&lt;/span&gt;&lt;span&gt;libuarte&lt;/span&gt;&lt;span&gt;, &lt;/span&gt;&lt;span&gt;data_array&lt;/span&gt;&lt;span&gt;, &lt;/span&gt;&lt;span&gt;len&lt;/span&gt;&lt;span&gt;);&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;span&gt;But my&amp;nbsp;&lt;/span&gt;&lt;/span&gt;baudrate = 1000000, it is enough to send it.&lt;/p&gt;&lt;/div&gt;&lt;/blockquote&gt;[/quote]
&lt;p&gt;With the baudrate of 1000000 bits per second which is 125000 bytes per second you seems to be attempting to transfer 32000 bytes per second which should be decent. If you have HWFC enabled then maybe the peer UART might not be able to process the incoming bytes fast enough? I am not sure, but 32 bytes per 1ms seems pretty much doable on 1M baud rate.&lt;/p&gt;
[quote user="Lurn_Z"]If I want to use driver to set PPI, how can I get the address about this event?[/quote]
&lt;p&gt;Maybe you want to use the below API from&amp;nbsp;modules\nrfx\hal\nrf_radio.h&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;NRF_PPI-&amp;gt;CH[5].EEP = nrf_radio_event_address_get(NRF_RADIO_EVENT_CRCOK);&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: UARTE crash</title><link>https://devzone.nordicsemi.com/thread/438858?ContentTypeID=1</link><pubDate>Sun, 30 Jul 2023 10:36:54 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ba03b313-edfc-4750-9c9c-0f69b0a75f90</guid><dc:creator>Lurn_Z</dc:creator><description>&lt;p&gt;Hi Susheel，&lt;/p&gt;
&lt;p&gt;Actually, I still have two questions.&lt;/p&gt;
&lt;p&gt;Q1:&lt;/p&gt;
[quote userid="123170" url="~/f/nordic-q-a/102304/uarte-crash/438646"]&lt;p&gt;Another question, did you have some suggestion to improve the speed to handle the packet when I send it via UARTE, or&amp;nbsp;&lt;span&gt;reduce delay in&amp;nbsp;sending or receiving data?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;Because I found that when I send 32bytes every 1ms, sometimes I will get the error = 17.&lt;/p&gt;
&lt;p&gt;&lt;span&gt;err_code&lt;/span&gt;&lt;span&gt; = &lt;/span&gt;&lt;span&gt;nrf_libuarte_async_tx&lt;/span&gt;&lt;span&gt;(&amp;amp;&lt;/span&gt;&lt;span&gt;libuarte&lt;/span&gt;&lt;span&gt;, &lt;/span&gt;&lt;span&gt;data_array&lt;/span&gt;&lt;span&gt;, &lt;/span&gt;&lt;span&gt;len&lt;/span&gt;&lt;span&gt;);&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;span&gt;But my&amp;nbsp;&lt;/span&gt;&lt;/span&gt;baudrate = 1000000, it is enough to send it.&lt;/p&gt;[/quote]
&lt;p&gt;Q2:&lt;/p&gt;
[quote userid="123170" url="~/f/nordic-q-a/102304/uarte-crash/438703"]If I want to use driver to set PPI, how can I get the address about this event?[/quote]
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;NRF_PPI-&amp;gt;CH[5].EEP = (uint32_t)&amp;amp;NRF_RADIO-&amp;gt;EVENTS_CRCOK;&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Lurn&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: UARTE crash</title><link>https://devzone.nordicsemi.com/thread/438718?ContentTypeID=1</link><pubDate>Fri, 28 Jul 2023 10:17:03 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:859a8690-0a14-4263-a17c-5ae942634437</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;Thanks for letting us know the whole chain of debugging and a solution.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: UARTE crash</title><link>https://devzone.nordicsemi.com/thread/438703?ContentTypeID=1</link><pubDate>Fri, 28 Jul 2023 09:07:11 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:53dac0c0-496f-46dc-b739-7c81ce967044</guid><dc:creator>Lurn_Z</dc:creator><description>&lt;p&gt;Sorry I get something wrong I should reset the CC in callback handler.&lt;pre class="ui-code" data-mode="c_cpp"&gt;static void blink_rtc_handler(nrf_drv_rtc_int_type_t int_type)
{
    nrf_drv_rtc_counter_clear(&amp;amp;m_rtc);
    nrf_drv_rtc_cc_set(&amp;amp;m_rtc, BLINK_RTC_CC, BLINK_RTC_TICKS, true);
    NRF_LOG_DEBUG(&amp;quot;blink_rtc_handler.&amp;quot;);
    APP_ERROR_CHECK(err_code);
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Now it runs fine.&lt;/p&gt;
&lt;p&gt;If I want to use driver to set PPI, how can I get the address about this event?&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;NRF_PPI-&amp;gt;CH[5].EEP = (uint32_t)&amp;amp;NRF_RADIO-&amp;gt;EVENTS_CRCOK;&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;change it to use driver like this&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;nrf_drv_ppi_channel_assign(m_ppi_channel1,
                                          nrf_drv_timer_event_address_get(&amp;amp;m_timer1,
                                                                          NRF_TIMER_EVENT_COMPARE0),
                                          nrf_drv_timer_task_address_get(&amp;amp;m_timer0,
                                                                         NRF_TIMER_TASK_STOP));&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: UARTE crash</title><link>https://devzone.nordicsemi.com/thread/438694?ContentTypeID=1</link><pubDate>Fri, 28 Jul 2023 08:35:38 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8cac9ed2-579c-4214-ac81-b3928e305582</guid><dc:creator>Lurn_Z</dc:creator><description>&lt;p&gt;Sorry to say that I change from write the RTC registers&amp;nbsp;to use the rtc driver, the ERROR 0 [NRF_SUCCESS] &lt;span&gt;no longer&amp;nbsp;&lt;/span&gt;&lt;span&gt;occurs, and I will not get the all 0 data too.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;But when I use nrf_drv_rtc_counter_clear() to clear the RTC counter,&amp;nbsp;I found it didn&amp;#39;t work.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;static void blink_rtc_handler(nrf_drv_rtc_int_type_t int_type)
{
    nrf_drv_rtc_counter_clear(&amp;amp;m_rtc);
    NRF_LOG_DEBUG(&amp;quot;blink_rtc_handler.&amp;quot;);
    APP_ERROR_CHECK(err_code);
}

void ppi_rtc2_init(void)
{
    ret_code_t err_code;

    err_code = nrf_drv_rtc_init(&amp;amp;m_rtc, &amp;amp;m_rtc_config, blink_rtc_handler);
    APP_ERROR_CHECK(err_code);
    err_code = nrf_drv_rtc_cc_set(&amp;amp;m_rtc, BLINK_RTC_CC, BLINK_RTC_TICKS, true);
    APP_ERROR_CHECK(err_code);
    nrf_drv_rtc_enable(&amp;amp;m_rtc);
}&lt;/pre&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;I can&amp;#39;t clear the RTC counter in the rtc handler by&amp;nbsp;nrf_drv_rtc_counter_clear().&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;what&amp;#39;s wrong with it?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Best regards&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: UARTE crash</title><link>https://devzone.nordicsemi.com/thread/438674?ContentTypeID=1</link><pubDate>Fri, 28 Jul 2023 07:05:59 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1d7e94f3-3fd5-4337-aa12-59e74cadcd4f</guid><dc:creator>Lurn_Z</dc:creator><description>&lt;p&gt;I think the question is caused by PPI/RTC2, but I don&amp;#39;t know why, because my uarte used RTC0.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;
void SWI3_EGU3_IRQHandler(void)
{
    /* Clear event register */
    NRF_EGU3-&amp;gt;EVENTS_TRIGGERED[0] = 0;
    // to do
}

void SWI5_EGU5_IRQHandler(void)
{
    /* Clear event register */
    NRF_EGU5-&amp;gt;EVENTS_TRIGGERED[0] = 0;
    NRF_RTC2-&amp;gt;TASKS_CLEAR = 1;
    NRF_RTC2-&amp;gt;TASKS_START = 1;
    // NRF_LOG_DEBUG(&amp;quot;NRF_RTC2-&amp;gt;TASKS_START.&amp;quot;);
}

static void gpiote_init(void)
{
    NRF_GPIOTE-&amp;gt;CONFIG[1] = (GPIOTE_CONFIG_POLARITY_LoToHi &amp;lt;&amp;lt; GPIOTE_CONFIG_POLARITY_Pos)
                            | (18 &amp;lt;&amp;lt; GPIOTE_CONFIG_PSEL_Pos)
                            | (GPIOTE_CONFIG_MODE_Event &amp;lt;&amp;lt; GPIOTE_CONFIG_MODE_Pos);
}


/** @brief Function for initializing the PPI peripheral.
 */
void ppi_rtc2_init(void)
{
    gpiote_init();
    /* 6 is the default int. priority used in SDK drivers */
    NVIC_SetPriority(SWI5_EGU5_IRQn, 6);
    NVIC_EnableIRQ(SWI5_EGU5_IRQn);

    NRF_EGU5-&amp;gt;INTENSET = EGU_INTEN_TRIGGERED0_Msk;

    NRF_PPI-&amp;gt;CH[6].EEP = (uint32_t)&amp;amp;NRF_GPIOTE-&amp;gt;EVENTS_IN[1];
    NRF_PPI-&amp;gt;CH[6].TEP = (uint32_t)&amp;amp;NRF_EGU5-&amp;gt;TASKS_TRIGGER[0];
    NRF_PPI-&amp;gt;CHENSET = PPI_CHENSET_CH6_Msk;

    NRF_RTC2-&amp;gt;CC[0] = RTC_US_TO_TICKS(SYNC_CYCLE_TIME, RTC_DEFAULT_CONFIG_FREQUENCY);
    NRF_RTC2-&amp;gt;INTENSET = RTC_INTENSET_COMPARE0_Msk;
    /* Event signal must be enabled explicitly unlike most other peripherals */
    NRF_RTC2-&amp;gt;EVTENSET = RTC_EVTEN_COMPARE0_Msk;

    /* 6 is the default int. priority used in SDK drivers */
    NVIC_SetPriority(SWI3_EGU3_IRQn, 6);
    NVIC_EnableIRQ(SWI3_EGU3_IRQn);

    NRF_EGU3-&amp;gt;INTENSET = EGU_INTEN_TRIGGERED0_Msk;

    NRF_PPI-&amp;gt;CH[4].EEP = (uint32_t)&amp;amp;NRF_RTC2-&amp;gt;EVENTS_COMPARE[0];
    NRF_PPI-&amp;gt;CH[4].TEP = (uint32_t)&amp;amp;NRF_EGU3-&amp;gt;TASKS_TRIGGER[0];
    /* RTC does not have a SHORT to clear counter on compare match
       so using PPI instead */
    NRF_PPI-&amp;gt;FORK[4].TEP = (uint32_t)&amp;amp;NRF_RTC2-&amp;gt;TASKS_CLEAR;

    NRF_PPI-&amp;gt;CHENSET = PPI_CHENSET_CH4_Msk;
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;when I call the&amp;nbsp;ppi_rtc2_init() to config the PPI and RTC2, I will get the the ERROR 0 [NRF_SUCCESS], and get some packets&amp;nbsp;get some data packets with all 0 data.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: UARTE crash</title><link>https://devzone.nordicsemi.com/thread/438646?ContentTypeID=1</link><pubDate>Fri, 28 Jul 2023 01:16:53 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7231718b-c03c-4879-9805-f8a8eae680fc</guid><dc:creator>Lurn_Z</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;You can see my callback handler, I do call the&amp;nbsp;&lt;strong&gt;nrf_libuarte_async_rx_free.&amp;nbsp;&lt;/strong&gt;But I still get the error.&lt;/p&gt;
&lt;p&gt;Another question, did you have some suggestion to improve the speed to handle the packet when I send it via UARTE, or&amp;nbsp;&lt;span&gt;reduce delay in&amp;nbsp;sending or receiving data?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;Because I found that when I send 32bytes every 1ms, sometimes I will get the error = 17.&lt;/p&gt;
&lt;p&gt;&lt;span&gt;err_code&lt;/span&gt;&lt;span&gt; = &lt;/span&gt;&lt;span&gt;nrf_libuarte_async_tx&lt;/span&gt;&lt;span&gt;(&amp;amp;&lt;/span&gt;&lt;span&gt;libuarte&lt;/span&gt;&lt;span&gt;, &lt;/span&gt;&lt;span&gt;data_array&lt;/span&gt;&lt;span&gt;, &lt;/span&gt;&lt;span&gt;len&lt;/span&gt;&lt;span&gt;);&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;span&gt;But my&amp;nbsp;&lt;/span&gt;&lt;/span&gt;baudrate = 1000000, it is enough to send it.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Lurn&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: UARTE crash</title><link>https://devzone.nordicsemi.com/thread/438568?ContentTypeID=1</link><pubDate>Thu, 27 Jul 2023 14:26:09 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ea39e8aa-bc95-43ae-b505-76c0ef6ad68b</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;This looks very much like the issue in &lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/82436/error-0-nrf_success-occurs-after-rx-receives-a-fixed-amount"&gt;this thread&lt;/a&gt;. You need to call&amp;nbsp;&lt;strong&gt;nrf_libuarte_async_rx_free&amp;nbsp;&lt;/strong&gt;in the uart callback handler&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: UARTE crash</title><link>https://devzone.nordicsemi.com/thread/438475?ContentTypeID=1</link><pubDate>Thu, 27 Jul 2023 10:06:22 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8b2af9dc-f011-4e64-8627-e1dd2efd1b61</guid><dc:creator>Lurn_Z</dc:creator><description>&lt;p&gt;And the irq handler.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;
void uart_event_handler(void *context, nrf_libuarte_async_evt_t *p_evt)
{
    nrf_libuarte_async_t *p_libuarte = (nrf_libuarte_async_t *)context;
    ret_code_t ret;
    buffer_t buf;
    switch (p_evt-&amp;gt;type)
    {
        case NRF_LIBUARTE_ASYNC_EVT_ERROR:
            UART_PRINTF(&amp;quot;NRF_LIBUARTE_ASYNC_EVT_ERROR = %d.&amp;quot;, p_evt-&amp;gt;data.errorsrc);
            break;
        case NRF_LIBUARTE_ASYNC_EVT_RX_DATA:
            memcpy(buf.p_data, p_evt-&amp;gt;data.rxtx.p_data, p_evt-&amp;gt;data.rxtx.length);
            buf.length = p_evt-&amp;gt;data.rxtx.length;
            ret = nrf_queue_push(&amp;amp;m_buf_queue, &amp;amp;buf);
            if (ret != NRF_SUCCESS)
                UART_PRINTF(&amp;quot;In%s %d err_code = %d.&amp;quot;, __func__, __LINE__, ret);
            // free the rx buffer
            nrf_libuarte_async_rx_free(p_libuarte, p_evt-&amp;gt;data.rxtx.p_data, p_evt-&amp;gt;data.rxtx.length);
            break;
        case NRF_LIBUARTE_ASYNC_EVT_TX_DONE:
            break;
        default:
            UART_PRINTF(&amp;quot;Unexpected LibUarte Event = %d.&amp;quot;, p_evt-&amp;gt;type);
            break;
    }
}&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>