Solved
How can I get access to M4 timers from A7 linux ? Is it possible ?
I need some clock synchronization between M4 and A7 cores. So I need steady clock values from A7 and M4 for single time point
I need some clock synchronization between M4 and A7 cores. So I need steady clock values from A7 and M4 for single time point
From M4, for instance:
(note that as you read a 64 bit counter over a 32-bit bus, you should ensure no rollover in between the two access of STGEN registers)
#define STGENR_CNTCVL_OFF 0x0000
#define STGENR_CNTCVU_OFF 0x0004
#define STGENR_CNTCVL (*(uint32_t *) (STGENR_BASE + STGENR_CNTCVL_OFF))
#define STGENR_CNTCVU (*(uint32_t *) (STGENR_BASE + STGENR_CNTCVU_OFF))
uint32_t cntr_upper, cntr_lower;
uint64_t cntr;
__HAL_RCC_STGENRO_CLK_ENABLE();
do
{
cntr_upper = STGENR_CNTCVU;
cntr_lower = STGENR_CNTCVL;
}
while (STGENR_CNTCVU != cntr_upper);
cntr = ((uint64_t)cntr_upper << 32) + (uint64_t)cntr_lower;This code is for example only (not tested).
Regards.
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.