cancel
Showing results for 
Search instead for 
Did you mean: 

Is there a tutorial or a working example of DFSDM on STM32MP157C-DK2 board ?

NLERO.1
Associate II

Hi all,

I am not familiar with STM32 platform but the DFSDM ADC feature seems to do exactly what I want (external delta-sigma modulator + digital filtering).

I bought a STM32MP157C-DK2 board and started playing with it. But, I can't find any working example of DFDSM and I am a bit lost ...

What would be the best way to start working with DFSDM ?

Thanks,

Best regards,

Nicolas

5 REPLIES 5
NLERO.1
Associate II

Thanks, I will check these links.

Best regards,

Nicolas

NLERO.1
Associate II

Hi,

I have been able to install kernel 5.4.31 on the board with the support of dfsdm following the wiki and the docs.

I have now two iio devices : dfsdm-adc0 and soc:adc-1

But I can't figure out how to use them and I can't see the clock on pin B13.

Here is the end of stm32mp15c-dk2.dts :

&dfsdm {
        pinctrl-names = "default", "sleep";
        pinctrl-0 = <&dfsdm_clkout_pins_a &dfsdm_data1_pins_a>;                        /* default pins */
        pinctrl-1 = <&dfsdm_clkout_sleep_pins_a &dfsdm_data1_sleep_pins_a>;            /* sleep pins for low-power mode */
        spi-max-frequency = <2048000>;                                                 /* desired maximum clock rate */
        status = "okay";
        dfsdm0: filter@0 {
                st,adc-channels = <1>;                                                 /* Assign channel 1 to this filter */
                st,adc-channel-names = "in1";                                          /* Give it a name */
                st,adc-channel-types = "SPI_R";                                        /* SPI data on rising edge */
                st,adc-channel-clk-src = "CLKOUT_F";                                   /* internal clock source used for conversion */
                io-channels = <&sd_adc1>;                                              /* phandle to the external sd-modulator */
                st,filter-order = <1>;
                status = "okay";
        };
};

And stm32mp15-pinctrl.dtsi :

dfsdm_clkout_pins_a: dfsdm-clkout-pins-0 {
                pins {
                        pinmux = <STM32_PINMUX('B', 13, AF3)>; /* DFSDM_CKOUT */
                        bias-disable;
                        drive-push-pull;
                        slew-rate = <0>;
                };
        };
 
        dfsdm_clkout_sleep_pins_a: dfsdm-clkout-sleep-pins-0 {
                pins {
                        pinmux = <STM32_PINMUX('B', 13, ANALOG)>; /* DFSDM_CKOUT */
                };
        };
 
        dfsdm_data1_pins_a: dfsdm-data1-pins-0 {
                pins {
                        pinmux = <STM32_PINMUX('C', 3, AF3)>; /* DFSDM_DATA1 */
                };
        };
 
        dfsdm_data1_sleep_pins_a: dfsdm-data1-sleep-pins-0 {
                pins {
                        pinmux = <STM32_PINMUX('C', 3, ANALOG)>; /* DFSDM_DATA1 */
                };
        };

What is the best way to start the modulator ? (I understand that it is not started by I might be wrong).

Thanks,

Best regards,

Nicolas

DDzie.1
Associate

Hi,

We have the same problem like Nicolas with DFSDM and microphones on our STM32MP157 prototype board from SomLabs. We configure DTS for STM32MP157 to working with two STM digital microphones with PDM interface.

We hope that We have propertly configure all in CubeMX but We don't have any signal clock after try arecord command in ALSA framework.

After boot we have following info in dmesg log.

[   3.365302] asoc-audio-graph-card sound_card: dmic-hifi <-> 4400d000.dfsdm:filter@0:dfsdm-d mapping ok

[   3.373574] asoc-audio-graph-card sound_card: dmic-hifi <-> 4400d000.dfsdm:filter@1:dfsdm-d mapping ok

What is wrong.

Please help us to solve this.

Best regards,

Dariusz Dziel

farid
Associate II

Hi,

Did anyone find solution to DFSDM Clock issue? We are facing the similar problem.

I've interfaced a single Digital Microphone with PDM output to OSD32MP1-RED board using DFSDM peripheral.

I modifed the devicetree source (kernel, uboot, tfa) following the application note AN5027, DFSDM Devicetree structure in STM32MP157C-EV1 board and the STM32CubeMX project.

Code compiles and runs OK, and I see the dfsdm iio node and ALSA command “arecord -l�? shows the soundcard entry.

The ALSA audio record (arecord) command completes successfully but the captured audio file is empty, no sound at all.

After some debugging I found that DFSDM Clock on pin PB13 (DFSDM1_CKOUT) is not generating.

Would appreciate if someone could help me find what's wrong or missing.