Commit Graph

201 Commits

Author SHA1 Message Date
jingli
41a0757bcc fix param passed to assert_valid_block, should be block not ptr 2022-06-23 21:43:53 +08:00
Omar Chebib
751c546a68 Heap: fix typos in test and component 2022-04-28 05:59:31 +00:00
Omar Chebib
bf8fd5f42c Heap: fix free bytes calculation for TLSF heap
* Closes https://github.com/espressif/esp-idf/issues/8270
2022-04-28 05:59:31 +00:00
Zim Kalinowski
a8c073c1cc fixed trailing whitespace 2022-02-18 12:58:53 +08:00
Chip Weinberger
9cc4c2f34d SPIRAM: 'Abort on allocation failure' should not trigger when there is available SPI ram
(cherry picked from commit 8dcdb2f363fd3fa00bd77e4bd75e7c73d6c7d0fb)
2022-02-17 22:22:26 +08:00
Mahavir Jain
7d9b93e2e0 Merge branch 'bugfix/MR16031_v4.4' into 'release/v4.4'
heap: adjust the order of RTC memory heap caps and regions(backport v4.4)

See merge request espressif/esp-idf!16704
2022-01-27 05:30:02 +00:00
jingli
23ec015d75 adjust the order of RTC memory heap caps and regions 2022-01-08 16:19:35 +08:00
Alexey Gerenkov
8c2990fcea trax: Adds ESP32-S3 support 2022-01-05 19:34:28 +01:00
Alexey Gerenkov
18cd2ea3e6 apptrace: Adds ESP32-S3 support 2022-01-05 19:26:33 +01:00
Omar Chebib
155de9c49e Heap: Add a target test to check that TLFS allocates the requested size 2021-12-22 14:06:41 +08:00
Omar Chebib
09db8845c6 Heap: Fix a possible bug in the TLSF allocator
Fix a bug that could return a chunk of memory smaller than requested,
easily leading to a memory corruption, when the required memory alignment
passed to the allocator is 4.
2021-12-22 14:06:41 +08:00
Jiang Jiang Jian
bd650062ca Merge branch 'feature/update_rtc_memory_heap_caps' into 'release/v4.4'
heap: update RTC memory heap caps (backport v4.4)

See merge request espressif/esp-idf!15941
2021-12-08 13:35:18 +00:00
Jiang Jiang Jian
67fcfc2e02 Merge branch 'feature/freertos_try_enter_critical_v4.4' into 'release/v4.4'
freertos: Add portTRY_ENTRY_CRITICAL() and deprecate legacy spinlock fucntions (v4.4)

See merge request espressif/esp-idf!16040
2021-12-08 10:10:17 +00:00
gaoxiaojie
666218d753 heap: fix multi_heap_get_info_impl 2021-11-25 10:34:06 +08:00
Darian Leung
c5efb55d43 freertos: Add portTRY_ENTRY_CRITICAL() and deprecate legacy spinlock fucntions
Add TRY_ENTRY_CRITICAL() API to all for timeouts when entering critical sections.
The following port API were added:
- portTRY_ENTER_CRITICAL()
- portTRY_ENTER_CRITICAL_ISR()
- portTRY_ENTER_CRITICAL_SAFE()

Deprecated legacy spinlock API in favor of spinlock.h. The following API were deprecated:
- vPortCPUInitializeMutex()
- vPortCPUAcquireMutex()
- vPortCPUAcquireMutexTimeout()
- vPortCPUReleaseMutex()

Other Changes:
- Added portMUX_INITIALIZE() to replace vPortCPUInitializeMutex()
- The assembly of the critical section functions ends up being about 50 instructions longer,
  thus the spinlock test pass threshold had to be increased to account for the extra runtime.

