2021-06-29 02:52 AM
Hi again,
that's how i understood it so far, correct me if i'm wrong:
cat /sys/devices/system/clocksource/clocksource0/available_clocksource
arch_sys_counter
When i read STGENR (using the mmap on A7) and CLOCK_MONOTONIC(_RAW) I get the following:
STGEN: 179706903683 = 7487.787653
MON 7479.443003674
MONR 7479.474111358
STGEN: 179706906840 = 7487.787785
Do you have any explanation where the ~8 secs difference come from?
Also, what is the most efficient way of reading STGENR from the A7 side in userland? (is it the mmap or is there some more direct way?)
Thanks in advance,
Thomas
2021-07-20 07:38 AM
I`m interested in this question too. I`m looking for a robust way for synchronizing A7 and M4 timestamps. STGEN seems a proper clock source as it is accessible from both M4 and A7 side. I would like getting STGEN through CLOCK_MONOTONIC from linux userspace.
2022-04-21 03:06 AM
Me too. All the documentation suggests STGENR is the way to share timestamps between domains yet I've not found any device or sys interface to do so on the Linux A7 side. We're using the M4 core to interface to a bunch of analog & digital I/O devices and I would like to be able to timestamp readings passed up to the A7 application and timing information passed down to the M4. Has anyone written a driver to expose the two 32-bit registers (STGENR_CNTCVU STGENR_CNTCVL) in a self-consistent way that they're willing to share?