Commit Graph

1054 Commits

Author SHA1 Message Date
Darian Leung
6fc935e584 refactor(freertos): Refactor usage of portBASE_TYPE to BaseType_t
portBASE_TYPE is an internal macro defined by the porting layer. This commit
changes all references to BaseType_t which is the official type exposed by
FreeRTOS.
2023-07-31 17:10:34 +02: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
Alexey Lapshin
5f07ed87f6 Merge branch 'fix/esp32c2-gdbstub-runtime' into 'master'
fix(freertos): enable esp32c2 runtime-gdbstub

See merge request espressif/esp-idf!24858
2023-07-28 15:41:07 +08:00
Armando
fd096c012d change(vector.S): port hw stack guard change to p4 2023-07-25 05:59:10 +00:00
Armando
5986e63c47 change(riscv): added fence after CLIC_INT_THRESH_REG is set 2023-07-25 05:59:10 +00:00
Armando
48ee1ba36e feat(freertos): base support on p4 2023-07-25 05:59:10 +00:00
Darian
2032c9029f Merge branch 'bugfix/freertos_1051_remove_croutine' into 'master'
FreeRTOS: Remove croutine.h from v10.5.1

See merge request espressif/esp-idf!24911
2023-07-24 10:35:20 +08:00
Zim Kalinowski
140f78b66d Merge branch 'bugfix/fixed-log-related-warning-in-freertos' into 'master'
fix(freertos): fixed log related warning

See merge request espressif/esp-idf!24725
2023-07-20 07:36:26 +08:00
Zim Kalinowski
72757bf68b fix(freertos): fixed log related warning 2023-07-20 06:22:36 +08:00
Darian Leung
0a77949477 fix(freertos): Removed croutine.h from v10.5.1
Remove croutine.h as is not supported in ESP-IDF
2023-07-19 23:09:19 +03:00
Alexey Lapshin
99ac68246e fix(freertos): enable esp32c2 runtime-gdbstub 2023-07-18 12:15:33 +04:00
Zim Kalinowski
a2d76ad38a Merge branch 'feature/freertos-10.5.1-added-base-riscv-porting-layer' into 'master'
feat(freertos): added base risc-v porting layer to 10.5.1

See merge request espressif/esp-idf!24773
2023-07-18 03:24:10 +08:00
Zim Kalinowski
ccf51a6263 feat(freertos): added base risc-v porting layer to 10.5.1
This commit adds the source files for the GCC RISC-V port of FreeRTOS V10.5.1.
Files copied from https://github.com/FreeRTOS/FreeRTOS-Kernel/tree/V10.5.1/portable/GCC/RISC-V
2023-07-17 18:59:16 +08:00
Zim Kalinowski
9fe9a9d7c6 feat(freertos): added static buffers support on the top on 10.5.1 (upstreamed) 2023-07-13 19:01:37 +08:00
Omar Chebib
2aee63a773 freertos: add a unit test for FPU context switch 2023-07-04 02:45:56 +00:00
Alexey Lapshin
4df3ff619e feat(esp_system): implement hw stack guard for riscv chips
- add hardware stack guard based on assist-debug module
- enable hardware stack guard by default
- disable hardware stack guard for freertos ci.release test
- refactor rtos_int_enter/rtos_int_exit to change SP register inside them
- fix panic_reason.h header for RISC-V
- update docs to include information about the new feature
2023-07-01 16:27:40 +00:00
KonstantinKondrashov
42fa005bf7 freertos: Fix Systick stuck when systimer was not reset
Relates to OTA update for C3 chips from IDF version 4.3 to v5.0 and above
2023-06-19 21:57:02 +08:00
Marius Vikhammer
6d11c37ff1 core-system: trim build components for core-system test apps 2023-06-13 09:14:42 +08:00
Marius Vikhammer
bd4c0fca3c core-system: changed CONFIG_COMPILER_OPTIMIZATION_DEFAULT to CONFIG_COMPILER_OPTIMIZATION_DEBUG
DEBUG is more descriptive and is consistent with the name used in the bootloader:
CONFIG_BOOTLOADER_COMPILER_OPTIMIZATION_DEBUG

Closes https://github.com/espressif/esp-idf/issues/8404
2023-06-02 15:16:50 +08:00
wuzhenghui
388746ca31 Kconfig: add more help info for pm related options help 2023-05-29 16:35:03 +08:00
David Cermak
a41d360842 freertos/linux: Fix use after scope exit in select() wrap 2023-05-15 10:28:54 +02:00
Darian
6281606986 Merge branch 'feature/freertos_add_v10.5.1_files' into 'master'
FreeRTOS: Add v10.5.1 upstream files

