<?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>UART k_fifo_get lose bytes of data from response</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/107641/uart-k_fifo_get-lose-bytes-of-data-from-response</link><description>Modyfying NUS example, I created a thread to send requests every second via uart_poll_out, then for 250ms read all data from thread to the buff as in code below: 
 For small response frame TMP (15 bytes) - everything works correctly For other frame MAIN</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 24 Jan 2024 11:14:38 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/107641/uart-k_fifo_get-lose-bytes-of-data-from-response" /><item><title>RE: UART k_fifo_get lose bytes of data from response</title><link>https://devzone.nordicsemi.com/thread/465767?ContentTypeID=1</link><pubDate>Wed, 24 Jan 2024 11:14:38 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ffa174a2-8830-414b-bce8-b54b33bfa25b</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;The only relevant setting I see here is the CONFIG_SERIAL option, which enables the serial driver. However, to pinpoint the root cause of the issue, it would be helpful to include more logging from the UART async callback to determine where it is failing. It might also be beneficial to use a debugger to read out the receive buffers and verify if any bytes are missing from them. Have you made any modifications to&amp;nbsp;the orginal UART callback?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: UART k_fifo_get lose bytes of data from response</title><link>https://devzone.nordicsemi.com/thread/465600?ContentTypeID=1</link><pubDate>Tue, 23 Jan 2024 13:57:02 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a1995c86-ef79-437e-af33-b3cb39e12d48</guid><dc:creator>Mati</dc:creator><description>&lt;p&gt;Differences in prj.config (the old one below):&lt;br /&gt;CONFIG_BT_SETTINGS=y&lt;br /&gt;CONFIG_FLASH=y&lt;br /&gt;CONFIG_FLASH_PAGE_LAYOUT=y&lt;br /&gt;CONFIG_FLASH_MAP=y&lt;br /&gt;CONFIG_NVS=y&lt;br /&gt;CONFIG_SETTINGS=y&lt;br /&gt;&lt;span class="diff-chunk_chunk__FCDi6 diff-chunk_inserted__ofOec"&gt;CONFIG_MAIN_STACK_SIZE=1152&lt;/span&gt;&lt;br /&gt;&lt;span class="diff-chunk_chunk__FCDi6 diff-chunk_inserted__ofOec"&gt;CONFIG_SERIAL=y&lt;br /&gt;&lt;/span&gt;&lt;span class="diff-chunk_chunk__FCDi6 diff-chunk_inserted__ofOec"&gt;CONFIG_GPIO=y&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: UART k_fifo_get lose bytes of data from response</title><link>https://devzone.nordicsemi.com/thread/465595?ContentTypeID=1</link><pubDate>Tue, 23 Jan 2024 13:53:38 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:86f36ba0-5b59-4b95-936f-c17c0129cf5d</guid><dc:creator>Mati</dc:creator><description>&lt;p&gt;... All data is basically gathered using code snippet above (with EOL data check to break loop faster)&lt;br /&gt;&lt;br /&gt;With configuration line for anomaly 198 all data is received correctly as below (41 bytes, calculatec and compared CRC pass):&lt;br /&gt;```&lt;br /&gt;[00:01:58.116,760] &amp;lt;inf&amp;gt; QWERTY: Cells bytes read = 41&lt;br /&gt;[00:01:58.116,790] &amp;lt;inf&amp;gt; QWERTY: Data: 22 02 08 21 10 0c ea 0d 06 0d&lt;br /&gt;[00:01:58.116,790] &amp;lt;inf&amp;gt; QWERTY: Data: 0a 0d 02 0d 08 0d 09 0d 09 0d&lt;br /&gt;[00:01:58.116,821] &amp;lt;inf&amp;gt; QWERTY: Data: 07 0d 05 0d 06 0d 07 0d 03 0d&lt;br /&gt;[00:01:58.116,851] &amp;lt;inf&amp;gt; QWERTY: Data: 04 0d 04 0d 04 0d 03 bd af 0d&lt;br /&gt;[00:01:58.116,851] &amp;lt;inf&amp;gt; QWERTY: Data: 0a 00 00 00 00 00 00 00 00 00&lt;br /&gt;[00:01:58.116,973] &amp;lt;inf&amp;gt; QWERTY: CELLS CRC PASS: bdaf&lt;br /&gt;```&lt;br /&gt;Without &lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/2.5.1/kconfig/index.html#CONFIG_NRF52_ANOMALY_198_WORKAROUND"&gt;CONFIG_NRF52_ANOMALY_198_WORKAROUND&lt;/a&gt; configuration line I got (al least previously - I specially get device with program writen previously and after uncommenting &lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/2.5.1/kconfig/index.html#CONFIG_NRF52_ANOMALY_198_WORKAROUND"&gt;CONFIG_NRF52_ANOMALY_198_WORKAROUND&lt;/a&gt; it worked as below... I removed build, checked if it is same as previous configuration, configured it and it is working corerectly... after I made git checkout to the prevoius commit compiled and upload,there are missing bytes as below, yet &lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/2.5.1/kconfig/index.html#CONFIG_NRF52_ANOMALY_198_WORKAROUND"&gt;CONFIG_NRF52_ANOMALY_198_WORKAROUND&lt;/a&gt; didnt made a change, thus it is (possibly) not this - I need to compare prj.conf and derive probable cause for loss of bytes...) data as below:&lt;br /&gt;```&lt;br /&gt;[00:00:12.108,978] &amp;lt;inf&amp;gt; QWERTY: Cells bytes read = 37&lt;br /&gt;[00:00:12.109,008] &amp;lt;inf&amp;gt; QWERTY: Data: 22 02 08 21 10 0c ea 0d 06 0d&lt;br /&gt;[00:00:12.109,039] &amp;lt;inf&amp;gt; QWERTY: Data: 0a 0d 02 08 0d 0a 0d 09 0d 08&lt;br /&gt;[00:00:12.109,039] &amp;lt;inf&amp;gt; QWERTY: Data: 05 0d 05 0d 07 0d 03 04 0d 04&lt;br /&gt;[00:00:12.109,100] &amp;lt;inf&amp;gt; QWERTY: Data: 0d 04 0d 02 ae 0d 0a 00 00 00&lt;br /&gt;[00:00:12.109,130] &amp;lt;inf&amp;gt; QWERTY: Data: 00 00 00 00 00 00 00 00 00 00&lt;br /&gt;[00:00:12.109,283] &amp;lt;inf&amp;gt; QWERTY: CELLS CRC ERROR: 9129 ;BMS CRC: 0000&lt;br /&gt;```&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: UART k_fifo_get lose bytes of data from response</title><link>https://devzone.nordicsemi.com/thread/465582?ContentTypeID=1</link><pubDate>Tue, 23 Jan 2024 13:24:29 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b151c65e-cede-4063-a71b-70c123c44d33</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Thanks for the update, but I&amp;#39;m not sure&amp;nbsp;how this fixed the problem. This Kconfig symbol enables the workaround for&amp;nbsp;&lt;a href="https://infocenter.nordicsemi.com/topic/errata_nRF52840_Rev3/ERR/nRF52840/Rev3/latest/anomaly_840_198.html?cp=5_0_1_0_1_28"&gt;[198] SPIM: SPIM3 transmit data might be corrupted&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/2.5.1/kconfig/index.html#CONFIG_NRF52_ANOMALY_198_WORKAROUND"&gt;CONFIG_NRF52_ANOMALY_198_WORKAROUND&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: UART k_fifo_get lose bytes of data from response</title><link>https://devzone.nordicsemi.com/thread/465578?ContentTypeID=1</link><pubDate>Tue, 23 Jan 2024 13:19:53 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8678eaf9-5ba1-4631-b37c-39259a5cfb65</guid><dc:creator>Mati</dc:creator><description>&lt;p&gt;... it seems that anomaly 198 is also on this chip (or whole line 52?) - after adding line below everything works fine&lt;br /&gt;&lt;br /&gt;CONFIG_NRF52_ANOMALY_198_WORKAROUND=y&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: UART k_fifo_get lose bytes of data from response</title><link>https://devzone.nordicsemi.com/thread/465353?ContentTypeID=1</link><pubDate>Mon, 22 Jan 2024 13:54:53 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6dda9005-bea6-4c54-ba51-50058cdde0d0</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;I&amp;#39;m not able to spot any problems with the code snippet you posted. To further debug this issue, I recommend adding more logging to the code to help determine where the bytes are being lost.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Note: the debug logs are printed over RTT.&amp;nbsp;&lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/samples/bluetooth/peripheral_uart/README.html#debugging"&gt;https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/samples/bluetooth/peripheral_uart/README.html#debugging&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Vidar&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>