1270 Commits

Author SHA1 Message Date
igor.udot
daf2d31008 test: format all test scripts 2025-03-05 12:08:48 +08:00
Omar Chebib
c95a12658e fix(freertos): fix a bug in prvTaskDeleteWithCaps related to coprocessors
When a coprocessor is used, the stack pointer is altered. It must be restored
before freeing the memory allocated to the task.
2025-02-18 11:59:04 +08:00
Sudeep Mohanty
ee18a4d9ab fix(freertos): Backported a change to suppress Coverity warnings
This commit backports the commit# f94bc89108ffca538cf91d5856149960a5d4be81
from the upstream FreeRTOS kernel repository to supress a Coverity
warning. The change was done to avoid using string modification
functions which cause a security violation.
2025-02-07 08:52:51 +01:00
gaoxu
5ef4f20778 feat(esp32h21): disable unsupported build test 2025-02-06 15:47:51 +08:00
Marius Vikhammer
afc1b31f43 Merge branch 'test/freertos_gptimer_not_supported' into 'master'
test(freertos): allow freertos tests to compile even when gptimer is not supported

Closes IDF-11554

See merge request espressif/esp-idf!36461
2025-01-20 09:56:48 +08:00
Marius Vikhammer
2ef05f9f9b test(idf_test): add performance target file for H21 2025-01-17 12:27:00 +08:00
Marius Vikhammer
638b22ef4e test(freertos): changed freertos tests to compile even if no gptimer 2025-01-17 12:07:07 +08:00
Mahavir Jain
6502148fdc
fix(examples): simple http_server example build for Linux target
Static task creation on Linux target had issues with insufficient stack
memory allocation. Type of `StackType_t` is `unsigned long` and hence
it must be considered during stack memory allocation.

Fix ensures proper working of simple HTTP server example.
2025-01-10 09:50:18 +05:30
Sudeep Mohanty
65dba9f930 fix(freertos): Limit idle task name length for copy operation
This commit:
- Updates the FreeRTOS kernel prvCreateIdleTasks() function to
limit the length of the IDLE task name before copying it to avoid memory
out-of-bounds warnings.
- Fixes a bug where in the IDLE task name string could be a non
  null-terminated string in SMP configuration.
2025-01-03 18:06:47 +08:00
Alexey Lapshin
888b5f7e8d feat(newlib): add picolibc support 2024-12-02 21:35:56 +07:00
Laukik Hase
ba2af7f611
feat(esp_tee): Support for ESP-TEE - hal, soc and freertos components 2024-12-02 12:19:46 +05:30
Laukik Hase
5328dcd00c
change(build): Add a new CMake flag NON_OS_BUILD for non-FreeRTOS builds 2024-10-21 19:03:30 +05:30
Sudeep Mohanty
1fe57a5d8e fix(freertos): Fixed SMP race condition in xStreamBufferSend()
This commit fixes a race condition in dual-core SMP mode where in the
xStreamBufferSend() makes the xTaskWaitingToSend NULL but it may
have already been evaluated to not be NULL by xStreamBufferReceive()
running on another core and eventually leading to a crash in tasks.c.
2024-10-16 19:39:42 +08:00
Sudeep Mohanty
03d76006b8 fix(freertos): Fixed SMP race condition in stream_buffers.c
This commit fixes a race condition in dual-core SMP mode where in the
xStreamBufferReceive() makes the xTaskWaitingToReceive NULL but it may
have already been evaluated to not be NULL by xStreamBufferSend()
running on another core and eventually leading to a crash in tasks.c.
2024-10-11 14:31:06 +02:00
Sudeep Mohanty
a97a7b0962 Merge branch 'fix/priority_inv_when_remove_from_unordered_event_list' into 'master'
fix(freertos): Fixed priority inversion when setting event group bits

Closes IDF-8160

See merge request espressif/esp-idf!33953
2024-10-11 17:49:08 +08:00
Sudeep Mohanty
eeafd12f37 Merge branch 'feat/add_freertos_port_layer_mocks' into 'master'
feat(freertos): Add FreeRTOS port layer mocks for CMock tests