Closes https://github.com/espressif/esp-idf/issues/5301
2021-11-22 18:42:10 +08:00
wuzhenghui
8d33d54af7 heap: update RTC memory heap caps 2021-11-15 10:56:08 +08:00
Li Shuai
e8188e5d8f ci: replacing old header with new SPDX header style 2021-10-20 11:36:23 +08:00
Li Shuai
44da7d27ef heap: add a new heap caps attribute for RTC fast memory 2021-10-20 11:36:22 +08:00
Li Shuai
9298db641e deep sleep: fix some rtc fast memory definition errors in esp32s3 2021-10-19 21:47:27 +08:00
gaoxiaojie
191a494e08 support dcache 64Byte and 16k 2021-09-02 02:27:40 +08:00
Michael (XIAO Xufeng)
064f12cb90 idf_size.py: fixed diram counted twice issue, and improve display
Currently static RAM usage are listed under corresponding physical
memory.

ld: fix linker script for C3 and S3
2021-08-11 17:51:50 +02:00
Omar Chebib
a7b6ec85b8 Merge branch 'feature/move_memory_layout_to_heap' into 'master'
G0: Memory layouts are now part of heap components

Closes IDF-1264

See merge request espressif/esp-idf!14028
2021-07-19 06:23:19 +00:00
Omar Chebib
c4f57af6c9 G0: Memory layouts are now part of heap components 2021-07-15 11:38:23 +10:00
Mahavir Jain
9ac9b69087 heap: use hal specific API to get cpu cycles count
This fixes compilation issue of heap tracing feature for RISC-V
architecture.
2021-06-22 14:14:10 +08:00
Angus Gratton
d6f4d99d93 core system: Fix warnings in compilation when assertions are disabled
Adds a CI config for hello world that sets this, to catch future regressions
2021-03-03 10:26:57 +11:00
Omar Chebib
c4dc3acba9 heap: add light poisoning configuration to the tests.
Relates to IDF-2653
2021-02-01 11:58:42 +08:00
Omar Chebib
d902b4e7db heap: fix unaligned memory bug when poisoning is enabled.
Poisoned memory is now aligned as requested by the user.
Closes IDF-2653
2021-02-01 11:58:42 +08:00
Martin Vychodil
69096ddce5 Security: ESP32C3 memory protection feature (IRAM0/DRAM0)
Software support for PMS module.
Allows controlled memory access to IRAM (R/W/X) and DRAM0 (R/W)
On/locked by default, configurable in Kconfig (esp_system)

Closes https://jira.espressif.com:8443/browse/IDF-2092
2021-01-27 08:44:03 +01:00
Renz Bagaporo
d1c800fbbb components: fix ldgen check errors 2021-01-19 11:17:18 +08:00
jiangguangming
47f469b238 heap: support aligned_alloc for retention memory on ESP32-C3 2021-01-13 14:41:22 +08:00
morris
753a929525 global: fix sign-compare warnings 2021-01-12 14:05:08 +08:00
Marius Vikhammer
9c8e4fd4c5 C3: build and run unit tests
Enable building and running of unit tests in CI for C3 as well as fix
related compile errors

Also enables building of C3 test apps
2021-01-11 11:34:37 +08:00
Felipe Neves
89d461df2a heap: increase the sl to reduce the fragmentation to acceptable level. 2020-12-17 12:52:56 -03:00
Angus Gratton
5228d9f9ce esp32c3: Apply one-liner/small changes for ESP32-C3 2020-12-01 10:58:50 +11:00
Angus Gratton
935e4b4d62 Merge branch 'feature/riscv_arch' into 'master'
Add RISC-V support

Closes IDF-2359

See merge request espressif/esp-idf!11140
2020-11-13 07:50:31 +08:00
Angus Gratton
420aef1ffe Updates for riscv support
* Target components pull in xtensa component directly
* Use CPU HAL where applicable
* Remove unnecessary xtensa headers
* Compilation changes necessary to support non-xtensa gcc types (ie int32_t/uint32_t is no
  longer signed/unsigned int).

Changes come from internal branch commit a6723fc
2020-11-13 07:49:11 +11:00
Felipe Neves
35ef4ffa99 heap: add tlsf config specific to the host test 2020-11-12 11:07:46 +11:00
Felipe Neves
60f79705a3 heap: tune the tlsf control structure to reduce per-pool overhead 2020-11-12 11:06:29 +11:00
Angus Gratton
66fb5a29bb Whitespace: Automated whitespace fixes (large commit)
Apply the pre-commit hook whitespace fixes to all files in the repo.

