Commit Graph
100 Commits
Author SHA1 Message Date
Guillaume Souchere 150a067da5 fix(console): Clamp linenoise cols field to 80 if getColums returns less than that 2026-07-13 12:15:56 +02:00
Guillaume Souchere cad3ef220e fix(console): Fix security code review findings 2026-07-13 12:15:56 +02:00
Guillaume Souchere aaae14008a fix(heap): Do not consider newly registered heap in minimum free size calcualtion
After startup is done and app_main is reached, all calls to
heap_caps_add_region_with_caps (adding a new heap to the list of registered
heaps) will not affect the minimum free heap size value.

For heaps created before startup, this won't apply and their size will
end up being taken into account in the calculation of the minimum.
2026-05-29 07:56:48 +02:00
Guillaume Souchere fb4cf0f0dc Merge branch 'fix/esp-coex-deps' into 'master'
fix(esp_coex): add missing esp_phy dependency for libcoexist.a symbols

See merge request espressif/esp-idf!48790
2026-05-22 08:20:46 +02:00
Guillaume Souchere a9bffc5581 fix(esp_coex): add missing esp_phy dependency for libcoexist.a symbols
libcoexist.a directly references phy_coex_force_rx_ant and
phy_coex_dismiss_rx_ant from libphy.a (esp_phy component) but never
declared this dependency. It only worked because esp_common privately
linked esp_wifi (which transitively brings esp_phy) with
LINK_INTERFACE_MULTIPLICITY 4, causing libphy.a to repeat in the link
line. An upcoming esp_common change removes that mechanism, exposing
this missing dependency.
2026-05-21 11:02:47 +02:00
Guillaume Souchere 3d0666ece8 Merge branch 'feat/add-max-arg-param-to-repl-config' into 'master'
feat(console): Add max_cmdline_args to esp_console_repl_config_t

Closes IDF-15624

See merge request espressif/esp-idf!47975
2026-05-05 11:12:27 +02:00
Guillaume Souchere ec576cfde3 feat(console): Add max_cmdline_args to esp_console_repl_config_t 2026-05-04 07:59:15 +02:00
Guillaume Souchere 89fbcebcd2 Merge branch 'feat/riscv-spiram-stack-pointer-update-before-restart' into 'master'
fix(esp_system): fix PSRAM stack crash in esp_restart_noos on RISC-V SPIRAM chips

Closes IDF-15595

See merge request espressif/esp-idf!47849
2026-04-29 08:42:53 +02:00
Guillaume Souchere b95e7df2fa Merge branch 'fix/mbedtls-esp-mem-move-to-idf-mbedtls' into 'master'
fix(mbedtls): Fix `test_rebuild_source_files` failure on Windows caused by unstable CMake Ninja paths

Closes IDFCI-10453

See merge request espressif/esp-idf!47984
2026-04-28 12:16:47 +02:00
Guillaume Souchere 0ce211539a fix(esp_system): PSRAM stack crash in esp_restart_noos on RISC-V chips
On RISC-V chips with SPIRAM support (esp32c5, esp32c61, esp32h4, esp32p4,
esp32s31), esp_restart_noos() was disabling the cache while the current
stack pointer could still be in external RAM. Any stack access after cache
disable (function call, local variable spill) would then fault with
"Cache disabled but cached memory region accessed".

Xtensa chips (esp32, esp32s2, esp32s3) already had this guard via the
SET_STACK macro. Add the equivalent for RISC-V:

- Add rv_utils_set_sp() to riscv/rv_utils.h (plain "mv sp, %0" with a
  memory clobber; no window register management needed on RISC-V)
- In each affected system_internal.c, under
  CONFIG_FREERTOS_TASK_CREATE_ALLOW_EXT_MEM, check whether the current
  SP is in PSRAM and if so switch it to the top of internal BSS before
  any cache disable or writeback operation
- Fix xTaskCreateStaticPinnedToCore() stack size argument in the
  spiram_stack test (was passing bytes instead of word count)
