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

Backport the static allocation feature from FreeRTOS V9.0.0 #21

Closed
wants to merge 1 commit into from

Conversation

danicampora
Copy link
Contributor

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.

@danicampora
Copy link
Contributor Author

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.
@danicampora
Copy link
Contributor Author

I fixed the bug of not saving the CoreID during task initialization and pushed again.

@negativekelvin
Copy link
Contributor

Just wondering what are the considerations for backporting these features vs moving completely to freertos 9?

FreeRTOS V9.x.x is a drop-in compatible replacement for FreeRTOS V8.x.x

@igrr
Copy link
Member

igrr commented Sep 23, 2016

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.

@danicampora
Copy link
Contributor Author

@igrr @Spritetm is there any update on this? Have you had a chance to look at it? Thanks :-)

@projectgus
Copy link
Contributor

projectgus commented Oct 3, 2016

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

@danicampora
Copy link
Contributor Author

@projectgus thanks for the feedback!

igrr added a commit that referenced this pull request Oct 27, 2016
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
@igrr
Copy link
Member

igrr commented Oct 27, 2016

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.

@igrr igrr closed this Oct 27, 2016
@danicampora
Copy link
Contributor Author

No probs @igrr , I'm happy that it's merged now :-)

0xFEEDC0DE64 pushed a commit to 0xFEEDC0DE64/esp-idf that referenced this pull request May 5, 2021
@espressif-bot espressif-bot added Status: Opened Issue is new Status: In Progress Work is in progress Resolution: Done Issue is done internally Status: Done Issue is done internally and removed Status: Opened Issue is new Status: In Progress Work is in progress labels Mar 16, 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

Successfully merging this pull request may close these issues.

5 participants