(Line endings, blank lines at end of file, trailing whitespace)
2020-11-11 07:36:35 +00:00
Michael (XIAO Xufeng)
1966f00f0b soc: updates caps usage
We should define caps as 1 if true. When use the caps macros, #if and
 #if ! should be used instead of #ifdef/#ifndef.
2020-10-17 16:10:17 +08:00
Angus Gratton
bf85348034 tlsf: Enable asserts 2020-10-14 16:11:49 +11:00
Felipe Neves
3057b76a7e tests: re-add all disabled tests and all disabled configurations 2020-10-14 16:11:49 +11:00
Felipe Neves
f3783ba258 app_trace/sysview: fixed freertos tracing calling plus sync apptrace component with the master branch version
docs: remove reference to backported features in freertos 10 api-reference.
2020-10-13 23:52:03 +00:00
Felipe Neves
bd9b921713 heap_tlsf: added implementation of TLSF allocator
heap: ported tlsf allocator into multi heap

heap_host_tests: added tlsf allocator into host test

heap_host_test: update freebytes after using free

heap_tests: tlsf now passing on host tests without poisoning

multi_heap: added support for memalign using tlsf implementation

heap_caps: removed heap_caps_aligned_free

heap/test: fixed broken aligned alloc test build

heap: added poisoning pattern when blocks are being merged

heap/tests: added timing tests for memory allocation

heap: reduced tlsf structure overhead

heap/tlsf: made all short functions inside of tlsf  module as inline to improve timings

heap: moved tlsf heap routines outside of flash memory

newlib: linked multiheap memalign with newlib memalign function

heap: moved block member functions to a separate file so multi_heap can use the functions

heap/test: improved the tlsf timing test

heap/test: added memalign on aligned alloc tests

heap: moved tlsf configuration constants to a separated file

heap: added random allocations test with timings

heap: modified the calculation of heap free bytes

heap: make aligned free true deprecated functions and update their documentation

heap: add extra assert after successive mallocs on small allocation host test

heap: remove legacy aligned alloc implementation.

performance: added malloc and free time performance default values
2020-10-13 23:52:03 +00:00
Jakob Hasse
20c068ef3b cmock: added cmock as component
* changing dependencies from unity->cmock
* added component.mk and Makefile.projbuild
* ignore test dir in gen_esp_err_to_name.py
* added some brief introduction of CMock in IDF
2020-09-02 16:38:37 +08:00
morris
2917651478 esp_rom: extract common ets apis into esp_rom_sys.h 2020-07-27 15:27:01 +08:00
Felipe Neves
6f5e43e26a heap: added alloc failed hook and configuration options
heap/test: added alloc failed hook tests

docs: added alloc failed hook documentation

heap: add function to register allocation failed hook

docs: allocation failed hook docs improvements
2020-05-04 10:58:38 -03:00
Angus Gratton
9300615a13 Merge branch 'bugfix/heap_psram_fill' into 'master'
heap: Only fill new heaps with FREE_FILL_PATTERN if Comprehensive poisoning is on

See merge request espressif/esp-idf!8210
2020-04-27 14:20:41 +08:00
Martin Vychodil
7491ea677a esp32s2: IRAM/DRAM memory protection
* new mem_prot API
* mem_prot on & locked by default (see Kconfig)
* feature activated in start_cpu0_default()

JIRA IDF-1355
2020-04-21 15:10:58 +02:00
Angus Gratton
100578a9e9 heap: Only fill new heaps with FREE_FILL_PATTERN if Comprehensive poisoning is on
Significantly speeds up heap initialization at startup when default "Light" heap
poisoning is enabled.

Tip via reddit user LinkeSeitentasche https://www.reddit.com/r/esp32/comments/fnj51a/a_guide_to_improving_esp32_boot_speed/
2020-04-15 07:16:08 +00:00