Hi,
I try to run an application from DDR memory. There is a 50 Hz periodic function triggers the application by posting a semaphore. In the application program, There is a simple counter that counts the number of run.
I have noticed that although counter is increased by one at the current run, at the next run released from pending the semaphore it becomes 0 again. So this can be corrected by cache invalidate and cache write back operations. At this point I have several questions:
a) Is this the normal situation? I mean I suppose that cache operations are used for communicating the cores over a shared external memory or a hardware peripheral (dma, PA, etc). What is expected within a task or tasks running on the same core?
b) If this is the expected situation, should I apply cache operations for all the global and local variables? It seems to me not practical. Does there exist an other rule to decide which variables should be applied cache operators?
c) I have seen that the variable should be aligned to 128 byte boundary for applying cache operators. But I have observed that it seems to work if it is not aligned to 128 byte. So is it a advice to increase the speed or mandatory requirement?
Thank you
Alpaslan