Xiao nRF52840 and PDM microphone

The PDM Microphone Usage on Seeed Studio XIAO nRF52840 Sense | Seeed Studio Wiki describe how to use the GitHub - Seeed-Studio/Seeed_Arduino_Mic

However, compilation fails with the following message

FQBN: Seeeduino:nrf52:xiaonRF52840Sense
Using board 'xiaonRF52840Sense' from platform in folder: /home/USER/.arduino15/packages/Seeeduino/hardware/nrf52/1.1.1
Using core 'nRF5' from platform in folder: /home/USER/.arduino15/packages/Seeeduino/hardware/nrf52/1.1.1

/home/USER/.arduino15/packages/Seeeduino/tools/arm-none-eabi-gcc/9-2019q4/bin/arm-none-eabi-g++ -mcpu=cortex-m4 -mthumb -c -g -Werror=return-type -mfloat-abi=hard -mfpu=fpv4-sp-d16 -u _printf_float -std=gnu++11 -ffunction-sections -fdata-sections -fno-threadsafe-statics -nostdlib --param max-inline-insns-single=500 -fno-rtti -fno-exceptions -w -x c++ -E -CC -DF_CPU=64000000 -DARDUINO=10607 -DARDUINO_Seeed_XIAO_nRF52840_Sense -DARDUINO_ARCH_NRF52 "-DARDUINO_BSP_VERSION=\"1.1.1\"" -DNRF52840_XXAA -DUSBCON -DUSE_TINYUSB -DUSB_VID=0x2886 -DUSB_PID=0x8045 "-DUSB_MANUFACTURER=\"Seeed\"" "-DUSB_PRODUCT=\"XIAO nRF52840 Sense\"" -DSOFTDEVICE_PRESENT -DARDUINO_NRF52_ADAFRUIT -DNRF52_SERIES -DDX_CC_TEE -DLFS_NAME_MAX=64 -Ofast -DCFG_DEBUG=0 -DCFG_LOGGER=0 -DCFG_SYSVIEW=0 -I/home/USER/.arduino15/packages/Seeeduino/tools/CMSIS/5.7.0/CMSIS/Core/Include/ -I/home/USER/.arduino15/packages/Seeeduino/tools/CMSIS/5.7.0/CMSIS/DSP/Include/ -I/home/USER/.arduino15/packages/Seeeduino/hardware/nrf52/1.1.1/cores/nRF5/nordic -I/home/USER/.arduino15/packages/Seeeduino/hardware/nrf52/1.1.1/cores/nRF5/nordic/nrfx -I/home/USER/.arduino15/packages/Seeeduino/hardware/nrf52/1.1.1/cores/nRF5/nordic/nrfx/hal -I/home/USER/.arduino15/packages/Seeeduino/hardware/nrf52/1.1.1/cores/nRF5/nordic/nrfx/mdk -I/home/USER/.arduino15/packages/Seeeduino/hardware/nrf52/1.1.1/cores/nRF5/nordic/nrfx/soc -I/home/USER/.arduino15/packages/Seeeduino/hardware/nrf52/1.1.1/cores/nRF5/nordic/nrfx/drivers/include -I/home/USER/.arduino15/packages/Seeeduino/hardware/nrf52/1.1.1/cores/nRF5/nordic/nrfx/drivers/src -I/home/USER/.arduino15/packages/Seeeduino/hardware/nrf52/1.1.1/cores/nRF5/nordic/softdevice/s140_nrf52_7.3.0_API/include -I/home/USER/.arduino15/packages/Seeeduino/hardware/nrf52/1.1.1/cores/nRF5/nordic/softdevice/s140_nrf52_7.3.0_API/include/nrf52 -I/home/USER/.arduino15/packages/Seeeduino/hardware/nrf52/1.1.1/cores/nRF5/freertos/Source/include -I/home/USER/.arduino15/packages/Seeeduino/hardware/nrf52/1.1.1/cores/nRF5/freertos/config -I/home/USER/.arduino15/packages/Seeeduino/hardware/nrf52/1.1.1/cores/nRF5/freertos/portable/GCC/nrf52 -I/home/USER/.arduino15/packages/Seeeduino/hardware/nrf52/1.1.1/cores/nRF5/freertos/portable/CMSIS/nrf52 -I/home/USER/.arduino15/packages/Seeeduino/hardware/nrf52/1.1.1/cores/nRF5/sysview/SEGGER -I/home/USER/.arduino15/packages/Seeeduino/hardware/nrf52/1.1.1/cores/nRF5/sysview/Config -I/home/USER/.arduino15/packages/Seeeduino/hardware/nrf52/1.1.1/libraries/Adafruit_TinyUSB_Arduino/src/arduino -I/home/USER/.arduino15/packages/Seeeduino/hardware/nrf52/1.1.1/cores/nRF5 -I/home/USER/.arduino15/packages/Seeeduino/hardware/nrf52/1.1.1/variants/Seeed_XIAO_nRF52840_Sense -I/home/USER/Projets/Arduino/libraries/Seeed_Arduino_Mic/src /home/USER/.var/app/cc.arduino.IDE2/cache/arduino/sketches/2418C4A7E8CFD158C8F46AA569315D7A/sketch/mic_serial_plotter.ino.cpp -o /home/USER/.var/app/cc.arduino.IDE2/cache/arduino/sketches/2418C4A7E8CFD158C8F46AA569315D7A/preproc/ctags_target_for_gcc_minus_e.cpp
In file included from /home/USER/.var/app/cc.arduino.IDE2/cache/.arduinoIDE-unsaved202361-30-1va1z4m.4yf1/mic_serial_plotter/mic_serial_plotter.ino:1:
/home/USER/Projets/Arduino/libraries/Seeed_Arduino_Mic/src/mic.h:26:2: error: #error "This library targets Wio Terminal boards and XIAO BLE at the moment"
   26 | #error "This library targets Wio Terminal boards and XIAO BLE at the moment"
      |  ^~~~~

