<?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>libuarte issue: nrf_balloc_alloc retuns NULL after a while.</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/63905/libuarte-issue-nrf_balloc_alloc-retuns-null-after-a-while</link><description>Hi. 
 I&amp;#39;m having an issue with the libuarte library. It seems to work perfectly but after some hours of running the program crashes because nrf_balloc_alloc returns NULL inside the rx_buffer_scheduile function which is called from the uart_evt_handler</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 01 Oct 2020 02:52:24 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/63905/libuarte-issue-nrf_balloc_alloc-retuns-null-after-a-while" /><item><title>RE: libuarte issue: nrf_balloc_alloc retuns NULL after a while.</title><link>https://devzone.nordicsemi.com/thread/272401?ContentTypeID=1</link><pubDate>Thu, 01 Oct 2020 02:52:24 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:28872f94-7335-4df1-a799-de703f6b66de</guid><dc:creator>cwmoreiras</dc:creator><description>&lt;p&gt;Thank you! Yes I resolved my problem. It was something different from yours. Appreciate the response though!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: libuarte issue: nrf_balloc_alloc retuns NULL after a while.</title><link>https://devzone.nordicsemi.com/thread/272400?ContentTypeID=1</link><pubDate>Thu, 01 Oct 2020 00:27:47 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5309ee41-aa08-404e-8d38-bd8e62064b80</guid><dc:creator>wozix</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;yes, I was able to solve this. I don&amp;#39;t remember exactly how but I think it had something to do with the timers assigned to the LIBUARTE library or to ESB. I reviewed the timers and did some changes and it got fixed. I did try many things and nothing worked.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;But maybe your issue is different, I only got a NULL once every several hours of constant activity. Was pretty rare so was really hard to debug.&lt;/p&gt;
