Hi folks,
it's me again.
Now I have my RAM test up and running in my application. And now there is a big problem which I don't know how to solve.
First thing I learned was, that the memory test destroys all global variable initialization, so I had to initialize them after the RAM test again.
Second thing I found ist a bigger problem and I kindly ask you to throw in your ideas about that problem.
Here we go:
I have a function which looks like this:
void write_val2buffer(uint8_t row, uint8_t col, uint8_t val) { char str[4]; sprintf(str, "%3d", val); /* write string to display buffer */ strncpy(display[row] + col, str, 3); return; }
Now I send in a val =0;
Without the RAM Test, the str is filled correctly and the display buffer also. I can see in the memory window of AVR Studio that the display buffer is filled with 0x20 0x20 0x30 which results in " 0" So far so good.
But when using my RAM Test during startup, I see the following when this function is called:
The display buffer is filled with 0x00 0x00 0x00 which is not correct and leads to not displaying correctly the value.
This is only one example of the problem. It appears everywhere where I fill a string with some date / signs / etc. and write it to the display buffer.
It seems that something for all the sprintf and strncpy is placed in RAM before executing and with the RAM test it is destroyed. :shock:
I'm totally lost on this.