<?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>Getting i2s to work...</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/12222/getting-i2s-to-work</link><description>Hi, 
 I&amp;#39;d like to output some audio data through i2s. It&amp;#39;s quite easy to understand your examples provided on infocenter, however, I can&amp;#39;t get my code to work. 
 Here is what I do: 
 #define TX_BUFFER_SIZE 8 /* Length of transmit buffer, specified</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 03 May 2017 13:37:09 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/12222/getting-i2s-to-work" /><item><title>RE: Getting i2s to work...</title><link>https://devzone.nordicsemi.com/thread/46241?ContentTypeID=1</link><pubDate>Wed, 03 May 2017 13:37:09 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e8c93f1c-ab1e-41f9-923c-e4d5258d52c9</guid><dc:creator>oneguy</dc:creator><description>&lt;p&gt;Thank you.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Getting i2s to work...</title><link>https://devzone.nordicsemi.com/thread/46240?ContentTypeID=1</link><pubDate>Wed, 03 May 2017 01:38:46 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e86b9962-aeb3-40d7-84b8-be9a119ae706</guid><dc:creator>chen</dc:creator><description>&lt;p&gt;HI,
I think you should take a look at this picture&lt;img src="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/7230.1.png" alt="image description" /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Getting i2s to work...</title><link>https://devzone.nordicsemi.com/thread/46239?ContentTypeID=1</link><pubDate>Mon, 07 Mar 2016 12:54:28 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9600affe-b8b4-41ec-a12b-a80a9535aa2d</guid><dc:creator>MartinBL</dc:creator><description>&lt;ul&gt;
&lt;li&gt;Yes&lt;/li&gt;
&lt;li&gt;The buffers should be 32 bits wide, so e.g. a buffer of size 3 is actually 12 bytes. So no need to make buffersizes multiples of 4.&lt;/li&gt;
&lt;li&gt;I&amp;#39;m not sure if I understand. If you only want to send p_data_to_send should never be NULL.&lt;/li&gt;
&lt;li&gt;Check out the nrf_drv_i2s_data_handler_t typedef in nrf_drv_i2s.h.&lt;/li&gt;
&lt;li&gt;Preferably not inside an interrupt. Look at how it is done in the SDK.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;I can&amp;#39;t think of anything else than that there must be something wrong with how you handle and/or point to your buffers.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Getting i2s to work...</title><link>https://devzone.nordicsemi.com/thread/46238?ContentTypeID=1</link><pubDate>Fri, 04 Mar 2016 12:13:36 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:14a626d8-63cf-4fe8-8298-921b3102201e</guid><dc:creator>oneguy</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I have tracked the issue a bit further. I find that &lt;strong&gt;p_i2s-&amp;gt;CONFIG.TXEN = (p_buffer_tx != NULL) ? 1 : 0;&lt;/strong&gt; (see line 494, nrf_i2s.h) may cause the problem. If set to 1 the code crashes, if set to 0 it doesn&amp;#39;t.
Crashing means: the code jumps to memory address 0x000007BC.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Getting i2s to work...</title><link>https://devzone.nordicsemi.com/thread/46237?ContentTypeID=1</link><pubDate>Thu, 03 Mar 2016 13:57:24 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e0610b0a-4883-4442-b2ce-356ab4a01dcd</guid><dc:creator>oneguy</dc:creator><description>&lt;p&gt;Hi Martin,&lt;/p&gt;
&lt;p&gt;Thanks for this and yes, you&amp;#39;re correct about the increment++.&lt;/p&gt;
&lt;p&gt;The code still crashes but with a bit of luck I&amp;#39;ll get it to work. Please confirm that my assumptions are correct:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;The buffer in nrf_drv_i2s_start () (2nd parameter) is used internally by the i2s driver, i.e. by easy-DMA or something like this.&lt;/li&gt;
&lt;li&gt;What I need to do for this is to allocate a buffer in RAM? It&amp;#39;s size needs to be a multiple of 4 bytes?&lt;/li&gt;
&lt;li&gt;If I only want to send audio data to a PCM amplifier I need to react to p_data_to_send != NULL. Is that so?&lt;/li&gt;
&lt;li&gt;I then need to copy number_of_words from my sound file (which is in const-memory) to *p_data_to_send.&lt;/li&gt;
&lt;li&gt;p_data_to_send points to the buffer provided in nrf_drv_i2s_start ()?&lt;/li&gt;
&lt;li&gt;number_of_words are 32-bit words?&lt;/li&gt;
&lt;li&gt;If my sound file is done I call nrf_drv_i2s_stop () from within the interrupt routine?&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Thank you
M&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Getting i2s to work...</title><link>https://devzone.nordicsemi.com/thread/46236?ContentTypeID=1</link><pubDate>Thu, 03 Mar 2016 12:37:09 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3069583e-7be9-4a26-a87b-0daf4bcf2306</guid><dc:creator>MartinBL</dc:creator><description>&lt;p&gt;It&amp;#39;s not easy to say what is going on here as it is not easy to reproduce on my end. I have tried to the best of my abilities to merge your code into the I2S example from the SDK. I&amp;#39;m able to get some code that compiles and runs fine, but I don&amp;#39;t get any hard faults. My best guess is that your code is trying to access some &amp;quot;bad&amp;quot; memory in the while(number_of_words). And are you trying to copy the content of the mTuneTx buffer to p_data_to_send? Won&amp;#39;t this code just overwrite the value in p_data_to_send[0]  &amp;#39;number_of_words&amp;#39; number of times since you are not incrementing p_data_to_send?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Getting i2s to work...</title><link>https://devzone.nordicsemi.com/thread/46235?ContentTypeID=1</link><pubDate>Wed, 02 Mar 2016 14:44:33 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:de812b80-0e80-45a8-9939-3e4b1e5f272c</guid><dc:creator>oneguy</dc:creator><description>&lt;p&gt;Hi Martin,&lt;/p&gt;
&lt;p&gt;it crashes out in &amp;quot;*p_data_to_send = *mTuneTx&amp;quot;. Used memcpy before - then changed it to this.&lt;/p&gt;
&lt;p&gt;Please find code attached...&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/uisound.c"&gt;uisound.c&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Getting i2s to work...</title><link>https://devzone.nordicsemi.com/thread/46234?ContentTypeID=1</link><pubDate>Wed, 02 Mar 2016 14:25:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:63db7294-8b9e-4f23-9222-1c76eaaa81af</guid><dc:creator>MartinBL</dc:creator><description>&lt;p&gt;Have you debugged and stepped through onTxPrepare() to see exactly where in the handler function the code hard faults? Do you mind uploading all of you code?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>