See merge request espressif/esp-idf!23502
2023-05-11 16:14:50 +08:00
Darian Leung
d044e63b39 freertos(IDF): Update kernel version tag of V10.5.1 source files
This commit updates the kernel version tags of all V10.5.1 source files to
indicate that the source files are modified.
2023-05-10 16:58:57 +08:00
Darian Leung
f76194add9 freertos(IDF): Add hidden build option for V10.5.1 kernel
This commit adds a "CONFIG_FREERTOS_USE_KERNEL_10_5_1" hidden option to enable
building of the v10.5.1 kernel for development/testing purposes. Currently
enabling this option will just cause CMake to error out.

Also added a markdown file to record the code changes made to the V10.5.1 source
when porting over SMP behavior.
2023-05-10 16:53:00 +08:00
Darian Leung
74f37f50ec freertos(IDF): Add upstream V10.5.1 files
This commit adds the source files for the FreeRTOS Kernel V10.5.1 in
preparation for upgrading ESP-IDF FreeRTOS Kernel version (files copied from
https://github.com/FreeRTOS/FreeRTOS-Kernel/tree/V10.5.1)

The following modifications were made to the files when copying

- Added "SPDX-FileCopyrightText" and "SPDX-FileContributor" tags to all files
  to pass ESP-IDF pre-commit checks.
- Left out some files unnecessary to ESP-IDF (e.g., URLs, "History.txt", and
"portable" folder).
2023-05-10 16:52:22 +08:00
Zim Kalinowski
54576b7528 Merge branch 'bugfix/freertos_fix_unordered_event_list' into 'master'
freertos: Updated vTaskRemoveFromUnorderedEventList() to consider scheduler state before adding task to ready list

Closes IDF-5785

See merge request espressif/esp-idf!23482
2023-05-10 01:48:47 +08:00
Zim Kalinowski
a495f4729b Merge branch 'ci/fix_system_invalid_kconfigs' into 'master'
ci: fix invalid kconfig options in system test apps

See merge request espressif/esp-idf!23582
2023-05-10 01:38:46 +08:00
Sudeep Mohanty
abe5311a22 freertos: Updated vTaskRemoveFromUnorderedEventList() to consider scheduler state before adding task to ready list
vTaskRemoveFromUnorderedEventList() runs under the assumption that the
scheduler is suspended during the call. However, for IDF FreeRTOS, this
is not true. When dual-core system is active, this API call is made in
a critical section but without suspending the scheduler. This commit
updates the vTaskRemoveFromUnorderedEventList() function to now consider
the scheduler state on either cores before adding a task to the ready list.
2023-05-09 10:47:24 +02:00
Sudeep Mohanty
1acd2b5ce7 freertos-idf: Fixed incorrect scheduler suspension check in xTaskRemoveFromEventList()
This commit fixes a bug in xTaskRemoveFromEvenetList() where in the
check for scheduler suspension did not account for nested suspensions.
Additionally, this commit updates all checks for scheduler
suspension to follow a uniform way.
2023-05-09 10:28:02 +02:00
Marius Vikhammer
a300b3eb81 ci: fix invalid kconfig options in system test apps 2023-05-09 11:27:55 +08: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
David Cermak
b2af4d9689 lwip/linux: Add lwip support for networking component under linux
linux/lwip: Wrap some IO posix functions
* to workaourd the FreeRTOS EINTR issue (when building without lwip)
* to correctly choose the sub-system based on fd (when building with
lwip) -- passing control to either linux/system or to lwip
This commit also addapts tapio-if to provide DHCP client by default and
configurable settings for static IP
2023-05-05 05:03:39 +00: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
Darian Leung
cf595293af freertos: Move port_systick to common directory
This commit moves port_systick to a directory that ia accessible to both
IDF FreeRTOS and Amazon SMP FreeRTOS.
2023-04-28 23:03:00 +08:00
Jakob Hasse
550ecbe37a feat(freertos): added POSIX/Linux simulator port to FreeRTOS SMP
* Added a POSIX/Linux simulator that is compatible with the Amazon
  FreeRTOS SMP API. Note that the simulator itself is still
  single core, like the IDF FreeRTOS POSIX/Linux simulator.
2023-04-25 13:58:57 +08:00
laokaiyao
49f16eefbb esp32h4: checked all the corner stuffs of the removal 2023-04-23 12:03:07 +00:00
laokaiyao
bf2a7b2df6 esp32h4: removed esp32h4 related codes 2023-04-23 12:03:07 +00:00
Darian Leung
948010dc0b freertos: Add task creation with caps functions
This commit adds the corresponding CreateWithCaps functions for tasks:

- xTaskCreatePinnedToCoreWithCaps()
- xTaskCreateWithCaps()
- vTaskDeleteWithCaps()

Documentation and migraiton guide have been updated accordingly.

Closes https://github.com/espressif/esp-idf/issues/11216
2023-04-21 15:43:08 +08:00
Darian Leung
6587e75251 xtensa: Add bare metal port stub functions for G0 build test
This commit adds "bare metal stubs" xtensa_rtos.h glue layer to mimic a bare
metal OS port. The bare metal stubs don't access any components outside of the
G0 group.
2023-04-18 15:51:38 +08:00
Darian Leung
5fde889a3d xtensa: Remove OS agnostic files from Amazon SMP FreeRTOS port
The previous commit moved the OS agnostic files from the IDF FreeRTOS port to
the xtensa component, thus can be accessed by both IDF and Amazon SMP FreeRTOS.

This commit removes the redudant copies in the Amazon SMP FreeRTOS port.
2023-04-18 15:51:38 +08:00
Darian Leung
b2c074bb70 xtensa: Move Xtensa RTOS porting layer files to xtensa component
When porting an RTOS to the Xtensa architecture, there are a few files that
are common to all Xtensa RTOS ports. These files form the Xtensa RTOS porting
layer (e.g., "xtensa_vectors.S", "xtensa_context.S"). An Xtensa RTOS port is
expected to provide an RTOS specific "xtensa_rtos.h" header to interface with
the Xtensa RTOS porting layer.

Previously, the Xtensa RTOS porting layer files were placed in the FreeRTOS
component. This commit does the following:

1. Moves the Xtensa RTOS porting layer files from the `freertos` component to
the `xtensa` component. The following files were moved:

    - xtensa_asm_utils.h
    - xtensa_context.S
    - xtensa_loadstore_handler.S
    - xtensa_vectors.S

2. Refactored xtensa component include paths to separate Xtensa RTOS porting
layer headers.

- Xtensa HAL headers included via `#include <xtensa/...h>`
- Xtensa RTOS porting layer headers included via `#include <...h>`

Note: The xtensa files in the Amazon SMP FreeRTOS port are not moved/deleted in
this commit to ensure the moved files retain a clean diff history.
2023-04-18 15:28:05 +08:00
Darian Leung
fa4491a56b freertos: Add unit tests for ...WithCaps() functions 2023-04-12 12:00:53 +08:00
Darian Leung
4e7cd2e706 freertos: Add wrapper functions to create objects with capabilities
This commit adds various ...WithCaps() functions to create FreeRTOS objects
with specific memory capabilities.
2023-04-12 12:00:53 +08:00
Darian Leung
478e041ce5 freertos: Add GetStaticBuffer functions
This commit adds the various ...GetStaticBuffer() functions from upstream
FreeRTOS. See https://github.com/FreeRTOS/FreeRTOS-Kernel/pull/641 for more
details.
2023-04-12 11:45:06 +08:00
Darian Leung
902d8f392d freertos: Fix idf_additions.h include order error
When building for CONFIG_FREERTOS_SMP, "idf_additions.h" was previously
implicitly included by "task.h" so that other ESP-IDF components still have
access to IDF API additions without needing to include "idf_additions.h"
directly.

However, some FreeRTOS headers (e.g., queue.h) will include task.h before
declaring any types (e.g., QueueHandle_t). Thus if any of those types are used
in idf_additions.h, we get a missing type error.

This commit moves the implicity include of idf_additions.h to FreeRTOS.h
2023-04-12 11:45:06 +08:00
Darian Leung
b042ed0495 freertos: Uncrustify idf_additions.h 2023-04-07 15:24:34 +08:00
Darian Leung
3d2e674326 freertos: Move private API additions to "freertos_idf_additions_priv.h"
Previously, some IDF FreeRTOS API additions that were meant to be private were
exposed through the same "idf_additions.h" header. This commit moves those
functions to a separate header included via
"esp_private/freertos_idf_additions_priv.h" so that they are not mistaken as
public API by users.

This commit also fixes some missing include and C++ guards in idf_additions.h
2023-04-07 15:24:34 +08:00
Darian Leung
0c21d59716 freertos: Move freertos_tasks_c_additions.h
freertos_tasks_c_additions.h is technically included as source file. This
commit removes the "private_include" directory of "freertos_tasks_c_additions.h"
and treats it as a source file of "esp_additions".
2023-04-07 15:24:34 +08:00
Sudeep Mohanty
7f6e9cf786 freertos-tests: Fixed failing CI test and added a new test case for vTaskSuspendAll() API
This commit fixes the failing test - Test vTaskSuspendAll allows
scheduling on other cores.
The commit also adds a new test to test the scenario where in an
unpinned task, when unblocked by an ISR can be scheduled on the core
which has the scheduler running.
2023-04-06 08:26:38 +02:00
Marius Vikhammer
bf8934002b freertos: re-enable "mutex released not by owner causes an assert" test in CI 2023-03-24 10:19:51 +08:00