Commit Graph

1179 Commits

Author SHA1 Message Date
Jakob Hasse
32ecb0411c Merge branch 'fix/console_linux_target_mac' into 'master'
fix(linux): prevent build error on MacOS and optimize buffer usage on Linux

See merge request espressif/esp-idf!29176
2024-03-05 09:59:55 +08:00
Sudeep Mohanty
e4f167df25 Merge branch 'fix/freertos_optimize_critical_sections' into 'master'
fix(riscv): Updated RISC-V functions to set interrupt threshold for CLIC targets

Closes IDFCI-2033, IDFCI-2034, IDF-8090, and IDF-8117

See merge request espressif/esp-idf!29055
2024-03-01 17:51:14 +08:00
Jakob Hasse
f9c9e18bca fix(linux): prevent build error on MacOS and optimize buffer usage on Linux 2024-03-01 11:01:15 +08:00
Alexey Lapshin
fdb7a43752 Merge branch 'feature/esp32p4_concontiguous_mem_mvp' into 'master'
feat(esp_system): allow .bss to spill over into L2MEM above 0x4ff40000 on P4

See merge request espressif/esp-idf!28783
2024-02-29 16:28:13 +08:00
Alexey Lapshin
824c8e0593 feat(esp_system): allow .bss to spill over into L2MEM above 0x4ff40000
This commit introduce SOC_MEM_NON_CONTIGUOUS_SRAM flag (that enebled for
esp32p4). If SOC_MEM_NON_CONTIGUOUS_SRAM is enabled:

- LDFLAGS+=--enable-non-contiguous-regions
- ldgen.py replaces "arrays[*]" from sections.ld.in with objects under
  SURROUND keyword. (e.g. from linker.lf: data -> dram0_data SURROUND(foo))
- "mapping[*]" - refers to all other data

If SOC_MEM_NON_CONTIGUOUS_SRAM, sections.ld.in file should contain at
least one block of code like this (otherwise it does not make sense):

  .dram0.bss (NOLOAD) :
  {
    arrays[dram0_bss]
    mapping[dram0_bss]
  } > sram_low

  .dram1.bss (NOLOAD) :
  {
    /* do not place here arrays[dram0_bss] because it may be splited
     * between segments */
    mapping[dram0_bss]
  } > sram_high
2024-02-28 19:41:25 +04:00
Sudeep Mohanty
459ff8348f fix(riscv): Added RISC-V functions to set interrupt threshold for CLIC targets
This commit added the RISC-V utility functions to set the interrupt
threshold for CLIC targets by using direct register value writes.
This makes the functions more efficient during run-time.
This is done to improve the critical section enter and exit performance on esp32p4.
2024-02-28 08:51:37 +01:00
fl0wl0w
90d1dcfd76 feat(freertos): Introduced new Kconfig option CONFIG_FREERTOS_NUMBER_OF_CORES
This commit replaces the use of portNUM_PROCESSORS and configNUM_CORES
macros in all of ESP-IDF. These macros are needed to realize an SMP
scenario by fetching the number of active cores FreeRTOS is running on.
Instead, a new Kconfig option, CONFIG_FREERTOS_NUMBER_OF_CORES, has been
added as a proxy for the FreeRTOS config option, configNUMBER_OF_CORES.
This new commit is now used to realize an SMP scenario in various places
in ESP-IDF.

[Sudeep Mohanty: Added new Kconfig option CONFIG_FREERTOS_NUMBER_OF_CORES]

Signed-off-by: Sudeep Mohanty <sudeep.mohanty@espressif.com>
2024-02-09 09:11:28 +01:00
Jakub Kocka
0b00e49ac5 fix: Fixed KConfig files that were not succesfully checked 2024-02-02 14:13:45 +01:00
Sudeep Mohanty
061da98124 refactor(freertos): Updated FreeRTOS component files to astyle format
This commit updates the FreeRTOS component source files (excluding
upstream source files) to the astyle coding format.
2024-01-31 16:41:58 +08:00
Ivan Grokhotkov
ecccad727f Merge branch 'bugfix/macos_build_linux_target_freertos' into 'master'
fix(freertos): override select function without relying on -Wl,--wrap