&lt;p&gt;regards.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: libuarte issue: nrf_balloc_alloc retuns NULL after a while.</title><link>https://devzone.nordicsemi.com/thread/272384?ContentTypeID=1</link><pubDate>Wed, 30 Sep 2020 17:25:29 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4cec114e-2e92-4a1c-9a6f-8ed598b5784b</guid><dc:creator>cwmoreiras</dc:creator><description>&lt;p&gt;Were you able to resolve this issue? I am attempting to use libuarte with ESB and nrf_balloc_alloc returns NULL every time.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: libuarte issue: nrf_balloc_alloc retuns NULL after a while.</title><link>https://devzone.nordicsemi.com/thread/261528?ContentTypeID=1</link><pubDate>Fri, 24 Jul 2020 08:37:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5291d69d-b248-40b2-b1fe-917cb03500d5</guid><dc:creator>&amp;#216;yvind</dc:creator><description>&lt;p&gt;I&amp;#39;m sorry for not answering your ticket. We are currently swamped with tickets, and I have not had the time to reproduce errors. I will need to start looking at this on Monday when more of our resources are back.&amp;nbsp;&lt;br /&gt;&lt;br /&gt;Sorry for the inconvenience this may cause.&amp;nbsp;&lt;br /&gt;&lt;br /&gt;Kind regards,&lt;br /&gt;Øyvind&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: libuarte issue: nrf_balloc_alloc retuns NULL after a while.</title><link>https://devzone.nordicsemi.com/thread/261290?ContentTypeID=1</link><pubDate>Thu, 23 Jul 2020 04:31:57 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:98c5c5f4-b42c-4db1-a0fb-3e4a44a42afd</guid><dc:creator>wozix</dc:creator><description>&lt;p&gt;I think it&amp;#39;s related to the ESB library. I&amp;#39;m also using that in the project. Probably a timer or PPI channel??&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&amp;Oslash;yvind, what parts of the ESB library do you think can conflict with the Libuarte library?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Thanks.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: libuarte issue: nrf_balloc_alloc retuns NULL after a while.</title><link>https://devzone.nordicsemi.com/thread/261214?ContentTypeID=1</link><pubDate>Wed, 22 Jul 2020 13:33:36 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d593fc6e-7e71-4722-a10f-fb1aeda8afeb</guid><dc:creator>wozix</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;It&amp;#39;s SDK 16.0&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I do not have the steps to reproduce this. The project is kind of complex (lots of code) and the issue happens once every 2-4 hours randomly.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I disabled (commented) many parts of the project to start narrowing the issue. I now think it&amp;#39;s related to other parts of the project, probably a timer.&lt;/p&gt;
&lt;p&gt;I left it running all the night and the issue never happened. So now I&amp;#39;m uncommenting (enabling) other modules in the project to see if it happens again and probably narrow it.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;But probably I won&amp;#39;t be able to tell you an exact way to reproduce so we might just need to deduce what is happening with the evidence I&amp;#39;m getting.&lt;/p&gt;
&lt;p&gt;Thanks.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: libuarte issue: nrf_balloc_alloc retuns NULL after a while.</title><link>https://devzone.nordicsemi.com/thread/261151?ContentTypeID=1</link><pubDate>Wed, 22 Jul 2020 09:30:38 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9963b08e-de99-4956-9360-e1fe37bca541</guid><dc:creator>&amp;#216;yvind</dc:creator><description>&lt;p&gt;Hi,&amp;nbsp;&lt;br /&gt;&lt;br /&gt;I could not see what SDK you are using. Can you please provide some details on how I can reproduce this issue?&lt;/p&gt;
&lt;p&gt;Thanks!&lt;br /&gt;&lt;br /&gt;-Øyvind&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: libuarte issue: nrf_balloc_alloc retuns NULL after a while.</title><link>https://devzone.nordicsemi.com/thread/261020?ContentTypeID=1</link><pubDate>Tue, 21 Jul 2020 14:27:11 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:15c32ff5-5a5f-4030-b3b7-613c4aa564da</guid><dc:creator>wozix</dc:creator><description>&lt;p&gt;Thanks&amp;nbsp;&lt;span&gt;&amp;Oslash;yvind,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;More information (probably useful). The received data from the UART is fine, I connected a logic analyzer and there were no framing errors and also there was no data overrun, less than 200 bytes were received between the last successful receptions and when the libuarte overrun gets triggered.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;I configured the libuarte with (5) 255 byte buffers so we should have enough space.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Somehow I think this is either DMA related or a timer related issue, where it&amp;#39;s counting more bytes than it actually received.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Any additional&amp;nbsp;idea on what I can test?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Thanks.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: libuarte issue: nrf_balloc_alloc retuns NULL after a while.</title><link>https://devzone.nordicsemi.com/thread/260920?ContentTypeID=1</link><pubDate>Tue, 21 Jul 2020 07:59:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:56fe1d3c-ae13-4c1f-aaf2-fe43877c30e1</guid><dc:creator>&amp;#216;yvind</dc:creator><description>&lt;p&gt;Hello,&amp;nbsp;&lt;br /&gt;&lt;br /&gt;My apologies for the late reply. Our team is currently understaffed due to summer vacations.&amp;nbsp;I will have a look at your case within today or tomorrow.&amp;nbsp;&lt;br /&gt;&lt;br /&gt;Sorry for the inconvenience.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Kind regards,&lt;br /&gt;Øyvind&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: libuarte issue: nrf_balloc_alloc retuns NULL after a while.</title><link>https://devzone.nordicsemi.com/thread/260864?ContentTypeID=1</link><pubDate>Mon, 20 Jul 2020 15:41:56 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:bafca165-d930-41ca-bc0a-6961cd6ddd2d</guid><dc:creator>wozix</dc:creator><description>&lt;p&gt;More info.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;When I reinit the libuarte async driver, it works for like 5-6 receptions and then it crashes, but there is something strange.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Usually the RX buffers I get are in the range of&amp;nbsp;&lt;strong&gt;0x20005A00&lt;/strong&gt; to&amp;nbsp;&lt;strong&gt;0x20005D00&lt;/strong&gt;, but after some receptions I get buffers in the range&amp;nbsp;&lt;strong&gt;0x2000FF00&lt;/strong&gt; onwards and that is when it crashes, probably goes above the&amp;nbsp;&lt;strong&gt;0x20010000&lt;/strong&gt; address but I have no idea why it goes there. I tried putting a flag in the libuarte library so that it only inits the nrf_balloc once (even if I call uninit and init again for the libuarte) but that didn&amp;#39;t help.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I hope this information is useful and thanks in advance for any help.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: libuarte issue: nrf_balloc_alloc retuns NULL after a while.</title><link>https://devzone.nordicsemi.com/thread/260722?ContentTypeID=1</link><pubDate>Mon, 20 Jul 2020 01:52:07 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7568d24a-e396-4bc1-8cb7-63b6a56aeae4</guid><dc:creator>wozix</dc:creator><description>&lt;p&gt;I activated the debug logs in the libuarte library and I got the following:&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;RX buf response (mp_next_rx not NULL:0x20005AC4), Provided buffer:0x20005BC4
(evt) RX dma_cnt:4294901761, endrx_cnt:0, stop_cnt:0
RX END chunk0:255, chunk1:-65790, data[0]=13 10
Freeing full buffer 0x20005CC4, 255, (currently allocated:2).
RX END Chunk1:-65790&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;dma_cnt:&amp;nbsp;4294901761 is&amp;nbsp;&lt;span&gt;0xFFFF0001 (which appear to be a rater specific value, could it be a -1 in 16 bit?).&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;I believe this overrun is not an uart overrun but instead a library defined overrun since the dma read more bytes that it could handle?&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;By the way, I am not using a Soft Device. I&amp;#39;m not using BLE.&lt;/p&gt;
&lt;p&gt;Any ideas?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thanks&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: libuarte issue: nrf_balloc_alloc retuns NULL after a while.</title><link>https://devzone.nordicsemi.com/thread/260717?ContentTypeID=1</link><pubDate>Sun, 19 Jul 2020 19:53:10 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:34a5aaae-643d-4538-99ec-c938ce49d5bf</guid><dc:creator>wozix</dc:creator><description>&lt;p&gt;I tried calling libuarte uninit and init inside the overrun case in the event handler but it later crashes when I try to access the data of received data from UART, so I guess that&amp;#39;s not the right way of doing it.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Does anyone know how to clear or handle the LIBUARTE OVERRUN error? I was not able to find in the documentation the proper way of handling it. In other architectures I used to clear the flag and&amp;nbsp;reenable the receiver. But I&amp;#39;m not sure how to do something similar with the libuarte async library.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thanks!!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: libuarte issue: nrf_balloc_alloc retuns NULL after a while.</title><link>https://devzone.nordicsemi.com/thread/260700?ContentTypeID=1</link><pubDate>Sun, 19 Jul 2020 02:55:54 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c7c453a2-870a-4905-9900-bb837576da4b</guid><dc:creator>wozix</dc:creator><description>&lt;p&gt;I did some more testing.&lt;/p&gt;
&lt;p&gt;This happens after I get an&amp;nbsp;NRF_LIBUARTE_ASYNC_EVT_OVERRUN_ERROR error, so obviously I&amp;#39;m not handling the error correctly.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;When I get an&amp;nbsp;NRF_LIBUARTE_ASYNC_EVT_OVERRUN_ERROR, what should I do?? Should I clear manually the error registers? or should I uninit and reinit the libuarte?&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;Thanks.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>