Commit Graph

611 Commits

Author SHA1 Message Date
Zim Kalinowski
ff56848a0e revert dependency
integrating changes from upstream
2021-08-17 16:10:45 +08:00
Omar Chebib
32067f9b6b Merge branch 'feature/freertos_snapshot_extraction' into 'master'
freertos: take tasks snapshot out of tasks.c source code

Closes IDF-3334

See merge request espressif/esp-idf!14675
2021-08-16 11:04:51 +00:00
Omar Chebib
83c9e1b223 freertos: take tasks snapshot out of tasks.c source code 2021-08-16 10:29:36 +08:00
KonstantinKondrashov
263c10cee1 freertos: Fix settings of systimer for SysTicks in case Unicore
systimer was stopped because the option SYSTIMER_TIMER_UNIT1_CORE1_STALL_EN is set by default 1, it blocks counting.
For Unicore should be:
SYSTIMER_TIMER_UNIT1_CORE0_STALL_EN  1
SYSTIMER_TIMER_UNIT1_CORE1_STALL_EN  0
2021-08-12 12:30:52 +05:00
Zim Kalinowski
afc77dbc5a freertos: Sync safe changes from Amazon SMP branch 2021-08-10 05:13:43 +08:00
Jakob Hasse
c9984faaef [mocks]: freertos mock
[esp_event]: added preliminary host-based tests
2021-08-06 17:08:21 +08:00
Sachin Parekh
6582f7070e 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-08-05 11:09:22 +05:30
Zim Kalinowski
1fd56e0b87 Merge branch 'feature/systimer_generate_rtos_tick' into 'master'
freertos(esp32s3): SysTick uses systimer

Closes IDF-2613

See merge request espressif/esp-idf!12246
2021-08-04 12:33:52 +00:00
Konstantin Kondrashov
29f581fc70 freertos(esp32s3): SysTick uses systimer 2021-08-04 20:33:44 +08:00
Mahavir Jain
77900888f7 Merge branch 'bugfix/uninitialized_tasknumber' into 'master'
fix(FreeRTOS): Initialize uxTaskNumber at task initialization

Closes IDFGH-1815

See merge request espressif/esp-idf!14620
2021-08-04 12:12:08 +00:00
Konstantin Kondrashov
4972605b16 esp_common: Add API for IPC to run small pieces of code on the other CPU, in the context of the level 4 interrupt 2021-08-03 14:35:29 +08:00
Gautier Seidel
5a5e710225 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-08-03 10:42:09 +05:30
Craig Kewley
99e2f970c3 doc: freertos: fix function name typo
Closes https://github.com/espressif/esp-idf/pull/7265
Closes IDFGH-5539
2021-07-28 19:04:15 +08:00
Konstantin Kondrashov
9c870b74bb Merge branch 'bugfix/freertos_ut_suspend' into 'master'
freertos: Increases delta for UT - Test suspend-resume CPU. The number of...

Closes IDFCI-688

See merge request espressif/esp-idf!14403
2021-07-21 06:07:34 +00:00
Ivan Grokhotkov
c28612cd2b Merge branch 'bugfix/freertos_coproc_save_area_alignment' into 'master'
freertos: Apply upstream stack masking fix for xtensa/port.c (Github PR)

Closes IDFGH-5549

See merge request espressif/esp-idf!14379
2021-07-20 09:00:04 +00:00
KonstantinKondrashov
84e5f52a26 freertos: Increases delta for UT - Test suspend-resume CPU. The number of tick_hook should be the same for both CPUs 2021-07-16 18:26:02 +05:00
Renz Bagaporo
7c22cccb9c esp32: cleanup build script 2021-07-16 20:14:27 +08:00
Axel Lin
6c2aa59b51 freertos: Apply upstream stack masking fix for xtensa/port.c
Link: 6a5784598a (diff-cfa9a8b71a9665b5610f59bd2f56cb81b3ee73beaa6cac3fc965884069588d47)
Signed-off-by: Axel Lin <axel.lin@gmail.com>

Merges https://github.com/espressif/esp-idf/pull/7274
2021-07-15 11:55:41 +02:00
Jakob Hasse
f6031d469b [cxx]: No ##__VA_ARGS__ in public header files
* ##__VA_ARGS__ is replaced by __VA_OPT__(,)
  and __VA_ARGS if C++20 is used.
* Affected header files are: esp_log.h,
  portmacro.h and esp_check.h

* Closes https://github.com/espressif/esp-idf/pull/6692
2021-07-15 17:05:57 +08:00
Vladimir Chistyakov
1d74652b5e Fix portGET_ARGUMENT_COUNT macro
portGET_ARGUMENT_COUNT uses a GCC extension ##__VA_ARGS__. It forces
the user to compile the code with GNU extensions enabled instead of ISO
language standard. The suggested change is to replace ##__VA_ARGS__ with
__VA_OPT__(,) __VA_ARGS__ which is supported by the current version of
GCC used in ESP-IDF for both C and C++ ISO standards.

This fix would enable ESP-IDF users to compile their code with ISO C++20
standard in future releases.

Signed-off-by: Jakob Hasse <jakob.hasse@espressif.com>
2021-07-15 17:01:31 +08:00
Shu Chen
ee23a489b9 esp32h2: code clean up 2021-07-01 19:53:50 +08:00
Shu Chen
6fce2930d0 esp32h2: enable more components to support esp32h2
Involved components:
 * app_trace
 * esp-tls
 * esp_adc_cal
 * esp_pm
 * esp_serial_slave_link
 * esp_timer
 * freertos
 * idf_test
 * log
 * mbedtls
 * newlib
 * perfmon
 * spi_flash
 * spiffs
 * ulp
 * unity
 * vfs