- Mark the null-pointer write in func_do_exception() as volatile to
  prevent the compiler from optimizing it away
- Extend the [spiram_stack] tests to RISC-V by sharing fibonacci() and
  the task/finish helpers across architectures, guarding only the
  Xtensa-specific WINDOWBASE/WINDOWSTART prints
2026-04-28 11:08:55 +02:00
Guillaume Souchere 44fafd42df fix(mbedtls): compile esp_mem.c in IDF component lib instead of builtin target
esp_mem.c in the builtin target via
target_sources(builtin PRIVATE ...) called from the parent CMakeLists.
This cross-directory source injection causes CMake's Ninja generator on
Windows to produce unstable TARGET_PDB/RSP_FILE paths across
reconfigures, changing the ninja command hash and forcing a re-archive
of libmbed-builtin.a on every cmake run — even when no source changed.
This broke test_rebuild_source_files.

Fix by adding esp_mem.c to the IDF mbedtls component library
(mbedtls_srcs) instead. The final ELF link uses --start-group, so
builtin's platform.o resolves esp_mbedtls_mem_calloc/free from the
component library regardless of archive order. esp_mem.c is IDF-specific
code (heap_caps_calloc, sdkconfig.h) and belongs in the port layer, not
in any submodule target.
2026-04-28 08:51:44 +02:00
Guillaume Souchere fd79fa136c Merge branch 'fix/missing-include-libc' into 'master'
fix(esp_libc): add missing <stdint.h> include in esp_time_impl.h

Closes IDFGH-17572

See merge request espressif/esp-idf!47890
2026-04-28 08:21:27 +02:00
Guillaume Souchere a8c57927e0 Merge branch 'feat/move-tlsf-patch-to-heap-component' into 'master'
feat(heap): move TLSF ROM patches and related files from esp_rom to heap

See merge request espressif/esp-idf!47820
2026-04-24 08:52:37 +02:00
Guillaume Souchere a56354e9ab feat(heap): move TLSF ROM patches and related files from esp_rom to heap
The TLSF ROM patch code (rom_patch_tlsf.c, rom_patch_multi_heap.c),
their headers, and the per-target *.rom.heap.ld linker scripts are
semantically owned by the heap component, not esp_rom. Move them
accordingly:

- components/esp_rom/patches/esp_rom_tlsf.c
  → components/heap/rom_patches/rom_patch_tlsf.c
- components/esp_rom/patches/esp_rom_multi_heap.c
  → components/heap/rom_patches/rom_patch_multi_heap.c
- components/esp_rom/include/esp_rom_tlsf.h
  → components/heap/rom_patches/include/rom_patch_tlsf.h
- components/esp_rom/include/esp_rom_multi_heap.h
  → components/heap/rom_patches/include/rom_patch_multi_heap.h
- components/esp_rom/<target>/ld/<target>.rom.heap.ld (×8)
  → components/heap/port/<target>/ld/<target>.rom.heap.ld

Update heap/CMakeLists.txt to:
- use target_linker_script() directly for *.rom.heap.ld
- guard post-registration ROM patch setup with NOT BOOTLOADER_BUILD
- drop stale CONFIG_HEAP_TLSF_CHECK_PATCH symbol reference
- drop esp_rom_include_multi_heap_patch from TLSF_CHECK_PATCH guard

Remove the corresponding entries from esp_rom/CMakeLists.txt.
2026-04-23 12:21:31 +02:00
Guillaume Souchere b65788a934 Merge branch 'fix/heap-integrity-check-rom-tlsf' into 'master'
fix(esp_rom): Set poison check hook for tlsf_walk_pool patch

Closes IDF-13793

See merge request espressif/esp-idf!42713
2026-04-23 10:40:20 +02:00
Guillaume Souchere da81ec6f47 fix(esp_rom): Set poison check hook for tlsf_walk_pool patch 2026-04-23 07:51:04 +02:00
Guillaume Souchere 6a5817cfde Merge branch 'fix/log-dram-early-direct-rom-printf' into 'master'
fix(esp_log): Add Kconfig option to disable usage of esp_rom_vprintf when this function is in IRAM and not ROM

