<?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>Xiao Seeed nRF52840 Sense - problem reading microphone data</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/126312/xiao-seeed-nrf52840-sense---problem-reading-microphone-data</link><description>Hi all, 
 I am having difficulties reading microphone data using built-in microphone at Xiao Seeed nRF52840 Sense. I have configured the overlay file as suggested here . Then used one of the examples - https://gist.github.com/hlord2000/52949ffc1650bb91f2170a4ac160ebae</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 02 Jan 2026 14:04:17 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/126312/xiao-seeed-nrf52840-sense---problem-reading-microphone-data" /><item><title>RE: Xiao Seeed nRF52840 Sense - problem reading microphone data</title><link>https://devzone.nordicsemi.com/thread/557828?ContentTypeID=1</link><pubDate>Fri, 02 Jan 2026 14:04:17 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:29a1196b-8385-4258-9203-a9b109bff506</guid><dc:creator>Syed Maysum Abbas Zaidi</dc:creator><description>&lt;p&gt;Hi Jaroslav,&lt;/p&gt;
&lt;p&gt;That’s fine. I hope it starts to work otherwise, please feel free to reach out to us again. Thanks.&lt;br /&gt;&lt;br /&gt;Best Regards,&lt;br /&gt;Syed Maysum&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Xiao Seeed nRF52840 Sense - problem reading microphone data</title><link>https://devzone.nordicsemi.com/thread/557779?ContentTypeID=1</link><pubDate>Wed, 31 Dec 2025 16:03:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0261d86b-02e2-4ceb-823b-a0d23ab94ecf</guid><dc:creator>jaroslav.psenicka</dc:creator><description>&lt;p&gt;Hi&amp;nbsp;&lt;span&gt;Syed,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;my aologies, the board I am using is actually not the &amp;quot;sense&amp;quot; version, and the microphone is not assembled. I need to go get the proper board, I am sure the code will start magically working after that.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;i am so sorry, this is so embarrasing :-D&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Jaroslav&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Xiao Seeed nRF52840 Sense - problem reading microphone data</title><link>https://devzone.nordicsemi.com/thread/557754?ContentTypeID=1</link><pubDate>Tue, 30 Dec 2025 16:26:47 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b2a71092-88ee-41c3-867e-a4dbb4bf57ec</guid><dc:creator>jaroslav.psenicka</dc:creator><description>&lt;p&gt;Hi&amp;nbsp;&lt;span&gt;Syed,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;thank you for&amp;nbsp;your answer. Attaching the overlay file:&lt;/span&gt;&lt;span&gt;&lt;br /&gt;&lt;pre class="ui-code" data-mode="text"&gt;/ {

    msm261d3526hicpm-c-en {
        regulator-boot-on;
    };

    aliases {
        mic-reg = &amp;amp;{/msm261d3526hicpm-c-en};
    };
};

dmic_dev: &amp;amp;pdm0 {
    status = &amp;quot;okay&amp;quot;;
};
    &lt;/pre&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;I also tried using right channel instead of the left one and printing out raw data captured by the microphone.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;The setup:&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;pre class="ui-code" data-mode="text"&gt;#define READ_TIMEOUT     SYS_FOREVER_MS 
#define PCM_WIDTH        16
#define CHANNELS         1
#define SAMPLE_RATE      16000
#define BLOCK_MS         5
#define BLOCK_COUNT      4

#define SAMPLES_PER_BLOCK (SAMPLE_RATE * BLOCK_MS / 1000)
#define BLOCK_SIZE_BYTES  (SAMPLES_PER_BLOCK * CHANNELS * sizeof(int16_t))

K_MEM_SLAB_DEFINE_STATIC(mem_slab, BLOCK_SIZE_BYTES, BLOCK_COUNT, 4);

...

	struct pcm_stream_cfg stream = {
		.pcm_width = PCM_WIDTH,
		.pcm_rate   = SAMPLE_RATE,
		.block_size = BLOCK_SIZE_BYTES,
		.mem_slab  = &amp;amp;mem_slab,
	};
	struct dmic_cfg cfg = {
		.io = {
			/* These fields can be used to limit the PDM clock
			 * configurations that the driver is allowed to use
			 * to those supported by the microphone.
			 */
			.min_pdm_clk_freq = 1000000,
			.max_pdm_clk_freq = 3500000,
			.min_pdm_clk_dc   = 40,
			.max_pdm_clk_dc   = 60,
		},
		.streams = &amp;amp;stream,
		.channel = {
			.req_num_streams = 1,
			.req_num_chan = 1,
			.req_chan_map_lo = dmic_build_channel_map(0, 0, PDM_CHAN_RIGHT),
			.req_chan_map_hi = 0,
		},
	};
