Commit Graph

377 Commits

Author SHA1 Message Date
Guillaume Souchere
3e214bc2f4 fix(heap): Loop break on failed alloc
don't check for heaps_array != NULL in the loop.
The check is done after the loop since it is allowed
for the allocation to fail until finding aa ssuitable
heap.
2024-04-12 12:27:13 +02:00
Guillaume Souchere
a12a681794 test(heap): Extend task tracking test with task handle check
Add a test to make sure that the task handles returned in the
task tracking information are valid task handles.

To verify that, feed the task name returned by pcTaskGetName()
using the task handle under test to xTaskGetHandle() and make
sure the task handle returned matches the one under test.
2024-04-12 09:27:41 +02:00
Guillaume Souchere
26160a217e fix(heap): Add block owner to allocs in heap_caps_init
Add the block owner field in the  memory allocated in
heap_caps_init() to avoid parsing error wheen using
the task tracking feature.

Closes https://github.com/espressif/esp-idf/issues/13467
2024-04-12 09:27:31 +02:00
Guillaume Souchere
29f835d2f1 fix(heap): Wrong size propagated in alloc fail callback
Propagate `n * size` as the size of the failed allocation
instead of just `size` when heap_caps_calloc() fails since
`n * size` is the actual number of bytes that the heap
component tried to allocate.
2024-04-08 08:36:43 +02:00
Marius Vikhammer
6b1413c3e9 fix(heap): fixed missing include in esp_heap_task_info.h
Would fail to compile if esp_heap_task_info.h was included without/before freertos includes
2024-02-20 12:04:45 +08:00
Guillaume Souchere
490df3a348 fix(heap): prevent double traversal of hashmap in map_find_and_remove
Remove the use of SLIST_REMOVE in map_find_and_remove to prevent the hashmap
list to be traversed twice in the function.

Closes https://github.com/espressif/esp-idf/issues/12820
2023-12-28 17:38:12 +08:00
Guillaume Souchere
66759438a9 fix(heap): Update the heap memory layout on esp32p4 target
- fix the value of SOC_ROM_STACK_START in soc.h
- Update the memory usage of ROM bootloader appendix in bootloader.ld
- Update the soc_memory_regions table to minimize the number of regions
  created after the startup stack is added back as a heap.
2023-12-06 04:48:00 +00:00
Guillaume Souchere
5740323822 fix(heap): Add missing test for heap task tracking config
- Add sdkconfig.ci.task_tracking that runs generic tests
with heap task tracking enabled.
- Add task_tracking.c that includes a test checking that
a created task that allocates memory is added to the list
of task tracked by the heap task tracking feature.
2023-11-16 02:57:15 +00:00
Guillaume Souchere
4824325fe4 fix(heap): Fix bugs in heap task tracking
Update task tracking feature to fix bugs introduced when
decoupling task tracking from heap poisoning.

Closes https://github.com/espressif/esp-idf/issues/12498
Closes https://github.com/espressif/esp-idf/issues/12493
2023-11-16 02:57:15 +00:00
Marius Vikhammer
20b6d92b91 Merge branch 'ci/reduce_heap_tests' into 'master'
ci(heap): reduce the number of test apps built

See merge request espressif/esp-idf!26643
2023-10-25 09:23:18 +08:00
Marius Vikhammer
7e8181b976 ci(heap): reduce the number of test apps built 2023-10-24 12:38:56 +08:00
Guillaume Souchere
787a4ad6c9 Merge branch 'feat/use-singly-linked-hashmap' into 'master'
feat(heap): update hash map to use singly linked list

Closes IDFGH-9846

See merge request espressif/esp-idf!26441
2023-10-23 13:12:37 +08:00
Guillaume Souchere
07165308f6 feat(heap): update hash map to use singly linked list
Previously, the hash map was a doubly linked list but was never
using the characteristics of it.

This commit switches the hash map to a singly linked list instead

This commit also fixes memory leak in heap trace tests by setting
hashmap size to 10 for the tests (instead of the default value of 250)

See https://github.com/espressif/esp-idf/issues/11173
2023-10-19 14:50:05 +02:00
Guillaume Souchere
63952fe2f6 Merge branch 'feat/make-task-tracking-independant-from-poisoning' into 'master'
feat(heap): Dissociate heap poisoning from task tracking functionalities