Closes IDFGH-17376

See merge request espressif/esp-idf!46640
2026-04-20 08:21:58 +02:00
Guillaume Souchere ea1af7c141 feat(log): Add test for constrained environment usage config 2026-04-17 12:46:23 +02:00
Guillaume Souchere 668dfb7e33 Merge branch 'fix/mbedtls-esp-mem-link-order' into 'master'
fix(mbedtls): undefined esp_mbedtls_mem_calloc/free when mbedtls has a single depender

See merge request espressif/esp-idf!47236
2026-04-10 10:01:48 +02:00
Guillaume Souchere e7cf8cd3cb fix(mbedtls): fix undefined esp_mbedtls_mem_calloc/free at link time
platform.c (compiled into the 'builtin' archive) calls
esp_mbedtls_mem_calloc and esp_mbedtls_mem_free directly by name via
the MBEDTLS_PLATFORM_STD_CALLOC/FREE macros in esp_config.h.
Previously, esp_mem.c was compiled into the 'tfpsacrypto' archive, which
appears after 'builtin' in the link command, causing the linker to fail
with undefined reference errors when 'builtin' was processed first.

Moving esp_mem.c into 'builtin' to assure that the function used by
esp_mbedtls_mem_calloc and esp_mbedtls_mem_free are available when
pltform.c is linked.
2026-04-09 10:51:21 +02:00
Guillaume Souchere 0cba1db0ed fix(esp_log): add Kconfig to optionally bypass esp_rom_vprintf
In Log V2, ESP_LOG macros are using the runtime
constrained-environment path in esp_log_vprintf() reference
esp_rom_vprintf as the fallback formatter. On chips where ets_vprintf
is not in ROM (all targets except ESP32-S2 and ESP32-C2), this pulls
~1.2 KB of printf implementation into IRAM.

Add a new Kconfig option LOG_API_CONSTRAINED_ENV_SAFE (default y) that
controls whether this IRAM-resident fallback is used:

Also update the logging and RAM-usage documentation accordingly.

Closes https://github.com/espressif/esp-idf/issues/18346
2026-04-07 12:00:51 +02:00
Guillaume Souchere 25cb4d0196 Merge branch 'feat/esp-system-linux-support-update' into 'master'
feat(esp_system): Add linux support for freertos hooks and system init function

See merge request espressif/esp-idf!46570
2026-04-02 11:31:42 +02:00
Guillaume Souchere 8706cd6135 feat(esp_system): add linux test for system init function regisration 2026-04-01 11:46:06 +02:00
Guillaume Souchere 1c2f7b435a feat(esp_system): Add linux support for freertos hooks and system init function 2026-04-01 11:46:06 +02:00
Guillaume Souchere 2a6e335189 Merge branch 'feat/esp-stdio-add-init-funcs' into 'master'
feat(console): Move IO initialization outside of the console component

See merge request espressif/esp-idf!43013
2026-03-24 09:50:58 +01:00
Guillaume Souchere 8232fe077a Merge branch 'feat/add-esp-cpu-linux-support' into 'master'
feat(esp_hw_support): Provide esp_cpu.h support for linux target

See merge request espressif/esp-idf!46647
2026-03-19 12:00:56 +01:00
Guillaume Souchere 5fac0b7386 feat(console): Move IO initialization outside of the console component
- Move the linux repl chip and deprecate chip related functions
- Update location of driver specific default config
- Add missing comments on the newly added functions in the affected components.
2026-03-17 08:30:23 +01:00
Guillaume Souchere 5415465164 feat(esp_hw_support): Add esp_cpu.h support for linux builds 2026-03-17 07:49:36 +01:00
Guillaume Souchere ca8eb6b6f2 Merge branch 'fix/esp-attr-section-impl' into 'master'
fix(esp_common): remove alignment value for section definition