See merge request espressif/esp-idf!34021
2024-10-11 17:47:51 +08:00
morris
aebf700919 refactor(freertos): rename SPIRAM_ALLOW_STACK_EXTERNAL_MEMORY and move to freertos 2024-10-09 13:32:03 +08:00
Sudeep Mohanty
0e5adc1b9c feat(freertos): Add FreeRTOS port layer mocks for CMock tests
This commit adds mocks for the FreeRTOS linux port layer for tests which
mock the FreeRTOS component and use port layer APIs.
2024-10-08 12:08:24 +02:00
Sudeep Mohanty
fc84220d90 test(freertos): Added unit test for event groups to test priority inversion
This commit adds a FreeRTOS unit test to verify that event groups do not
cause priority inversion when unblocking a higher priority task.
2024-10-08 09:36:45 +02:00
Sudeep Mohanty
bd4de3c8a3 fix(freertos): Fixed priority inversion when setting event group bits
This commit fixes a priority inversion when a lower priority task set
event group bits to unblock a higher priority task but the lower
priority task continued to run.
2024-10-08 09:36:45 +02:00
Marius Vikhammer
4bf8d49159 fix(system): fixed potential double exception when booting on xtensa
Due to old windows from the startup flow being present after
switching to running freertos tasks  windowoverflow exceptions
could potentially try to save windows to the startup stack.

During this overflow they also values previously saved on the
startup stack to find earlier frames' stacks.
Since the start up stack was already recycled these values were
invalid and would cause a crash.

Closes https://github.com/espressif/esp-idf/issues/14406Y
2024-09-27 09:34:00 +08:00
Sudeep Mohanty
c01512f4b0 Merge branch 'fix/assert_fail_in_xtaskdeletewithcaps' into 'master'
Fixed occational assert failure in vTaskDeleteWithCaps()

Closes IDFGH-13294

See merge request espressif/esp-idf!33468
2024-09-20 16:19:40 +08:00
Sudeep Mohanty
86c1ad216c Merge branch 'task/enable_freertos_tests_for_h2' into 'master'
test(freertos): Enabled FreeRTOS unit tests for esp32h2

See merge request espressif/esp-idf!33571
2024-09-19 16:42:22 +08:00
Alexey Gerenkov
81f4ef73c3 Merge branch 'feature/update-esp-clang-to-esp-18.1.2_20240815' into 'master'
feat(tools): update esp-clang version to esp-18.1.2_20240912

Closes LLVM-333

See merge request espressif/esp-idf!32895
2024-09-19 03:49:46 +08:00
Alexey Gerenkov
9ca231e76e change(build): Use integrated assembler with Clang for RISCV chips 2024-09-18 21:40:39 +03:00
Sudeep Mohanty
01f521f3a0 test(freertos): Enabled FreeRTOS unit tests for esp32h2 2024-09-18 12:51:24 +02:00
Sudeep Mohanty
c36674eaa8 fix(freertos): Fixed assert failure in vTaskDeleteWithCaps
This commit fixes an assert failure in vTaskDeleteWithCaps() when
multiple un-pinned tasks are created with stack in the external memory
and such tasks delete themselves.

Closes https://github.com/espressif/esp-idf/issues/14222
2024-09-18 11:11:04 +02:00
Sudeep Mohanty
02cd0253a1 test(freertos): Added a test for vTaskDeleteWithCaps when stack is in ext RAM
This commit adds a stress tests for creating multiple tasks with
xTaskCreateWithCaps such that the stack is allocated in external SPIRAM.
Then the tasks self-delete. This is done iteratively as stress test.
2024-09-18 10:39:24 +02:00
Sudeep Mohanty
812fbb7874 test(freertos): Enabled FreeRTOS unit tests for esp32c61 2024-09-17 14:17:01 +02:00
David Čermák
4dd715922f Merge branch 'fix/freertos_sim_nonblock_select' into 'master'
fix(freertos): Made select function non-blocking on Linux target (GitHub PR)

Closes IDFGH-13569 and IDFGH-13498

See merge request espressif/esp-idf!33331
2024-09-12 16:57:58 +08:00
Xiaoyu Liu
3d403a4ba8 refactor(intr): unify riscv freertos set/clear intr mask from isr apis
refactor(intr): find a potential bug that clic intr mask need extra nop ops
2024-09-11 18:26:07 +08:00
David Cermak
f7129481ed fix(freertos): Update select on Linux target to handle edge cases
* Handle not found "select()" symbol if dlsym() return NULL
* Handle minimum wait time if remaining time < designated minimum sleep
time
2024-09-09 16:52:51 +02:00
Alexey Lapshin
725b9ec81e fix(freertos): fix GCC 14 analyzer warnings 2024-09-08 13:53:52 +07:00
snake-4
8a39db3fae fix(freertos): Made select function non-blocking on Linux target
The select function wrapper was rewritten to be non-blocking
on Linux systems, as it was stealing all the CPU time
from lower priority tasks when called from a higher priority task.
This is because the FreeRTOS scheduler does not know
that the task thread is sleeping during the system call.

