<?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 add a new devicetree in nrf5340 audio dk?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/96979/how-to-add-a-new-devicetree-in-nrf5340-audio-dk</link><description>Hello, 
 I am using nrf5340 audio dk to make some modifications and tests. 
 When I add a devicetree to the overlay file and use DEVICE_DT_GET to get the device object, it always occur build fail: undefined reference to &amp;#39;__device_dts_ord_N&amp;#39;. 
 For example</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 24 Feb 2023 01:14:13 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/96979/how-to-add-a-new-devicetree-in-nrf5340-audio-dk" /><item><title>RE: How to add a new devicetree in nrf5340 audio dk?</title><link>https://devzone.nordicsemi.com/thread/411804?ContentTypeID=1</link><pubDate>Fri, 24 Feb 2023 01:14:13 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1f6493f5-6724-4830-a004-3b618ee2940a</guid><dc:creator>LandyWang</dc:creator><description>&lt;p&gt;Thank you for your assistance.It&amp;#39;s working for me .&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to add a new devicetree in nrf5340 audio dk?</title><link>https://devzone.nordicsemi.com/thread/411742?ContentTypeID=1</link><pubDate>Thu, 23 Feb 2023 16:25:31 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:bb917e4c-c03e-42ce-a53b-bb18f18aabd1</guid><dc:creator>haakonsh</dc:creator><description>&lt;p&gt;&lt;span style="font-size:inherit;"&gt;Try this:&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;div&gt;
&lt;div&gt;&lt;span style="font-size:inherit;"&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;CONFIG_AUDIO=y
CONFIG_AUDIO_DMIC=y
CONFIG_DMA=y
CONFIG_HEAP_MEM_POOL_SIZE=1024&lt;/pre&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size:inherit;"&gt;If&amp;nbsp;CONFIG_AUDIO is not set then the dmic_nrfx_pdm.c driver will never&amp;nbsp;&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 add a new devicetree in nrf5340 audio dk?</title><link>https://devzone.nordicsemi.com/thread/411568?ContentTypeID=1</link><pubDate>Thu, 23 Feb 2023 09:07:12 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:174a6a3b-68ac-4c3b-b4bc-b369c010f7d5</guid><dc:creator>LandyWang</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Thank you for your reply.&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;I add pinctrl define to the overlay file and set CONFIG_NRFX_PDM, but an undefined reference error still occurs.&lt;/p&gt;
&lt;p&gt;Then I modify the overlay file as below, it still build fail with the same error.&lt;pre class="ui-code" data-mode="text"&gt;&amp;amp;pinctrl{
    pdm0_default: pdm0_default {
		group1 {
			psels = &amp;lt;NRF_PSEL(PDM_CLK, 1, 9)&amp;gt;,
			        &amp;lt;NRF_PSEL(PDM_DIN, 1, 6)&amp;gt;;
		};
	};

	pdm0_sleep: pdm0_sleep {
		group1 {
			psels = &amp;lt;NRF_PSEL(PDM_CLK, 1, 9)&amp;gt;,
			        &amp;lt;NRF_PSEL(PDM_DIN, 1, 6)&amp;gt;;
			low-power-enable;
		};
	};
};
&amp;amp;pdm0{
	compatible = &amp;quot;nordic,nrf-pdm&amp;quot;;
	status = &amp;quot;okay&amp;quot;;
	pinctrl-0 = &amp;lt;&amp;amp;pdm0_default&amp;gt;;
	pinctrl-1 = &amp;lt;&amp;amp;pdm0_sleep&amp;gt;;
	pinctrl-names = &amp;quot;default&amp;quot;, &amp;quot;sleep&amp;quot;;
};&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Here is the config I added to my prj.conf.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;CONFIG_AUDIO_DMIC=y
CONFIG_DMA=y
CONFIG_HEAP_MEM_POOL_SIZE=1024
CONFIG_NRFX_PDM=y&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to add a new devicetree in nrf5340 audio dk?</title><link>https://devzone.nordicsemi.com/thread/411547?ContentTypeID=1</link><pubDate>Thu, 23 Feb 2023 08:32:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:326baf08-acf9-433d-abf7-c1f0a3e03898</guid><dc:creator>haakonsh</dc:creator><description>&lt;p&gt;Meybe we need to define the pins with pinctrl:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;&amp;amp;pinctrl{
    pdm0_default: pdm0_default {
		group1 {
			psels = &amp;lt;NRF_PSEL(PDM_CLK, 1, 9)&amp;gt;,
			        &amp;lt;NRF_PSEL(PDM_DIN, 1, 6)&amp;gt;;
		};
	};

	pdm0_sleep: pdm0_sleep {
		group1 {
			psels = &amp;lt;NRF_PSEL(PDM_CLK, 1, 9)&amp;gt;,
			        &amp;lt;NRF_PSEL(PDM_DIN, 1, 6)&amp;gt;;
			low-power-enable;
		};
	};
};

&amp;amp;pdm0{
	status = &amp;quot;okay&amp;quot;;
};&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;And that CONFIG_NRFX_PDM is set.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>