Files
esphome-yambms/pvbrain2/base/device_psram_settings.yaml
T
2024-10-07 18:25:33 +02:00

34 lines
2.3 KiB
YAML

# Updated : 2024.08.28
# Version : 1.1.1
# GitHub : https://github.com/Sleeper85/esphome-yambms
# This file optimizes the use of the ESP32-S3 PSRAM by authorizing or
# forcing certain data to be written to the PSRAM rather than to the
# internal RAM.
# The configuration presented here already seems stable for several
# users and visibly offers better behavior of the esp when it contains
# a lot of entities.
esphome:
platformio_options:
build_flags: "-DBOARD_HAS_PSRAM"
board_build.arduino.memory_type: opi_opi # qio_opi
esp32:
framework:
sdkconfig_options:
COMPILER_OPTIMIZATION_SIZE: y
CONFIG_COMPILER_OPTIMIZATION_PERF: y
CONFIG_SPIRAM_SUPPORT: y
CONFIG_SPIRAM_USE_MALLOC: y # fully integrating it making malloc() also able to return SPI RAM pointers.
CONFIG_SPIRAM_ALLOW_BSS_SEG_EXTERNAL_MEMORY: y
CONFIG_SPIRAM_ALLOW_NOINIT_SEG_EXTERNAL_MEMORY: y # Allow .noinit segment placed in external memory
CONFIG_SPIRAM_ALLOW_STACK_EXTERNAL_MEMORY: y # Allow external memory as an argument to xTaskCreateStatic
CONFIG_SPIRAM_TRY_ALLOCATE_WIFI_LWIP: y # Try to allocate memories of WiFi and LWIP in SPIRAM firstly. If failed, allocate internal memory
CONFIG_BT_NIMBLE_MEM_ALLOC_MODE_EXTERNAL: y # Allocation strategy for NimBLE host stack, essentially provides ability to allocate all required dynamic allocations
CONFIG_BLE_MESH_MEM_ALLOC_MODE_EXTERNAL: y # Allocation strategy for BLE Mesh stack, essentially provides ability to allocate all required dynamic allocations
CONFIG_BLE_MESH_FREERTOS_STATIC_ALLOC_EXTERNAL: y # Choose the memory to be used for FreeRTOS objects.
CONFIG_FATFS_ALLOC_PREFER_EXTRAM: y # Prefer external RAM when allocating FATFS buffers
CONFIG_MBEDTLS_EXTERNAL_MEM_ALLOC: y # Allocation strategy for mbedTLS, essentially provides ability to allocate all required dynamic allocations
CONFIG_SPIRAM_MALLOC_RESERVE_INTERNAL: "131072" # Reserve this amount of bytes for data that specifically needs to be in DMA or internal memory. Default value: 32768
CONFIG_SPIRAM_MALLOC_ALWAYSINTERNAL: "8096" # Maximum malloc() size, in bytes, to always put in internal memory. Default value: 16384