Add option to enable compiler psram workaround. Needs custom crosstool.
This commit is contained in:
parent
378216e594
commit
5e934ebba0
3 changed files with 14 additions and 1 deletions
|
@ -108,6 +108,14 @@ config MEMMAP_SPIRAM_ENABLE
|
|||
|
||||
if MEMMAP_SPIRAM_ENABLE
|
||||
|
||||
config SPIRAM_CACHE_WORKAROUND
|
||||
bool "Enable workaround for bug in SPI RAM cache for V1 silicon"
|
||||
default "y"
|
||||
help
|
||||
V1 ESP32 silicon has a bug that can cause a write to PSRAM not to take place in some situations
|
||||
when the cache line needs to be fetched from external RAM and an interrupt occurs. This enables a
|
||||
fix in the compiler that makes sure the specific code that is vulnerable to this will not be emitted.
|
||||
|
||||
choice MEMMAP_SPIRAM_TYPE
|
||||
prompt "Type of SPI RAM chip in use"
|
||||
default MEMMAP_SPIRAM_TYPE_ESPPSRAM32
|
||||
|
|
|
@ -92,7 +92,7 @@ static const char* TAG = "cpu_start";
|
|||
#if CONFIG_FREERTOS_UNICORE
|
||||
#define PSRAM_MODE PSRAM_VADDR_MODE_NORMAL
|
||||
#else
|
||||
#define PSRAM_MODE PSRAM_VADDR_MODE_LOWHIGH
|
||||
#define PSRAM_MODE PSRAM_VADDR_MODE_EVENODD
|
||||
#endif
|
||||
|
||||
/*
|
||||
|
|
|
@ -239,6 +239,11 @@ else
|
|||
OPTIMIZATION_FLAGS = -Og
|
||||
endif
|
||||
|
||||
# Enable psram cache bug workaround in compiler if selected
|
||||
ifeq ("$(CONFIG_SPIRAM_CACHE_WORKAROUND)", "y")
|
||||
COMMON_FLAGS+=-mfix-esp32-psram-cache-issue
|
||||
endif
|
||||
|
||||
# Enable generation of debugging symbols
|
||||
# (we generate even in Release mode, as this has no impact on final binary size.)
|
||||
DEBUG_FLAGS ?= -ggdb
|
||||
|
|
Loading…
Reference in a new issue