Hi! I hope you are well. I have gotten the following example to work well on the nrf9160dk from Nordic, and am struggling to get it to work on the feather:
https://github.com/zephyrproject-rtos/zephyr/blob/main/samples/drivers/audio/dmic/prj.conf
I did update the overlay file to specify pin 3 as data in, since pin 30 is connected to the accelerometer.
/*
* Copyright (c) 2020 Circuit Dojo LLC
*
* SPDX-License-Identifier: Apache-2.0
*/
/ {
chosen {
nordic,pm-ext-flash = &w25q32jv;
};
};
/* add digital mic */
&pinctrl {
pdm0_default_alt: pdm0_default_alt {
group1 {
psels = <NRF_PSEL(PDM_CLK, 0, 31)>,
<NRF_PSEL(PDM_DIN, 0, 3)>;
};
};
};
dmic_dev: &pdm0 {
status = "okay";
pinctrl-0 = <&pdm0_default_alt>;
pinctrl-names = "default";
clock-source = "PCLK32M_HFXO";
};
Since I only have one PDM (not PCM) mic connected, I removed the code specifying the second mic (lines 121 to 132), but otherwise the code is unchanged.
When I run the example it boots, configs the mic correctly (I believe), then enters the loop to read data where it seems to reads some data, start to print it through LOG_INF, then crash and reboot.
Connecting..
Connected to /dev/cu.usbserial-110!
*** Booting Zephyr OS build v3.3.99-ncs1-2 ***
[00:00:00.256,866] <inf> main: DMIC sample
[00:00:00.261,413] <inf> main: PCM output rate: 16000, channels: 1
[00:00:00.268,096] <inf> dmic_nrfx_pdm: PDM clock frequency: 1280000, actual PCM rate: 16000
*** Booting Zephyr OS build v3.3.99-ncs1-2 ***0x20012708 of 3200 bytes
[00:00:00.256,866] <inf> main: DMIC sample
[00:00:00.261,413] <inf> main: PCM output rate: 16000, channels: 1
[00:00:00.268,066] <inf> dmic_nrfx_pdm: PDM clock frequency: 1280000, actual PCM rate: 16000
*** Booting Zephyr OS build v3.3.99-ncs1-2 ***0x20012708 of 3200 bytes
[00:00:00.256,896] <inf> main: DMIC sample
[00:00:00.261,474] <inf> main: PCM output rate: 16000, channels: 1
[00:00:00.268,127] <inf> dmic_nrfx_pdm: PDM clock frequency: 1280000, actual PCM rate: 16000
*** Booting Zephyr OS build v3.3.99-ncs1-2 ***0x20012708 of 3200 bytes
[00:00:00.256,896] <inf> main: DMIC sample
[00:00:00.261,444] <inf> main: PCM output rate: 16000, channels: 1
[00:00:00.268,127] <inf> dmic_nrfx_pdm: PDM clock frequency: 1280000, actual PCM rate: 16000
*** Booting Zephyr OS build v3.3.99-ncs1-2 ***0x20012708 of 3200 bytes
I have tried a number of different pins, a range of values for CONFIG_MAIN_STACK_SIZE in proj.conf and can’t get anything to work.
It’s mystifying since I am using code that worked on the nordic dev kit, so I’m loath to make large changes.
Thank you!
Jason