See merge request espressif/esp-idf!46582
2026-03-13 12:24:19 +01:00
Guillaume Souchere 51d2cc2245 fix(esp_common): Remove alignement in ojects placced in specific sections
Let the compiler use variabel natural alignment
2026-03-12 13:53:43 +01:00
Guillaume Souchere 597beaa228 Merge branch 'feat/portable-section-macros' into 'master'
feat(esp_common): Add portable link-time section macros to esp_attr.h

See merge request espressif/esp-idf!46186
2026-03-10 12:02:35 +01:00
Guillaume Souchere bf2d8faebb test(esp_common): Add Linux host test for portable section macros
Add a test app that verifies PLACE_IN_SECTION, _SECTION_ATTR_SYMBOL_DECL_GENERIC,
_SECTION_START and _SECTION_END macros work correctly on Linux.

The test places 5 uint32_t values into a custom .test_data_table section from
two separate translation units, then iterates the section at runtime to verify
the correct count and content of all entries.

Includes:
- Custom linker script (ld/test_section.ld)
- Build-test-rules entry (linux only)
- pytest host_test marker
2026-03-09 07:18:27 +01:00
Guillaume Souchere 0549755e37 feat(esp_common): Add portable link-time section macros to esp_attr.h
Add PLACE_IN_SECTION, _SECTION_ATTR_IMPL_GENERIC, _SECTION_ATTR_SYMBOL_DECL_GENERIC,
_SECTION_START and _SECTION_END macros that emit real section attributes on every
platform (embedded ELF, Linux ELF, macOS Mach-O).

Unlike _SECTION_ATTR_IMPL which is a no-op on Linux, these macros work uniformly
across all targets, enabling link-time arrays for error-code tables, init-function
arrays, and similar patterns.

Also moves _COUNTER_STRINGIFY definition before its first use.
2026-03-02 08:17:50 +01:00
Guillaume Souchere 974f610d11 Merge branch 'feat/esp-event-default-loop-in-ext-ram' into 'master'
feat(esp_event): Add option to allocate event loop in external RAM

Closes IDF-14468

See merge request espressif/esp-idf!43510
2026-01-09 09:43:11 +01:00
Guillaume Souchere 0c570d860d feat(esp_event): Add option to allocate event loop in external RAM 2026-01-08 10:38:43 +01:00
Guillaume Souchere 023df327d0 Merge branch 'feat/cxx-depends-components' into 'master'
ci(cxx): Add depends_components attribute to build-test-rules.yml

Closes IDF-14164

See merge request espressif/esp-idf!44724
2026-01-06 03:46:41 +01:00
Guillaume Souchere 622d2da492 Merge branch 'feat/freertos-depends_components' into 'master'
ci(freertos): Add depends_components attribute to build-test-rules.yml

Closes IDF-14171

See merge request espressif/esp-idf!44736
2026-01-05 10:13:27 +01:00
Guillaume Souchere 2c8dfc0afb ci(freertos): Add depends_components attribute to build-test-rules.yml 2026-01-05 09:07:27 +01:00
Guillaume Souchere 6ab76c30f8 Merge branch 'feat/console-depends-components' into 'master'
ci(console): Add depends_components attribute to .build-test-rules.yml

Closes IDF-14163

See merge request espressif/esp-idf!44733
2026-01-05 09:03:14 +01:00
Guillaume Souchere 40258eb3e1 Merge branch 'feat/heap-depends-components' into 'master'
ci(heap): Add depends_components attribute to build-test-rules.yml

Closes IDF-14172

See merge request espressif/esp-idf!44725
2026-01-05 08:22:48 +01:00
Guillaume Souchere 55e9868979 ci(heap): Add depends_components attribute to build-test-rules 2026-01-05 07:44:50 +01:00
Guillaume Souchere 66115a0e0b ci(console): Add depends_components attribute to .build-test-rules.yml 2025-12-31 10:53:34 +01:00
Guillaume Souchere 97cb925d47 fix(esp_event): Leak in setup / teardown and wonrg evaluation of variable 2025-12-31 14:07:34 +08:00
Guillaume Souchere 518dc8d45b Merge branch 'feat/heap-support-esp32h21' into 'master'
feat(heap): Support heap for esp32h21

