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

ARM Cortex-M4: Semaphores could not be used in ISRs with priority 0? #28867

Closed
eugmes opened this issue Oct 2, 2020 · 1 comment
Closed

ARM Cortex-M4: Semaphores could not be used in ISRs with priority 0? #28867

eugmes opened this issue Oct 2, 2020 · 1 comment
Labels
bug The issue is a bug, or the PR is fixing a bug

Comments

@eugmes
Copy link
Contributor

eugmes commented Oct 2, 2020

Describe the bug
The documentations says that semaphores could be used from ISRs if they don't block. When I'm trying to use them from ISRs I'm sometimes getting assertion failures with message "recursive spinlock" with address of sem.c:lock (nrfconnect/sdk-nrf#3003 (comment)).

From reading the documentation for BASEPRI register I understand that it cannot be used alone to block priority-0 ISRs, this would break spin locks used from such interrupts.

I would like to clarify if my suspicion is correct, and if so, the limitation be documented somewhere.

Expected behavior
Semaphores could be used from all ISR priorities as documented.

Impact
In my case I can avoid using semaphores from ISRs.

@eugmes eugmes added the bug The issue is a bug, or the PR is fixing a bug label Oct 2, 2020
@eugmes eugmes changed the title ARM Cortex-M4: Semaphores could not be used in IRQs with priority 0? ARM Cortex-M4: Semaphores could not be used in ISRs with priority 0? Oct 2, 2020
@eugmes
Copy link
Contributor Author

eugmes commented Oct 2, 2020

I guess these are zero latency IRQs so they should not be used with kernel APIs. Still, I wonder how many other people will overlook that...

@eugmes eugmes closed this as completed Oct 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug The issue is a bug, or the PR is fixing a bug
Projects
None yet
Development

No branches or pull requests

1 participant