<?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>NRF9160 problem with rx buffer in lpuart sample</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/86727/nrf9160-problem-with-rx-buffer-in-lpuart-sample</link><description>Hello! I&amp;#39;m trying to use this low power UART sample: https://developer.nordicsemi.com/nRF_Connect_SDK/doc/1.9.1/nrf/samples/peripheral/lpuart/README.html I have a problem when I try to read data from rx buffer as is done in the example. The problem is</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 08 Apr 2022 06:13:33 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/86727/nrf9160-problem-with-rx-buffer-in-lpuart-sample" /><item><title>RE: NRF9160 problem with rx buffer in lpuart sample</title><link>https://devzone.nordicsemi.com/thread/362482?ContentTypeID=1</link><pubDate>Fri, 08 Apr 2022 06:13:33 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:fad58883-afe9-47fa-8a66-7d724b105c0f</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;There was just &lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/85128/uart-wrong-offset-after-buffer-overflow/362477#362477"&gt;a reply&lt;/a&gt; in &lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/85128/uart-wrong-offset-after-buffer-overflow"&gt;this thread&lt;/a&gt; that may be relevant.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF9160 problem with rx buffer in lpuart sample</title><link>https://devzone.nordicsemi.com/thread/362317?ContentTypeID=1</link><pubDate>Thu, 07 Apr 2022 11:28:39 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1e61b7f1-b73f-4d59-9f44-582cb0d5c38d</guid><dc:creator>MaLu</dc:creator><description>&lt;p&gt;Hi,&lt;br /&gt;asuming you are&amp;nbsp; using the uart in &amp;quot;async&amp;quot; mode, you should get an offset in the callback in&amp;nbsp;&lt;code&gt;&lt;span&gt;evt&lt;/span&gt;&lt;span&gt;-&amp;gt;&lt;/span&gt;&lt;span&gt;data&lt;/span&gt;&lt;span&gt;.&lt;/span&gt;&lt;span&gt;rx&lt;/span&gt;&lt;span&gt;.&lt;/span&gt;&lt;/code&gt;&lt;span&gt;&lt;code&gt;offset&lt;/code&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;The following is the&amp;nbsp;&lt;code&gt;&lt;span&gt;evt&lt;/span&gt;&lt;span&gt;-&amp;gt;&lt;/span&gt;&lt;span&gt;data&lt;/span&gt;&lt;span&gt;.&lt;/span&gt;&lt;/code&gt;&lt;span&gt;&lt;code&gt;rx&lt;/code&gt; structure&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;/**
 * @brief UART RX event data.
 *
 * The data represented by the event is stored in rx.buf[rx.offset] to
 * rx.buf[rx.offset+rx.len].  That is, the length is relative to the offset.
 */
struct uart_event_rx {
	/** @brief Pointer to current buffer. */
	uint8_t *buf;
	/** @brief Currently received data offset in bytes. */
	size_t offset;
	/** @brief Number of new bytes received. */
	size_t len;
};&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;In case you are using &amp;quot;interrupt driven&amp;quot; mode, I cannot help you, as I have never used it. (I am not nordic staff btw, you should also wait for an aswer from them)&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>