<?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 skipping characters?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/65815/uart-skipping-characters</link><description>Dear Community; 
 
 I am trying to read serial data sent by a PMS 5003 in hexadecimal. If I connect the PMS 5003 to a conventional serial device (Raspberry) this is what I read: 
 
 42 4d 00 1c 00 07 00 0a 00 0a 00 07 00 0a 00 0a 04 38 01 59 00 30 00</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 21 Sep 2020 14:29:10 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/65815/uart-skipping-characters" /><item><title>RE: UART skipping characters?</title><link>https://devzone.nordicsemi.com/thread/270643?ContentTypeID=1</link><pubDate>Mon, 21 Sep 2020 14:29:10 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:540fac1d-31f1-4d39-9536-4d0a2c3f0552</guid><dc:creator>isurki</dc:creator><description>&lt;p&gt;Hi Heidi,&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I managed to read all 32 bytes using as reference &amp;quot;test_uart_fifo.c&amp;quot; example provided under /zephyr/tests/drivers/uart/uart_basic_api/src/&lt;/p&gt;
&lt;p&gt;Regards,&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Ander.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: UART skipping characters?</title><link>https://devzone.nordicsemi.com/thread/270503?ContentTypeID=1</link><pubDate>Mon, 21 Sep 2020 08:54:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6fc0d583-2cd5-4319-b055-7cb8b3c4b35a</guid><dc:creator>Heidi</dc:creator><description>&lt;p&gt;Okay, thank you for trying.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I&amp;#39;m pretty sure it&amp;#39;s reading out the data faster than it is sent. So&amp;nbsp;try reading out the information byte for byte instead of 1024 at once, and then storing that in a buffer to read out after?&amp;nbsp;&lt;/p&gt;
&lt;p&gt;As long as data_length comes back non-zero:&lt;/p&gt;
&lt;p&gt;-Read out one byte&lt;br /&gt;-Store in buffer[count]&lt;br /&gt;-Count++&lt;/p&gt;
&lt;p&gt;Then read out buffer after.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: UART skipping characters?</title><link>https://devzone.nordicsemi.com/thread/270006?ContentTypeID=1</link><pubDate>Thu, 17 Sep 2020 08:31:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:602ff2fb-127f-45f5-922e-eb22a051b396</guid><dc:creator>isurki</dc:creator><description>&lt;p&gt;Hi;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I have tried your suggestion and I am reading &amp;quot;BM?z??&amp;quot; from UART.&amp;nbsp; Letter &amp;quot;B&amp;quot; is 42 interpreted as ASCII, &amp;quot;M&amp;quot; is 4d... but some characters are left.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;According to the datasheet, and proven on the Raspberry, I should read&amp;nbsp; 32 bytes of data.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thanks for your answer.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Regards.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: UART skipping characters?</title><link>https://devzone.nordicsemi.com/thread/269816?ContentTypeID=1</link><pubDate>Wed, 16 Sep 2020 10:23:16 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:09ad2cc2-247b-4b97-80db-c3993dcebb41</guid><dc:creator>Heidi</dc:creator><description>&lt;p&gt;It looks like you might be blocking yourself, re this line:&lt;/p&gt;
&lt;p&gt;&lt;em&gt;printf(&amp;quot;PMS5003 hexadecimal data: %02X\n&amp;quot;, (unsigned char) uart_buf[0]);&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Perhaps try this line instead for printing the received information:&lt;/p&gt;
&lt;p&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;printk&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;&lt;span&gt;&lt;span&gt;&amp;quot;&lt;/span&gt;&lt;span&gt;%s&lt;/span&gt;&lt;span&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;span&gt;, uart_buf);&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: UART skipping characters?</title><link>https://devzone.nordicsemi.com/thread/269809?ContentTypeID=1</link><pubDate>Wed, 16 Sep 2020 09:43:55 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:785ac11b-86fe-47ef-917c-ddf8042b9a16</guid><dc:creator>isurki</dc:creator><description>&lt;p&gt;yes:&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;CONFIG_SERIAL=y&lt;br /&gt;CONFIG_TRUSTED_EXECUTION_NONSECURE=y&lt;br /&gt;CONFIG_UART_INTERRUPT_DRIVEN=y&lt;br /&gt;CONFIG_MAIN_STACK_SIZE=8192&lt;br /&gt;CONFIG_HEAP_MEM_POOL_SIZE=4096&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: UART skipping characters?</title><link>https://devzone.nordicsemi.com/thread/269789?ContentTypeID=1</link><pubDate>Wed, 16 Sep 2020 08:43:36 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3224bf78-d3da-499d-8365-627214e068c5</guid><dc:creator>Heidi</dc:creator><description>&lt;p&gt;Okay. Could you please attach your prj.conf file?&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: UART skipping characters?</title><link>https://devzone.nordicsemi.com/thread/269775?ContentTypeID=1</link><pubDate>Wed, 16 Sep 2020 08:03:50 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d34f9484-387f-4f53-8f7a-f1e777860cc1</guid><dc:creator>isurki</dc:creator><description>&lt;p&gt;Hi Heidi,&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I have tried with 1024, 2048, 4096 buff size and I am getting the same results.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thanks for your answer!&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Regards.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: UART skipping characters?</title><link>https://devzone.nordicsemi.com/thread/269651?ContentTypeID=1</link><pubDate>Tue, 15 Sep 2020 12:29:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c248c1c7-2853-42a8-ae07-4644931e00aa</guid><dc:creator>Heidi</dc:creator><description>&lt;p&gt;Hi! Sorry about the wait.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Have you tried increasing the buffer size (uart_buf)?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Heidi&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: UART skipping characters?</title><link>https://devzone.nordicsemi.com/thread/269530?ContentTypeID=1</link><pubDate>Tue, 15 Sep 2020 07:05:18 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c13d7128-c32d-4c87-8d7a-c2b1794e3298</guid><dc:creator>isurki</dc:creator><description>&lt;p&gt;Can someone help me, please? Still waiting...&lt;/p&gt;
&lt;p&gt;Thanks.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>