Hi, I’m the Toradex AI Assistant. The Toradex Support team will follow up with you shortly!
Did you like my answer?
Yes, it is possible to connect a PDM digital microphone to the Apalis iMX8 and configure it using a device tree overlay. Below are the steps to create a device tree overlay to connect the PDM microphone to the specified pins (200 for Clock and 202 for DAP1_D_IN).
Steps to Create a Device Tree Overlay
-
Create the Device Tree Overlay Source File:
Create a new file, for example,pdm-mic-overlay.dts
. -
Define the Overlay Header:
The header should include the/plugin/;
directive and the target compatible device./dts-v1/; /plugin/; / { compatible = "toradex,apalis-imx8"; };
-
Define the Pin Control Node:
Define the pin control settings for the PDM microphone pins.&iomuxc { pinctrl_pdm_mic: pdm_micgrp { fsl,pins = < MX8QM_I2S0_TXC_LSIO_GPIO3_IO20 0x1c0 /* Pin 200: Clock */ MX8QM_I2S0_RXD_LSIO_GPIO3_IO22 0x1c0 /* Pin 202: DAP1_D_IN */ >; }; };
-
Configure the Audio Interface:
Configure the audio interface to use the PDM microphone.&sai1 { pinctrl-names = "default"; pinctrl-0 = <&pinctrl_pdm_mic>; status = "okay"; pdm_mic: pdm-mic { compatible = "pdm-microphone"; clocks = <&clks IMX8QM_CLK_SAI1>; clock-names = "pdm_clk"; pinctrl-names = "default"; pinctrl-0 = <&pinctrl_pdm_mic>; status = "okay"; }; };
-
Compile the Device Tree Overlay:
Use the Device Tree Compiler (DTC) to compile the overlay source file into a binary overlay file (.dtbo).dtc -I dts -O dtb -o pdm-mic-overlay.dtbo pdm-mic-overlay.dts
-
Deploy the Device Tree Overlay:
Copy the compiled.dtbo
file to the boot partition of your Apalis iMX8 module.cp pdm-mic-overlay.dtbo /media/boot/
-
Enable the Device Tree Overlay:
Edit theoverlays.txt
file located on the boot partition to include the new overlay.echo "pdm-mic-overlay.dtbo" >> /media/boot/overlays.txt
-
Sync and Reboot:
Ensure the changes are written to the file system and reboot the board.sync reboot
Summary
By following these steps, you should be able to connect and configure a PDM digital microphone to the Apalis iMX8 using a device tree overlay. This configuration assumes that the PDM microphone is compatible and that the necessary drivers are available in the kernel. If additional configuration or driver support is needed, you may need to adjust the overlay or kernel configuration accordingly.
Please, also check if these links can help you solve your problem: