Skip to main content
Graduate
June 13, 2023
Question

Define an ASoC soundcard in a separate Device Tree file?

  • June 13, 2023
  • 5 replies
  • 1758 views

Hi,

I'm looking into creating sound cards with STM32MP135F-DK discovery board, and it seems that all the tutorials point to editing the /core/arch/arm/dts/stm32mp135f-dk.dts so that it takes the new sound card into account. Previously I had a chance to work with Raspberry Pi and there it's not uncommon to have multiple .dts files handling different things.

Is it possible to define a sound card in a separate file from the main board.dts also on the stm32 MPUs, or is it really a necessity to append to the the main file? If so, how?

    This topic has been closed for replies.

    5 replies

    Technical Moderator
    June 13, 2023

    HI @Antoni Jankowski​ ,

    as far as I know, you could add as many 'include' as you want in dts files.

    https://wiki.st.com/stm32mpu/wiki/STM32_MPU_device_tree

    For instance: https://github.com/STMicroelectronics/u-boot/blob/v2021.10-stm32mp/arch/arm/dts/stm32mp135f-dk.dts

    Regards.

    AJank.2Author
    Graduate
    June 13, 2023

    Shall I then include the stm32mp135f-dk.dts in my soundcard.dts file or the other way? The soundcard.dts has to use the i2s nodes, so my intuition tells me that the latter is correct.

    Technical Moderator
    June 13, 2023

    If you are using an STM32MP135F-DK board, I think easier way is to #include your own dts 'adds' in existing stm32mp135f-dk.dts file.

    In other way, you could define a new myboard.dts with all your wished additional settings and #include the stm32mp135f-dk.dts in it, but I guess this will require to modify some compilation script and configuration files to use a new myboard.dtb file name.

    I'm not expert and if you did not reach a working solution, feel free to continue this thread or better open a new one with details of encountered issues.

    Regards.

    AJank.2Author
    Graduate
    June 13, 2023

    Can you maybe provide an example of I2S-only based soundcard device tree configuration? The codec I want to use is rather simple, similar to PCM5102a, however the set up still isn't clear. The examples seem to mostly rely on sai bus.

    Technical Moderator
    June 13, 2023

    We use I2S on STM32MP157F-DK2 for audio output on HDMI chipset (SiI9022).

    https://github.com/STMicroelectronics/u-boot/blob/v2021.10-stm32mp/arch/arm/dts/stm32mp15xx-dkx.dtsi

    If possible on your board, we recommend using SAI as it is likely more flexible than SPI/I2S as fully tailored for audio purposes.

    Regards.