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

timer_spinlock_take/give IRAM_ATTR (IDFGH-5038) #6824

Closed
boborjan2 opened this issue Apr 5, 2021 · 6 comments
Closed

timer_spinlock_take/give IRAM_ATTR (IDFGH-5038) #6824

boborjan2 opened this issue Apr 5, 2021 · 6 comments
Labels
Resolution: Done Issue is done internally Status: Done Issue is done internally

Comments

@boborjan2
Copy link

boborjan2 commented Apr 5, 2021

Environment

  • Module or chip used: [ESP32-WROOM-32E]
  • IDF version (run git describe --tags to find it): v4.3-dev-3175-g9a2d25191
  • Build System: [Make]
  • Compiler version (run xtensa-esp32-elf-gcc --version to find it): (crosstool-NG esp-2020r3) 8.4.0
  • Operating System: [Linux]
  • Using an IDE?: [No]
  • Power Supply: [external]

Problem Description

timer_spinlock_take has no IRAM_ATTR attribute but according to docs, it should be able to be called from an isr that may be placed to IRAM.

Expected Behavior

My understanding is that these two functions shall be in iram.

Thanks
Viktor

@espressif-bot espressif-bot added the Status: Opened Issue is new label Apr 5, 2021
@github-actions github-actions bot changed the title timer_spinlock_take/give IRAM_ATTR timer_spinlock_take/give IRAM_ATTR (IDFGH-5038) Apr 5, 2021
@espressif-bot espressif-bot added Status: In Progress Work is in progress and removed Status: Opened Issue is new labels Apr 12, 2021
@espressif-bot espressif-bot added Status: Done Issue is done internally Resolution: Done Issue is done internally and removed Status: In Progress Work is in progress labels Apr 19, 2021
boborjan2 pushed a commit to boborjan2/esp-idf that referenced this issue May 9, 2021
@AxelLin
Copy link
Contributor

AxelLin commented May 11, 2021

The v4.3 branch also needs this fix.

@Alvin1Zhang
Copy link
Collaborator

Thanks for pointing out, we will back port this fix to release/4.3, thanks.

@boborjan2
Copy link
Author

It should go into 4.2 as well imho. Thx.

@ESP-Marius
Copy link
Collaborator

Fix will be backported up to and including v4.1

@KaeLL
Copy link
Contributor

KaeLL commented May 11, 2021

@ESP-Marius ETA on the publishing of these fixes?
Also, since we're on the subject, doesn't deprecating the timer spinlock APIs also deprecate timer_isr_register? And by the way, why deprecate the timer spinlock APIs in the first place? timer_isr_default is overly verbose and in my use case, re-enabling the alarm by itself is undesirable. Seems ironic to constrain what you call General Purpose Timers in the docs in such a way.

@suda-morris
Copy link
Collaborator

Hi @KaeLL we deprecated because nowhere is using that spinlock_get/set in esp-idf code base. Exposing spinlock_get/set is not a good design, at least we don't want the user space to touch a spinlock used by the driver itself directly. So we have introduced another callback way.

re-enabling the alarm by itself is undesirable.

Thanks for this information, yes this is an issue and we're fixing now, will be backported to release/v4.1. The issue is, we shound't reenable the alarm interrupt in timer_isr_register if user has configured the "auto-reload".

projectgus pushed a commit that referenced this issue May 21, 2021
projectgus pushed a commit that referenced this issue Jun 8, 2021
boborjan2 pushed a commit to boborjan2/esp-idf that referenced this issue Aug 31, 2021
boborjan2 pushed a commit to boborjan2/esp-idf that referenced this issue Mar 24, 2022
boborjan2 pushed a commit to boborjan2/esp-idf that referenced this issue May 4, 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

7 participants