<?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>How do I know I2S transfer finished using SDK&amp;#39;s I2S driver</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/23620/how-do-i-know-i2s-transfer-finished-using-sdk-s-i2s-driver</link><description>When using SDK v13&amp;#39;s I2S driver, the data to send is filled via data_handler callback. How do I fill last block data?
Assume i2s buffer size is 2000, then every 1000 words sent I have to prepare the next new block data. But what if last block was not</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 04 Dec 2019 12:00:28 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/23620/how-do-i-know-i2s-transfer-finished-using-sdk-s-i2s-driver" /><item><title>RE: How do I know I2S transfer finished using SDK's I2S driver</title><link>https://devzone.nordicsemi.com/thread/223569?ContentTypeID=1</link><pubDate>Wed, 04 Dec 2019 12:00:28 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:405d39ed-f887-4770-bb81-c6558dd3d91b</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>&lt;p&gt;When a transfer is stopped, you will get a&amp;nbsp;NRF_I2S_EVENT_STOPPED event from the peripheral. The data_handler in the driver is called with status set to 0, indicating that no new buffers are required. In case new buffers are required, status will be set to&amp;nbsp;&lt;a href="https://infocenter.nordicsemi.com/topic/sdk_nrf5_v16.0.0/group__nrf__drv__i2s.html#ga34c91f7dad4fad0d72291c11bb9ef6d3"&gt;NRF_DRV_I2S_STATUS_NEXT_BUFFERS_NEEDED&lt;/a&gt;/&lt;a href="https://infocenter.nordicsemi.com/topic/sdk_nrf5_v16.0.0/group__nrfx__i2s.html#ga7bc726913d2d940afc2ecbd9112c9772"&gt;NRFX_I2S_STATUS_NEXT_BUFFERS_NEEDED&lt;/a&gt;.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How do I know I2S transfer finished using SDK's I2S driver</title><link>https://devzone.nordicsemi.com/thread/223336?ContentTypeID=1</link><pubDate>Tue, 03 Dec 2019 13:15:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3ae062a4-bf55-46c2-aeae-483e49487fad</guid><dc:creator>HKjace</dc:creator><description>&lt;ul&gt;
&lt;li&gt;
&lt;p class="src"&gt;&lt;span&gt;After calling nrf_drv_i2s_start(), how do you know that the all data transfer is complete?can you&amp;nbsp;help&amp;nbsp;me ,thank you ,&lt;/span&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How do I know I2S transfer finished using SDK's I2S driver</title><link>https://devzone.nordicsemi.com/thread/92809?ContentTypeID=1</link><pubDate>Fri, 21 Jul 2017 07:47:05 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:84d05444-6300-4539-92bc-d1502cfdd60c</guid><dc:creator>Howard</dc:creator><description>&lt;p&gt;I understand double buffer is necessary but why the driver must have every block data to be fixed size? If I wrote the driver I would return actual filled data length and the remain size of data from data_handler to the driver.  The driver should stop automatically when finished last data.
I also would like a status check function for main context to check whether the all data finished.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How do I know I2S transfer finished using SDK's I2S driver</title><link>https://devzone.nordicsemi.com/thread/92811?ContentTypeID=1</link><pubDate>Fri, 21 Jul 2017 06:37:18 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2dd1b464-4cfc-492b-ba62-dee6ab781860</guid><dc:creator>endnode</dc:creator><description>&lt;p&gt;To be honest it&amp;#39;s hard to do simpler design then two buffers on &amp;quot;swing&amp;quot; (because even with DMA you need this otherwise how could be transfer safe against interrupts and glitches???)...&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How do I know I2S transfer finished using SDK's I2S driver</title><link>https://devzone.nordicsemi.com/thread/92812?ContentTypeID=1</link><pubDate>Fri, 21 Jul 2017 03:08:03 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a01a8568-864b-47f6-837b-8d936c06abff</guid><dc:creator>Howard</dc:creator><description>&lt;p&gt;Thanks very much Jorgen. However, your solution looks too complex for me, I have no confidence to make it work.&lt;/p&gt;
&lt;p&gt;Hi endnode, thank you very much too! Your method looks most feasible for me. I already did like this. The bad things is that I don&amp;#39;t know the actual time that the I2S transfer finished. To safely stop I2S, I have to fill silence data for one more block and wait for data_handler called. thus I need fill the remaining 700 words of last block and additional 1 more block with silence data. Is that correct?&lt;/p&gt;
&lt;p&gt;I have to say, this driver is not well designed compared to STM32&amp;#39;s HAL driver, which is far more easier to use...I had spend two days on this, I just want to send a simple sound to the  audio DAC via I2S.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How do I know I2S transfer finished using SDK's I2S driver</title><link>https://devzone.nordicsemi.com/thread/92815?ContentTypeID=1</link><pubDate>Thu, 20 Jul 2017 09:29:38 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:03ed7295-6c0a-4b09-870e-fa08c296dc22</guid><dc:creator>endnode</dc:creator><description>&lt;p&gt;What I did in my I2S application was simply demanding input stream to be padded by &amp;quot;silence&amp;quot; (whatever it is in your encoding) to the closest transfer &amp;quot;block&amp;quot; size or if not possible doing it inside the FW. It&amp;#39;s not super-elegant but few milliseconds of driven silence instead of real silence didn&amp;#39;t harm anything;)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How do I know I2S transfer finished using SDK's I2S driver</title><link>https://devzone.nordicsemi.com/thread/92813?ContentTypeID=1</link><pubDate>Thu, 20 Jul 2017 09:26:39 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:28083322-4b87-410a-8674-3d6d6b6ab1ed</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>&lt;p&gt;The driver does not support this. You will have to stop the transfer and start it again with the new buffer. I guess this is not a good solution for your DAC either. Another alternativ can be to call the I2S HAL function used by the driver (in &lt;code&gt;nrf_drv_i2s_start()&lt;/code&gt;) to set the &lt;a href="http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.nrf52832.ps.v1.1/i2s.html?cp=2_1_0_43_9_16#register.RXTXD.MAXCNT"&gt;MAXCNT&lt;/a&gt; register (transfer size) and buffers, &lt;code&gt;nrf_i2s_transfer_set()&lt;/code&gt;, from inside &lt;code&gt;data_handler&lt;/code&gt; with pointers to a smaller buffer. I have not tried this, but I can&amp;#39;t see anything in the driver preventing your from doing this.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How do I know I2S transfer finished using SDK's I2S driver</title><link>https://devzone.nordicsemi.com/thread/92814?ContentTypeID=1</link><pubDate>Wed, 19 Jul 2017 17:03:25 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1b12d1b6-07a2-4926-b15c-317b309411c4</guid><dc:creator>Howard</dc:creator><description>&lt;p&gt;Thank you for your reply! but My receiver is an Audio DAC, which does not know the total size and not able to ignore the last 700 words. About your alternate solution, how can I setup a new buffer for the remaining data while the previous data is still in transferring?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How do I know I2S transfer finished using SDK's I2S driver</title><link>https://devzone.nordicsemi.com/thread/92810?ContentTypeID=1</link><pubDate>Wed, 19 Jul 2017 12:35:04 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3d8fb1f7-b3f7-4c6e-aa7c-481c329470b4</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>&lt;p&gt;You don&amp;#39;t need to fill the buffer, but then the receiver should know the total size and ignore the 700 last words. The whole TX buffer passed to &lt;code&gt;nrf_drv_i2s_start()&lt;/code&gt;will be transmitted. You should know in your application if you do not have more data to fill. Alternatively, you can setup a new, smaller buffer, for the remaining data. The best solution will depend on your application.&lt;/p&gt;
&lt;p&gt;You can stop I2S the next time &lt;code&gt;data_handler&lt;/code&gt; is called, as this is called when new data is required for transmission, or data is received. You should preferrably set a flag in the callback and stop I2S in main context.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How do I know I2S transfer finished using SDK's I2S driver</title><link>https://devzone.nordicsemi.com/thread/92816?ContentTypeID=1</link><pubDate>Wed, 19 Jul 2017 08:43:04 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:aa26f7e3-6ee3-4c53-a29b-b8c80a075224</guid><dc:creator>endnode</dc:creator><description>&lt;p&gt;I2S driver cannot process more than 0xFF = 255 samples, does it?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>