[Custom Board] CC-WST-J17D-NK – MEMS microphones not working: no clock generated, empty recording (DTS/Yocto)

Hi,

I developed a custom board for a CC-WST-J17D-NK module. Everything works fine except for the MEMS microphones.

I connected two microphones (CMM-4030DT-261280-TR) to the module: CLOCK to D1 and DATA to D0 (configured using the Digi ConnectCore Smart IOmux tool). One is configured as right channel and the second as left channel.

My difficulty is configuring the DTS file for Yocto:

/ {

dummy_codec_mic: dummy-codec-mic {

    compatible = "linux,snd-soc-dummy";

    #sound-dai-cells = <0>;

};



sound_mic: sound-mic {

    compatible = "simple-audio-card";

    simple-audio-card,name = "SAI1A-Mic-Stereo";

    simple-audio-card,format = "pdm";



    sai1a_cpu: simple-audio-card,cpu {

        sound-dai = <&sai1a>;

    };



    simple-audio-card,codec {

        sound-dai = <&dummy_codec_mic>;

    };

};

};

&sai1 {

pinctrl-names = "default", "sleep";

pinctrl-0 = <&ccmp25_sai1_pins>;

pinctrl-1 = <&ccmp25_sai1_sleep_pins>;

status = "okay";



sai1a: audio-controller@4400b004 {

    dma-names = "rx";                   /\* capture uniquement \*/

    status = "okay";



    sai1a_port: port {

        sai1a_endpoint: endpoint {

            format = "pdm";

        };

    };

};

};

&pinctrl {

ccmp25_sai1_pins: ccmp25-sai1 {

    pins {

        pinmux = <STM32_PINMUX('D',  0,  AF6)>, /\* SAI1_D1 \*/

                 <STM32_PINMUX('D',  1,  AF6)>; /\* SAI1_CK2 \*/

        drive-push-pull;

        bias-disable;

        slew-rate = <1>;

    };

};



ccmp25_sai1_sleep_pins: ccmp25-sai1-sleep {

    pins {

        pinmux = <STM32_PINMUX('D',  0, ANALOG)>, /\* SAI1_D1 \*/

                 <STM32_PINMUX('D',  1, ANALOG)>; /\* SAI1_CK2 \*/

    };

};

};

under Linux I can see the sound card, but when I perform a recording it is empty and no clock is generated (verified with an oscilloscope).

If someone could help me debug this, I would appreciate it.

Thank you in advance.

Here’s a well-structured forum response you can post:


Hi Philippe,

Thanks for the detailed post — this is a good starting point for debugging. The symptom of no clock on the oscilloscope is the key clue here, and it points to a few likely DTS configuration issues rather than a hardware problem. Let’s work through them:


1. PDM format is not standard simple-audio-card territory

The simple-audio-card driver works well for I2S/PCM audio, but PDM microphones on STM32MP25 SAI peripherals typically need to be declared using the digi,ccmp2x-sound or the STM32-specific SAI PDM binding rather than simple-audio-card with format = "pdm". The linux,snd-soc-dummy codec also won’t drive any clock generation — it is purely a placeholder.

Try replacing your sound node with the STM32 SAI PDM approach:

&sai1 {
    pinctrl-names = "default", "sleep";
    pinctrl-0 = <&ccmp25_sai1_pins>;
    pinctrl-1 = <&ccmp25_sai1_sleep_pins>;
    status = "okay";

    sai1a: audio-controller@4400b004 {
        #sound-dai-cells = <0>;
        dma-names = "rx";
        st,sync = "internal";
        clocks = <&rcc SAI1_K>;
        clock-names = "sai_ck";
        status = "okay";
    };
};


2. Clock source must be explicitly set

The SAI peripheral will not generate a clock unless the kernel knows which clock tree to use. Make sure your SAI node includes the correct clocks and clock-names properties pointing to your RCC clock source. Without this the SAI controller powers up but never enables the MCLK/BCLK output — which matches exactly what you’re seeing on the oscilloscope.


3. Pin mux — verify D0/D1 alternate function

Double-check in the STM32MP257 datasheet that AF6 on PD0 and PD1 maps to SAI1_D1 and SAI1_CK2 specifically for your silicon revision. Also confirm the IOmux tool output matches — there have been cases where the tool and the actual AF table differ by one.


4. Verify the SAI subblock address

The address 4400b004 for sai1a — please confirm this against the STM32MP25 reference manual for your specific variant. An incorrect register base address will cause the driver to bind silently but never actually configure the hardware.


5. Quick debug steps to try right now

# Check that the SAI clock is actually running
cat /sys/kernel/debug/clk/sai1/clk_rate

