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