maxikrie commented on issue #8207:
URL: https://github.com/apache/nuttx/issues/8207#issuecomment-6989858110

   Measured on a NUCLEO-H753ZI (400 MHz, tickless, 1 µs tick, TIM2): 
`usleep(n)` takes n + 20 µs (alarm mode) or n + 30 µs (interval mode) with 
`CONFIG_DEBUG_NOOPT` (`-O0`, the default when `CONFIG_DEBUG_SYMBOLS` is set), 
and n + 8 µs with `-O2`, constant from 10 µs to 10 ms. Of the 8 µs, 1 µs is the 
+1 tick round-up and the rest is the time from the timer interrupt (which 
arrives on the exact tick) to the task running again. 
`CONFIG_TIMER_ADJUST_NSEC` is meant to compensate for that, but had no effect; 
fixed in #22027 . With it, alarm mode and 7000 gives n + 1 µs, but watchdog 
callbacks then also run up to 7 µs early, so the safe value is the 
ISR-to-callback latency (about 2 µs here, n + 6 µs).


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to