2021-07-01 19:53:11 +08:00
Angus Gratton
a413cbd784 Merge branch 'feature/esp_timer_with_skip_unhandled_events_does_not_wake_up' into 'master'
esp_timer: A timer with skip_unhandled_events won't wake up in light sleep mode

See merge request espressif/esp-idf!13219
2021-06-29 08:10:51 +00:00
Ivan Grokhotkov
d7928bf1db Merge branch 'feature/esp32c3_apptrace' into 'master'
apptrace: refactoring & esp32c3 support

See merge request espressif/esp-idf!11702
2021-06-28 06:00:24 +00:00
Alexey Gerenkov
20fd09728f apptrace: Adds ESP32-C3 support 2021-06-24 13:16:14 +03:00
Alexey Gerenkov
821869d98d apptrace: Refactors apptrace for better support various tracing HW 2021-06-24 13:16:13 +03:00
Fu Hanxi
cb46558c30 ci: update performance test key to db compatible format 2021-06-21 14:17:45 +08:00
KonstantinKondrashov
f9ad16bb66 esp_timer: Timers with skip_unhandled_events option won't wake up system from light sleep 2021-06-19 12:45:17 +08:00
Angus Gratton
dc6b950257 doc: Add performance guides for execuion speed, binary size, RAM usage
Closes https://github.com/espressif/esp-idf/issues/7007
Closes https://github.com/espressif/esp-idf/issues/6715
Closes https://github.com/espressif/esp-idf/issues/3781
Closes https://github.com/espressif/esp-idf/issues/2566
2021-06-03 13:55:34 +10:00
Ivan Grokhotkov
38d902f544 Merge branch 'feature/gdbstubs_rt' into 'master'
Extension of GDBStub component for handling GDB by serial port at runtime.

See merge request espressif/esp-idf!10312
2021-05-18 17:14:51 +00:00
Omar Chebib
dda7001c25 freertos: revert minimum stack size from 2304 to 1536 2021-05-14 11:12:28 +08:00
Dmitry
00a7ecb5a3 Code cleanup. Bugfix after rebase with master. Formating. 2021-05-13 15:03:40 +03:00
Angus Gratton
e02439f2de freertos: Add addition overflow check for stream buffer
Patch from upstream commit d05b9c123f2bf9090bce386a244fc934ae44db5b
2021-05-04 16:55:40 +10:00
Angus Gratton
b41d4b0a9c freertos: Check for arithmetic overflows on queue creation
Addition overflow check is from FreeRTOS kernel commit 47338393f1f79558f6144213409f09f81d7c4837
2021-05-04 16:55:20 +10:00
Angus Gratton
96c2acd9a8 Merge branch 'refactor/strip_systimer_hal_layer' into 'master'
refactor HAL driver of systimer to a common systimer_hal

Closes IDF-2996

See merge request espressif/esp-idf!13027
2021-04-23 07:45:31 +00:00
Ivan Grokhotkov
cfdfeed973 freertos: linker.lf rules fixes
1. Add conditions based on Kconfig options for functions which are
   compiled based on those options.
2. Static allocation is always enabled, move corresponding functions
   into the common list.
2021-04-22 17:14:46 +02:00
morris
ec898b771e systimer: strip hal driver 2021-04-22 21:08:39 +08:00
Ivan Grokhotkov
0535195983 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-04-21 13:45:21 +02:00
Angus Gratton
c7328f1cc0 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 14:46:49 +10:00
Angus Gratton
191e649257 freertos: Add some comments about deleting tasks when using SMP
Some cases are not immediately obvious, so document them in comments.
2021-04-13 03:40:10 +00:00
Angus Gratton
f7b859ac84 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-13 03:40:10 +00:00
Angus Gratton
db7d272873 freertos: Add unit test for deleting task which may be blocking 2021-04-13 03:40:10 +00:00
Angus Gratton
94ac251091 Merge branch 'doc/general_notes' into 'master'
doc: Update docs about startup sequence and memory types

Closes IDF-2321, IDF-2409, and IDFGH-1540

See merge request espressif/esp-idf!12636
2021-04-05 23:51:25 +00:00
Angus Gratton
37acd13cdd doc: Add notes that vTaskStartScheduler() is called during startup
Closes https://github.com/espressif/esp-idf/issues/1457
2021-03-31 09:37:28 +11:00
Renz Bagaporo
8d32232899 esp_system: check early for single core variant 2021-03-29 06:50:47 +00:00
Angus Gratton
11e2620acc freertos docs: Specify that uxTaskGetStackHighWaterMark() returns bytes not words
As reported https://esp32.com/viewtopic.php?f=13&t=20043&p=73732
2021-03-25 00:08:24 +00:00
Angus Gratton
9122e530be Merge branch 'refactor/freertosconfig_h' into 'master'
freertos: common config header

Closes IDF-2389

See merge request espressif/esp-idf!12485
2021-03-22 09:04:41 +00:00
Angus Gratton
1581744c10 Merge branch 'feature/main_task_affinity_pr6627' into 'master'
Allow selection of different core for main task

Closes IDFGH-4828

See merge request espressif/esp-idf!12654
2021-03-22 06:46:24 +00:00
Renz Bagaporo
021cce3f56 freertos: formatting fixes for config file 2021-03-22 13:35:49 +08:00
Renz Bagaporo
39cf818838 freertos: common config header 2021-03-22 12:19:03 +08:00