The repository release reads

Initial release, only supports Wio Terminal

Configuration:

  • Arduino IDE 2.1.0
  • Xiao nRF board package 1.1.1
  • Seeed_Arduino_Mic 1.0

Thank you!

You have to read the Getting Started Page carefully. You should use the “mbed” version.

Two Arduino Libraries

Seeed Studio XIAO nRF52840 assembles many functions in one tiny board and sometimes may not perform the best of them. Hence, Seeed has published two Arduino libraries to let it maximum the power of each function. Therefore:

  • It is recommanded to use the Seeed nRF52 Boards library if you want to apply Bluetooth function and “Low Energy Cost Function”.
  • It is recommanded to use the Seeed nRF52 mbed-enabled Boards library if you want to use it in embedded Machine Learning Applications or apply “IMU & PDM advanced function”.
  • Both libraries support very well when it comes to the basic usage, such as LED, Digital, Analog, Serial, I2C, SPI.

Yes, I read that but the exact wording is

  • The PDM Microphone will perform better when we use the “Seeed nrf52 mbed-enabled Boards Library”, so we highly recommon that.

Shouldn’t it be

  • The PDM Microphone requires the “Seeed nrf52 mbed-enabled Boards Library”

Judging from above you have installed the wrong package or it is not the latest version. Existing mbed version is 2.9.2. Seeed instructions are extremely confusing so you better check everything over again.

1 Like

I will try again with the nRF52840 Mbed version release 2.9.2.

I faced issues with the latest non-Mbed version 1.1.3. The recommended solution as per XIAO BLE wont compile ArduinoBLE- Arduino IDE - #11 by msfujino is to use the previous 1.1.1.

I fully agree with you. The Xiao boards are incredible pieces of hardware: let’s hope software and collaterals be on par!

Hello.
Seeed Studio XIAO nRF52840 is not equipped with this PDM Microphone module.
So you’d better use mbed2.9.2 to compile this program.

I hope this picture is the final result you were looking for.