Integration of PDM microphone with thingy53

I want to integrate the PDM microphone with thingy53, I found no particular sample code for it

Would be needing help from scratch

Parents
  • Hi Rakshita

    Have you tested the DMIC sample in the SDK?

    It is not officially supported on the Thingy53, but it does support the nRF5340DK. If you copy and rename the nrf5340dk_nrf5340_cpuapp.overlay file to thingy53_nrf5340_cpuapp.overlay, and change the pins as necessary, I would expect the example to work on the thingy as well. 

    Not sure what you mean about repeating output? If I understand you correctly the clock output from the nRF53 is fine, but the data from the microphone seems wrong? Would you be able to attach a trace/scope capture? 

    Best regards
    Torbjørn

  • dmic is not working with thingy53 even after changing the overlay files 

  • Executing task: nRF Connect: Build: dmic_thingy53/build (active) 
    
    Building dmic_thingy53
    west build --build-dir c:/nrf/samples/bluetooth/dmic_thingy53/build c:/nrf/samples/bluetooth/dmic_thingy53
    
    -- west build: generating a build system
    Loading Zephyr default modules (Zephyr base (cached)).
    -- Application: C:/nrf/samples/bluetooth/dmic_thingy53
    -- CMake version: 3.20.5
    -- Cache files will be written to: C:/ncs/v2.5.2/zephyr/.cache
    -- Zephyr version: 3.4.99 (C:/ncs/v2.5.2/zephyr)
    -- Found west (found suitable version "1.1.0", minimum required is "0.14.0")
    -- Board: thingy53_nrf5340_cpuapp
    -- Found host-tools: zephyr 0.16.1 (C:/ncs/toolchains/c57af46cb7/opt/zephyr-sdk)
    -- Found toolchain: zephyr 0.16.1 (C:/ncs/toolchains/c57af46cb7/opt/zephyr-sdk)
    -- Found BOARD.dts: C:/ncs/v2.5.2/zephyr/boards/arm/thingy53_nrf5340/thingy53_nrf5340_cpuapp.dts
    -- Found devicetree overlay: C:/nrf/samples/bluetooth/dmic_thingy53/boards/thingy53_nrf5340_cpuapp.overlay
    devicetree error: pinctrl-names property in /soc/peripheral@50000000/pdm@26000 in C:/ncs/v2.5.2/zephyr/misc/empty_file.c has 1 strings, expected 2 strings
    -- In: C:/nrf/samples/bluetooth/dmic_thingy53/build/zephyr, command: C:/ncs/toolchains/c57af46cb7/opt/bin/python.exe;C:/ncs/v2.5.2/zephyr/scripts/dts/gen_defines.py;--dts;C:/nrf/samples/bluetooth/dmic_thingy53/build/zephyr/zephyr.dts.pre;--dtc-flags;'-Wno-unique_unit_address_if_enabled';--bindings-dirs;C:/ncs/v2.5.2/nrf/dts/bindings;C:/ncs/v2.5.2/zephyr/dts/bindings;--header-out;C:/nrf/samples/bluetooth/dmic_thingy53/build/zephyr/include/generated/devicetree_generated.h.new;--dts-out;C:/nrf/samples/bluetooth/dmic_thingy53/build/zephyr/zephyr.dts.new;--edt-pickle-out;C:/nrf/samples/bluetooth/dmic_thingy53/build/zephyr/edt.pickle;--vendor-prefixes;C:/ncs/v2.5.2/nrf/dts/bindings/vendor-prefixes.txt;--vendor-prefixes;C:/ncs/v2.5.2/zephyr/dts/bindings/vendor-prefixes.txt
    -- Configuring incomplete, errors occurred!
    CMake Error at C:/ncs/v2.5.2/zephyr/cmake/modules/dts.cmake:279 (message):
      gen_defines.py failed with return code: 1
    Call Stack (most recent call first):
      C:/ncs/v2.5.2/zephyr/cmake/modules/zephyr_default.cmake:129 (include)
      C:/ncs/v2.5.2/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:66 (include)
      C:/ncs/v2.5.2/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:97 (include_boilerplate)
      CMakeLists.txt:5 (find_package)
    
    
    FATAL ERROR: command exited with status 1: 'C:\ncs\toolchains\c57af46cb7\opt\bin\cmake.EXE' -DWEST_PYTHON=C:/ncs/toolchains/c57af46cb7/opt/bin/python.exe '-Bc:\nrf\samples\bluetooth\dmic_thingy53\build' -GNinja '-Sc:\nrf\samples\bluetooth\dmic_thingy53'
    
     *  The terminal process terminated with exit code: 1. 
     *  Terminal will be reused by tasks, press any key to close it. 

  • Can you tell me what to do next, I am kind of stuck on this microphone thing only 

  • There is also an error in main function

    Can u please help me out to solve it

  • In main.c file dmic_dev is actually not present in common.dtsi file so did u added it externally

  • Hi 

    Rakshita said:
    In main.c file dmic_dev is actually not present in common.dtsi file so did u added it externally

    Yes, I added this in the overlay files in the board folder of the example I sent you:

    dmic_dev: &pdm0 {
    	status = "okay";
    	pinctrl-0 = <&pdm0_default_alt>;
    	pinctrl-names = "default";
    	clock-source = "ACLK";
    };
    

    Rakshita said:

    There is also an error in main function

    Can u please help me out to solve it

    Could you zip your example and attach it to the case? Then I will try to build it and see if I can spot the issue. 

    Best regards
    Torbjørn

Reply
  • Hi 

    Rakshita said:
    In main.c file dmic_dev is actually not present in common.dtsi file so did u added it externally

    Yes, I added this in the overlay files in the board folder of the example I sent you:

    dmic_dev: &pdm0 {
    	status = "okay";
    	pinctrl-0 = <&pdm0_default_alt>;
    	pinctrl-names = "default";
    	clock-source = "ACLK";
    };
    

    Rakshita said:

    There is also an error in main function

    Can u please help me out to solve it

    Could you zip your example and attach it to the case? Then I will try to build it and see if I can spot the issue. 

    Best regards
    Torbjørn

Children
Related