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

Update FreeRTOS to 10.4.5 or newer (IDFGH-5391) #7137

Closed
DawidDiaco opened this issue Jun 11, 2021 · 35 comments
Closed

Update FreeRTOS to 10.4.5 or newer (IDFGH-5391) #7137

DawidDiaco opened this issue Jun 11, 2021 · 35 comments
Assignees
Labels
Resolution: Done Issue is done internally Status: Done Issue is done internally Type: Feature Request Feature request for IDF

Comments

@DawidDiaco
Copy link

Is your feature request related to a problem? Please describe.

Hello, I would like to request an update for FreeRTOS. The current release/4.3 apears to be working on version 10.2.1, which is quite outdated at this point. In the current version of FreeRTOS they have some interesting features that I would like to use in my project.

The one that I'm really looking forward to use is ulTaskNotifyTakeIndexed function, because they claim, that this function is 45% faster than standard ISR handling by using semaphore.

https://www.freertos.org/RTOS_Task_Notification_As_Counting_Semaphore.html

Describe the solution you'd like

I would like to have an updated version of FreeRTOS in the closest release. I'm not sure at this moment if ESP-IDF is using just the kernel of FreeRTOS, or the whole FreeRTOS subsystem, but when I look a those releases, they look juicy as hell!

https://github.com/FreeRTOS/FreeRTOS/releases
https://github.com/FreeRTOS/FreeRTOS-Kernel/releases

So updating FreeRTOS to version 10.4.4, or 202104.00 seems to have the most sense for now.

Describe alternatives you've considered

For now I'm sticking with ulTaskNotifyTake, which is fine, but if I can provide a better way to utilize my ESP, then I want to do this.

I've also considered to update freertos by my self, but my lack of experience with embeded systems may result in more problems than benefits. That's why I would like that this component got updated by experienced team. Especialy it looks like the freertos required some porting for it to work with esp.

@DawidDiaco DawidDiaco added the Type: Feature Request Feature request for IDF label Jun 11, 2021
@espressif-bot espressif-bot added the Status: Opened Issue is new label Jun 11, 2021
@github-actions github-actions bot changed the title Update for FreeRTOS Update for FreeRTOS (IDFGH-5391) Jun 11, 2021
@projectgus projectgus changed the title Update for FreeRTOS (IDFGH-5391) Update FreeRTOS to 10.4.x or newer (IDFGH-5391) Jun 15, 2021
@projectgus
Copy link
Contributor

Hi @DawidDiaco,

Thanks for bringing this up. Agree there are some nice features in these newer FreeRTOS releases.

ESP-IDF uses the FreeRTOS kernel, with modifications for SMP (dual core) support. Because of the kernel modifications, updating is more risky than just using the new kernel source - new features may need modifications to work correctly and careful testing to make sure they work in the SMP configuration and don't introduce subtle bugs or regressions. It's quite a lot of work to update.

That said, we will consider updating to pick up these new features. I can't give you any ETA on this, sorry.

Long term, FreeRTOS team has recently created a development branch with an official SMP kernel and we're looking to move ESP-IDF to this, but such a change will require a major version update as the behaviour is different and some APIs will break. If/when we use the official upstream SMP kernel then updating to new upstream versions will become much simpler!

Angus

@DawidDiaco
Copy link
Author

Thank you for your explanation. I think I can live with the current version of FreeRTOS, but I will be patiently waiting for updates.

For now you can close this ticket, or mark it as whatever is appropriate in this case.

@Dazza0
Copy link
Contributor

Dazza0 commented Feb 14, 2022

@DawidDiaco Current IDF master (20847ee) should already have updated FreeRTOS to v10.4.3. Closing this issue, please feel free to reopen.

@Dazza0 Dazza0 closed this as completed Feb 14, 2022
@espressif-bot espressif-bot added Resolution: Done Issue is done internally Status: Done Issue is done internally and removed Status: Opened Issue is new labels Feb 14, 2022
@ammaree
Copy link

ammaree commented Feb 14, 2022

@DawidDiaco
@Dazza0

Can please reopen this issue.
The ability to change ulRunTimeCounter to uint64_t is a very valuable feature for us since it will enable far longer periods of per task processor utilization trending.

Currently we have to run a routine is an idle task to detect and handle wrapping of the runtime counter, an unnecessary kludge.

