Configure microphones on ST Discovery kit IoT node


Daniele Bortoluzzi <danieleb88@...>
 

Hi,
I'm Bortoluzzi Daniele, and I'm developing, for my master's thesis with University of Turin, a project using platformio and zephyr, helped by my thesis advisor and co-supervisor.

I would like to use the microphone (MP34DT01) of the B-L475E-IOT01A (ST Discovery kit IoT node) in a zephyr project. This mcu is supported by zephyr, but the .dts file doesn't configure the interface used by mic.

According with the hardware specs [1], I tried to start from zephyr example using st_mpxxdtyy driver [2] and configure:

prj.conf:

CONFIG_AUDIO=y
CONFIG_AUDIO_DMIC=y
CONFIG_AUDIO_MPXXDTYY=y


app.overlay:

&XXXX {
     status = "okay";
     pinctrl-0 = <&YYYY &ZZZZ>;
     pinctrl-names = "default";

     mp34dt01: mp34dt01@0 {
            compatible = "st,mpxxdtyy";
            reg = <0>;
            label = "MP34DT01";
     };
};


According with the specs [1] and analyzing the ST function pack FP-AI-SENSING1 [4], we think we should use:
- DFSDM1_CKOUT —» pin PE9
- DFSDM1_DATIN2 —» pin PE7
but we don't know how to write the DTS file.

In particular, about the app.overlay, we are not sure:
- which interface to use (XXXX field)
- which pin variables to use (YYYY, ZZZZ fields).

Could you please help us?

Thank you very much for your support.

Daniele

Some infos:


Daniele Bortoluzzi <danieleb88@...>
 

Hi,
I also tried these configurations, according to .dts specs:

prj.conf:
CONFIG_DMA=y

app.overlay:
/ {
soc {
i2c4: i2c@40005800 {
compatible = "st,stm32-i2c-v2";
#address-cells = <1>;
#size-cells = <0>;
label= "I2C_4";

status = "okay";
pinctrl-names = "default";
clock-frequency = <I2C_BITRATE_FAST_PLUS>;

mp34dt01@0 {
compatible = "st,mpxxdtyy";
reg = <0>;
label = "MP34DT01";
};
};
};

i2c4_ck_pe9: i2c4_ck_pe9@0 {
pinmux = <STM32_PINMUX('E', 9, GPIO)>;
drive-open-drain;
};

i2c4_da_pe7: i2c4_da_pe7@0 {
pinmux = <STM32_PINMUX('E', 7, GPIO)>;
drive-open-drain;
};
};

&i2c4 {
pinctrl-names = "default";
pinctrl-0 = <&i2c4_ck_pe9 &i2c4_da_pe7>;
};

But it doesn't compile:
Error: disco_l475_iot1.dts.pre.tmp:1939.55-56 syntax error
FATAL ERROR: Unable to parse input tree



Il giorno mer 9 mar 2022 alle ore 09:48 Daniele Bortoluzzi <danieleb88@...> ha scritto:
Hi,
I'm Bortoluzzi Daniele, and I'm developing, for my master's thesis with University of Turin, a project using platformio and zephyr, helped by my thesis advisor and co-supervisor.

I would like to use the microphone (MP34DT01) of the B-L475E-IOT01A (ST Discovery kit IoT node) in a zephyr project. This mcu is supported by zephyr, but the .dts file doesn't configure the interface used by mic.

According with the hardware specs [1], I tried to start from zephyr example using st_mpxxdtyy driver [2] and configure:

prj.conf:

CONFIG_AUDIO=y
CONFIG_AUDIO_DMIC=y
CONFIG_AUDIO_MPXXDTYY=y


app.overlay:

&XXXX {
     status = "okay";
     pinctrl-0 = <&YYYY &ZZZZ>;
     pinctrl-names = "default";

     mp34dt01: mp34dt01@0 {
            compatible = "st,mpxxdtyy";
            reg = <0>;
            label = "MP34DT01";
     };
};


According with the specs [1] and analyzing the ST function pack FP-AI-SENSING1 [4], we think we should use:
- DFSDM1_CKOUT —» pin PE9
- DFSDM1_DATIN2 —» pin PE7
but we don't know how to write the DTS file.

In particular, about the app.overlay, we are not sure:
- which interface to use (XXXX field)
- which pin variables to use (YYYY, ZZZZ fields).

Could you please help us?

Thank you very much for your support.

Daniele

Some infos:


Marco Cavallini
 

On 12/03/22 12:11, Daniele Bortoluzzi wrote:
Hi,
I also tried these configurations, according to .dts specs:
- *prj.conf*:
CONFIG_DMA=y
- *app.overlay*:
/ {
soc {
i2c4: i2c@40005800 {
compatible = "st,stm32-i2c-v2";
#address-cells = <1>;
#size-cells = <0>;
label= "I2C_4";
status = "okay";
pinctrl-names = "default";
clock-frequency = <I2C_BITRATE_FAST_PLUS>;
mp34dt01@0 {
compatible = "st,mpxxdtyy";
reg = <0>;
label = "MP34DT01";
};
};
};
i2c4_ck_pe9: i2c4_ck_pe9@0 {
pinmux = <STM32_PINMUX('E', 9, GPIO)>;
drive-open-drain;
};
i2c4_da_pe7: i2c4_da_pe7@0 {
pinmux = <STM32_PINMUX('E', 7, GPIO)>;
drive-open-drain;
};
};
&i2c4 {
pinctrl-names = "default";
pinctrl-0 = <&i2c4_ck_pe9 &i2c4_da_pe7>;
};
But it doesn't compile:
/Error: disco_l475_iot1.dts.pre.tmp:1939.55-56 syntax error
FATAL ERROR: Unable to parse input tree/

Hi Daniele,
'm not using Zephyr Project at the moment, however showing your DTS and a better description and excerpts would help to figure out the solution.

Just my two cents ;-)


Distinti Saluti / Best Regards
--
Marco Cavallini | KOAN sas
Bergamo - Italia
embedded software engineering
https://KoanSoftware.com