Adding VM3011 Audio Driver Issues

I'm attempting to integrate the VM3011 audio driver into my project which uses the Thingy53 platform.

This question originally led me to Edge Impulse's VM3011 driver code: Audio driver for VM3011 in Thingy:53 - Nordic Q&A - Nordic DevZone - Nordic DevZone (nordicsemi.com)

I copied the vm3011 folder: firmware-nordic-thingy53/drivers/vm3011 at main · edgeimpulse/firmware-nordic-thingy53 · GitHub from their repository into my own project under a /drivers folder at the root of my application.

I think added the corresponding KConfig options from the driver to the prj.conf file:

# Microphone Support
CONFIG_VM3011=y
CONFIG_VM3011_PDM_BUFFER_SIZE=1600
CONFIG_AUDIO=y
CONFIG_AUDIO_DMIC=y
CONFIG_AUDIO_DMIC_LOG_LEVEL_DBG=y

and finally in the root CMakeLists.txt for the project I added:

set(ZEPHYR_EXTRA_MODULES ${CMAKE_CURRENT_SOURCE_DIR}/drivers/vm3011)

When I attempt to compile my project I get the following error:

C:/ncs/v2.3.0/zephyr/scripts/kconfig/kconfig.py: Dependency loop
===============

I2C (defined at boards/shields\x_nucleo_53l0a1\Kconfig.defconfig:9, C:/ncs/v2.3.0/zephyr/boards/arm/thingy53_nrf5340/Kconfig.defconfig:95, drivers/i2c/Kconfig:9), with definition...

config I2C
        bool
        default y
        depends on SHIELD_X_NUCLEO_53L0A1

config I2C
        bool
        default y
        depends on !TRUSTED_EXECUTION_SECURE && (BOARD_THINGY53_NRF5340_CPUAPP || BOARD_THINGY53_NRF5340_CPUAPP_NS)

menuconfig I2C
        bool "I2C Drivers"
        help
          Enable I2C Driver Configuration

My questions are as follows:
1) Why would my project, which targets that thingy53_nrf5340_cpuapp_ns board target pull in some kconfig resources for the x_nucleo_53l0a1 shield? This reference to the shield is causing a dependency loop error listed above. How would I debug why this shield file gets pulled in?

2) Is there a good example for adding an out of tree driver to a basic project? My understanding is that I need to provide the driver files which Edge Impulse as already written, then add a devicetree overlay file that adds the vm3011 to system and it should just work correct?

Parents
  • Spent some more time digging and troubleshooting and I found a suggested solution from EdgeImpulse here: https://forum.edgeimpulse.com/t/firmware-nordic-thingy-53-build-error-in-nrf-connect-sdk/5533

    The problem is I can't roll back to less than v2.x.x of the SDK.

    Any idea what the root cause of this is? If it builds correctly in nRF SDK 1.9.1 but fails on all v2+ versions what could have changed in the KConfig that would cause this kind of dependence?

  • I think you will have to wait for the update from Edge Impulse, which in the forum post they say will take a couple of weeks.

  • Thanks for looking into this  I think you are right and I'll just have to wait and see what EdgeImpulse develops. No sense in doing the work twice.

    Here are a few observations I found while trying to root cause the issue that might be of help to others with similar problems:

    1) The messages that appear in the errors don't actually appear in the files that it references or anywhere in the SDK.

    config I2C
            bool
            default y
            depends on SHIELD_X_NUCLEO_53L0A1

    The above section of the error doesn't exist in the Nucleo shield defconfig file referenced in the error. There are no "bool" or "depends on SHIELD_X_NUCLEO_53L0A1" lines in the actual file.

    2) When I remove the line `select SENSOR` from the vm3011 driver config the dependency loop goes away. I tried tracing the files that SENSOR includes or selects but was not able to find a link back to the nucleo board.

  • I haven't checked in with Edge Impulse on whether or not they released an updated version but if anyone still needs a barebones driver for this attached is what I ended up using. I took what was available from Edge Impulse at the time and reworked it to allow for blocking audio calls and removed the I2C capabilities to fix the configuration issue.

    The attached code should be useful for anyone looking to pull data from the microphone on the Thingy:53 in it's default configuration. You can adjust sample rate but you can't adjust any of the gain or wake up settings with this code. Feel free to use this as a reference, I make no claims to it's stability or licensing in any way.

    vm3011.zip

Reply
  • I haven't checked in with Edge Impulse on whether or not they released an updated version but if anyone still needs a barebones driver for this attached is what I ended up using. I took what was available from Edge Impulse at the time and reworked it to allow for blocking audio calls and removed the I2C capabilities to fix the configuration issue.

    The attached code should be useful for anyone looking to pull data from the microphone on the Thingy:53 in it's default configuration. You can adjust sample rate but you can't adjust any of the gain or wake up settings with this code. Feel free to use this as a reference, I make no claims to it's stability or licensing in any way.

    vm3011.zip

Children
No Data
Related