Other Parts Discussed in Thread: TMS570LC4357
Hello,
First, I want to say I know you cannot write to flash like you would do RAM, you need to use an API.
I use a TMS570LC4357 and CCS5.5 with compiler V5.1.8.
My question is, why when I write to flash using a pointer, I can read back the value even if it was not really written in flash. I would expect the write to have no effect and to be able to read back the value in flash.
For example, I use a pointer to access address 0x000991D0 located in my program in flash and this address contains an instructions continuously used by my program in the idle loop.
If I do “variable = *((unsigned long *)0x000991D0L)”, the variable takes value 0xE35C0FFA which is a BLT instruction. This is the behavior I would expect.
If I do “*((unsigned long *)0x000991D0L) = 10L” and then “variable = *((unsigned long *)0x000991D0L)”, the variable take value 10. I know the flash was not changed because my program still runs. But I would expect the variable to still have value 0xE35C0FFA.
If I connect with an XDS510 emulator, in the Eclipse memory browser I see value 10 at address 0x000991D0L. If I do a CPU reset, the value is still 10 and when I do a System reset the value goes back to the original value of 0xE35C0FFA.
I would like to understand why this is happening. Apparently reading memory and instruction fetching don’t return the same value. Did I just find 4Mb of extra RAM?
Thanks,
Martin