Hi,
For the last couple of years we've been working on an embedded ARM project. This worked fine all until suddenly out of nowhere global variables are no longer initialized. The problem happens in C99 code. The C99 project runs in non-protected mode (UM10562 rev.3, page 882). The program is not doing anything special, it has an "int main(void)" from where everything is happening, no special startup-code. The code started to fail when a malloc+free was introduced which was removed later on, and then it kept(!) failing (so no more mallocs/frees where in the code!).
What is the cause of this? And how can I resolve it?
regards
A simple example would be:
int a = 3;
int main(void) { printf("%d\n", a); }
One would expect "3" to be emitted. In our situation garbage was emitted (some random value).
UM10562.pdf is the documentation of the ARM processor we use. I was pointing to the section which describes how to protected mode (the 0x12345678 in CRP1 thing).
and you're sure that's not just down to a baud rate error or some other comms issue?
What does the debugger show?
Would be more helpful to give a link to the document - and name the maker & model.
And what happens if you add an infinite loop in your main?