espressif / esp-idf

Espressif IoT Development Framework. Official development framework for Espressif SoCs.
Apache License 2.0
13.48k stars 7.26k forks source link

Will ESP-IDF upgrade to the Amazon FreeRTOS? (IDFGH-875) #3231

Closed maxgerhardt closed 5 years ago

maxgerhardt commented 5 years ago

Currently ESP-IDF uses

https://github.com/espressif/esp-idf/blob/76da10a665c228b81225130ca2060d04c1ee000a/components/freertos/include/freertos/FreeRTOS.h#L1-L3

Now the people at https://github.com/aws/amazon-freertos have released documentation and demos regarding Amazon FreeRTOS on the ESP32 (https://docs.aws.amazon.com/freertos/latest/userguide/getting_started_espressif.html and demo code https://github.com/aws/amazon-freertos/tree/master/demos/espressif/esp32_devkitc_esp_wrover_kit).

This uses

https://github.com/aws/amazon-freertos/blob/5b2967a59ecf8b3a1385bca0797ad93842d9bee3/lib/include/FreeRTOS.h#L1-L4

/*
 * FreeRTOS Kernel V10.2.0
 * Copyright (C) 2019 Amazon.com, Inc. or its affiliates.  All Rights Reserved.
 *

The demo project seems kind of weird to me, because the components folder agains adds an freertos folder (that doesn't interfere with Espressif's built-in freertos component) and lots of other already existing components like tcpip_adapter etc., which apparently had to be adapted to work with Amazon FreeRTOS.

Will ESP-IDF switch to the Amazon FreeRTOS in the future or will it continue to use FreeRTOS V8 from 2015?

negativekelvin commented 5 years ago

https://docs.espressif.com/projects/esp-idf/en/latest/api-guides/freertos-smp.html

maxgerhardt commented 5 years ago

@negativekelvin The documentation states that FreeRTOS v8.2.0 was used as a base with a few backported features from V9.0.0, and while this documentation of the implementation and designs is interesting it doesn't answer the question stated in the issue; thanks regardless.

negativekelvin commented 5 years ago

The most important part is

The ESP-IDF FreeRTOS is a modified version of vanilla FreeRTOS which supports symmetric multiprocessing (SMP)

Currently, the Amazon FreeRTOS port for ESP32-WROVER-KIT and ESP DevKitC does not support the following features: Lightweight IP. Symmetric multiprocessing (SMP).

So unless you are using esp32-solo you lose dual core. If there is a specific feature you are looking for from V10 then it would be useful to mention it. You could also encourage Amazon to add support for SMP.

mahavirj commented 5 years ago

@maxgerhardt

Now the people at https://github.com/aws/amazon-freertos have released documentation and demos regarding Amazon FreeRTOS on the ESP32

Port for ESP32 in Amazon FreeRTOS is maintained by Espressif.

The demo project seems kind of weird to me, because the components folder agains adds an freertos folder (that doesn't interfere with Espressif's built-in freertos component) and lots of other already existing components like tcpip_adapter etc., which apparently had to be adapted to work with Amazon FreeRTOS.

Extra freertos component directory is required because of compatibility with IDF,

Other duplicated components are for similar reasons. Regarding tcpip_adapter component, it is adapted to support FreeRTOS TCP stack (IDF uses lwIP networking stack).

Will ESP-IDF switch to the Amazon FreeRTOS in the future or will it continue to use FreeRTOS V8 from 2015?

This largely depends on SMP support in vanilla freertos. Interim, any specific requirement that your are looking for?

ammaree commented 5 years ago

Here is an example of the functionality missed... #1453

maxgerhardt commented 5 years ago

Thanks @ammaree for the issue link, I think @projectgus has answered my question there already:

We've decided to stop backporting FreeRTOS features to our ESP-IDF fork of FreeRTOS V9, and instead we're focusing on updating to add SMP support to FreeRTOS V10.

So far we don't have an ETA for this update, I'm sorry. We will update this GitHub issue as soon as that work is done, though.

ghost commented 5 years ago

Hi, is there any ETA for adding SMP support to FreeRTOS V10 yet?

Thanks,

p0wl commented 4 years ago

any updates on this?

projectgus commented 4 years ago

Hi @p0wl,

There is a preview branch of ESP-IDF with FreeRTOS 10 here: https://github.com/espressif/esp-idf/tree/feature/freertos_upstream_plus_tlsf_allocator_preview

You can read more about it here: https://esp32.com/viewtopic.php?f=10&t=15322

There is still no upstream API for SMP in Amazon FreeRTOS, so this branch still relies on patches to add SMP to some APIs compared to the official FreeRTOS APIs.