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

esp_timer软件定时器 (IDFGH-12699) #13689

Open
3 tasks done
heyangxinmei opened this issue Apr 25, 2024 · 3 comments
Open
3 tasks done

esp_timer软件定时器 (IDFGH-12699) #13689

heyangxinmei opened this issue Apr 25, 2024 · 3 comments
Assignees
Labels
Awaiting Response awaiting a response from the author Status: Opened Issue is new

Comments

@heyangxinmei
Copy link

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

软件定时器的回调函数,有时候会停止运行一段时间。之后有正常回调。请问什么原因会引起这个问题呢?谢谢
image

@espressif-bot espressif-bot added the Status: Opened Issue is new label Apr 25, 2024
@github-actions github-actions bot changed the title esp_timer软件定时器 esp_timer软件定时器 (IDFGH-12699) Apr 25, 2024
@o-marshmallow
Copy link
Collaborator

Hello @heyangxinmei ,

In order to help you, I have a few questions:

  • Which target (ESP32, S2, S3.. ?) are you running this on?
  • Which version of IDF are you using?
  • How did you notice that it stopped sometimes?
  • What about the output on the UART?
  • Do you have a small reproducible example?

@heyangxinmei
Copy link
Author

  1. esp32s3 2. idf v4.4.5 3. 通过日志观察到的计数值不增加了。4. 通过串口输出日志 是有比软件定时器优先级的任务运行引起的吗?

@ESP-Marius
Copy link
Collaborator

Yes, the callback is called from a task with ESP_TASK_TIMER_PRIO, so there could be tasks with a higher priority (e.g. BT)

会停止运行一段时间

How long is 一段时间? Is the callback delayed a few ms, or is it multiple seconds? Are you using power-management/sleep in your application?

It is also possible to dispatch the callback directly from the ISR: https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-reference/system/esp_timer.html#using-the-interrupt-dispatch-method

@espressif-bot espressif-bot added Awaiting Response awaiting a response from the author and removed Awaiting Response awaiting a response from the author labels Apr 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Awaiting Response awaiting a response from the author Status: Opened Issue is new
Projects
None yet
Development

No branches or pull requests

4 participants