Hi,
I am running Linux on a zc702 board with arm cortex a9 on it. I want to do some time measuring and am accessing the performance counter to get the cycles measured.
The experiment is like this: I am triggering an interrupt every 5 ms. The ISR sends a signal to a user application which reads the cycles from the register and also reads the current time via clock_gettime(). I also read the cycles in the ISR. The frequency of the CPU is 666MHz. The problem is, that the cycle values seem to be wrong. If I compare two subsequent values from the ISR, I get for example: 2956835712 and 2955811130. The difference between them ist 1024582. In ms it is about 1,5 instead of the expected 5 ms. I am sure that the interrupt is occurring in the right frequency.
I have already used the cycle counter with FreeRTOS on the same platform and it worked very well.
Does anybody have an idea what is wrong here? I have tried to turn of all profiling and power management options in the kernel, but still the same problem! Any ideas are appreciated!