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

Device unable to go to light sleep with PCNT unit enabled without glitch filter (IDFGH-14231) #15027

Open
3 tasks done
Tracked by #288
lptr opened this issue Dec 13, 2024 · 1 comment
Open
3 tasks done
Tracked by #288
Assignees
Labels
Resolution: NA Issue resolution is unavailable Status: Done Issue is done internally

Comments

@lptr
Copy link

lptr commented Dec 13, 2024

Answers checklist.

  • 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.

General issue report

In ESP-IDF 5.3.1 and before, the APB frequency lock was only used if the glitch filter was enabled for a PCNT unit. This allowed the device to enter light sleep even when a PCNT unit was enabled (but without a glitch filter).

In ESP-IDF 5.3.2 the commit 33f8207 introduced new behavior, and the lock is always installed and used, even if the glitch filter is not enabled.

This means that since 5.3.2 the device cannot enter light sleep when a PCNT unit is enabled, even if it uses no glitch filter.

The commit comment says "fix" but I found no record of what problem this is fixing.

The documentation in 5.3.2 still says the lock is installed lazily only when a glitch filter is present:

 *       So this function will lazy-install a PM lock internally when the power management is enabled. With this lock, the APB frequency won't be changed.

https://github.com/espressif/esp-idf/blob/v5.3.2/components/esp_driver_pcnt/include/driver/pulse_cnt.h#L128

@espressif-bot espressif-bot added the Status: Opened Issue is new label Dec 13, 2024
@github-actions github-actions bot changed the title Device unable to go to light sleep with PCNT unit enabled without glitch filter Device unable to go to light sleep with PCNT unit enabled without glitch filter (IDFGH-14231) Dec 13, 2024
@Kainarx
Copy link
Collaborator

Kainarx commented Dec 16, 2024

Thank you for your feedback. We've left some documentation unchanged. In fact the APB clock is the function clock for the PCNT peripheral, not only for the glitch filter. The previous version was actually not correct.

@espressif-bot espressif-bot added Status: Done Issue is done internally Resolution: NA Issue resolution is unavailable and removed Status: Opened Issue is new labels Dec 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Resolution: NA Issue resolution is unavailable Status: Done Issue is done internally
Projects
None yet
Development

No branches or pull requests

3 participants