Hello,
currently I am exploring shared memory between the cores.
(I should mention that using OpenVx and stuff from vision apps is not an option for me.)
So on the C71 have a code similar to this:
volatile uint32_t* testPtr = (uint32_t*)0xBC000000;
uint32_t counter = 0U;
while(true)
{
*testPtr = counter++;
sleep(s); // 1sec
}
Now on the A72 Linux I can use a tool like "devmem" from busybox or a smiliar implementation and read the value at this address.
When I do something like this:
while true; do sudo ./devmem 0xBC000000; done
It works fine and the counter is incrementing every second.
But when I implement a program which uses /dev/mem and mmap() (like devmem dose) and which reads the value in a loop it does not work.
Suddenly the numbers jump every few seconds. So it only works when closing and recreating the mapping in between.
I think it is a caching problem in Linux. How can I make use of the shared memory in Linux userspace?
How can I prevent caching or sync the memory?
Best regards
Jan