<?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>I2S Reading in Thread Throwing Hard Fault</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/117634/i2s-reading-in-thread-throwing-hard-fault</link><description>Hi there, 
 So, this is in a sequence of attempts to read data from a digital microphone SPH0645 using i2s master protcool on nRF5340. The program layout is as follows: 
 
 
 
 I have written a thread for reading the i2s data that is enabled only after</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 02 Jan 2025 09:50:41 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/117634/i2s-reading-in-thread-throwing-hard-fault" /><item><title>RE: I2S Reading in Thread Throwing Hard Fault</title><link>https://devzone.nordicsemi.com/thread/516620?ContentTypeID=1</link><pubDate>Thu, 02 Jan 2025 09:50:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:22453268-d747-4687-aa37-3a2c9218bfff</guid><dc:creator>umer</dc:creator><description>&lt;p&gt;Update:&lt;br /&gt;&lt;br /&gt;I was able to resolve by fixing the function call in `k_memslab_free(&amp;amp;mem_slab, &amp;amp;mem_block)`.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;The correct function call is:&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;k_mem_slab_free(&amp;amp;mem_slab, mem_block);

// That is, the function definition of k_mem_slab_free expects a pointer to the memory location as the second argument. &lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>