See merge request espressif/esp-idf!28065
2024-01-24 04:14:00 +08:00
Ivan Grokhotkov
f5cd3b7ff4
fix(freertos): override select function without relying on -Wl,--wrap
This commit changes the approach used to override select function
in FreeRTOS simulator.

The previous approach relied on '--wrap', which is a feature of GNU
linker that performs symbol substitution at link time. Sadly this
feature is not present in macOS linker.

The alternative solution is to define 'select' wrapper as a regular
(exported) symbol, preventing it from being loaded from system
libraries. To call the "real" select implementation we use dlsym
function and find the function pointer at run time. This solution
works on both Linux and macOS.
2024-01-23 16:57:38 +01:00
Ivan Grokhotkov
66431a62d1
fix(freertos): warning fix for building with IDF_TARGET=linux on macOS 2024-01-23 16:57:37 +01:00
Erhan Kurubas
029a0582e1 feat(coredump): improve the probability of accessing healthy TCBs 2024-01-22 00:18:28 +08:00
Omar Chebib
cdde05335e Merge branch 'refactor/riscv_interrupt' into 'master'
refactor(riscv): Refactor crosscore interrupts and core interrupt code

Closes IDF-5720, DOC-5177, and IDF-7899

See merge request espressif/esp-idf!27845
2024-01-19 10:51:04 +08:00
Omar Chebib
102d5bbf72 refactor(riscv): added a new API for the interrupts 2024-01-18 16:36:53 +08:00
Omar Chebib
5cdf145f55 refactor(riscv): refactor crosscore interrupt 2024-01-18 16:27:36 +08:00
Omar Chebib
c7e63078b7 fix(riscv): adjust TCBs lowest stack address when the FPU is used 2024-01-18 13:06:29 +08:00
Sudeep Mohanty
5a5869a4a6 Merge branch 'feature/freertos_optimize_xtaskincrementtickothercores' into 'master'
feat(freertos): Optimized xTaskIncrementTickOtherCores()

Closes IDF-7905

See merge request espressif/esp-idf!28232
2024-01-08 16:07:49 +08:00
Sudeep Mohanty
d4ca7c246e fix(freertos): Fixed incorrect int level restoration on esp32p4
This commit fixes a bug where in the portENABLE_INTERRUPTS() macro
incorrectly restored the interrupt level to 1 (non-CLIC controller).
2024-01-05 11:00:56 +01:00
Sudeep Mohanty
6e074c02e0 feat(freertos): Optimized xTaskIncrementTickOtherCores()
This commit optimizes the xTaskIncrementTickOtherCores() function by
avoiding unnecessary context switches.
2024-01-05 08:43:03 +01:00
Armando
3c5a4f9e8a ci(p4): added todo jira for disabled tests on p4 2024-01-04 09:36:38 +08:00
Armando
907b876354 ci(p4): temporarily disable failed ci tests on p4 2024-01-04 09:36:06 +08:00
Omar Chebib
1472343439 fix(freertos): display tasks with no affinity as -1 during tracing
Closes https://github.com/espressif/esp-idf/issues/12858
2023-12-22 12:11:30 +08:00
Chip Weinberger
3686689a2a feat(esp_system): Add esp_backtrace_print_all_tasks()
This commit adds esp_backtrace_print_all_tasks() which prints the backtraces
of all tasks at runtime.

Closes https://github.com/espressif/esp-idf/issues/9708
CLoses https://github.com/espressif/esp-idf/pull/11575

[Omar Chebib: Prevent task switching while printing backtraces of tasks.]
[Omar Chebib: Ensure all task stacks are flushed from register to RAM.]
[Omar Chebib: Removed esp_task_snapshot_to_backtrace_frame() as task snapshot is private API.]
[Omar Chebib: Added test case for esp_backtrace_print_all_tasks().]

Signed-off-by: Omar Chebib <omar.chebib@espressif.com>
2023-12-12 19:54:17 +08:00
morris
e96491fb1f feat(systimer): support ETM on esp32p4 2023-12-07 18:46:24 +08:00
Darian
e3191df37a Merge branch 'change/deprecate_legacy_xtensa_include_path' into 'master'
change(xtensa): Deprecate legacy include paths

Closes IDF-7230

