<?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 to configure the skip_gpio_cfg flag on my PDM microphone?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/106343/how-to-configure-the-skip_gpio_cfg-flag-on-my-pdm-microphone</link><description>I know how to setup my pdm microphone in my .overlay file as follows: 
 
 
 &amp;amp; clock { 
 hfclkaudio-frequency = &amp;lt; 12288000 &amp;gt;; 
 }; 
 
 &amp;amp; pinctrl { 
 pdm0_default_alt: pdm0_default_alt { 
 group1 { 
 psels = &amp;lt; NRF_PSEL ( PDM_CLK , 0 , 2 )&amp;gt;, 
 &amp;lt; NRF_PSEL</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 06 Dec 2023 11:46:57 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/106343/how-to-configure-the-skip_gpio_cfg-flag-on-my-pdm-microphone" /><item><title>RE: How to configure the skip_gpio_cfg flag on my PDM microphone?</title><link>https://devzone.nordicsemi.com/thread/459151?ContentTypeID=1</link><pubDate>Wed, 06 Dec 2023 11:46:57 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:84003e11-9d3e-4255-88c2-90496d4e7e70</guid><dc:creator>Sigurd Hellesvik</dc:creator><description>[quote user="clovett"]&lt;span&gt;So this probably explains why P0.02 didn&amp;#39;t work for me.&lt;/span&gt;[/quote]
&lt;p&gt;I agree, it would seem like that is it.&lt;/p&gt;
&lt;p&gt;There is also a less detailed drawing in silkscreen on the back of the DK showing how P0.02 is connected.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to configure the skip_gpio_cfg flag on my PDM microphone?</title><link>https://devzone.nordicsemi.com/thread/459079?ContentTypeID=1</link><pubDate>Tue, 05 Dec 2023 23:21:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:98cc2174-0438-43cd-9f91-1a552bbd394e</guid><dc:creator>Chris Lovett</dc:creator><description>&lt;p&gt;I did some further digging and found&amp;nbsp;&lt;/p&gt;
&lt;div&gt;
&lt;div&gt;&lt;span&gt;CONFIG_NFCT_PINS_AS_GPIOS&lt;/span&gt;&lt;span&gt;=y&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;which lead me to find that the&amp;nbsp;&lt;span&gt;nrf5340 DK has isolated P0.02 for NFC, and so I probably need to solder a jump pad to make it work as&amp;nbsp;GPIO.&amp;nbsp; I see the following info at&amp;nbsp;&lt;a href="https://infocenter.nordicsemi.com/topic/ug_nrf5340_dk/UG/dk/hw_nfc_if.html?cp=4_0_4_4_10"&gt;infocenter.nordicsemi.com/.../hw_nfc_if.html&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&amp;gt; Pins&amp;nbsp;&lt;span class="keyword pinname"&gt;P0.02/NFC1&lt;/span&gt;&amp;nbsp;and&amp;nbsp;&lt;span class="keyword pinname"&gt;P0.03/NFC2&lt;/span&gt;&amp;nbsp;are by default configured to use the NFC antenna. To use these pins as GPIO,&amp;nbsp;&lt;span class="ph"&gt;&lt;span class="keyword pcb"&gt;R43&lt;/span&gt;&amp;nbsp;and&amp;nbsp;&lt;span class="keyword pcb"&gt;R46&lt;/span&gt;&lt;/span&gt;&amp;nbsp;must be not connected (NC) and&amp;nbsp;&lt;span class="ph"&gt;&lt;span class="keyword pcb"&gt;R42&lt;/span&gt;&amp;nbsp;and&amp;nbsp;&lt;span class="keyword pcb"&gt;R45&lt;/span&gt;&lt;/span&gt;&amp;nbsp;must be shorted with an OR resistor.&lt;br /&gt;&lt;br /&gt;So this probably explains why P0.02 didn&amp;#39;t work for me.&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to configure the skip_gpio_cfg flag on my PDM microphone?</title><link>https://devzone.nordicsemi.com/thread/459062?ContentTypeID=1</link><pubDate>Tue, 05 Dec 2023 17:59:10 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5108a1a2-8784-4c40-b90f-e2f571a0fc68</guid><dc:creator>Chris Lovett</dc:creator><description>&lt;p&gt;Sounds like your answer is &amp;quot;there is no way&amp;quot;.&amp;nbsp; Thanks.&amp;nbsp; It&amp;#39;s not really an XY problem -&amp;nbsp;I had&amp;nbsp;a very specific question and you answered it.&amp;nbsp; But since you are curious about the bigger picture, the reason&amp;nbsp;I&amp;#39;m asking is that my pdm mic works on pins 25/26 but not on 02/05, (using the nrf5340 DK) so I was debugging into dmic_configure -&amp;gt; dmic_nrfx_pdm_configure -&amp;gt;&amp;nbsp; nrfx_pdm_init -&amp;gt;&amp;nbsp; pdm_configure which starts with:&lt;br /&gt;&lt;br /&gt;&lt;span&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span&gt;if&lt;/span&gt;&lt;span&gt; (&lt;/span&gt;&lt;span&gt;!&lt;/span&gt;&lt;span&gt;p_config&lt;/span&gt;&lt;span&gt;-&amp;gt;&lt;/span&gt;&lt;span&gt;skip_gpio_cfg&lt;/span&gt;&lt;span&gt;)&lt;/span&gt;&lt;/p&gt;
&lt;div&gt;
&lt;div&gt;&lt;span&gt;&amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span&gt;nrfy_gpio_pin_clear&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;&lt;span&gt;p_config&lt;/span&gt;&lt;span&gt;-&amp;gt;&lt;/span&gt;&lt;span&gt;clk_pin&lt;/span&gt;&lt;span&gt;);&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span&gt;nrfy_gpio_cfg_output&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;&lt;span&gt;p_config&lt;/span&gt;&lt;span&gt;-&amp;gt;&lt;/span&gt;&lt;span&gt;clk_pin&lt;/span&gt;&lt;span&gt;);&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span&gt;nrfy_gpio_cfg_input&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;&lt;span&gt;p_config&lt;/span&gt;&lt;span&gt;-&amp;gt;&lt;/span&gt;&lt;span&gt;din_pin&lt;/span&gt;&lt;span&gt;, &lt;/span&gt;&lt;span&gt;NRF_GPIO_PIN_NOPULL&lt;/span&gt;&lt;span&gt;);&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&amp;nbsp; &amp;nbsp;}&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;So that got me thinking, who is initializing the pins if this is not doing it?&amp;nbsp; And perhaps if I initialize the pins 02 and 05 myself then it might start working? The easy way would be to enable this block of code somehow, hence my question.&amp;nbsp; Interestingly, I also tried the hard way after I posted this question as follows:&lt;br /&gt;&lt;br /&gt;
&lt;div&gt;
&lt;div&gt;&lt;span&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span&gt;nrfx_pdm_config_t&lt;/span&gt;&lt;span&gt;*&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;config&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;=&lt;/span&gt;&lt;span&gt; (&lt;/span&gt;&lt;span&gt;nrfx_pdm_config_t&lt;/span&gt;&lt;span&gt;*&lt;/span&gt;&lt;span&gt;)&lt;/span&gt;&lt;span&gt;dmic&lt;/span&gt;&lt;span&gt;-&amp;gt;&lt;/span&gt;&lt;span&gt;config&lt;/span&gt;&lt;span&gt;; &amp;nbsp; &lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;&lt;span&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span&gt;struct&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;gpio_dt_spec&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;pdm_clock&lt;/span&gt;&lt;span&gt;;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span&gt;pdm_clock&lt;/span&gt;&lt;span&gt;.&lt;/span&gt;&lt;span&gt;port&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;=&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;gpio_port_0&lt;/span&gt;&lt;span&gt;;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span&gt;pdm_clock&lt;/span&gt;&lt;span&gt;.&lt;/span&gt;&lt;span&gt;pin&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;=&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;config&lt;/span&gt;&lt;span&gt;-&amp;gt;&lt;/span&gt;&lt;span&gt;clk_pin&lt;/span&gt;&lt;span&gt;;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span&gt;pdm_clock&lt;/span&gt;&lt;span&gt;.&lt;/span&gt;&lt;span&gt;dt_flags&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;=&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;GPIO_ACTIVE_LOW&lt;/span&gt;&lt;span&gt;;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span&gt;gpio_pin_configure_dt&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;&lt;span&gt;&amp;amp;&lt;/span&gt;&lt;span&gt;pdm_clock&lt;/span&gt;&lt;span&gt;, &lt;/span&gt;&lt;span&gt;GPIO_OUTPUT&lt;/span&gt;&lt;span&gt;);&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span&gt;gpio_pin_set&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;&lt;span&gt;pdm_clock&lt;/span&gt;&lt;span&gt;.&lt;/span&gt;&lt;span&gt;port&lt;/span&gt;&lt;span&gt;, &lt;/span&gt;&lt;span&gt;pdm_clock&lt;/span&gt;&lt;span&gt;.&lt;/span&gt;&lt;span&gt;pin&lt;/span&gt;&lt;span&gt;, &lt;/span&gt;&lt;span&gt;0&lt;/span&gt;&lt;span&gt;);&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;&lt;span&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span&gt;struct&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;gpio_dt_spec&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;pdm_data&lt;/span&gt;&lt;span&gt;;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span&gt;pdm_data&lt;/span&gt;&lt;span&gt;.&lt;/span&gt;&lt;span&gt;port&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;=&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;gpio_port_0&lt;/span&gt;&lt;span&gt;;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span&gt;pdm_data&lt;/span&gt;&lt;span&gt;.&lt;/span&gt;&lt;span&gt;pin&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;=&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;config&lt;/span&gt;&lt;span&gt;-&amp;gt;&lt;/span&gt;&lt;span&gt;din_pin&lt;/span&gt;&lt;span&gt;;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span&gt;pdm_data&lt;/span&gt;&lt;span&gt;.&lt;/span&gt;&lt;span&gt;dt_flags&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;=&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;GPIO_ACTIVE_LOW&lt;/span&gt;&lt;span&gt;; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span&gt;gpio_pin_configure_dt&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;&lt;span&gt;&amp;amp;&lt;/span&gt;&lt;span&gt;pdm_data&lt;/span&gt;&lt;span&gt;, &lt;/span&gt;&lt;span&gt;GPIO_INPUT&lt;/span&gt;&lt;span&gt;);&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;br /&gt;But that didn&amp;#39;t work either, so I wonder if there&amp;#39;s a hardware difference and PDM only works on certain gpio pins?&amp;nbsp;Or my hard way code is wrong. I couldn&amp;#39;t find anything about that in the PDM documentation on&amp;nbsp;&lt;a href="https://infocenter.nordicsemi.com/topic/ps_nrf5340/pdm.html?cp=4_0_0_6_21."&gt;infocenter.nordicsemi.com/.../pdm.html&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to configure the skip_gpio_cfg flag on my PDM microphone?</title><link>https://devzone.nordicsemi.com/thread/458932?ContentTypeID=1</link><pubDate>Tue, 05 Dec 2023 10:34:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:cd9dfa30-9244-44a4-bc80-24cb76e89170</guid><dc:creator>Sigurd Hellesvik</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;From &lt;a href="https://github.com/nrfconnect/sdk-zephyr/blob/2364b332d085341d78e9618125256ae3a5cc71b0/drivers/audio/dmic_nrfx_pdm.c#L568-L569"&gt;https://github.com/nrfconnect/sdk-zephyr/blob/2364b332d085341d78e9618125256ae3a5cc71b0/drivers/audio/dmic_nrfx_pdm.c#L568-L569&lt;/a&gt;, we can see that skip_gpio_cfg and skip_psel_cfg are hard-coded initialized to True.&lt;/p&gt;
&lt;p&gt;My guess is that since Zephyr should have control over the different pin states, and therefore we do not want to allow PDM to control these from their drivers.&lt;/p&gt;
&lt;p&gt;I realize that this may be an &lt;a href="https://en.wikipedia.org/wiki/XY_problem"&gt;XY Problem&lt;/a&gt;: Why do you want to access &lt;span&gt;nrfx_pdm_config_t&lt;/span&gt;&lt;span&gt;&lt;/span&gt; directly?&lt;/p&gt;
&lt;p&gt;Regards,&lt;br /&gt;Sigurd Hellesvik&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>