@Dazza0 Dazza0 reopened this Feb 14, 2022
@Dazza0
Copy link
Contributor

Dazza0 commented Feb 15, 2022

@ammaree Could you specific exactly which FreeRTOS version you want?

@ammaree
Copy link

ammaree commented Feb 15, 2022 via email

@AxelLin
Copy link
Contributor

AxelLin commented Feb 15, 2022

@ammaree Could you specific exactly which FreeRTOS version you want?

I think @ammaree want this feature:
https://github.com/FreeRTOS/FreeRTOS-Kernel/blob/main/History.txt#L31-L34

@Dazza0 Dazza0 changed the title Update FreeRTOS to 10.4.x or newer (IDFGH-5391) Update FreeRTOS to 10.4.5 or newer (IDFGH-5391) Feb 15, 2022
@ammaree
Copy link

ammaree commented Feb 15, 2022 via email

@espressif-bot espressif-bot added Status: In Progress Work is in progress and removed Resolution: Done Issue is done internally Status: Done Issue is done internally labels Feb 17, 2022
@espressif-bot espressif-bot added Status: Opened Issue is new and removed Status: In Progress Work is in progress labels Mar 9, 2022
@ammaree
Copy link

ammaree commented Aug 5, 2022

@Dazza0

Any chance of on update on this functionality?

@Dazza0
Copy link
Contributor

Dazza0 commented Aug 10, 2022

@ammaree We're still discussing whether to upgrade to v10.4.3. Our main concern right now is that v10.4.3 is an LTS version. Given that we are going to move over to the SMP Kernel in the future, we preferably want to leave the legacy kernel on an LTS version.

If this ends up being the case, then we will backport specific functionality from later versions (such as the configRUN_TIME_COUNTER_TYPE feature in this case). However, if there are numerous functions required from v10.4.5, then we may also consider upgrading the kernel version.

@ammaree do you have any preference w.r.t the two approaches mentioned above?

@ammaree
Copy link

ammaree commented Aug 10, 2022

Our only requirement is for the 64bit runtime counters so you welcome to choose the option that would be the least effort and quickest.

Other users might requirement additional 10.4.5 functionality but cannot speak for them.

@AxelLin
Copy link
Contributor

AxelLin commented Aug 11, 2022

@ammaree We're still discussing whether to upgrade to v10.4.3. Our main concern right now is that v10.4.3 is an LTS version. Given that we are going to move over to the SMP Kernel in the future, we preferably want to leave the legacy kernel on an LTS version.

According to the FAQ https://www.freertos.org/faq-lts.html#question2 , the support period for FreeRTOS LTS libraries is two years.
V10.4.3 was released on 15 Dec 2020, so it will reach the end of TLS support period by the end of this year.
Given such timing it's probably fine to move to newer version (or next TLS version).

@AxelLin
Copy link
Contributor

AxelLin commented Sep 18, 2022

FYI, V10.5.0 released.
https://github.com/FreeRTOS/FreeRTOS-Kernel/releases/tag/V10.5.0

@AxelLin
Copy link
Contributor

AxelLin commented Apr 7, 2023

We will evaluate this,

AFAICT, the espressif's response is too slow.
4 Months ago I already pointed out new FreeRTOS LTS version is available by #7137 (comment) .
The esp-idf is using a EOL version of FreeRTOS now.

@espressif-bot espressif-bot assigned zikalino and unassigned Dazza0 Apr 12, 2023
@ammaree
Copy link

ammaree commented May 29, 2023

@Dazza0 @igrr
I notice in master repo that we have 'FreeRTOS-Kernel-V10.5.1' there. this OK to use?
Any instructions on selecting and using this new kernel?

@igrr
Copy link
Member

igrr commented May 29, 2023

Not yet, it is in progress at the moment:

config FREERTOS_USE_KERNEL_10_5_1
bool "Use v10.5.1 Kernel (EXPERIMENTAL)"
depends on IDF_EXPERIMENTAL_FEATURES
default n
help
Hidden option for development/testing purposes to enable building with the v10.5.1 kernel

if(CONFIG_FREERTOS_USE_KERNEL_10_5_1)
message(FATAL_ERROR "FreeRTOS v10.5.1 is not buildable yet. Still under development")

@ammaree
Copy link

ammaree commented May 29, 2023

Thanks @igrr

Any estimated timeframe for having a "testable" version in master?

@AxelLin
Copy link
Contributor

