Error compiling Microphone_PDM examples

I just got my edge ml kit and I wanted to test some of the components individually. I started with the pdm mic. Downloaded the Microphone_PDM library and copied the examples to my project. None of them compiled. They all gave me some form of the following errors:

:::: COMPILING APPLICATION

Creating ~/src/audio-server/target/5.8.0/p2/memory_platform_user.ld ...
Creating ~/src/audio-server/target/5.8.0/p2/memory_platform_user.ld ...
/Users/gmelika/.particle/toolchains/gcc-arm/10.2.1/bin/../lib/gcc/arm-none-eabi/10.2.1/../../../../arm-none-eabi/bin/ld: ~/src/audio-server/target/5.8.0/p2/audio-server_fi.elf section `.bdsram.data' will not fit in region `SRAM'
/Users/gmelika/.particle/toolchains/gcc-arm/10.2.1/bin/../lib/gcc/arm-none-eabi/10.2.1/../../../../arm-none-eabi/bin/ld: section .backup VMA [000000001007b400,000000001007b403] overlaps section .bdsram.data VMA [000000001007aca0,000000001007b49f]
/Users/gmelika/.particle/toolchains/gcc-arm/10.2.1/bin/../lib/gcc/arm-none-eabi/10.2.1/../../../../arm-none-eabi/bin/ld: region `SRAM' overflowed by 2028 bytes
collect2: error: ld returned 1 exit status
make[3]: *** [~/src/audio-server/target/5.8.0/p2/audio-server_fi.elf] Error 1
make[2]: *** [modules/tron/user-part] Error 2
make[1]: *** [make-main] Error 2
make: *** [compile-user] Error 2

this is in a brand new vscode project using workbench. I'm very new to this so I'm likely doing something wrong but I can't figure out what it is.

I can build a simple project that controls the D7 LED. but the minute I try to instantiate the microphone instance I get the above error

Hi and welcome to the community!
Seems like it does not fit in memory, so maybe the device is not set properly.
Can you double check that you selected Photon 2?
Best

1 Like

Is this where I need to select it? that is what has been set on the project

image

I have also tried cloud compiling it and that shows that it is targeting p2

image

Also here is the code:

#include "Microphone_PDM.h"

SYSTEM_THREAD(ENABLED);
void setup()
{
	Particle.connect();
	Microphone_PDM::instance()
		.withOutputSize(Microphone_PDM::OutputSize::SIGNED_16)
		.withRange(Microphone_PDM::Range::RANGE_2048)
		.withSampleRate(32000)
		.init();

	Microphone_PDM::instance().start();
}

void loop()
{
}

There is one other report of SRAM overflow occurring recently. Engineering will be investigating this.

Your steps look correct. Another use who ran into this was able to successfully cloud compile the same source, which is a good workaround.

just tried using the web IDE, but same error: Particle Web IDE

Try switching to target 5.6.0. I was able to reproduce the problem with 5.8.0 but 5.6.0 works properly for me.

confirmed moving to 5.6 does indeed solve the issue. Thank you