<?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>PDM hardware exception</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/51164/pdm-hardware-exception</link><description>So this is a small continuation of this ticket https://devzone.nordicsemi.com/f/nordic-q-a/50656/using-pdm-mic-on-nrf9160dk . 
 The problem I&amp;#39;m having now is that when I run my program basically just using nrfx_pdm_start() I get a hardware exception error</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 20 Aug 2019 14:38:23 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/51164/pdm-hardware-exception" /><item><title>RE: PDM hardware exception</title><link>https://devzone.nordicsemi.com/thread/205103?ContentTypeID=1</link><pubDate>Tue, 20 Aug 2019 14:38:23 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:763f681f-f098-45ed-87a2-268c72433ec2</guid><dc:creator>octvargas</dc:creator><description>&lt;p&gt;Thanks&amp;nbsp;&lt;span&gt;H&amp;aring;kon, &lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;I no longer get a hardware exception.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;I&amp;#39;m sure I&amp;#39;ll continue having questions about PDM, but for now I&amp;#39;ll close this ticket.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Thanks again!&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: PDM hardware exception</title><link>https://devzone.nordicsemi.com/thread/205060?ContentTypeID=1</link><pubDate>Tue, 20 Aug 2019 13:24:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:53209994-e6b0-4e71-8006-755d52d501bd</guid><dc:creator>H&amp;#229;kon Alseth</dc:creator><description>&lt;p&gt;In main.c. Sorry, should have been more clear on that &lt;span class="emoticon" data-url="https://devzone.nordicsemi.com/cfs-file/__key/system/emoji/1f642.svg" title="Slight smile"&gt;&amp;#x1f642;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;Let me know how it goes.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Kind regards,&lt;/p&gt;
&lt;p&gt;Håkon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: PDM hardware exception</title><link>https://devzone.nordicsemi.com/thread/205057?ContentTypeID=1</link><pubDate>Tue, 20 Aug 2019 13:18:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:bcc36b1b-c602-4512-ae13-348fc961bd6e</guid><dc:creator>octvargas</dc:creator><description>&lt;p&gt;Hi &lt;span&gt;H&amp;aring;kon,&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Maybe a dumb question but here it goes, where/what file am I supposed to add those lines to?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Thanks&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: PDM hardware exception</title><link>https://devzone.nordicsemi.com/thread/204916?ContentTypeID=1</link><pubDate>Tue, 20 Aug 2019 07:33:29 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2d3bcad8-cd70-452d-8f97-a630d0680b2f</guid><dc:creator>H&amp;#229;kon Alseth</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Sorry for not seeing this before. The interrupt handler must be declared within the OSes options.&lt;/p&gt;
&lt;p&gt;If you add these lines, the program should run:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;ISR_DIRECT_DECLARE(pdm_isr_handler)
{
	nrfx_pdm_irq_handler();
	ISR_DIRECT_PM(); /* PM done after servicing interrupt for best latency
			  */

	return 1; /* We should check if scheduling decision should be made */
}

void main(void)
{
	IRQ_DIRECT_CONNECT(PDM_IRQn, 0,
			   pdm_isr_handler, 0);
	/* Rest of main */&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I&amp;#39;ll add these observations to the internal task.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
[quote user=""]P.S. Also, the datasheet seems to indicate that the nrfx_pdm_stop command is automatically carried out when the buffer is full, is that correct?&amp;nbsp;[/quote]
&lt;p&gt;When the buffer end is reached (either reading or writing), it will give the event EVENTS_END. You can abort the process by sending the TASKS_STOP, which will finish the ongoing transfer transaction, then send the END event to the application.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Kind regards,&lt;/p&gt;
&lt;p&gt;Håkon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>