Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cortex_m_systick programmed cycles are 1.7 tick less than expected, for tickless idle #2575

Closed
zephyrbot opened this issue Oct 14, 2016 · 4 comments
Labels
area: Kernel bug The issue is a bug, or the PR is fixing a bug priority: low Low impact/importance bug

Comments

@zephyrbot
Copy link
Collaborator

zephyrbot commented Oct 14, 2016

Reported by Sharron LIU:

The issue is detected when I tried to verify tickless idle @arm with unified kernel.

After time idle enter, the test case check "__scs.systick.strvr" programmed, and expect the value should be around "ticks * cycles_per_tick", with an error range that not greater than a tick (in ARM case, 840000 cycles).

However, for a 20-tick idle, now the "__scs.systick.strvr" programmed is "15352506", while "[15960000, 16800000]" is expected.

Could you review if this error is as expected? Since when read into the code I noticed two steps added to buffer time for reaction.

  • timer_idle_skew is introduced
  • (ticks - 1) is used

I attaching the test code.

# source zephyr-env.sh
# tar -zxvf test_tickless_concept.tgz
# make -C test_tickless_concept BOARD=arduino_due
# bossa ....
# verify from console output "programmed cycles 15352506 err 1447494", failed

Actual programmed cycles: err 1447494 (which is around 1.7 tick)
Expected programmed cycles: err within 840000 (cycles per tick)

NOTE: the test case works on X86 @quark_se and @quark_d2000

(Imported from Jira ZEP-1072)

@zephyrbot
Copy link
Collaborator Author

zephyrbot commented Oct 14, 2016

by Sharron LIU:

@zephyrbot
Copy link
Collaborator Author

by Dmitriy Korovkin:

The attached test demonstrates on Arduino Due, FRDM-k64f and qemu-x86 platforms the fact that sleep takes 200 ms (as the test requires) plus one timer tick.
The behavior the test demonstrates is exactly what is expected: kernel waits for the system clock tick and then waits for 200 ms, which is exactly 20 system clock ticks.

@zephyrbot
Copy link
Collaborator Author

by Anas Nashif:

correct behaviour per developer

@zephyrbot
Copy link
Collaborator Author

by Mark Linkmeyer:

Fixing incorrect priority

@zephyrbot zephyrbot added priority: low Low impact/importance bug area: Kernel bug The issue is a bug, or the PR is fixing a bug labels Sep 23, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: Kernel bug The issue is a bug, or the PR is fixing a bug priority: low Low impact/importance bug
Projects
None yet
Development

No branches or pull requests

1 participant