&lt;/pre&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;And use:&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;pre class="ui-code" data-mode="text"&gt;	while (true){
		for (int i = 0; i &amp;lt; block_count; ++i) {
			void *buffer;
			uint32_t size;
			int ret;

			ret = dmic_read(dmic_dev, 0, &amp;amp;buffer, &amp;amp;size, READ_TIMEOUT);
			if (ret &amp;lt; 0) {
				LOG_ERR(&amp;quot;%d - read failed: %d&amp;quot;, i, ret);
				return ret;
			}

			int16_t *s = buffer;
			LOG_INF(&amp;quot;RAW: %d %d %d %d %d %d %d %d %d %d&amp;quot;, s[0], s[1], s[2], s[3], s[4], s[5], s[6], s[7], s[8], s[9]);&lt;/pre&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Gives me the following output:&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;pre class="ui-code" data-mode="text"&gt;[00:04:30.396,545] &amp;lt;inf&amp;gt; dmic_sample: RAW: 16208 8192 160 0 9216 244 0 7 7 7
[00:04:30.397,308] &amp;lt;inf&amp;gt; dmic_sample: RMS: 0.069493
[00:04:30.401,550] &amp;lt;inf&amp;gt; dmic_sample: RAW: 16208 8192 160 0 9216 244 0 0 7 7
[00:04:30.402,160] &amp;lt;inf&amp;gt; dmic_sample: RMS: 0.069493
[00:04:30.406,555] &amp;lt;inf&amp;gt; dmic_sample: RAW: 16208 8192 160 0 9216 244 0 0 7 7
[00:04:30.407,165] &amp;lt;inf&amp;gt; dmic_sample: RMS: 0.069493
[00:04:30.411,560] &amp;lt;inf&amp;gt; dmic_sample: RAW: 16208 8192 160 0 9216 244 0 0 7 7
[00:04:30.411,956] &amp;lt;inf&amp;gt; dmic_sample: RMS: 0.069493
[00:04:30.416,564] &amp;lt;inf&amp;gt; dmic_sample: RAW: 16208 8192 160 0 9216 244 7 7 7 7
[00:04:30.416,931] &amp;lt;inf&amp;gt; dmic_sample: RMS: 0.069493
[00:04:30.421,569] &amp;lt;inf&amp;gt; dmic_sample: RAW: 16208 8192 160 0 9216 244 7 7 7 7
[00:04:30.421,936] &amp;lt;inf&amp;gt; dmic_sample: RMS: 0.069493
[00:04:30.426,574] &amp;lt;inf&amp;gt; dmic_sample: RAW: 16208 8192 160 0 9216 244 7 7 7 7
[00:04:30.426,940] &amp;lt;inf&amp;gt; dmic_sample: RMS: 0.069493
[00:04:30.431,549] &amp;lt;inf&amp;gt; dmic_sample: RAW: 16208 8192 160 0 9216 244 0 7 7 7
[00:04:30.432,312] &amp;lt;inf&amp;gt; dmic_sample: RMS: 0.069493
[00:04:30.436,553] &amp;lt;inf&amp;gt; dmic_sample: RAW: 16208 8192 160 0 9216 244 0 0 7 7
[00:04:30.437,133] &amp;lt;inf&amp;gt; dmic_sample: RMS: 0.069493
[00:04:30.441,558] &amp;lt;inf&amp;gt; dmic_sample: RAW: 16208 8192 160 0 9216 244 0 0 7 7
[00:04:30.442,169] &amp;lt;inf&amp;gt; dmic_sample: RMS: 0.069493
[00:04:30.446,563] &amp;lt;inf&amp;gt; dmic_sample: RAW: 16208 8192 160 0 9216 244 0 0 7 7
[00:04:30.446,929] &amp;lt;inf&amp;gt; dmic_sample: RMS: 0.069493
[00:04:30.451,568] &amp;lt;inf&amp;gt; dmic_sample: RAW: 16208 8192 160 0 9216 244 7 7 7 7
&lt;/pre&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Unfortunately, this version does not reflect the sound either. The microphone sort of works, but keeps returning the same data... does not even look like a noise or something... weird.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Thank you for your help,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Jaroslav&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Xiao Seeed nRF52840 Sense - problem reading microphone data</title><link>https://devzone.nordicsemi.com/thread/557737?ContentTypeID=1</link><pubDate>Tue, 30 Dec 2025 14:05:38 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8789f251-cb06-4488-acdf-9c4bacb91654</guid><dc:creator>Syed Maysum Abbas Zaidi</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Thanks for the detailed description and logs.&lt;/p&gt;
&lt;p&gt;The fact that you see changing RMS values only briefly after reset and then a constant value suggests that the PDM capture starts correctly but then stops delivering new samples. On the XIAO BLE Sense this could be related to the Devicetree configuration for the on-board microphone.&lt;/p&gt;
&lt;p&gt;You mentioned that you configured the overlay as suggested in the Seeed wiki. To help us verify that everything matches the expected setup for this board, could you please share the overlay file? Once we can review the overlay, we can check that the microphone power regulator and the PDM/DMIC node are configured as intended and not being overridden.&lt;/p&gt;
&lt;p&gt;Best Regards,&lt;br /&gt;Syed Maysum&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>