nuttx icon indicating copy to clipboard operation
nuttx copied to clipboard

driver/note: To support clock_gettime for CPU sleep scenario

Open mjy-acc opened this issue 7 months ago • 0 comments

Note: Please adhere to Contributing Guidelines.

Summary

In the current code, the note module gets the time from perf_gettime(). When encountering instructions such as idle WFI, the CPU cycle will not continue to grow, resulting in time distortion. Support note to obtain time from clock_gettime() to support scenarios when the CPUis sleeping.

Impact

The note module obtains time from perf_gettime() by default. Add configuration to support obtaining time from clock_gettime().

Testing

Test environment

  • CPU: X280 (RISCV)
  • Compiler: gcc
  • Target: When encountering WFI instruction CPU sleep, note can get the correct time

mjy-acc avatar May 13 '25 11:05 mjy-acc