Commit Graph

575 Commits

Author SHA1 Message Date
Zim Kalinowski
8bb5d87f0c Merge branch 'bugfix/freertos_ut_suspend_v4.3' into 'release/v4.3'
freertos: Increases delta for UT - Test suspend-resume CPU. The number of... (v4.3)

See merge request espressif/esp-idf!14630
2021-09-13 04:14:14 +00:00
Zim Kalinowski
121910b939 Merge branch 'ci/change_perf_key_v4.3' into 'release/v4.3'
ci: update performance test key to db compatible format (v4.3)

See merge request espressif/esp-idf!14654
2021-09-10 04:23:09 +00:00
Mahavir Jain
94667365d3 Merge branch 'esp32c3/override_assert_v4.3' into 'release/v4.3'
newlib: Override __assert and __assert_func (v4.3)

See merge request espressif/esp-idf!14685
2021-09-09 13:24:01 +00:00
Gautier Seidel
7808bccfb9 fix(FreeRTOS): Initialize uxTaskNumber at task initialization
Signed-off-by: Laukik Hase <laukik.hase@espressif.com>

Closes https://github.com/espressif/esp-idf/pull/4025
2021-09-08 16:42:30 +08:00
Sachin Parekh
cc9d354ba8 Update tests for assert and abort
- Place panic_abort in IRAM
- Added abort, assert test case in case of cache disabled
- Expect assert instead of abort in a freertos_mutex test
2021-09-08 16:32:09 +08:00
Fu Hanxi
2231d6b158 ci: update performance test key to db compatible format 2021-08-04 12:22:25 +08:00
KonstantinKondrashov
0cd1bc6753 freertos: Increases delta for UT - Test suspend-resume CPU. The number of tick_hook should be the same for both CPUs 2021-08-03 12:50:15 +05:00
Krzysztof Budzynski
5ab8799f09 Merge branch 'docs/provide_link_to_pcb_layout_for_ethernet_board_v4.3' into 'release/v4.3'
docs: provide the link to pcb layout for ethernet board v1.2 and fix a typo in freetos/task (v4.3)

See merge request espressif/esp-idf!13966
2021-07-23 10:57:37 +00:00
Angus Gratton
9f6e09d0d3 Merge branch 'bugfix/flash_rodata_any_alignement_v4.3' into 'release/v4.3'
build: Fix cache issue and add dedicated section for (Custom) App version info (backport v4.3)

See merge request espressif/esp-idf!13448
2021-06-22 00:23:49 +00:00
Angus Gratton
b5256118ff Merge branch 'bugfix/riscv_stack_alignment_v4.3' into 'release/v4.3'
core: fix cases where riscv SP were not 16 byte aligned (v4.3)

See merge request espressif/esp-idf!13653
2021-06-17 02:09:34 +00:00
Wang Fang
1903d8587a docs: provide the link to pcb layout for ethernet board v1.2 and fix a typo in freetos/task 2021-06-15 15:26:10 +08:00
Marius Vikhammer
57442c38bd core: fix cases where riscv SP were not 16 byte aligned
RISC-V stack pointer should always be 16 byte aligned, but for some cases where
we were doing manual SP manipulation this was not always the case.
2021-06-02 16:02:10 +08:00
Angus Gratton
0cca9e860d freertos docs: Specify that uxTaskGetStackHighWaterMark() returns bytes not words
As reported https://esp32.com/viewtopic.php?f=13&t=20043&p=73732
2021-05-28 05:13:40 +00:00
Ivan Grokhotkov
b7707c54ce freertos: fix TLS run-time address calculation
Since dd849ffc, _rodata_start label has been moved to a different
linker output section from where the TLS templates (.tdata, .tbss)
are located. Since link-time addresses of thread-local variables are
calculated relative to the section start address, this resulted in
incorrect calculation of THREADPTR/$tp registers.

Fix by introducing new linker label, _flash_rodata_start, which points
to the .flash.rodata output section where TLS variables are located,
and use it when calculating THREADPTR/$tp.