This issue manifests all "slow" system calls on the Linux target,
but handling the case of select fixes the problems for most ESP-IDF components.

The FreeRTOS POSIX port documentation lists this as a known issue,
so user code is responsible handling this case if other system calls are used,
even if unknowingly.

This closes GH issue #14395 "select() blocks the FreeRTOS scheduler on Linux target"
2024-09-04 15:15:26 +02:00
Fu Hanxi
3c30341cfd
ci: fix test_freertos markers 2024-09-03 09:34:09 +02:00
wanckl
4e095f4b9f ci(esp32c61): enable c61 generic target test 2024-09-02 19:26:12 +08:00
Marius Vikhammer
bdb36f133a Merge branch 'docs/freertos_stack_size' into 'master'
docs(freertos): update freertos comments to reflect that stack size is in bytes

Closes IDFGH-10342

See merge request espressif/esp-idf!32946
2024-08-26 16:19:01 +08:00
Marius Vikhammer
a04bedc4ce Merge branch 'bugfix/assert_ndebug' into 'master'
feat(newlib): add option to disable eval of expression in assert() when NDEBUG set

Closes IDFGH-479 and IDFGH-8692

See merge request espressif/esp-idf!32887
2024-08-26 15:42:31 +08:00
Marius Vikhammer
0d140f38ea fix(system): fixed warnings related to ununsed var if asserts disabled 2024-08-26 10:25:04 +08:00
Sudeep Mohanty
a110f09d5e Merge branch 'task/enable_fpu_in_isr_for_esp32s3' into 'master'
feat(freertos): Enabled Kconfig option to allow FPU usage in ISR for esp32s3

Closes IDFGH-13365

See merge request espressif/esp-idf!32746
2024-08-23 20:18:18 +08:00
Marius Vikhammer
9bff8ad50e docs(freertos): update freertos comments to reflect that stack size is in bytes
Closes https://github.com/espressif/esp-idf/issues/11600
2024-08-20 09:26:09 +08:00
Marius Vikhammer
6cbee5c7f6 Merge branch 'contrib/github_pr_13578' into 'master'
Make FreeRTOS configUSE_TIMERS optional in KConfig (GitHub PR)

Closes IDFGH-12576

See merge request espressif/esp-idf!32576
2024-08-13 10:06:51 +08:00
Sudeep Mohanty
bfa3c55250 feat(freertos): Enabled Kconfig option to allow FPU usage in ISR for esp32s3
This commit enables the Kconfig option to allow FPU usage in an ISR
context for the esp32s3.
2024-08-10 13:20:02 +02:00
Sudeep Mohanty
0db5d725ef fix(freertos): Fixed critical section macro in vTaskPlaceOnEventListRestricted()
The vTaskPlaceOnEventListRestricted() did not use the correct macro when
exiting a kernel cirtical section. This does not affect the HW targets
but on the Linux port, this caused an issue as the critical nesting
count became negative, leading to deadlocks. This commit fixes the bug
and updates the linux port to prevent the nesting count from going
negative.
2024-08-09 08:45:23 +02:00
Marius Vikhammer
0bcee8518b fix(freertos): split idf_additions.c event groups to separate file 2024-08-09 11:19:40 +08:00
dvosully
025b336916 Make FreeRTOS configUSE_TIMERS optional in KConfig 2024-08-09 11:19:40 +08:00
Frantisek Hrbata
0fdb309d1e change: exclude CVEs that do not impact ESP-IDF components
cJSON:    CVE-2024-31755 - Resolved in cJSON v1.7.18
FreeRTOS: CVE-2024-28115 - Affects only ARMv7-M MPU ports, and ARMv8-M ports

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2024-08-01 12:24:47 +02:00
Konstantin Kondrashov
0bdf675992 fix(linux): Fix warnings for Linux target when COMPILER_STATIC_ANALYZER=y 2024-07-31 11:23:54 +03:00
Sudeep Mohanty
c3da2ace27 fix(freertos): Fixed memory leak issue in vTaskDeleteWithCaps()
vTaskDeleteWithCaps() leaked memory when a task uses the API to delete
itself. This commit adds a fix to avoid the memory leak.

Closes https://github.com/espressif/esp-idf/issues/14222
2024-07-26 16:58:18 +02:00
Sudeep Mohanty
7806aeb372 Merge branch 'fix/freertos_port_assert_in_isr_bug' into 'master'
fix(freertos): Incorrect assert in FreeRTOS port layer when not in ISR context

See merge request espressif/esp-idf!32324
2024-07-26 21:14:53 +08:00