Closes IDF-8332

See merge request espressif/esp-idf!26311
2023-10-18 20:18:22 +08:00
Guillaume Souchere
7492c862af feat(heap): Dissociate heap poisoning from task tracking
In order to enable CONFIG_HEAP_TASK_TRACKING, some kind
of poisoning had to be enabled (!HEAP_POISONING_DISABLED).
However since those functionalities don't seem to be related
in any way, this commit decouple them by removing
MULTI_HEAP_BLOCK_OWNER from poison_head_t in multi_heap_poisoning.c
and handling the block ownership in heap_caps.c instead.

Note that handling task tracking in multi_heap.c would necessitate
updating the ROM implementation of multi_heap.c as well. For this
reason, the task tracking feature has to be handled in heap_caps.c.
2023-10-18 06:43:22 +02:00
Guillaume Souchere
84c5d3e52f fix(heap): Fixed integrity check on used blocks by the tlsf component
This commit updates the tlsf submodule to include the modification made in the component
aiming to perform integrity check on all blocks (not only the free ones).
Added test to test the fix in test_apps/heap_tests.

Fixes https://github.com/espressif/esp-idf/issues/12231
2023-10-16 12:29:38 +02:00
wuzhenghui
5926116644 change(heap): fix and clean memory caps defination in memory_layout
1. move startup_stack attr from soc_memory_type_desc_t to soc_memory_region_t and
   remove unused aliased_iram field
2. all of the last level of RAM is retention dma accessible on esp32c3
3. remove esp32c2 and later chips retention dma accessible memory caps
4. allow allocate memory from RTC_RAM with MALLOC_CAP_EXEC cap
2023-09-28 07:53:20 +00:00
Chen Yudong
2e11919f70 fix(ci): change build-test-rules files folder 2023-09-20 19:17:06 +08:00
Armando
712c0c0075 feat(psram): esp32p4 psram device driver support 2023-08-28 14:14:58 +08:00
Armando
7dbd3f6909 feat(ci): Enable p4 example, test_apps and unit tests CI build 2023-08-24 12:51:19 +08:00
Armando
706d684418 feat(esp32p4): introduced new target esp32p4, supported hello_world 2023-08-09 19:33:25 +08:00
morris
956ec54aed fix(heap): use _SAFE version of critical section
because we allow to call malloc and free in an ISR context
2023-08-03 12:02:09 +08:00
Marius Vikhammer
39b9113f13 Merge branch 'bugfix/heap_trace_depth_assert' into 'master'
core-systems/heap: fixed wrong error message from assert in heap trace

See merge request espressif/esp-idf!24071
2023-07-11 09:15:59 +08:00
Marius Vikhammer
b70aaa16f1 Merge branch 'contrib/github_pr_11509' into 'master'
[Heap Trace Standalone] do not allocate memory until init is called (GitHub PR)

Closes IDFGH-10247

See merge request espressif/esp-idf!23958
2023-07-10 19:59:00 +08:00
Marius Vikhammer
450618c39d docs(heap): fixed typo in heap trace docs 2023-07-07 10:49:15 +08:00
morris
f0c07f82b5 fix(test): check call graph for hal component 2023-07-05 09:09:01 +08:00
Zim Kalinowski
2b4137d212 heap: enable qemu tests 2023-06-20 16:03:41 +02:00
Konstantin Kondrashov
c350c3c504 Merge branch 'feature/cleanup_wrong_log_use' into 'master'
all: Removes unnecessary newline character in logs

Closes IDFGH-10197

See merge request espressif/esp-idf!24131
2023-06-15 21:49:49 +08:00
Armando (Dou Yiwen)
17d6768e65 Merge branch 'feature/add_target_esp32p4' into 'master'
esp32p4: introduce the target

See merge request espressif/esp-idf!24155
2023-06-14 10:16:44 +08:00
Marius Vikhammer
86c5b437b5 Merge branch 'ci/trim_test_apps' into 'master'
core-system: limit build components for core-system test apps

Closes IDF-7092