Closes IDF-13085

See merge request espressif/esp-idf!42961
2025-11-11 02:55:14 +01:00
Guillaume Souchere 7a58d6d8fb fix(heap): Update RTC test to account for esp32h21 characteristics
"RTC memory should be lowest priority and its free size should be big enough"
was failing because the expected size of RTC heap left after init was bigger
than the total RTC size itself.

The test was updated to:
- check that the minimum free RTC heap size matches the current size
- the current RTC heap size is bigger than 80% of the total RTC memory region
2025-11-10 14:43:16 +01:00
Guillaume Souchere 67b258d55a Merge branch 'fix/console-deinit-test-threshold' into 'master'
fix(console): Update the leak threashold after struct update in intr_alloc.c

See merge request espressif/esp-idf!42809
2025-10-24 04:28:12 +02:00
Guillaume Souchere 018cd86846 fix(console): Update the leak threashold after struct update in intr_alloc.c 2025-10-22 09:24:40 +02:00
Guillaume Souchere 75305c2719 Merge branch 'feat/make-use-of-exec-cap-compile-time-error' into 'master'
feat(heap): Make MALLOC_CAP_EXEC illegal use a compile time error

Closes IDFGH-14014 and IDF-11690

See merge request espressif/esp-idf!34903
2025-10-06 13:34:16 +02:00
Guillaume Souchere 7a24a8aef6 Merge branch 'fix/console-coverity-findings' into 'master'
fix(console): Remove dead code findings from coverity

Closes IDF-13098 and IDF-13134

See merge request espressif/esp-idf!42324
2025-10-01 08:39:12 +02:00
Guillaume Souchere b6b7337f5b fix(console): Remove dead code findings from coverity 2025-09-30 09:31:34 +02:00
Guillaume Souchere 0f3f44be62 feat(heap): Add hidden Kconfig option to allow exec cap 2025-09-29 10:45:33 +08:00
Guillaume Souchere da9d8a143a feat(heap): Report prohibited usage of MALLOC_CAPS_EXEC at compile time
Add a condition on the definition of the MALLOC_CAP_EXEC macro to
prevent it from being defined if ESP_SYSTEM_MEMPROT_FEATURE or
ESP_SYSTEM_PMP_IDRAM_SPLIT is enabled, thus throwing a compile time
error when using it.

Closes https://github.com/espressif/esp-idf/issues/14837
2025-09-29 10:45:32 +08:00
Guillaume Souchere 4c589d6282 Merge branch 'feat/add-ringbuf-reset' into 'master'
feat(esp_ringbuf): Add vRingbufferReset

Closes IDFGH-16385

See merge request espressif/esp-idf!41717
2025-09-24 10:11:07 +02:00
Guillaume Souchere cdef6dce44 Merge branch 'feat/allow-adc-unit-2-ulp' into 'master'
feat(ulp): Allow usage of ADC unit 2 on RISCV co processor

Closes IDFGH-16376

See merge request espressif/esp-idf!41863
2025-09-23 10:00:16 +02:00
Guillaume Souchere 1798034d3f feat(tools): Remove old copy of Catch2 in tools 2025-09-23 08:49:58 +02:00
Guillaume Souchere c03987ca49 feat(esp_ringbuf): Update vRingbufferReset to return an error
when items are not sent, complete or returned, make the function
return an error instead of checking the state in an assert.
2025-09-23 08:42:09 +02:00
Guillaume Souchere 1e0463673b feat(ulp): Allow usage oof ADC unit 2 on RISCV co processor 2025-09-22 12:38:37 +02:00
Guillaume Souchere ce9563d85c Merge branch 'fix/argtable3-coverity-findings' into 'master'
fix(console): Add input validation in arg_utils.c functions

Closes IDF-13986 and IDF-13987

