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

test_timer_duration_period fails with stm32 lptimer #20991

Closed
FRASTM opened this issue Nov 26, 2019 · 4 comments · Fixed by #20992
Closed

test_timer_duration_period fails with stm32 lptimer #20991

FRASTM opened this issue Nov 26, 2019 · 4 comments · Fixed by #20992
Assignees
Labels
area: Kernel area: Tests Issues related to a particular existing or missing test bug The issue is a bug, or the PR is fixing a bug platform: STM32 ST Micro STM32 priority: medium Medium impact/importance bug
Milestone

Comments

@FRASTM
Copy link
Collaborator

FRASTM commented Nov 26, 2019

When the LPTIMER is enabled, the kernel test timer/timer_api fails in the
"test_timer_duration_period: tdata.expire_cnt == 4 is false"

To Reproduce
Steps to reproduce the behavior:

  1. Enable the LPTIMER in the proj.conf :
    CONFIG_STM32_LPTIM_TIMER=y
    CONFIG_STM32_LPTIM_CLOCK_LSE=y
  2. mkdir build; cd build
  3. cmake -DBOARD=board\nucleo_l4r5zi
  4. make
  5. See error
    "Assertion failed at ZEPHYR_BASE/tests/kernel/timer/timer_api/src/main.c:138: test_timer_duration_period: tdata.expire_cnt == 4 is false "
@FRASTM FRASTM added bug The issue is a bug, or the PR is fixing a bug platform: STM32 ST Micro STM32 labels Nov 26, 2019
@erwango erwango assigned FRASTM and unassigned erwango Nov 26, 2019
@dleach02 dleach02 added the priority: low Low impact/importance bug label Nov 26, 2019
@FRASTM
Copy link
Collaborator Author

FRASTM commented Feb 11, 2020

Due to the LPTIM clock source = LSE, the minimal tick period is set to 1000 per sec.
This makes one tick duration = about 33 lptim counting units

Note that the max possible timeout remains 2000ms , reached when the LPTIM counter = 0xFFFF

@FRASTM
Copy link
Collaborator Author

FRASTM commented Apr 6, 2020

Applying the PR #24080
Plus a similar approach for the previous check in the testcase test_timer_remaining
zassert_true(rem_ticks <= (dur_ticks / 2) + 1 , NULL);

and it fixes for wb55 and l4r5 when the STM32_LPTIM_TIMER is defined

@carlescufi carlescufi added area: Tests Issues related to a particular existing or missing test area: Kernel labels Apr 30, 2020
@erwango erwango added has-pr priority: medium Medium impact/importance bug and removed priority: low Low impact/importance bug labels May 13, 2020
@erwango erwango added this to the v2.3.0 milestone May 15, 2020
@carlescufi
Copy link
Member

@erwango It doesn't seem this actually has a PR does it?

@erwango
Copy link
Member

erwango commented May 22, 2020

@carlescufi #20992 should be the one closing this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: Kernel area: Tests Issues related to a particular existing or missing test bug The issue is a bug, or the PR is fixing a bug platform: STM32 ST Micro STM32 priority: medium Medium impact/importance bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants