cancel
Showing results for 
Search instead for 
Did you mean: 

Physical memory for buffer interfered by random instructions

Posted on February 15, 2009 at 10:22

Physical memory for buffer interfered by random instructions

2 REPLIES 2
Posted on May 17, 2011 at 13:02

Hello,

I'm currently struggeling with a really strange problem.

I'm having a global variable ''u32 SDO_Buffer[SIZE]'' as a ring buffer. It basically works to access it and write my data into the buffer, but what also does happen, and that's the weird thing, is that random instructions in the code cause to write random data into the buffer (or at least the same physical memory).

Those instructions could be a simple delay: for (i=0; i

Or a local variable in a totally other part of the program: TxMessage.DLC=DLC;

The local variable still works, so it doesn't look to me that they're sharing the same physical memory. But somehow the instruction itselfs seem to affect that physical memory, where my buffer is ''stored''.

Any suggstions where to look at? I'm thinking about using malloc to dynamically allocate my memory. But that's just a work-around and doesn't fix the problem, which could occur at any other point again.

Don't know if that helps, but I'm using the newest Keil MDK 3.40 (Evaluation Version)

Thanks

-Stefan

jj
Associate II
Posted on May 17, 2011 at 13:02

Hi-

Use IAR - would like to see if I can replicate your condition. Can you post the minimal code which regularly causes this effect? Also - provide the STM32 part no. - I can test across several devices...