Commit Graph

17 Commits

Author SHA1 Message Date
Darian Leung
1332f2934a
feat(freertos): Add application task tag support
This commit enables support for application task tag.

- Added CONFIG_FREERTOS_USE_APPLICATION_TASK_TAG option
- Added basic unit test
2024-03-09 00:57:37 +08:00
Darian Leung
83c686c744
feat(freertos/smp): Update ports to support Amazon FreeRTOS v11.0.1
- vTaskPreemptionDisable()/vTaskPreemptionEnable() are no longer available in
single-core builds.
- xTaskIncrementTick() calls must now be wrapped by critical section
- Minimal Idle Task renamed to Passive Idle Task
- Port critical section APIs updated
2024-03-05 15:44:12 +08:00
fl0wl0w
90d1dcfd76 feat(freertos): Introduced new Kconfig option CONFIG_FREERTOS_NUMBER_OF_CORES
This commit replaces the use of portNUM_PROCESSORS and configNUM_CORES
macros in all of ESP-IDF. These macros are needed to realize an SMP
scenario by fetching the number of active cores FreeRTOS is running on.
Instead, a new Kconfig option, CONFIG_FREERTOS_NUMBER_OF_CORES, has been
added as a proxy for the FreeRTOS config option, configNUMBER_OF_CORES.
This new commit is now used to realize an SMP scenario in various places
in ESP-IDF.

[Sudeep Mohanty: Added new Kconfig option CONFIG_FREERTOS_NUMBER_OF_CORES]

Signed-off-by: Sudeep Mohanty <sudeep.mohanty@espressif.com>
2024-02-09 09:11:28 +01:00
Sudeep Mohanty
f01dbe0314 feat(freertos/idf): Add config option for FreeRTOS Timer Task core affinity
This commit adds the ability to set the core affinity for the FreeRTOS
Timer Service task when multi-core configuration is enabled. This commit
also adds a Kconfig option to set the core affinity of the timer task
via the menuconfig.

Closes https://github.com/espressif/esp-idf/issues/10315
2023-11-16 11:42:40 +01:00
Sudeep Mohanty
bf237a2bd4 Merge branch 'feature/freertos_expose_list_integrity_check_option' into 'master'
feat(freertos): Exposed Kconfig option for configUSE_LIST_DATA_INTEGRITY_CHECK_BYTES

Closes IDF-8366

See merge request espressif/esp-idf!26960
2023-11-14 21:27:19 +08:00
Sudeep Mohanty
289913daaf fix(freertos/idf): Define configLIST_VOLATILE for list elements
It was noticed that when high level compiler optimizations are enabled,
the compiler optimizes some list manupulation code. This commit enables
the configLIST_VOLATILE for list elements to prevent the compiler from
optimizing out essential kernel code.
2023-11-10 09:23:51 +01:00
Sudeep Mohanty
d507a86285 feat(freertos): Exposed Kconfig option for configUSE_LIST_DATA_INTEGRITY_CHECK_BYTES
This commit exposes the FreeRTOS List integrity check option
configUSE_LIST_DATA_INTEGRITY_CHECK_BYTES via menuconfig.
2023-11-09 14:54:13 +01:00
Darian Leung
b301f175c9 feat(freertos/idf): Add configRUN_TIME_COUNTER_TYPE option
This commit adds a Kconfig option for configRUN_TIME_COUNTER_TYPE

Closes https://github.com/espressif/esp-idf/issues/11973
2023-10-31 14:55:12 +08:00
Darian Leung
b13b9c1163 fix(freertos/idf/linux): Fix configMAX_PRIORITIES for linux port
Previously the linux port of FreeRTOS set configMAX_PRIORITIES to 7. However,
multiple linux POSIX simulator examples will call API that create tasks with
priortiies >= 7.