Also remove the hardcoded rodata section alignment for Xtensa targets.
Alignment of rodata can be affected by the user application, which is
the issue dd849ffc was fixing. To accommodate any possible alignment,
save it in a linker label (_flash_rodata_align) and then use when
calculating THREADPTR. Note that this is not required on RISC-V, since
this target doesn't use TPOFF.
2021-05-06 11:42:14 +08:00
Angus Gratton
d30ec8c94e freertos: Add addition overflow check for stream buffer
Patch from upstream commit d05b9c123f2bf9090bce386a244fc934ae44db5b
2021-05-04 18:30:49 +10:00
Angus Gratton
658a0acdbe freertos: Check for arithmetic overflows on queue creation
Addition overflow check is from FreeRTOS kernel commit 47338393f1f79558f6144213409f09f81d7c4837
2021-05-04 18:30:49 +10:00
Angus Gratton
275743ab1c doc: Add notes that vTaskStartScheduler() is called during startup
Closes https://github.com/espressif/esp-idf/issues/1457
2021-04-23 22:48:47 +10:00
Angus Gratton
2290d0385e freertos: Fix race condition returning incorrect TCB on unpinned tasks
Noted as a problem with thread local storage returning a different task's
pointers, but some other were APIs also accessing current task unsafely.

Regression in FreeRTOS 10 update a3c90bf59a
2021-04-20 03:51:43 +00:00
Angus Gratton
a7994b1a42 freertos: Add some comments about deleting tasks when using SMP
Some cases are not immediately obvious, so document them in comments.
2021-04-14 19:45:08 +10:00
Angus Gratton
c725aa3ec1 freertos: Fix race condition using vTaskDelete() cross-core causing resource leak
Causes test added in parent commit to pass.

This race happens if the deleted task is running on the other CPU,
and is already spinning in a critical section waiting for xTaskQueueMutex
because it's about to be blocked for a resource.

The "deleted" task would end up blocked, possibly indefinitely, and
never actually deleted or its resources cleaned up by the idle tasks.

Details:

vTaskDelete() adds the target task to the xTasksWaitingTermination list,
expecting it to be yielded off CPU and then cleaned up later. However as soon as
vTaskDelete() releases xTaskQueueMutex, the target task runs and moves itself to the
xDelayedTaskList1. Because interrupts are already disabled on that CPU,
the "yield" to the other CPU sent by the vTaskDelete() comes afterward so
doesn't help.
2021-04-14 19:45:08 +10:00
Angus Gratton
3687ae989b freertos: Add unit test for deleting task which may be blocking 2021-04-14 19:45:08 +10:00
Angus Gratton
7703fcbd8d Merge branch 'bugfix/silent_asserts_v4.3' into 'release/v4.3'
freertos/lw ip: Support silent assertions (v4.3)

See merge request espressif/esp-idf!13011
2021-04-13 04:30:09 +00:00
Angus Gratton
322cba0bf0 freertos: Add a small additional stack when optimization set to None
Fix for occasional crash on startup when DPORT task overwrites its stack during
context switch, otherwise.
2021-04-06 02:43:24 +00:00
Angus Gratton
f5c6595cb4 freertos: Increase minimum task stack size when stack smashing checker is enabled
Fixes issue with DPORT init task, this task uses minimum stack size and may not be
enough if stack smashing detection is set to Overall mode.

Also reworks the way we calculate minimum stack to allow for adding multiple
contributing factors.

Closes https://github.com/espressif/esp-idf/issues/6403
2021-04-06 02:43:24 +00:00
Angus Gratton
e9e2b68587 freertos: Use the standard assert() function for configASSERT
Unless the option for "assert and keep running" is enabled.

This means that silent asserts now work for FreeRTOS, and disabling asserts
now also disables them in FreeRTOS without needing a separate config change.

Related to https://github.com/espressif/esp-idf/issues/6306
2021-04-02 11:07:23 +11:00
Omar Chebib
774f010196 freertos: Fix delay between interrupt request and trigger on RISC-V
NOP instructions have been added in order to prevent the code
from executing code it shouldn't execute. This is due to a delay
between the moment an interrupt is requested and the moment it
is fired. It only happens on RISC-V SoC.
2021-03-10 12:14:21 +08:00
Angus Gratton
8e187e7157 Merge branch 'bugfix/c3_unit_test_cleanup_v4.3' into 'release/v4.3'
System: C3 shared stack watchpoint & unit test cleanups (v4.3)

See merge request espressif/esp-idf!12418
2021-02-24 22:51:11 +00:00
Marius Vikhammer
3d9523724d freertos: add API for getting tick rate on C3 2021-02-23 12:14:11 +08:00
Marius Vikhammer
360e7c4d51 system: enable shared stack watchpoint
Enable shared stack watchpoint for overflow detection

Enable unit tests:
 * "test printf using shared buffer stack" for C3
 * "Test vTaskDelayUntil" for S2
 * "UART can do poll()" for C3
