hi,
(lpc1317-64P) during execution of my code const data changes. I don't know how. I have used const uint8_t *p[] = { "", "abcd", };
I have checked by adding the array in watch. At one point randomly data in null type gets changed to some long garbage data..
I need null character at 0 th places because I have made logic in that way. Also I don't think how const data can get changed randomly.I have also monitired VCC during program its 3.3V. No glitch.
is this due to because I am using 36KB of 64K byte flash & 6KB ram out of 8KB available or due to optimization as compiler stores null character in RAM for faster exceution or something
As in smaller module this code works fine without any problem. Problem come when I club the module.
However const data shouldn't be changed.
const uint8_t *p[] = { "", "abcd", };
That is not quite as const as you may think it is. This is an array of two const pointers to uint8_t. Note that this means the uint8_t data themselves are not const.
And another thing: it is easy to make the mistake of believing that 'const' qualified data are 100% totally unmodifiable, read-only data. That's not the case. 'const' only means that an otherwise correct C program will not be able to write to them. There's a difference.
"This is an array of two const pointers to uint8_t."
Umm no, but this is:
uint8_t * const p[];