Other Parts Discussed in Thread: HALCOGEN
Tool/software: Code Composer Studio
Hi,
my question is related to this thread: https://e2e.ti.com/support/microcontrollers/hercules/f/312/t/577279
I'm using F021 Flash API v2.01.01 Build(000830) and I'm experiencing kind of the same issue as described in the thread mentioned above. After erasing a sector and programming data, validating the programmed data fails.
What I do is:
- Erase a sector
- Program data
- Validate data, i.e. read data from flash and compare with programmed data. Result: data is equal
- Erase the same sector again
- Program different data
- Validate data. Result: data is not equal, although it should be equal (in the memory browser it also seems like the newly programmed data is hidden)
When I do it according to Christian's suggestion (see thread mentioned above) and simply call _dCacheInvalidate_(); after programming, it works as expected (the newly programmed data shows up and validation is successful). Probably using Christian's "new cache maintenance function" would work as well but I haven't tried it yet.
I tried to solve this issue in different ways but none of them seems to be a clean solution:
- Call _dCacheInvalidate_(); after writing data to the flash
- In the HalCoGen MPU tab: Disable the cache
- In the HalCoGen MPU tab: Set flash memory region type to "NORMAL_OINC_NONSHARED" (Memory type normal outer and inner non-cachable and non shared)
I also read your application report on MPU and cache settings (http://www.ti.com/lit/an/spna238/spna238.pdf). As far as I understand, what I need is that data is written to the flash memory even for write accesses that are cache-hit. From my understanding it should be sufficient to configure the flash memory region type as "NORMAL_OIWTNOWA_NONSHARED" (Memory type normal outer and inner write-through non write allocate and non shared). Could you please explain why that doesn't work and how would a clean solution for that problem look like?
Thanks for your help,
Simon