See merge request espressif/esp-idf!26725
2023-12-05 15:05:29 +08:00
Darian Leung
33b7e40223 fix(freertos/idf): Fix invalid xCoreID arguments in single-core
IDF FreeRTOS v10.5.1 no longer accepts out of range xCoreID arguments in
"PinnedToCore" task creation functions when building for single-core. This
commit fixes those violations through ESP-IDF.
2023-12-02 15:46:07 +08:00
Darian Leung
439c7c4261 change(freertos/idf): Remove xCoreID TCB member for single-core
This commit does the following:

- removes the xCoreID member from the TCB when building for single-core
- xCoreID is no longer hard set to 0 when calling "PinnedToCore" task creation
functions in single-core
- Tidy up or add missing xCoreID asserts for functions that take xCoreID as an
argument:
    - Functions that set/query a variable of a particular core will call
      taskVALID_CORE_ID() to ensure ) 0 <= xCoreID < configNUMBER_OF_CORES
    - Task creation functions that accept xCoreID also call taskVALID_CORE_ID()
      but also allow tskNO_AFFINITY.
- Fix TaskStatus_t
    - Remove xCoreID from TaskStatus_t if configTASKLIST_INCLUDE_COREID is not
      defined.
    - Set xCoreID to 0 when calling vTaskGetInfo() in single-core builds
2023-12-02 15:46:07 +08:00
Darian Leung
ae2bd61054 refactor(freertos/idf): Refactor yield and affinity macros
This commit refactors the following macros so that calling them no longer
requires referencing pxTCB->xCoreID.

- taskIS_YIELD_REQUIRED()
- taskIS_YIELD_REQUIRED_USING_PRIORITY()
- taskIS_AFFINITY_COMPATIBLE()
2023-12-02 15:46:07 +08:00
Darian Leung
a5d5ee7445 change(xtensa): Deprecate ".../xtensa_context.h" include path
This commit deprecates the "freertos/xtensa_context.h" and "xtensa/xtensa_context.h"
include paths. Users should use "xtensa_context.h" instead.

- Replace legacy include paths
- Removed some unnecessary includes of "xtensa_api.h"
- Add warning to compatibility header
2023-11-30 21:58:52 +08:00
Darian Leung
2204c8e137 change(xtensa): Deprecate ".../xtensa_api.h" include path
This commit deprecates the "freertos/xtensa_api.h" and "xtensa/xtensa_api.h"
include paths. Users should use "xtensa_api.h" instead.

- Replace legacy include paths
- Removed some unnecessary includes of "xtensa_api.h"
- Replaced some calls with "esp_cpu_..." equivalents
- Add warning to compatibility header
2023-11-30 21:58:52 +08:00
Ivan Grokhotkov
e39d1ae9ce Merge branch 'feature/update_unity' into 'master'
feat(unity): upgrade to 2.6.0-RC1

See merge request espressif/esp-idf!27456
2023-11-30 17:12:12 +08:00
Ivan Grokhotkov
88fa79fcc7
feat(unity): upgrade to 2.6.0-RC1 2023-11-28 20:22:02 +01:00
Sudeep Mohanty
0b1649d22b refactor(freertos/idf): Refactor FreeRTOS suspend-resume tests
This commit refactors suspend-resume tests by moving them to appropraite
test files. This commit also removes tests which are not necessary or
have been subsumed by refactored tests.
2023-11-28 10:50:24 +01:00
Sudeep Mohanty
f01dbe0314 feat(freertos/idf): Add config option for FreeRTOS Timer Task core affinity
This commit adds the ability to set the core affinity for the FreeRTOS
Timer Service task when multi-core configuration is enabled. This commit
also adds a Kconfig option to set the core affinity of the timer task
via the menuconfig.

Closes https://github.com/espressif/esp-idf/issues/10315
2023-11-16 11:42:40 +01:00
Darian
fb8ff0e9fe Merge branch 'feature/freertos_add_valid_core_id_macro' into 'master'
feat(freertos/idf): Add taskVALID_CORE_ID() macro

See merge request espressif/esp-idf!27014
2023-11-15 20:51:55 +08:00
Darian Leung
c12da6b77d feat(freertos/idf): Add taskVALID_CORE_ID() macro
This commit adds a taskVALID_CORE_ID() macro, similar to the one offered in
Amazon SMP FreeRTOS.