See merge request espressif/esp-idf!41736
2025-09-22 09:45:44 +02:00
Guillaume Souchere f8cb539e29 feat(heap): Update test to CMake and use Catch2 component 2025-09-18 10:07:08 +02:00
Guillaume Souchere 903d613a4e feat(esp_gdbstub): Update test to CMake and use Catch2 component 2025-09-18 10:07:08 +02:00
Guillaume Souchere dea3fd2ceb fix(console): Add input validation in arg_utils.c functions 2025-09-04 08:33:44 +02:00
Guillaume Souchere 5ee5280195 fix(esp_vfs_console): Update placement of cdcacm_xx_cb when ETS print enabled 2025-08-06 12:13:24 +02:00
Guillaume Souchere 361c1b1fd6 Merge branch 'fix/linenoise-arrow-usage' into 'master'
fix(linenoise): Read escape sequences one character at a time

Closes IDFGH-15849

See merge request espressif/esp-idf!40601
2025-07-18 08:57:15 +02:00
Guillaume Souchere b46f4689bd fix(linenoise): Read escape sequences one character at a time 2025-07-16 08:28:22 +02:00
Guillaume Souchere fd9b2fab3a Merge branch 'fix/tcm-mem-not-considered-in-esp_ptr_eexecutable' into 'master'
fix(memory-utils): Check TCM in esp_ptr_internal and esp_ptr_byte_accessible

Closes IDFGH-15339 and IDFGH-15337

See merge request espressif/esp-idf!39388
2025-06-19 10:09:40 +02:00
Guillaume Souchere 2f4c5d278e Merge branch 'feat/remove-unecessray-condition-in-usj-read' into 'master'
fix(driver): remove unecessary if conditions in the read function

Closes IDF-13166

See merge request espressif/esp-idf!39523
2025-06-17 14:19:38 +02:00
Guillaume Souchere 740762c997 feat(usb_serial_jtag): Update vfs read to be POSIX compliant
The function now returns with available data in blocking mode
instead of waiting for the requested size to be available before
returning.
2025-06-13 07:58:22 +02:00
Guillaume Souchere 81b93828cf Merge branch 'change/update-esp-event-register-doxygen' into 'master'
change(esp-event): Update the doxygen comment of esp_event_handler_register

Closes IDF-13368

See merge request espressif/esp-idf!39819
2025-06-12 15:01:41 +02:00
Guillaume Souchere 2a17297d66 change(esp-event): Update the doxygen comment of esp_event_handler_register
Add a comment to specify what happens when registering a handler several times
to the same event.
2025-06-12 08:23:20 +02:00
Guillaume Souchere 139df47cf3 feat(usb_cdc): Update vfs read() to comply with POSIX standards 2025-06-06 11:41:26 +02:00
Guillaume Souchere 24048d8267 feat(usb_serial_tag_vfs): Add test for read exit conditions
Add a test to make sure the VFS read does not return on reception
of the \n character
2025-06-05 12:14:50 +02:00
Guillaume Souchere a3270694f0 fix(driver): remove unecessary if conditions in the read function
This changes affect usb_serial_jtag_vfs and cdcacm_vfs read functions.
This commit removes the exit condition on reception of \n character.
2025-06-03 12:04:14 +02:00
Guillaume Souchere 83f28973be Merge branch 'docs/document-task-tracking' into 'master'
docs(heap): Document heap task tracking

Closes IDF-12684

See merge request espressif/esp-idf!38247
2025-04-30 16:27:36 +08:00
Guillaume Souchere 0627576982 docs(heap): Document heap task tracking
Populate the heap_debug.rst section on heap task tracking with the
description of the reworked task tracking.
2025-04-29 10:11:58 +02:00
Guillaume Souchere 826c69f13b Merge branch 'feat/heap-get-size-from-any-pointer' into 'master'
feat(heap): add API to get allocated size from any pointer

Closes IDF-12764

See merge request espressif/esp-idf!34531
2025-04-28 15:53:37 +08:00
Guillaume Souchere 8a987d9288 feat(heap): Update get allocated size function to take any pointer 2025-04-25 09:50:15 +02:00
Guillaume Souchere 4019e77441 Merge branch 'feat/heap-update-to-latest-tlsf' into 'master'
fix(heap): Update to latest TLSF fix

