nRF52840 PDM microphone causes interrupt issue – code runs only when PDM-related lines are commented

Hello Nordic Community,

I am working with the nRF5340 SoC as the master and trying to configure a PDM microphone. I have two related queries regarding PDM/DMIC operation.


Situation 1: 

I am working with the nRF52840 SoC and trying to capture audio using a PDM microphone.

When I run my application with all code enabled, throwing error, i have pasted the error in text file .


 Executing task: nRF Connect: Build [incremental]: untitled/build 

Building untitled
west build --build-dir c:/Users/2768/untitled/build c:/Users/2768/untitled
[0/5] Performing build step for 'untitled'
[1/5] Linking C executable zephyr\zephyr_pre0.elf
FAILED: zephyr/zephyr_pre0.elf zephyr/zephyr_pre0.map C:/Users/2768/untitled/build/untitled/zephyr/zephyr_pre0.map 
cmd.exe /C "cd . && C:\ncs\toolchains\b8b84efebd\opt\zephyr-sdk\arm-zephyr-eabi\bin\arm-zephyr-eabi-gcc.exe  -gdwarf-4 zephyr/CMakeFiles/zephyr_pre0.dir/misc/empty_file.c.obj -o zephyr\zephyr_pre0.elf  zephyr/CMakeFiles/offsets.dir/./arch/arm/core/offsets/offsets.c.obj  -T  zephyr/linker_zephyr_pre0.cmd  -Wl,-Map=C:/Users/2768/untitled/build/untitled/zephyr/zephyr_pre0.map  -Wl,--whole-archive  app/libapp.a  zephyr/libzephyr.a  zephyr/arch/common/libarch__common.a  zephyr/arch/arch/arm/core/libarch__arm__core.a  zephyr/arch/arch/arm/core/cortex_m/libarch__arm__core__cortex_m.a  zephyr/arch/arch/arm/core/mpu/libarch__arm__core__mpu.a  zephyr/lib/libc/picolibc/liblib__libc__picolibc.a  zephyr/lib/libc/common/liblib__libc__common.a  zephyr/soc/soc/nrf52840/libsoc__nordic.a  zephyr/drivers/usb/device/libdrivers__usb__device.a  zephyr/drivers/usb/common/nrf_usbd_common/libdrivers__usb__common__nrf_usbd_common.a  zephyr/drivers/audio/libdrivers__audio.a  zephyr/drivers/clock_control/libdrivers__clock_control.a  zephyr/drivers/console/libdrivers__console.a  zephyr/drivers/flash/libdrivers__flash.a  zephyr/drivers/hwinfo/libdrivers__hwinfo.a  zephyr/drivers/pinctrl/libdrivers__pinctrl.a  zephyr/drivers/serial/libdrivers__serial.a  zephyr/drivers/timer/libdrivers__timer.a  modules/nrf/drivers/hw_cc3xx/lib..__nrf__drivers__hw_cc3xx.a  modules/hal_nordic/modules/hal_nordic/nrfx/libmodules__hal_nordic__nrfx.a  modules/segger/libmodules__segger.a  -Wl,--no-whole-archive  zephyr/kernel/libkernel.a  -LC:/Users/2768/untitled/build/untitled/zephyr  zephyr/arch/common/libisr_tables.a  -mcpu=cortex-m4  -mthumb  -mabi=aapcs  -mfp16-format=ieee  -mtp=soft  -fuse-ld=bfd  -Wl,--gc-sections  -Wl,--build-id=none  -Wl,--sort-common=descending  -Wl,--sort-section=alignment  -Wl,-u,_OffsetAbsSyms  -Wl,-u,_ConfigAbsSyms  -nostdlib  -static  -Wl,-X  -Wl,-N  -Wl,--orphan-handling=warn  -Wl,-no-pie  -specs=picolibc.specs  -DPICOLIBC_LONG_LONG_PRINTF_SCANF  C:/ncs/v3.1.0/nrfxlib/crypto/nrf_cc310_platform/lib/cortex-m4/soft-float/no-interrupts/libnrf_cc310_platform_0.9.19.a -L"c:/ncs/toolchains/b8b84efebd/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/thumb/v7e-m/nofp" -lc -lgcc && cmd.exe /C "cd /D C:\Users\2768\untitled\build\untitled\zephyr && C:\ncs\toolchains\b8b84efebd\opt\bin\cmake.exe -E true""
c:/ncs/toolchains/b8b84efebd/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld.bfd.exe: app/libapp.a(main.c.obj): in function `pdm_isr_handler_body':
C:/Users/2768/untitled/src/main.c:52: undefined reference to `nrfx_pdm_irq_handler'
collect2.exe: error: ld returned 1 exit status
ninja: build stopped: subcommand failed.
FAILED: _sysbuild/sysbuild/images/untitled-prefix/src/untitled-stamp/untitled-build C:/Users/2768/untitled/build/_sysbuild/sysbuild/images/untitled-prefix/src/untitled-stamp/untitled-build 
cmd.exe /C "cd /D C:\Users\2768\untitled\build\untitled && C:\ncs\toolchains\b8b84efebd\opt\bin\cmake.exe --build ."
ninja: build stopped: subcommand failed.
FATAL ERROR: command exited with status 1: 'C:\ncs\toolchains\b8b84efebd\opt\bin\cmake.EXE' --build C:/Users/2768/untitled/build

 *  The terminal process terminated with exit code: 1. 
 *  Terminal will be reused by tasks, press any key to close it. 

Situation 2: 

However, when I comment out lines 50–57 and line 61 in main.c, the code:

  • Runs without errors

  • Flashes successfully on the nRF52840

  • But no printf output appears on the serial terminal

After debugging, I observed that the issue seems to be interrupt-related, possibly linked to the PDM peripheral.

i have uploading the screenshot , when debug the code 


nrf52840_pdm_mic.zip


Parents
  • Hello, 

    I just want to let you know that I have picked up this case and I'll share some feedback tomorrow. 

    Best regards,

    Maria

  • Hello, 

    Situation 1: 

    I am working with the nRF52840 SoC and trying to capture audio using a PDM microphone.

    When I run my application with all code enabled, throwing error, i have pasted the error in text file .

    This line from your build log points to the issue while building: 

    C:/Users/2768/untitled/src/main.c:52: undefined reference to `nrfx_pdm_irq_handler'

    The build system expects an instance to be specified. I resolved the build error by specifying nrfx_pdm_0_irq_handler on line #52 in main.c

    Situation 2: 

    However, when I comment out lines 50–57 and line 61 in main.c, the code:

    • Runs without errors

    • Flashes successfully on the nRF52840

    • But no printf output appears on the serial terminal

    In the prj.conf printf is configured to appear on RTT and not the serial terminal. Do you also get no RTT output? 

    Best regards,

    Maria

Reply
  • Hello, 

    Situation 1: 

    I am working with the nRF52840 SoC and trying to capture audio using a PDM microphone.

    When I run my application with all code enabled, throwing error, i have pasted the error in text file .

    This line from your build log points to the issue while building: 

    C:/Users/2768/untitled/src/main.c:52: undefined reference to `nrfx_pdm_irq_handler'

    The build system expects an instance to be specified. I resolved the build error by specifying nrfx_pdm_0_irq_handler on line #52 in main.c

    Situation 2: 

    However, when I comment out lines 50–57 and line 61 in main.c, the code:

    • Runs without errors

    • Flashes successfully on the nRF52840

    • But no printf output appears on the serial terminal

    In the prj.conf printf is configured to appear on RTT and not the serial terminal. Do you also get no RTT output? 

    Best regards,

    Maria

Children
No Data
Related