2021-02-19 16:59:29 +08:00
Marius Vikhammer
04df1f3a42 CI: enable example builds for C3
Enables building C3 examples in CI.

Fixes related warnings/errors and disables examples that cannot run.
2021-02-09 12:04:02 +08:00
Angus Gratton
fe44643808 Merge branch 'bugfix/doc_freertos_smp_macros' into 'master'
docs: Update SMP descriptions for taskENTER_CRITICAL/taskEXIT_CRITICAL

Closes IDFGH-4428

See merge request espressif/esp-idf!12219
2021-02-05 08:14:50 +08:00
Angus Gratton
bc09dda0f4 docs: Update SMP descriptions for taskENTER_CRITICAL/taskEXIT_CRITICAL
Closes https://github.com/espressif/esp-idf/issues/6259
2021-02-05 10:18:23 +11:00
Ivan Grokhotkov
458308786b Merge branch 'doc/fix_pxTaskGetStackStart' into 'master'
[doc/freertos]: fixed doc of pxTaskGetStackStart()

Closes IDF-1668

See merge request espressif/esp-idf!12159
2021-02-02 07:09:00 +08:00
Ivan Grokhotkov
bb1f75179b Merge branch 'bugfix/freertos_systimer_stall_when_cpu_halted' into 'master'
freertos: stall systimer while CPU is in debug mode

See merge request espressif/esp-idf!12063
2021-01-29 07:02:30 +08:00
Angus Gratton
cc934ea0a1 Merge branch 'feature/esp32c3_tls' into 'master'
freertos: add thread local storage support in RISC-V port

Closes IDF-2125

See merge request espressif/esp-idf!12064
2021-01-27 15:19:06 +08:00
Marius Vikhammer
4374966d4e freerots: fix rtos_int_exit writing outside ISR stack
rtos_int_exit would store RA at an offset of 4 byte from the SP,
where the offset should be 0.

This caused rtos_int_exit to overwrite variables in bss.
2021-01-26 11:18:39 +00:00
Jakob Hasse
fd58ed2f74 [doc/freertos]: fixed doc of pxTaskGetStackStart()
Closes IDF-1668
2021-01-26 17:31:11 +08:00
Ivan Grokhotkov
1402941402 test/freertos: add RISC-V support in thread local storage test 2021-01-24 12:38:15 +00:00
Ivan Grokhotkov
b2aaebaf85 freertos: add thread local storage support in RISC-V port 2021-01-24 12:38:15 +00:00
Ivan Grokhotkov
d7bac619ec freertos: stall systimer while CPU is in debug mode 2021-01-24 11:32:17 +00:00
Angus Gratton
3532f52f60 Merge branch 'bugfix/ldgen_ignore_nonexistent_archives_and_obj' into 'master'
ldgen: check mappings

Closes IDF-1624

See merge request espressif/esp-idf!8557
2021-01-21 15:59:35 +08:00
Jiang Jiang Jian
26ae354dc5 Merge branch 'feature/support_esp32c3_lightsleep_master' into 'master'
support esp32c3 lightsleep for master

Closes IDF-2106

See merge request espressif/esp-idf!11975
2021-01-20 16:00:06 +08:00
Ivan Grokhotkov
b69f94fb3a Merge branch 'feature/move_ringbuf_funcs_into_flash' into 'master'
esp_ringbuf: add kconfig opt to move ringbuffer functions into flash

Closes IDF-2247

See merge request espressif/esp-idf!10731
2021-01-20 07:32:39 +08:00
Alex Lisitsyn
8bde6b8fca esp_ringbuf: add kconfig opt to move ringbuffer functions into flash 2021-01-20 07:32:31 +08:00
Li Shuai
63c4e5481f fix no RTOS SysTick interrupt for a period of time after the OS Scheduler is started 2021-01-19 14:51:22 +08:00
Li Shuai
355dd10257 light sleep: dfs support for esp32c3 2021-01-19 14:50:58 +08:00
Renz Bagaporo
d1c800fbbb components: fix ldgen check errors 2021-01-19 11:17:18 +08:00
Alexey Gerenkov
ae1cc5f49b freertos: Adds snapshot API to walk over tasks lists 2021-01-15 06:37:12 +00:00
Jakob Hasse
b51889dccb system: stack watchpoint support on C3
Closes IDF-2307
2021-01-14 17:46:44 +08:00
morris
753a929525 global: fix sign-compare warnings 2021-01-12 14:05:08 +08:00