- Various functions have been updated to use that macro
- Removed some unecessary static asserts of CONFIG_FREERTOS_NO_AFFINITY and
added casting.
- Uncrustify changes
2023-11-15 11:53:26 +08:00
Sudeep Mohanty
bf237a2bd4 Merge branch 'feature/freertos_expose_list_integrity_check_option' into 'master'
feat(freertos): Exposed Kconfig option for configUSE_LIST_DATA_INTEGRITY_CHECK_BYTES

Closes IDF-8366

See merge request espressif/esp-idf!26960
2023-11-14 21:27:19 +08:00
Sudeep Mohanty
ff6b0ed148 Merge branch 'task/freertos_deprecate_xtaskgetaffinity' into 'master'
change(freertos/idf): Deprecate some FreeRTOS IDF addition functions

Closes IDF-8164 and IDF-8163

See merge request espressif/esp-idf!26875
2023-11-13 20:23:49 +08:00
Sudeep Mohanty
289913daaf fix(freertos/idf): Define configLIST_VOLATILE for list elements
It was noticed that when high level compiler optimizations are enabled,
the compiler optimizes some list manupulation code. This commit enables
the configLIST_VOLATILE for list elements to prevent the compiler from
optimizing out essential kernel code.
2023-11-10 09:23:51 +01:00
Sudeep Mohanty
d507a86285 feat(freertos): Exposed Kconfig option for configUSE_LIST_DATA_INTEGRITY_CHECK_BYTES
This commit exposes the FreeRTOS List integrity check option
configUSE_LIST_DATA_INTEGRITY_CHECK_BYTES via menuconfig.
2023-11-09 14:54:13 +01:00
Darian
c4eea80c07 Merge branch 'change/freertos_local_crit_section_macro' into 'master'
change(freertos/idf): Refactor thread safety convenience macros

Closes IDF-8161

See merge request espressif/esp-idf!26805
2023-11-08 10:29:22 +08:00
Sudeep Mohanty
ebeea3df60 Merge branch 'revert/freertos_same_priority_preemption_disabled' into 'master'
Revert "fix(freertos/idf): Add workaround for same priority preemption in xTaskIncrementTick()"

Closes IDF-8428

See merge request espressif/esp-idf!26732
2023-11-03 21:59:17 +08:00
Sudeep Mohanty
d38f100223 change(freertos/idf): Deprecate some FreeRTOS IDF addition functions
This commit deprecates xTaskGetAffinity(), xTaskGetCurrentTaskHandleForCPU()
and xTaskGetIdleTaskHandleForCPU() APIs for IDF-FreeRTOS kernel.
Instead, users are directed to use alternatives. All other
components in IDF using these functions have been updated accordingly.
2023-11-03 14:54:06 +01:00
Darian Leung
52a929521d refactor(freertos/idf): Update thread safety convenience macros
This commit refactors some of the thread safety convenience macros by removing
some repeated definitions and keeping them all in "freertos_idf_additions_priv.h"
2023-11-03 15:41:46 +08:00
Darian Leung
e2c8185f72 fix(freertos/idf): Fix xEventGroupGetBitsFromISR() critical section
Adds missing critical section to xEventGroupGetBitsFromISR() that is required
in dual-core SMP.
2023-11-03 15:41:39 +08:00
Sudeep Mohanty
0a0c7ef40f fix(freertos/idf): Updated IDLE task names for each core to have the coreID as a suffix
This commit updates the IDLE task names for each core by concatenating
the respective coreIDs to the task names.

Closes https://github.com/espressif/esp-idf/issues/12204
2023-11-01 12:32:06 +00:00
Sudeep Mohanty
3fb23c85b6 Revert "fix(freertos/idf): Add workaround for same priority preemption in xTaskIncrementTick()"
This reverts commit 6c6a6ad44a.
2023-11-01 12:31:37 +00:00
Darian
7baebd4ae3 Merge branch 'feature/add_run_time_counter_type_option' into 'master'
feat(freertos/idf): Add configRUN_TIME_COUNTER_TYPE option

Closes IDFGH-10757

See merge request espressif/esp-idf!26704
2023-11-01 17:07:11 +08:00
Darian Leung
b301f175c9 feat(freertos/idf): Add configRUN_TIME_COUNTER_TYPE option
This commit adds a Kconfig option for configRUN_TIME_COUNTER_TYPE

Closes https://github.com/espressif/esp-idf/issues/11973
2023-10-31 14:55:12 +08:00