<?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>nrf_serial_write don&amp;#39;t work in blocking mode</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/72666/nrf_serial_write-don-t-work-in-blocking-mode</link><description>Hi! 
 
 I&amp;#39;m working on the NRF52832. I&amp;#39;m using the function &amp;quot;nrf_serial_write()&amp;quot; to send data over uart. I want it to work in blocking mode. As I can read in the infocenter , if I put a time into the &amp;quot; timeout_ms&amp;quot; parameter, the function should work in</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 12 Apr 2021 18:31:26 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/72666/nrf_serial_write-don-t-work-in-blocking-mode" /><item><title>RE: nrf_serial_write don't work in blocking mode</title><link>https://devzone.nordicsemi.com/thread/304366?ContentTypeID=1</link><pubDate>Mon, 12 Apr 2021 18:31:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2aef4322-30eb-4254-9b82-35006f05d120</guid><dc:creator>Emile</dc:creator><description>&lt;p&gt;I realized that the function&amp;nbsp;&lt;span&gt;nrf_serial_write() is only in blocking mode when an array larger than the fifo size is passed in argument. The function stops blocking when there is equal byte to send than the size of the fifo. E.g. You have a fifo of 32 bytes and an array of 56 bytes is passed in argument. The function seems to block for the first 24 bytes then it stops blocking for the last 32 bytes. I patched this problem by using a delay&amp;nbsp;&amp;quot;nrf_delay_ms()&amp;quot;. Since I know the size of the array and the bauderate, I can estimate the delay.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf_serial_write don't work in blocking mode</title><link>https://devzone.nordicsemi.com/thread/300052?ContentTypeID=1</link><pubDate>Tue, 16 Mar 2021 10:00:05 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b81dee02-ff39-4a65-98a7-89a5d98a307b</guid><dc:creator>Jared</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Could you try calling &lt;span&gt;nrf_serial_flush() after the call to&amp;nbsp;nrf_serial_write(). That should flush the remaining data after the&amp;nbsp;nrf_serial_write() returns.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;regards&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Jared&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf_serial_write don't work in blocking mode</title><link>https://devzone.nordicsemi.com/thread/299558?ContentTypeID=1</link><pubDate>Fri, 12 Mar 2021 19:19:19 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:dd6e2548-4147-4786-8f96-18fcfd0297ae</guid><dc:creator>Emile</dc:creator><description>&lt;p&gt;Hi Jared!&lt;/p&gt;
&lt;p&gt;The return of the function is NRF_SUCCESS.&lt;/p&gt;
&lt;p&gt;After further digging into the function nrf_serial_write, I can see that the function blocks only until there is less byte to send than the fifo size (SERIAL_FIFO_TX_SIZE).&lt;/p&gt;
&lt;p&gt;But in my case I want the function to stop only when there is no more byte to send. Do you know How I can do it? I tried with a flag triggered on the TX_DONE event. but this event doesn&amp;#39;t seem to trigger when all the bytes have been sent, but when a chunk of data have been sent.&lt;/p&gt;
&lt;p&gt;Thank you!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf_serial_write don't work in blocking mode</title><link>https://devzone.nordicsemi.com/thread/299507?ContentTypeID=1</link><pubDate>Fri, 12 Mar 2021 14:35:35 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:096b2c45-f485-48df-bfd2-ef3185fccb19</guid><dc:creator>Jared</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Could you check what is returned by nrf_serial_write()?&amp;nbsp;&lt;/p&gt;
&lt;p&gt;regards&lt;/p&gt;
&lt;p&gt;Jared&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>