Commit Graph

8 Commits

Author SHA1 Message Date
Darian Leung
39cf3638ae change(freertos): Deprecate usage of vPortCleanUpTCB() by applications
Previously, if CONFIG_FREERTOS_ENABLE_STATIC_TASK_CLEAN_UP was enabled, users
would provide a definition for a vPortCleanUpTCB() hook function that is called
right before a task's memory is freed in prvDeleteTCB(). However,
vPortCleanUpTCB() will be reclaimed by ESP-IDF for internal use in v6.0.

This commit introduces the following changes...

Introduced a new CONFIG_FREERTOS_TASK_PRE_DELETION_HOOK option:

- Provides the same pre-deletion hook functionality. But users now define
vTaskPreDeletionHook() instead.
- CONFIG_FREERTOS_ENABLE_STATIC_TASK_CLEAN_UP still exists, but is marked as
deprecated. This is to maintain compatibility with existing applications
that already define vPortCleanUpTCB().
- Removed redundant --wl --wrap workaround with vPortCleanUpTCB()
- Added todo notes to remove support for user defined vPortCleanUpTCB()
completely in v6.0.
- Updated test cases to use new CONFIG_FREERTOS_TASK_PRE_DELETION_HOOK option

Freed up portCLEAN_UP_TCB() to call a new internal vPortTCBPreDeleteHook():

- vPortTCBPreDeleteHook() now replaces the previous "wrapped" implementation
of vPortCleanUpTCB().
- vPortTCBPreDeleteHook() is an internal task pre-delete hook for IDF FreeRTOS
ports to inject some pre-deletion operations.
- Internal pre-delete hook now invokes user provided vTaskPreDeletionHook()
if enabled.
- Relocated vPortTCBPreDeleteHook() to correct section in port.c
2023-08-23 17:50:08 +08:00
Darian Leung
76d4c9f592 freertos: Refactor port_systick
This commit refactors port_systick.c so that all ports (RISC-V vs Xtensa) of
all FreeRTOS implementations (IDF vs Amazon SMP FreeRTOS) use the same set of
tick interrupt functions. Thus, these funcitons are now common:

- vPortSetupTimer() to setup the tick interrupt's timer
- xPortSysTickHandler() that is called on each tick interrupt
2023-04-28 23:03:00 +08:00
Alexey Lapshin
d1214aef8c freertos: riscv: fix vPortTaskWrapper for clang 2023-02-20 13:09:42 +08:00
Darian Leung
321254a776 freertos(SMP): Update SMP FreeRTOS linker fragment file
This commit updates the linker fragment file for Amazon SMP FreeRTOS.

- Linker fragment file's formatting was updated
- Placement rules of functions is now clearly specified inside the linker
  fragment file.
- Some extra functions are now placed in flash in accordance to the new
  placement rules.
2023-02-01 15:15:51 +08:00
Darian Leung
0574e63e6f freertos: Add linker fragments for common functions
This commit adds a separate linker fragment file "linker_common.lf" for the
functions in "port_common.c". The placement rules are now clearly specified
inside the linker fragment file.
2023-02-01 15:09:46 +08:00
Darian Leung
09690906e7 freertos: Refactor OS startup functions
This commit refactors the OS startup functions as follows:

- Moved the OS/app startup functions listed below to "app_startup.c". Their
    implementations are now common to all ports (RISC-V and Xtensa) of all
    FreeRTOS implementations (IDF and Amazon SMP).
    - esp_startup_start_app()
    - esp_startup_start_app_other_cores()
- Removed esp_startup_start_app_common() as app startup functions are now
    already common to all ports.
- Added extra logs to "main_task" to help with user debugging

Note: Increased startup delay on "unity_task". The "unity_run_menu()" is non
blocking, thus if the main task or other startup tasks have not been freed
by the time "unity_run_menu()" is run, those tasks will be freed the next time
"unity_task" blocks. This could cause some tests to have a memory leak, thus
the "unity_task" startup delay has increased.
2022-12-08 01:57:30 +08:00
KonstantinKondrashov
aea2fe0816 freertos: Adds new APIs to set/get and restore base priority
Closes https://github.com/espressif/esp-idf/issues/7580
2022-09-01 07:07:08 +00:00
Darian Leung
733021ebf8 freertos: Move some SMP FreeRTOS functions to flash
The CONFIG_FREERTOS_PLACE_FUNCTIONS_INTO_FLASH allows some FreeRTOS functions to be placed
into flash, thus saving some IRAM. However, this feature was previously not supported for
SMP FreeRTOS.

This commit adds CONFIG_FREERTOS_PLACE_FUNCTIONS_INTO_FLASH support for SMP FreeRTOS. There
are now separate linker fragment files for IDF FreeRTOS and SMP FreeRTOS, named "linker.lf"
and "linker_smp.lf" respectively.
2022-06-23 16:00:46 +08:00