I see that it uses the 'real time counter', which is the DWT cycle counter in STM32. Does it handle the wrapping around of the real time counter? If you start a time measurement just before the real time counter wraps around, and stop it after the wrap - would that be problematic? Looking at tm_stop(), I see this:
Code: Select all
tmp->last = (now - tmp->last) - offset;
Absolute high resolution System Time:
According to this post, viewtopic.php?f=3&t=4166&e=1&view=unread#p30955, it seems that the system timer wrap arounds are handled in tickless mode. If I configure the system tick to be 1Mhz, how can I get absolute system time in a way that isn't limited to the system timer width? My system uptime can be over a month. I looked at the chVTTimeElapsedSince, chTimeDiff, but none of those seem to handle the systick timer wrap around - i just see something like (end - start) .
This post, viewtopic.php?f=24&t=4265&start=10#p30959, mentions introducing a global sysinterval_t variable, which can be updated each time the systick wraps around. Then, the absolute time would be the global sysinterval_t + current system time. Is some functionality similar to that already present, can I use any existing APIs to accomplish this?
Using Core SysTick timer:
Can the Cortex-M 24-bit SysTick timer be used in ChibiOS, or must we use a 16-bit or 32-bit hardware timer ?