We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
Hi
Recently my ARM LPC2478 MDK-ARM project has reached a point where if I add one extra line of code I see all kinds of RAM corruption and sometimes the DABT_handler being called. If I remove that line of code everything is all OK again. The corruption is noticable as text on a LCD corrupting between frame updates even though it is just being copied from Flash to external RAM.
The extra line of code can be totally irrelevant, for example adding a line to draw a bitmap to an LCD can cause erractic code behaviour even if that line of code never gets executed.
Right now I can only get it to work and execute correctly with level -O3 optimisation, any level below that is now causing problems. My on board 512K flash is pretty full up but I have moved some bitmap files into an external Flash but the problem is still the same.
I am using about 4Mbytes of DDR external RAM out of 32Mbytes total. I have tried doubling the stack and heaps but still the same problem. I also tried reducing the overall external RAM bandwidth but still the same problem.
Does anyone know if there are limits on say the individual C module lengths? I saw a very similar problem a few days back when I tried using sprintf function with %f. Could this be due to a larger library being linked and also taking the code over some limit which I have again reached?
Could this be a compiler error? For information I am using a lot of C modules with unbounded arrays to hold bitmaps, fonts and sound effect. Could this be part of the problem?
I would appreciate any suggestions you can think of as this problem has totally stopped development.
Thanks in advance.
If it isn't stack space, then it's often uninitialized variables (specially pointers) or buffer overflows from accessing arrays with negative index or too high index.
Or having interrupts interact with main code with concurrent modification of critical variables.