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

xTimerIsTimerActive incorrectly returns pdTRUE when called from the timer callback. (IDFGH-6353) #8014

Closed
3 tasks done
h2zero opened this issue Dec 5, 2021 · 1 comment
Closed
3 tasks done
Assignees
Labels
Resolution: Done Issue is done internally Status: Done Issue is done internally

Comments

@h2zero
Copy link
Contributor

h2zero commented Dec 5, 2021

  • I have read the documentation ESP-IDF Programming Guide and the issue is not addressed there.
  • I have updated my IDF branch (master or release) to the latest version and checked that the issue is present there.
  • I have searched the issue tracker for a similar issue and not found a similar issue.

Environment

  • Development Kit: [ESP32-DevKitC]
  • Kit version (for WroverKit/PicoKit/DevKitC): [|v3]
  • Module or chip used: [ESP32-WROVER]
  • IDF version (run git describe --tags to find it): v4.4-dev-2030-gd93887f9f0
  • Build System: [idf.py]
  • Compiler version (run xtensa-esp32-elf-gcc --version to find it):
    // 1.22.0-80-g6c4433a
  • Operating System: [Linux]
  • Using an IDE?: [No]
  • Power Supply: [USB]

Problem Description

xTimerIsTimerActive returns pdTRUE even though the timer has expired if checked in the callback function.
This causes the NimBLE scan timer to fail to stop the scan when using FreeRTOS timers instead of esp-timer.

Expected Behavior

xTimerIsTimerActive should return pdFALSE when the timer is no longer active.

Actual Behavior

xTimerIsTimerActive returns pdTRUE when the timer is not active.

Steps to reproduce

  1. Using NimBLE blecent example, set a time for the scanner to stop (I used 5000ms).
  2. Restart the scanner.
  3. Eventually the scan stop timer will fail and just continue scanning.

The error occurs due to this line

pxTimer->ucStatus |= tmrSTATUS_IS_ACTIVE;

As it sets the active flag and then calls the callback at this line

pxTimer->pxCallbackFunction( ( TimerHandle_t ) pxTimer );

This has been fixed upstream with this PR: FreeRTOS/FreeRTOS-Kernel#305

@espressif-bot espressif-bot added the Status: Opened Issue is new label Dec 5, 2021
@github-actions github-actions bot changed the title xTimerIsTimerActive incorrectly returns pdTRUE when called from the timer callback. xTimerIsTimerActive incorrectly returns pdTRUE when called from the timer callback. (IDFGH-6353) Dec 5, 2021
@Dazza0 Dazza0 self-assigned this Dec 6, 2021
@espressif-bot espressif-bot assigned Dazza0 and unassigned Dazza0 May 23, 2022
@AxelLin
Copy link
Contributor

AxelLin commented Jun 18, 2022

@Dazza0 Any update?

@sudeep-mohanty sudeep-mohanty self-assigned this Jul 8, 2022
@espressif-bot espressif-bot added Status: In Progress Work is in progress Resolution: NA Issue resolution is unavailable Status: Done Issue is done internally Resolution: Done Issue is done internally and removed Status: Opened Issue is new Status: In Progress Work is in progress Resolution: NA Issue resolution is unavailable labels Jul 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Resolution: Done Issue is done internally Status: Done Issue is done internally
Projects
None yet
Development

No branches or pull requests

5 participants