See merge request espressif/esp-idf!24167
2023-06-13 15:31:00 +08:00
Armando
101e6a18eb esp32p4: introduce the target
Add esp32p4 target to tools and Kconfig
Create directories and files that are essential for `idf.py --preview set-target esp32p4`
2023-06-13 15:16:11 +08:00
Marius Vikhammer
6d11c37ff1 core-system: trim build components for core-system test apps 2023-06-13 09:14:42 +08:00
KonstantinKondrashov
e72061695e all: Removes unnecessary newline character in logs
Closes https://github.com/espressif/esp-idf/issues/11465
2023-06-09 03:31:21 +08:00
Konstantin Kondrashov
f875978fb3 Merge branch 'bugfix/incorrect_time_after_ota' into 'master'
esp_hw_support: Fix invalid system time if s_esp_rtc_time_us & s_rtc_last_ticks were moved around

Closes IDFGH-7930

See merge request espressif/esp-idf!23030
2023-06-09 00:30:52 +08:00
KonstantinKondrashov
cb6e2133f0 esp_hw_support: Fix invalid system time if s_esp_rtc_time_us & s_rtc_last_ticks were moved around
The commit fixes the case:
If variables in RTC RAM have been moved around by the linker,
they will be filled with garbage data. Any reset other than OTA would work fine
because the variables would still be initialized from the initial bootup.

So now system time will be valid even after OTA.

Closes https://github.com/espressif/esp-idf/issues/9448
2023-06-08 21:59:21 +08:00
Marius Vikhammer
c212c2b61c core-systems/heap: fixed wrong error message from assert in heap trace 2023-06-06 11:08:50 +08:00
Chip Weinberger
23cba5fe00 [Heap Trace Standalone] increase Kconfig max stack size 2023-05-31 12:41:16 +08:00
Marius Vikhammer
185d7a7bd4 heap: fixed unused variable warning 2023-05-30 11:40:17 +08:00
Chip Weinberger
fc1e8b0365 [Heap Trace Standalone] do not allocate memory until init is called 2023-05-29 00:00:15 -07:00
Marius Vikhammer
5b77f77e53 core-system/linux-target: fixed heap_caps_realloc not correctly allocating the requested number of bytes
Closes https://github.com/espressif/esp-idf/issues/11523
2023-05-29 10:09:54 +08:00
Marius Vikhammer
a300b3eb81 ci: fix invalid kconfig options in system test apps 2023-05-09 11:27:55 +08:00
laokaiyao
bf2a7b2df6 esp32h4: removed esp32h4 related codes 2023-04-23 12:03:07 +00:00
laokaiyao
b16ed57b2e esp32h4: removed esp32h4 related files 2023-04-23 12:03:07 +00:00
Guillaume Souchere
6ce1ccd964 heap: Add trace configuration to allow hash map placement in external RAM bss section when possible
- Remove the size limit for the hash_map array from the CONFIG_HEAP_TRACE_HASH_MAP_SIZE
- Add test case for heap tracing using hashmap
- Update heap_debug.rst to document the newly added configurations in the heap component

Closes https://github.com/espressif/esp-idf/issues/11172
2023-04-19 10:30:59 +02:00
Guillaume Souchere
48932ce910 Merge branch 'feature/heap-in-flash' into 'master'
heap: Add a configuration that places all the heap component in flash

Closes IDF-7143 and IDF-2853

See merge request espressif/esp-idf!23050
2023-04-13 14:38:15 +08:00
Guillaume Souchere
110aac240d heap: Add a configuration that places all the heap component and related functionalities in flash when enabled
Add test configuration to run all tests with heap component in the flash.
Add reference to this new configuration in performance section of the documentation.
2023-04-12 08:11:24 +02:00
Anton Maklakov
a1584750c8 Merge branch 'fix/heap-test-h2' into 'master'
heap: remove exclusion of esp32h2 as a target for heap pytest

Closes IDF-6880

See merge request espressif/esp-idf!23075
2023-04-12 13:43:29 +08:00
Marius Vikhammer
5cbd311ecf system: add kconfig option for using parts of SRAM1 for IRAM
Using parts of SRAM1 for IRAM allows apps with more statically allocated IRAM

Closes https://github.com/espressif/esp-idf/issues/9824
2023-04-07 07:12:58 +00:00
Jakob Hasse
dac64725af esp_system, heap: increase host test timeout for CI 2023-04-06 10:23:44 +08:00
Guillaume Souchere
c42c93758f heap: remove exclusion of esp32h2 as a target for no/light/comprehensive_poisoning tests 2023-04-05 09:19:39 +02:00