See merge request espressif/esp-idf!38301
2025-04-24 16:10:58 +08:00
Guillaume Souchere 1de60605c1 Merge branch 'fix/console-deinit-deadlock-default-read' into 'master'
fix(console): Default read_func to the read function

See merge request espressif/esp-idf!38299
2025-04-09 18:44:56 +08:00
Guillaume Souchere 76f777c0e5 feat(heap): Update to latest TLSF
- this new version of TLSF uses uintptr_t instead of unsigned int
  casting in tlsf_malloc_addr to allow proper use of the function
  on 64bit targets.
2025-04-08 10:51:11 +02:00
Guillaume Souchere bd7814c93a fix(console): Default read_func to the read function
To make sure the static function pointer read_func is never NUL,
set its default value to th read function instead of setting it
to NULL pointer.
2025-04-08 08:52:47 +02:00
Guillaume Souchere 24df1d2128 Merge branch 'fix/example-tusb-msc-console-exit' into 'master'
fix(tinyusb): Update console exit mechanism in tusb_msc example

Closes IDF-12791

See merge request espressif/esp-idf!38172
2025-04-04 14:05:55 +08:00
Guillaume Souchere e4e2a83e2f Merge branch 'fix/console-deinit-deadlock' into 'master'
fix(console): Deadlock on console deletion

Closes IDFGH-9188, IDFGH-8520, and IDF-6906

See merge request espressif/esp-idf!30920
2025-04-04 13:56:03 +08:00
Guillaume Souchere 8f0e9f038b fix(tinyusb): Update console exit mechanism in tusb_msc example 2025-04-03 10:06:59 +02:00
Guillaume Souchere 30f8b59ed0 feat(console): Make console deinit optional 2025-04-03 10:06:01 +02:00
Guillaume Souchere 8a89dc0b9c feat(vfs): Add linux target support for esp_vfs_eventfd 2025-04-03 10:06:01 +02:00
Guillaume Souchere 203b3b5a4e fix(console): Memory leaks after deinit 2025-04-03 10:06:01 +02:00
Guillaume Souchere 5b2f2e05f3 fix(console): add ability to unblock linenoise, to fix deadlock
Closes https://github.com/espressif/esp-idf/pull/10580
Closes https://github.com/espressif/esp-idf/issues/9974
2025-04-03 10:06:00 +02:00
Guillaume Souchere 6ef7ad67d4 Merge branch 'feat/per-task-peak-usage' into 'master'
feat(heap): Add per task peak heap usage feature

Closes IDF-1811 and IDFGH-11277

See merge request espressif/esp-idf!26462
2025-03-26 15:20:04 +08:00
Guillaume Souchere d429b1fdbb feat(examples): Update heap task tracking examples
update example to showcasee the new API of heap task tracking

- Add basic heap task traacking example
- Add advanced example for task tracking
2025-03-25 10:22:30 +01:00
Guillaume Souchere daf8f9edb6 feat(heap): Add feature to get peak heap usage
This feature keeps track of the per task peak memory usage.

- Update the heap_task_tracking example to make use of the new feature
Cleanup the implementation:
- multi_heap_get_free_size() is never used, remove it.
- Minor update in heap_caps_update_per_task_info_xx() funcitons.
- Update settting on block owner in heap_caps.c to work with the
get peak usage feature.

- Update heap_caps_update_per_task_info_free() to detect when it
is called to delete the memory allocated for a task TCB. Mark
the corresponding task in the statistic list as deleted.

- Add a Kconfig option dependant on HEAP_TASK_TRACKING being enabled
that force the deletion of the statistics related to deleted task
when set to true.

- In task tracking feature, add a current and peak memory usage
to the heap_stat_t structure to keep track of the current and
peak memory usage of the given task across all heaps.

- Fix missing block owner when allocating memory for heaps_array
in heap_caps_init.

