Quantcast
Channel: ARM Connected Community: Message List
Viewing all articles
Browse latest Browse all 8551

How to Access Physical Counter in ARM Cortex-A7?

$
0
0

Hello,

        I have an custom FPGA board running ARM Cortex-A7 processor. I want to access the system physical counter. According to the ARM architecture reference manual I am trying to access the CNTFRQ and CNTPCT values. I have an assembly code as follows

 

        mrc p15, 0, r1, c14, c1, 0                      @ Read CNTKCTL into r1.

        ldr r2, =0x1

        orr r3, r1, r2

        mcr p15, 0, r3, c14, c1, 0                      @ Write R3 into CNTKCTL.

    

        mrc p15, 0, r5, c14, c0, 0                      @ Read CNTFRQ into R5 in Hz.

 

        mrrc p15, 0, r6, r7, c14                        @Read 64-bit CNTPCT into R6 (low word) and R7 (high word).

 

But after executing the read CNTFRQ instruction the frequency returned into R5 register is all zeros. The same is for read CNTPCT instruction. Can someone please point out where I am going wrong here?

 

Regards,

Amit.


Viewing all articles
Browse latest Browse all 8551

Latest Images

Trending Articles



Latest Images