Question/Issue:
I’m hoping someone with more knowledge of this platform can save me from banging my head against my desk over this one .
Particle Photon 2. Project deployed as a Particle library. After importing the library and copying the “examples/particle_microphone/main.cpp” code into “src/main.cpp” exactly as is and compiling/flashing, everything looks to be OK.
But, I need to make some changes to the code to make it useful for my purposes. Any minor change seems to result in a PSRAM overflow, however. For example, simply adding:
pinMode(D7, OUTPUT);
to the setup() function results in:
… visual_alerts_inferencing_fi.elf section .psram_text' will not fit in region PSRAM’
… arm-none-eabi/bin/ld: region `PSRAM’ overflowed by 4 bytes
Any thoughts on how I can extend the example code without running into this?
Thanks in advance!
Project ID:
272259
Context/Use case:
Classify audio from supported PDM mic.
Thanks @louis and @Arjan! Glad to hear it’s not something I was doing wrong.
I had tried 5 deviceOS versions: 5.0.0, 5.3.0, 5.3.1. 5.3.2, and 5.4.1.
With 5.4.1, it does compile and flash, however, I get no serial output (which is where the predictions are printed). To test if if was just a serial problem or something more, I added this:
pinMode(D7, OUTPUT);
to setup(), and this:
digitalWrite(D7, LOW);
to the beginning of loop(). D7 is connected to the onboard LED, so it should turn off, but it does not, so it seems that something has failed silently, and the impulse is not actually running, despite compiling and flashing fine.
5.3.2 does the same. 5.0.0, 5.3.0, and 5.3.1 compile and produce serial output, however, if I make any changes whatsoever, I get a PSRAM overflow, so I can’t customize them.
I’ve been trying today to fix the serial on version 5.4.1, but without success unfortunately. We will need more time to figure this out.
In the meantime I have a workaround for version 5.3.2 to get rid of the PSRAM & SRAM 4 bytes overflow error. In the installed Particle SDK (located in your root folder) open following file ~/.particle/toolchains/deviceOS/5.3.2/modules/shared/rtl872x/build_linker_script.mk