Skip to content

tests/kernel/context/testcase.yaml#kernel.common.k_sleep fails on nrf52_pca10040 and nrf52840_pca10056 #9466

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

Closed
spoorthik opened this issue Aug 16, 2018 · 1 comment
Assignees
Labels
area: ARM ARM (32-bit) Architecture bug The issue is a bug, or the PR is fixing a bug platform: nRF Nordic nRFx priority: medium Medium impact/importance bug
Milestone

Comments

@spoorthik
Copy link
Contributor

spoorthik commented Aug 16, 2018

Execution log:

Running test suite context
===================================================================
starting test - test_kernel_interrupts
PASS - test_kernel_interrupts
===================================================================
starting test - test_kernel_timer_interrupts
SKIP - test_kernel_timer_interrupts
===================================================================
starting test - test_kernel_ctx_thread
Testing k_current_get() from an ISR and thread
Testing k_is_in_isr() from an ISR
Testing k_is_in_isr() from a preemptible thread
PASS - test_kernel_ctx_thread
===================================================================
starting test - test_busy_wait
Thread busy waiting for 20000 usecs
Thread busy waiting completed
PASS - test_busy_wait
===================================================================
starting test - test_k_sleep
 thread sleeping for 50 milliseconds
 thread back from sleep
FAIL - thread_sleep@684. timestamp out of range, got 70

    Assertion failed at /home/kspoorth/work/latest_zephyr/tests/kernel/context/src/main.c:753: test_k_sleep: (rv not equal to 0)
 *** thread timed out waiting for thread on k_sleep().
FAIL - test_k_sleep
===================================================================
starting test - test_kernel_cpu_idle_atomic
SKIP - test_kernel_cpu_idle_atomic
===================================================================
starting test - test_kernel_cpu_idle
PASS - test_kernel_cpu_idle
===================================================================
starting test - test_k_yield
PASS - test_k_yield
===================================================================
starting test - test_kernel_thread
PASS - test_kernel_thread
===================================================================
===================================================================

PROJECT EXECUTION FAILED

Platforms: nrf52_pca10040 and nrf52840_pca10056
Latest commit on which the failure is seen: afa0e00

@spoorthik spoorthik added bug The issue is a bug, or the PR is fixing a bug area: ARM ARM (32-bit) Architecture labels Aug 16, 2018
@nashif
Copy link
Member

nashif commented Aug 21, 2018

@pizi-nordic can you take a look?

@ioannisg ioannisg added the platform: nRF Nordic nRFx label Aug 22, 2018
@nashif nashif added the priority: medium Medium impact/importance bug label Aug 23, 2018
@nashif nashif added this to the v1.13.0 milestone Aug 26, 2018
carlescufi pushed a commit to carlescufi/zephyr that referenced this issue Aug 31, 2018
The following 2 improvements are contained in this patch:

- When converting from ms to ticks, instead of using hardware cycles
  per tick, use hardware cycles per second. This ensures that the
  multiplication is done before the division, increasing precision.
- When converting from ticks to ms, instead of using cycles per tick
  and cycles per sec, use ticks per sec. This too increases the
  precision.

The concept is to make the dividend as large as possible compared to the
divisor in order to lose as little precision as possible.

Fixes zephyrproject-rtos#8898
Fixes zephyrproject-rtos#9459
Fixes zephyrproject-rtos#9466
Fixes zephyrproject-rtos#9468

Signed-off-by: Vinayak Kariappa Chettimada <[email protected]>
Signed-off-by: Carles Cufi <[email protected]>
nashif pushed a commit that referenced this issue Aug 31, 2018
The following 2 improvements are contained in this patch:

- When converting from ms to ticks, instead of using hardware cycles
  per tick, use hardware cycles per second. This ensures that the
  multiplication is done before the division, increasing precision.
- When converting from ticks to ms, instead of using cycles per tick
  and cycles per sec, use ticks per sec. This too increases the
  precision.

The concept is to make the dividend as large as possible compared to the
divisor in order to lose as little precision as possible.

Fixes #8898
Fixes #9459
Fixes #9466
Fixes #9468

Signed-off-by: Vinayak Kariappa Chettimada <[email protected]>
Signed-off-by: Carles Cufi <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: ARM ARM (32-bit) Architecture bug The issue is a bug, or the PR is fixing a bug platform: nRF Nordic nRFx priority: medium Medium impact/importance bug
Projects
None yet
Development

No branches or pull requests

4 participants