This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Memory Corruption Issues

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.

Parents
  • Hi jaikanth,

    What do you mean by "placed my code in debug mode"? Do you mean attaching a debugger, or just compiling it with less optimization/more debug information?

    One of the effects you're seeing - increasing the number of buffers - could be a caching effect.Once you increase past the size of the data cache you're essentially provoking more cache activity, and you may simply be seeing the effect because of that increased activity. Producing "debug" binaries which are larger and less efficient may be changing the performance profile of the code and increasing the number of memory accesses, causing a similar churn on the data cache.

    How big in bytes is "20 pairs of coefficient buffers of size 200" - are they padded in any way, or is it literally 2*20*200=8000 bytes? How big is the data cache on your Cortex-M7 (perhaps 8KiB?) and what is your system environment like ('operating system' or other software)? Do you have an idea on what kind of explicit cache maintenance is being performed and the MPU settings for the region covering the buffers?

    Ta,

    Matt

Reply
  • Hi jaikanth,

    What do you mean by "placed my code in debug mode"? Do you mean attaching a debugger, or just compiling it with less optimization/more debug information?

    One of the effects you're seeing - increasing the number of buffers - could be a caching effect.Once you increase past the size of the data cache you're essentially provoking more cache activity, and you may simply be seeing the effect because of that increased activity. Producing "debug" binaries which are larger and less efficient may be changing the performance profile of the code and increasing the number of memory accesses, causing a similar churn on the data cache.

    How big in bytes is "20 pairs of coefficient buffers of size 200" - are they padded in any way, or is it literally 2*20*200=8000 bytes? How big is the data cache on your Cortex-M7 (perhaps 8KiB?) and what is your system environment like ('operating system' or other software)? Do you have an idea on what kind of explicit cache maintenance is being performed and the MPU settings for the region covering the buffers?

    Ta,

    Matt

Children