-
Notifications
You must be signed in to change notification settings - Fork 7.4k
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
Backport the static allocation feature from FreeRTOS V9.0.0 #21
Conversation
This change is the last requirement needed in order to enable MicroPython threading on the ESP32. MicroPython threads (and locks) are created using native FreeRTOS objects that must live in the pool of memory owned by MicroPython's garbage collector. |
This feature allows to use static buffers (or from a pool of memory which is not controlled by FreeRTOS). In order to reduce the impact of the changes, the static feature has only been added to the queus (and in consequence to the semaphores and the mutexes) and the tasks. The Timer task is always dynamically allocated and also the idle task(s), which in the case of the ESP-IDF is ok, since we always need to have dynamic allocation enabled.
I fixed the bug of not saving the CoreID during task initialization and pushed again. |
Just wondering what are the considerations for backporting these features vs moving completely to freertos 9?
|
Latest FreeRTOS version for which an Xtensa port is available is 8.2.0. It has been extensively modified to support dual core setup. So while version 9.0.0 may be a drop in replacement from the application perspective, it is not drop-in from the port perspective. |
Hi @danicampora, Sorry for the slow update. This commit is in our internal review/test queue for merging. This week will be quiet because all of China is on holidays (Golden Week), but we should get back to you shortly after. Angus |
@projectgus thanks for the feedback! |
Backport the static allocation feature from FreeRTOS V9.0.0 This feature allows to use static buffers (or from a pool of memory which is not controlled by FreeRTOS). In order to reduce the impact of the changes, the static feature has only been added to the queus (and in consequence to the semaphores and the mutexes) and the tasks. The Timer task is always dynamically allocated and also the idle task(s), which in the case of the ESP-IDF is ok, since we always need to have dynamic allocation enabled. Original PR on Github: #21 See merge request !107
Turned out that test failures we saw were unrelated to FreeRTOS changes. This is now merged in master. Daniel, sorry that it took so long. |
No probs @igrr , I'm happy that it's merged now :-) |
This feature allows to use static buffers (or from a pool of memory which is not
controlled by FreeRTOS).
In order to reduce the impact of the changes, the static feature has only been added
to the queus (and in consequence to the semaphores and the mutexes) and the tasks.
The Timer task is always dynamically allocated and also the idle task(s), which in the
case of the ESP-IDF is ok, since we always need to have dynamic allocation enabled.