- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
I am currently trying to place some data at a precise address, that can be later on modified by erasing and writing the flash. After that, I would like to read the data.
I place my data like so:
const volatile uint8 data __at(0x80400000) = (uint8)0x00;
After erasing the flash and writing some other value, I can see the new value in the memory watch during debug. However, when I read it through a variable, I always get the old value.
I am using volatile on all variables that are concerned and I also tried reading through memcpy function. I am currently using Aurix Developement Studio and I deactivated all optimization on the code (as far as I know).
Is there any particular way to read this new data ?
Thank you !
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Do you have the cache enabled? If you read it from segment 0xA what happens?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Do you have the cache enabled? If you read it from segment 0xA what happens?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
Apparently, reading from the segment 0xA solves my problem. However, IFX_CFG_SSW_ENABLE_TRICORE1_PCACHE is defined, so I guess the cache should be enabled. Do you have any idea why I have this behaviour ?
Thank you!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
In your scenario, the old data is in the cache. When reading, the data is read from the cache and not from the main memory. You need to invalidate the cache after memory modification so that the new data is available in the cache.
Thanks