Kconfig 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141
  1. menu "Heap memory debugging"
  2. choice HEAP_CORRUPTION_DETECTION
  3. prompt "Heap corruption detection"
  4. default HEAP_POISONING_DISABLED
  5. help
  6. Enable heap poisoning features to detect heap corruption caused by out-of-bounds access to heap memory.
  7. See the "Heap Memory Debugging" page of the IDF documentation
  8. for a description of each level of heap corruption detection.
  9. config HEAP_POISONING_DISABLED
  10. bool "Basic (no poisoning)"
  11. config HEAP_POISONING_LIGHT
  12. bool "Light impact"
  13. config HEAP_POISONING_COMPREHENSIVE
  14. bool "Comprehensive"
  15. endchoice
  16. choice HEAP_TRACING_DEST
  17. bool "Heap tracing"
  18. default HEAP_TRACING_OFF
  19. help
  20. Enables the heap tracing API defined in esp_heap_trace.h.
  21. This function causes a moderate increase in IRAM code side and a minor increase in heap function
  22. (malloc/free/realloc) CPU overhead, even when the tracing feature is not used.
  23. So it's best to keep it disabled unless tracing is being used.
  24. config HEAP_TRACING_OFF
  25. bool "Disabled"
  26. config HEAP_TRACING_STANDALONE
  27. bool "Standalone"
  28. select HEAP_TRACING
  29. config HEAP_TRACING_TOHOST
  30. bool "Host-based"
  31. select HEAP_TRACING
  32. endchoice
  33. config HEAP_TRACING
  34. bool
  35. default F
  36. help
  37. Enables/disables heap tracing API.
  38. config HEAP_TRACING_STACK_DEPTH
  39. int "Heap tracing stack depth"
  40. range 0 0 if IDF_TARGET_ARCH_RISCV # Disabled for RISC-V due to `__builtin_return_address` limitation
  41. default 0 if IDF_TARGET_ARCH_RISCV
  42. range 0 32
  43. default 2
  44. depends on HEAP_TRACING
  45. help
  46. Number of stack frames to save when tracing heap operation callers.
  47. More stack frames uses more memory in the heap trace buffer (and slows down allocation), but
  48. can provide useful information.
  49. config HEAP_USE_HOOKS
  50. bool "Use allocation and free hooks"
  51. help
  52. Enable the user to implement function hooks triggered for each successful allocation and free.
  53. config HEAP_TASK_TRACKING
  54. bool "Enable heap task tracking"
  55. help
  56. Enables tracking the task responsible for each heap allocation.
  57. This function depends on heap poisoning being enabled and adds four more bytes of overhead for each block
  58. allocated.
  59. config HEAP_TRACE_HASH_MAP
  60. bool "Use hash map mechanism to access heap trace records"
  61. depends on HEAP_TRACING_STANDALONE
  62. default n
  63. help
  64. Enable this flag to use a hash map to increase performance in handling
  65. heap trace records.
  66. Heap trace standalone supports storing records as a list, or a list + hash map.
  67. Using only a list takes less memory, but calls to 'free' will get slower as the
  68. list grows. This is particularly affected when using HEAP_TRACE_ALL mode.
  69. By using a list + hash map, calls to 'free' remain fast, at the cost of
  70. additional memory to store the hash map.
  71. config HEAP_TRACE_HASH_MAP_IN_EXT_RAM
  72. bool "Place hash map in external RAM"
  73. depends on HEAP_TRACE_HASH_MAP
  74. default n
  75. help
  76. When enabled this configuration forces the hash map to be placed in external RAM.
  77. config HEAP_TRACE_HASH_MAP_SIZE
  78. int "The number of entries in the hash map"
  79. depends on HEAP_TRACE_HASH_MAP
  80. default 512
  81. help
  82. Defines the number of entries in the heap trace hashmap. Each entry takes 8 bytes.
  83. The bigger this number is, the better the performance. Recommended range: 200 - 2000.
  84. config HEAP_ABORT_WHEN_ALLOCATION_FAILS
  85. bool "Abort if memory allocation fails"
  86. default n
  87. help
  88. When enabled, if a memory allocation operation fails it will cause a system abort.
  89. config HEAP_TLSF_USE_ROM_IMPL
  90. bool "Use ROM implementation of heap tlsf library"
  91. depends on ESP_ROM_HAS_HEAP_TLSF
  92. default y
  93. help
  94. Enable this flag to use heap functions from ROM instead of ESP-IDF.
  95. If keeping this as "n" in your project, you will have less free IRAM.
  96. If making this as "y" in your project, you will increase free IRAM,
  97. but you will lose the possibility to debug this module, and some new
  98. features will be added and bugs will be fixed in the IDF source
  99. but cannot be synced to ROM.
  100. config HEAP_PLACE_FUNCTION_INTO_FLASH
  101. bool "Force the entire heap component to be placed in flash memory"
  102. depends on !HEAP_TLSF_USE_ROM_IMPL
  103. default n
  104. help
  105. Enable this flag to save up RAM space by placing the heap component in the flash memory
  106. Note that it is only safe to enable this configuration if no functions from esp_heap_caps.h
  107. or esp_heap_trace.h are called from ISR.
  108. config HEAP_TLSF_CHECK_PATCH
  109. bool "Patch the tlsf_check_pool() for ROM HEAP TLSF implementation"
  110. depends on IDF_TARGET_ESP32C2 && ESP32C2_REV_MIN_FULL < 200
  111. default y
  112. help
  113. ROM does not contain the patch of tlsf_check_pool() allowing perform
  114. the integrity checking on used blocks. The patch to allow such check
  115. needs to be applied.
  116. endmenu