Kconfig.spiram.common 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. # Common (non-chip-specific) SPIRAM options
  2. #
  3. # sourced into the "SPIRAM config" submenu for ESP32 or ESP32S2
  4. # invisible option selected by ESP32_SPIRAM_SUPPORT || ESP32S2_SPIRAM_SUPPORT
  5. config SPIRAM
  6. bool
  7. config SPIRAM_BOOT_INIT
  8. bool "Initialize SPI RAM during startup"
  9. default "y"
  10. help
  11. If this is enabled, the SPI RAM will be enabled during initial boot. Unless you
  12. have specific requirements, you'll want to leave this enabled so memory allocated
  13. during boot-up can also be placed in SPI RAM.
  14. config SPIRAM_IGNORE_NOTFOUND
  15. bool "Ignore PSRAM when not found"
  16. default "n"
  17. depends on SPIRAM_BOOT_INIT && !SPIRAM_ALLOW_BSS_SEG_EXTERNAL_MEMORY
  18. help
  19. Normally, if psram initialization is enabled during compile time but not found at runtime, it
  20. is seen as an error making the CPU panic. If this is enabled, booting will complete
  21. but no PSRAM will be available.
  22. choice SPIRAM_USE
  23. prompt "SPI RAM access method"
  24. default SPIRAM_USE_MALLOC
  25. help
  26. The SPI RAM can be accessed in multiple methods: by just having it available as an unmanaged
  27. memory region in the CPU's memory map, by integrating it in the heap as 'special' memory
  28. needing heap_caps_malloc to allocate, or by fully integrating it making malloc() also able to
  29. return SPI RAM pointers.
  30. config SPIRAM_USE_MEMMAP
  31. bool "Integrate RAM into memory map"
  32. config SPIRAM_USE_CAPS_ALLOC
  33. bool "Make RAM allocatable using heap_caps_malloc(..., MALLOC_CAP_SPIRAM)"
  34. config SPIRAM_USE_MALLOC
  35. bool "Make RAM allocatable using malloc() as well"
  36. select FREERTOS_SUPPORT_STATIC_ALLOCATION
  37. endchoice
  38. config SPIRAM_MEMTEST
  39. bool "Run memory test on SPI RAM initialization"
  40. default "y"
  41. depends on SPIRAM_BOOT_INIT
  42. help
  43. Runs a rudimentary memory test on initialization. Aborts when memory test fails. Disable this for
  44. slightly faster startup.
  45. config SPIRAM_MALLOC_ALWAYSINTERNAL
  46. int "Maximum malloc() size, in bytes, to always put in internal memory"
  47. depends on SPIRAM_USE_MALLOC
  48. default 16384
  49. range 0 131072
  50. help
  51. If malloc() is capable of also allocating SPI-connected ram, its allocation strategy will prefer to
  52. allocate chunks less than this size in internal memory, while allocations larger than this will be
  53. done from external RAM. If allocation from the preferred region fails, an attempt is made to allocate
  54. from the non-preferred region instead, so malloc() will not suddenly fail when either internal or
  55. external memory is full.
  56. config SPIRAM_TRY_ALLOCATE_WIFI_LWIP
  57. bool "Try to allocate memories of WiFi and LWIP in SPIRAM firstly. If failed, allocate internal memory"
  58. depends on SPIRAM_USE_CAPS_ALLOC || SPIRAM_USE_MALLOC
  59. default "n"
  60. help
  61. Try to allocate memories of WiFi and LWIP in SPIRAM firstly. If failed, try to allocate internal
  62. memory then.
  63. config SPIRAM_MALLOC_RESERVE_INTERNAL
  64. int "Reserve this amount of bytes for data that specifically needs to be in DMA or internal memory"
  65. depends on SPIRAM_USE_MALLOC
  66. default 32768
  67. range 0 262144
  68. help
  69. Because the external/internal RAM allocation strategy is not always perfect, it sometimes may happen
  70. that the internal memory is entirely filled up. This causes allocations that are specifically done in
  71. internal memory, for example the stack for new tasks or memory to service DMA or have memory that's
  72. also available when SPI cache is down, to fail. This option reserves a pool specifically for requests
  73. like that; the memory in this pool is not given out when a normal malloc() is called.
  74. Set this to 0 to disable this feature.
  75. Note that because FreeRTOS stacks are forced to internal memory, they will also use this memory pool;
  76. be sure to keep this in mind when adjusting this value.
  77. Note also that the DMA reserved pool may not be one single contiguous memory region, depending on the
  78. configured size and the static memory usage of the app.
  79. config SPIRAM_ALLOW_BSS_SEG_EXTERNAL_MEMORY
  80. bool "Allow .bss segment placed in external memory"
  81. default n
  82. depends on SPIRAM
  83. help
  84. If enabled the option,and add EXT_RAM_ATTR defined your variable,then your variable will be placed in
  85. PSRAM instead of internal memory, and placed most of variables of lwip,net802.11,pp,bluedroid library
  86. to external memory defaultly.