2024-10-25 08:51 AM
Hello everyone,
I'm currently developing an application that uses the pdm2pcm library to convert digital audio from a MEMS microphone. I'm working in STM32CubeIDE, where I manually linked this library. I have access to both GCC and IAR pre-compiled versions of the library.
Currently, I'm using the GCC version, but it's taking up a substantial amount of flash memory—over 47 KB. According to the library's documentation, the expected flash usage is around 7 KB when compiled with IAR.
Does anyone know how to optimize flash usage for this library in GCC? Are there specific GCC flags or settings that could help reduce the memory footprint?
Thank you all in advance for your help!
2024-11-07 06:58 AM
Hello @Nicottone and welcome to the Community;
You can activate the optimization option as shown in the below figure.
In this case the compiler will attempt to improve the performance and/or code size at the expense of compilation time and possibly the ability to debug the program.
Therefore, when debugging the execution will not be in line with the written code.
I recommended that you check this link: Optimize Options (Using the GNU Compiler Collection (GCC))
I hope my reply answered your question.
Thank you.
Kaouthar
To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.