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

components/driver/rmt: portENTER_CRITICAL called from ISR context #498

Closed
devsaurus opened this issue Apr 6, 2017 · 1 comment
Closed

Comments

@devsaurus
Copy link
Contributor

This is based on reviewing the code, I haven't yet observed any problems running the code. Not sure if this is really an issue, so feel free to close if considered not relevant.

Function rmt_fill_memory() is called dual-use from task and ISR context. It subsequently calls the portENTER_CRITICAL() and portEXIT_CRITICAL() macros.

But http://www.freertos.org/taskENTER_CRITICAL_taskEXIT_CRITICAL.html states that these macros must not be called from ISR context (e.g. taskENTER_CRITICAL() directly maps to portENTER_CRITICAL() in components/freertos/include/freertos/task.h).

@projectgus
Copy link
Contributor

Hi @devsaurus ,

Thanks for the comprehensive description of what you're seeing.

In IDF, we have made some modifications to standard FreeRTOS behaviour. One of these is that it's safe to call portENTER_CRITICAL() from an ISR. It may be necessary to enter a critical sectio in an ISR, in order to prevent concurrent access by the other CPU.

Some notes about the implementation can be found here in the source code:
https://github.com/espressif/esp-idf/blob/master/components/freertos/include/freertos/portmacro.h#L177

Please feel free to reopen if you believe this behaviour change is causing any bugs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants