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 Reply
  • Hi Rakshita

    Could you try to build for thingy53_nrf5340_cpuapp instead of thingy53_nrf5340_cpuapp_ns? 

    I am also struggling to get it to work when building for the non secure target. 

    When building for thingy53_nrf5340_cpuapp I was able to see activity on the PDM clock line, which I routed to P0.08 so that it can be accessed from the debug and extension board. 

    I have included my modified dmic example below: 

    dmic_thingy53.zip

    Best regards
    Torbjørn

Children
  • The code which you shared is not building, terminating with exit code 1

  • Hi Rakshita

    I set the PDM_CLK to P0.08 and the data pin to P0.09, as you can see from the overlay:

    	psels = <NRF_PSEL(PDM_CLK, 0, 8)>,
    		<NRF_PSEL(PDM_DIN, 0, 9)>;

    Which SDK version are you using to build it? 

    Can you share the full build output with me so I can try to figure out what is happening? 
    Please use the Insert -> Code feature in devzone to add a larger block of text, or attach the build output as a text file. 

    Best regards
    Torbjørn

  • Yes but as per the thingy's schematic the clk pin is P1.09 and data pin is P0.27
    sdk v2.5.2

  • 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. 

Related