This commit fixes the configMAX_PRIORITIES and unifies all ports to have 25
priorities.
2023-10-21 04:39:16 +08:00
Darian Leung
16ccb31d33 change(freertos/idf): Make v10.5.1 the default kernel
This commit makes v10.5.1 the default FreeRTOS kernel in ESP-IDF by removing
the CONFIG_FREERTOS_USE_KERNEL_10_5_1 option and v10.4.3 specific code
blocks.
2023-10-21 04:39:16 +08:00
Darian Leung
b09462eae8 feat(freertos): Add beta support for FreeRTOS v10.5.1 kernel
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 https://github.com/espressif/esp-idf/issues/7137
2023-09-18 21:32:14 +08:00
Darian Leung
db64e51e53 feat(freertos): Add SMP kernel changes to FreeRTOS v10.5.1
This commit adds the key kernel changes to the v10.5.1 kernel to support
dual-core SMP. These changes are temporarily documented in the `idf_changes.md`
document. This commit...

- Added changes to kernel data structures to support multiple cores
- Changes to scheduling algorithm support SMP scheduling.
- Changes to each FreeRTOS function to support multiple cores and SMP
scheduling algorithm.
2023-09-18 18:32:54 +08:00
Sudeep Mohanty
371ad531ee feat(freertos): Added a Kconfig option for FreeRTOS Timer Service task name
This commit adds a Kconfig option for setting a custom name for the
FreeRTOS Timer Service task.
2023-09-08 16:39:15 +02:00
Darian Leung
0db40f9e6c refactor(freertos/idf): Move IDF task utility functions to API addition headers
This commit combines various task utility API additions in IDF FreeRTOS and with
their Amazon SMP FreeRTOS addition counterparts. The folloiwng functions have
been moved to freertos_tasks_c_additions.h and idf_additions.h as these API
are considered public:

- xTaskGetCurrentTaskHandleForCPU()
- xTaskGetIdleTaskHandleForCPU()
- xTaskGetAffinity()
- pxTaskGetStackStart()

Also fixed in missing #if macros when vTaskCoreAffinityGet() is called in
Amazon SMP FreerTOS tests.
2023-09-05 16:20:59 +08:00
Darian Leung
57eb41ce83 refactor(freertos): Call TLSP deletion callback from portCLEAN_UP_TCB()
Previously, TLSP deletion callbacks were...

- Stored in a seprate TCB member "pvThreadLocalStoragePointersDelCallback"
- Called separately via multipole prvDeleteTLS() insertions in tasks.c

This commit refactors how TLSP deletion callbacks are stored and called:

- TLSP deletion callbacks are now stored in "pvThreadLocalStoragePointers"
directly. configNUM_THREAD_LOCAL_STORAGE_POINTERS is doubled in size so that
the deletion callbacks are stored in the latter half of the array

- The callbacks are now called via "portCLEAN_UP_TCB()". As such, the
prvDeleteTLS() additions are no longer needed and the function can be removed

- Removed some legacy TLSP tests using the old method of storing the callback
pointers.

This commit reduces the source code diff between IDF FreeRTOS and upstream
vanilla FreeRTOS, in preparation for v10.5.1 upgrade.
2023-08-24 19:32:06 +08:00
Darian Leung
1e51387222 refactor(freertos): Refactor usage of portSTACK_TYPE to StackType_t
portSTACK_TYPE is an internal macro defined by the porting layer. This commit
changes all references to StackType_t which is the official type exposed by
FreeRTOS.
2023-07-31 16:59:41 +02:00
Darian Leung
66499f17a5 freertos: Refactor component structure
This commit refactors the "freertos" component's structure as follows:

- "FreeRTOSConfig.h" related files moved to "./config" directory
- Refactored CMakeLists.txt file in preparation for v10.5.1 upgrade
    - Grouped list appends based on component organization
    - Removed some unecessarily public "include_dirs"
- Removed FreeRTOS-openocd.c
    - uxTopUsedPriority has been added back to tasks.c since v10.4.2
    - Thus the workaround in FreeRTOS-openocd.c is no longer needed and can
      be removed.
2023-05-08 18:40:03 +08:00