- Keep the original implementation of the task tracking
for backward compatibility reasons.
2025-03-24 12:08:48 +01:00
Guillaume Souchere 063d673fae Merge branch 'fix/memory-utils-esp_ptr_in_rtc_dram_fast' into 'master'
fix(esp_hw_support): esp_ptr_in_rtc_iram_fast check to return false

Closes IDFCI-2717

See merge request espressif/esp-idf!36930
2025-03-13 20:05:46 +08:00
Guillaume Souchere 8c50df00ff fix(esp_hw_support): esp_ptr_in_rtc_iram_fast check to return false
esp_ptr_in_rtc_iram_fast logic should be executed if
SOC_RTC_FAST_MEM_SUPPORTED is set but it should also be executed
if IRAM and DRAM region mapping is the same. Remove the
SOC_RTC_IRAM_LOW != SOC_RTC_DRAM_LOW part of the check.

Update heap component to use the modify function appropriately.
2025-03-11 12:06:32 +01:00
Guillaume Souchere 7e93f4b5ed Merge branch 'fix/memory-utils-ptr-executable' into 'master'
fix(memory-utils): Missing case in esp_ptr_executable logic

Closes IDF-12458

See merge request espressif/esp-idf!36904
2025-02-19 15:27:11 +08:00
Guillaume Souchere 92d575379f fix(memory-utils): Missing case in esp_ptr_executable logic
esp_ptr_executable does not consider that the PSRAM and FLASH
memory mapping are not always matching.

Added a "pointer is in PSRAM" specific check in the logic to
fix the issue.
2025-02-13 07:56:58 +01:00
Guillaume Souchere 5a0e1615d9 Merge branch 'fix/usb-cdc-non-blocking-read' into 'master'
fix(esp_vfs_console): USB CDC read when non blocking

See merge request espressif/esp-idf!36469
2025-02-05 14:30:15 +08:00
Guillaume Souchere ae7c8691d9 fix(esp_vfs_console): USB CDC read when non blocking
In non blocking mode, the read function is expected
to return weather data is available for reading or not.

In case data are available but the size does not match
the expected size, the function read should return whatever
data is available.

Previously, the function was returning -1 with errno set
to EWOULDBLOCK even if the size of data in the buffer was
less than the requested size. It would only return the
available data if the size in the buffer was greater or equal
to the requested size.

The implementation of cdcacm_read is modified to return the avilable
data from the buffer even is the size is lesser than the requested
size.
2025-01-30 08:51:54 +01:00
Guillaume Souchere 82f558b47a Merge branch 'fix/esp-event-profiling' into 'master'
fix(esp_event): Fix event loop profiling in handler_execute function

Closes IDFGH-14245

See merge request espressif/esp-idf!35735
2025-01-30 15:42:21 +08:00
Guillaume Souchere 15f6775f5d fix(esp_event): Handler unregistration by itself issue
when esp_event_handler_unregister_with_internal cannot take
the loop mutex (e.g., when the handler unregisters itself),
create an event with a special base identifier and add it to
the queue of the corresponding loop to postpone the removal
of the handler from the list at a time when the loop mutex can be
successfully taken.
2025-01-29 13:37:27 +01:00
Guillaume Souchere d8d3c50b3f fix(esp_event): Fix event loop profiling in handler_execute function
handler_execute function is looking to match the handler only in the
list of loop events but does not look in the base event handler list
nor the id event handler list. So unless the event handler is
registered to be triggered for all event bases and all event ids of
an event loop, its profiling fields (invoked and time) are not updated
when it is called.

This commit updates the search for the matching handler to also look
in base event list and ID event list.

Closes https://github.com/espressif/esp-idf/issues/15041
2025-01-29 13:17:00 +01:00
Guillaume Souchere 4d11fe5847 Merge branch 'fix/memory-utils-unused-var' into 'master'
fix(esp_hw_support): Unused variables in memory_utils functions

See merge request espressif/esp-idf!36295
2025-01-15 14:05:01 +08:00