AxelLin commented Jul 9, 2023

Not yet, it is in progress at the moment:

I'm wondering if FreeRTOS-10.5.1 fixes this issue: #8849

@espressif-bot espressif-bot added Status: In Progress Work is in progress and removed Status: Opened Issue is new labels Jul 14, 2023
@zikalino
Copy link
Contributor

@AxelLin I will check
@ammaree we are actively working on this at the moment, at the end of Q3 we should have version for RISC-V chips

@ammaree
Copy link

ammaree commented Jul 14, 2023 via email

@AxelLin
Copy link
Contributor

AxelLin commented Aug 15, 2023

@AxelLin I will check

So how is the status? Any update?

@espressif-bot espressif-bot added Status: Reviewing Issue is being reviewed and removed Status: In Progress Work is in progress labels Sep 1, 2023
@espressif-bot espressif-bot assigned Dazza0 and unassigned zikalino Sep 1, 2023
@AxelLin
Copy link
Contributor

AxelLin commented Sep 22, 2023

@AxelLin I will check

However, I don't get further response at all. @zikalino

@ammaree
Copy link

ammaree commented Sep 22, 2023

@igrr
@Dazza0
@zikalino

This issue is almost 20 months old, from the date of it being reopened at my request. We are STILL, 20 months later, on an LTS version of FreeRTOS that is EOL.

We accept the argument of the older version being retained with the IDF 4.4.x releases/updates, but to still be using the EOL RTOS with IDF v5.2, that is a serious problem.

Also not sure why the "focus" on upgrading the RTOS for C3 series, surely ESP32/S2/S3 should receive same if not higher priority?

@Dazza0
Copy link
Contributor

Dazza0 commented Sep 22, 2023

@AxelLin @ammaree The FreeRTOS upgrade has already been merged internally and is waiting sync to GitHub.

@espressif-bot espressif-bot added Status: Done Issue is done internally Resolution: Done Issue is done internally and removed Status: Reviewing Issue is being reviewed labels Sep 22, 2023
@AxelLin
Copy link
Contributor

AxelLin commented Sep 22, 2023

@AxelLin @ammaree The FreeRTOS upgrade has already been merged internally and is waiting sync to GitHub.

@Dazza0
But that is not the question I asked, see #7137 (comment)
What I asked is if the fixes in newer FreeRTOS release fixes the bug in current FreeRTOS in esp-idf.
What I care is if current release branches are stable because the reported issue is still open.

@Dazza0
Copy link
Contributor

Dazza0 commented Sep 22, 2023

@AxelLin

@ammaree
Copy link

ammaree commented Sep 25, 2023

@AxelLin @ammaree The FreeRTOS upgrade has already been merged internally and is waiting sync to GitHub.

Any idea how long the delay to finally get to GitHub?
We are already another 3 days later and still nothing...

movsb pushed a commit to movsb/esp-idf that referenced this issue Dec 1, 2023
This commit adds beta support for the FreeRTOS v10.5.1 kernel which can be
enabled by enabling the CONFIG_FREERTOS_USE_KERNEL_10_5_1 option.

The following changes have been made:

- Updated freertos/CMakeLists.txt to build v10.5.1 kernel with v10.4.3. ports
- Updated existing Xtensa and RISC-V ports to work with V10.5.1
- Modifications to other ESP-IDF components to work with v10.5.1
- Added some ESP-IDF specific tracing changes to v10.5.1 kernel
- Make CONFIG_FREERTOS_USE_KERNEL_10_5_1 a public option

Note: The beta release is missing some minor fixes, performance improvements,
and features. Using this beta release for production is not recommended.

Closes espressif#7137
@AxelLin
Copy link
Contributor

AxelLin commented Dec 20, 2023

FYI, FreeRTOS-v11.0.0 released. (SMP merged into the mainline)
https://github.com/FreeRTOS/FreeRTOS-Kernel/releases/tag/V11.0.0

@AxelLin
Copy link
Contributor

AxelLin commented Jul 2, 2024

@AxelLin
Copy link
Contributor

AxelLin commented Mar 5, 2025

FYI, FreeRTOS-v11.2.0 released.
https://github.com/FreeRTOS/FreeRTOS-Kernel/releases/tag/V11.2.0

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 Type: Feature Request Feature request for IDF
Projects
None yet
Development

No branches or pull requests

8 participants