Skip to content

xtimer mis-scaling with long sleep times #9049

@ZetaR60

Description

@ZetaR60

Description

On the ATmega platforms, xtimer is not scaling properly with XTIMER_HZ when sleeping for longer time periods. It is properly scaling for shorter sleep times. I don't know if this occurs on other platforms (as I have no non-ATmega boards). I discovered this while trying to track down problems with tests/posix_semaphore for #8904

Steps to reproduce the issue

Build and run something that uses longer sleep times, such as tests/xtimer_drift. Change the XTIMER_HZ define in board.h, then build and run again. Also try something with shorter sleep times, such as tests/xtimer_usleep.

Expected results

Both short and long sleep times (tests/xtimer_drift and tests/xtimer_usleep) vary only slightly with different XTIMER_HZ defines.

Actual results

Shorter sleep times (tests/xtimer_usleep) vary slightly, and longer sleep times (tests/xtimer_drift) vary wildly.

Versions

Board: mega-xplained

Installed compiler toolchains 
-----------------------------
             native gcc: missing
      arm-none-eabi-gcc: missing
                avr-gcc: avr-gcc (Fedora 7.2.0-1.fc27) 7.2.0
       mips-mti-elf-gcc: missing
             msp430-gcc: missing
   riscv-none-embed-gcc: missing
                  clang: missing

Installed compiler libs
-----------------------
   arm-none-eabi-newlib: missing
    mips-mti-elf-newlib: missing
riscv-none-embed-newlib: missing
               avr-libc: "2.0.0" ("20150208")

Installed development tools
---------------------------
                  cmake: cmake version 3.11.0
               cppcheck: missing
                doxygen: missing
                 flake8: missing
                    git: git version 2.14.2
             coccinelle: missing

Metadata

Metadata

Assignees

Labels

Area: timersArea: timer subsystemsState: won't fixState: The issue can not or will not be fixedType: bugThe issue reports a bug / The PR fixes a bug (including spelling errors)

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions