Hi,
I am using an audio module for 3d sound effects where I will be using around 20 pair(for Left and Right Channels) of coefficient buffers of size 200. I could able to run this code on M7 and got expected effects from the module. If I increase my coefficient buffers to 40 pairs of size 200, I am not able to get the expected effects from the module. But I am surprised to get the expected effects when i placed my code in debug mode. I feel there might some memory corruption in increasing the number of buffers. Can somebody help me to sort out this problem. In brief, I am getting different effects when I placed my code in release & debug mode.
Thanks in advance.
regards,
jaikanth.
If you are providing your own linker map for laying out memory, you may also find that increasing the number of buffers may just cause different memory resources to start overlapping if they are not spaced far enough apart (e.g. one of ZI, heap, and stack intersect).
The linker *may* error if it can spot this, but it isn't always possible if the resources are not static (E.g. allocated on the stack dynamically, and not guard page at the bottom of the stack). Compiling for debug at a lower optimization level will change the compiler's stacking behavior, which may cause bugs to vanish (or appear).
Also note with the M7 that the cacheability of memory regions may be different, and is controlled by the MPU configuration. If your code is relying on uncached data memory (e.g. to talk to an audio peripheral), but has grown into a cached region due to the increased size, then that may also cause problems. Debuggers often insert cache maintenance to force coherency with the JTAG view of the world automatically, so this is definitely one area where attaching a debugger can make issues disappear.
Cheers, Pete