# Check ALSA sees the card
aplay -l
arecord -l

# Try a capture with verbose output
arecord -D hw:0,0 -f S16_LE -r 16000 -c 2 -v test.wav
dmesg | grep -i sai

The dmesg output after attempting a recording would be very helpful to share here.


Could you share the following so we can dig deeper:

  • Output of dmesg | grep -i sai after boot

  • Output of cat /sys/kernel/debug/clk/sai1/clk_rate

  • The full IOmux tool configuration screenshot or export

  • Which Yocto DEY version you are using

That will help us pinpoint whether this is a clock tree, DTS binding, or pin configuration issue.

1 Like

Thank you for your reply.

You are right, I had some mistakes in my DTS (wrong GPIO and alternate function). Here is my updated code — I have commented out dummy_codec_mic and sound_min:

&sai1 {

pinctrl-names = “default”, “sleep”;

pinctrl-0 = <&ccmp25_sai1_pins>;

pinctrl-1 = <&ccmp25_sai1_sleep_pins>;

status = “okay”;

sai1a: audio-controller@40290004 {

#sound-dai-cells = <0>;

compatible = “st,stm32-sai-sub-a”;

dma-names = “rx”;

st,sync = “internal”;

clocks = <&rcc CK_KER_SAI1>;

clock-names = “sai_ck”;

status = “okay”;

sai1a_port: port {

sai1a_endpoint: endpoint {

format = “pdm”;

};

};

};

};

&pinctrl {

ccmp25_sai1_pins: ccmp25-sai1 {

pins {

pinmux = <STM32_PINMUX(‘D’, 0, AF3)>, /* SAI1_D1 */

<STM32_PINMUX(‘D’, 3, AF3)>; /* SAI1_CK2 */

drive-push-pull;

bias-disable;

slew-rate = <1>;

};

};

ccmp25_sai1_sleep_pins: ccmp25-sai1-sleep {

pins {

pinmux = <STM32_PINMUX(‘D’, 0, ANALOG)>, /* SAI1_D1 */

<STM32_PINMUX(‘D’, 3, ANALOG)>; /* SAI1_CK2 */

};

};

};

However, nothing seems to be working yet. Here is what I get when running the following commands:

root@ccmp25-dvk:~# cat /sys/kernel/debug/clk/ck_icn_p_sai1/clk_rate
200000000
root@ccmp25-dvk:~# aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: Dummy [Dummy], device 0: Dummy PCM [Dummy PCM]
Subdevices: 8/8
Subdevice #0: subdevice 0
Subdevice #1: subdevice 1
Subdevice #2: subdevice 2
Subdevice #3: subdevice 3
Subdevice #4: subdevice 4
Subdevice #5: subdevice #6:
Subdevice #6: subdevice 6
Subdevice #7: subdevice 7
root@ccmp25-dvk:~# arecord -l
**** List of CAPTURE Hardware Devices ****
card 0: Dummy [Dummy], device 0: Dummy PCM [Dummy PCM]
Subdevices: 8/8
Subdevice #0: subdevice 0
Subdevice #1: subdevice 1
Subdevice #2: subdevice 3
Subdevice #3: subdevice 4
Subdevice #4: subdevice 4
Subdevice #5: subdevice 5
Subdevice #6: subdevice 6
Subdevice #7: subdevice 7
root@ccmp25-dvk:~# arecord -D hw:0,0 -f S16_LE -r 16000 -c 2 -v test.wav
Hardware PCM card 0 ‘Dummy’ device 0 subdevice 0
Its setup is:
stream : CAPTURE
access : RW_INTERLEAVED
format : S16_LE
subformat : STD
channels : 2
rate : 16000
exact rate : 16000 (16000/1)
msbits : 16
buffer_size : 8000
period_size : 2000
period_time : 125000
tstamp_mode : ENABLE
tstamp_type : MONOTONIC
period_step : 1
avail_min : 2000
period_event : 0
start_threshold : 1
stop_threshold : 8000
silence_threshold: 0
silence_size : 0
boundary : 9007199254740992000
appl_ptr : 0
hw_ptr : 0
Recording WAVE ‘test.wav’ : Signed 16 bit Little Endian, Rate 16000 Hz, Stereo
^CAborted by signal Interrupt…
root@ccmp25-dvk:~# dmesg | grep -i sai
root@ccmp25-dvk:~#

The SAI1 device does not appear in arecord -l (only the Dummy card is listed), and dmesg | grep -i sai returns nothing. It seems the SAI1 node is not being probed at all.

Thank you.

Voici une version corrigée :


Hi,

I understand why I cannot configure PDM. This mode is not managed by the driver. Does anybody have any experience with it?

Thanks