psram: make SPIRAM_ALLOW_STACK_EXTERNAL_MEMORY configurable on S2 and S3

SPIRAM_ALLOW_STACK_EXTERNAL_MEMORY was always enabled on S2 and S3, but this option is not
compatible with ESP_COREDUMP_ENABLE_TO_FLASH. Make it configurable to allow users to deactive
it so that ESP_COREDUMP_ENABLE_TO_FLASH can be used.
pull/9408/head
Marius Vikhammer 2022-07-06 11:17:40 +08:00
rodzic c017f006cd
commit 342f4f315c
4 zmienionych plików z 24 dodań i 24 usunięć

Wyświetl plik

@ -8,10 +8,6 @@ config SPIRAM
menu "SPI RAM config"
depends on SPIRAM
config SPIRAM_ALLOW_STACK_EXTERNAL_MEMORY
bool
default "y"
config SPIRAM_MODE_QUAD
bool
default "y"
@ -33,6 +29,17 @@ menu "SPI RAM config"
bool "ESP-PSRAM64 or LY68L6400"
endchoice
config SPIRAM_ALLOW_STACK_EXTERNAL_MEMORY
bool "Allow external memory as an argument to xTaskCreateStatic"
default y
help
Accessing memory in SPIRAM has certain restrictions, so task stacks allocated by xTaskCreate
are by default allocated from internal RAM.
This option allows for passing memory allocated from SPIRAM to be passed to xTaskCreateStatic.
This should only be used for tasks where the stack is never accessed while the cache is disabled.
Cannot be used together with ESP_COREDUMP_ENABLE_TO_FLASH.
menu "PSRAM clock and cs IO for ESP32S2"
depends on SPIRAM
config DEFAULT_PSRAM_CLK_IO

Wyświetl plik

@ -8,10 +8,6 @@ config SPIRAM
menu "SPI RAM config"
depends on SPIRAM
config SPIRAM_ALLOW_STACK_EXTERNAL_MEMORY
bool
default "y"
choice SPIRAM_MODE
prompt "Mode (QUAD/OCT) of SPI RAM chip in use"
default SPIRAM_MODE_QUAD
@ -42,6 +38,17 @@ menu "SPI RAM config"
bool "ESP-PSRAM64 , LY68L6400 or APS6408"
endchoice
config SPIRAM_ALLOW_STACK_EXTERNAL_MEMORY
bool "Allow external memory as an argument to xTaskCreateStatic"
default y
help
Accessing memory in SPIRAM has certain restrictions, so task stacks allocated by xTaskCreate
are by default allocated from internal RAM.
This option allows for passing memory allocated from SPIRAM to be passed to xTaskCreateStatic.
This should only be used for tasks where the stack is never accessed while the cache is disabled.
Cannot be used together with ESP_COREDUMP_ENABLE_TO_FLASH.
menu "PSRAM Clock and CS IO for ESP32S3"
depends on SPIRAM
config DEFAULT_PSRAM_CLK_IO

Wyświetl plik

@ -139,14 +139,7 @@ External RAM use has the following restrictions:
* In general, external RAM will not be used as task stack memory. :cpp:func:`xTaskCreate` and similar functions will always allocate internal memory for stack and task TCBs.
.. only:: esp32
The option :ref:`CONFIG_SPIRAM_ALLOW_STACK_EXTERNAL_MEMORY` can be used to place task stacks into external memory. In these cases :cpp:func:`xTaskCreateStatic` must be used to specify a task stack buffer allocated from external memory, otherwise task stacks will still be allocated from internal memory.
.. only:: not esp32
:cpp:func:`xTaskCreateStatic` can be used to explicitly place task stacks into external memory.
The option :ref:`CONFIG_SPIRAM_ALLOW_STACK_EXTERNAL_MEMORY` can be used to allow placing task stacks into external memory. In these cases :cpp:func:`xTaskCreateStatic` must be used to specify a task stack buffer allocated from external memory, otherwise task stacks will still be allocated from internal memory.
Failure to initialize

Wyświetl plik

@ -139,15 +139,8 @@ ESP-IDF 启动过程中,片外 RAM 被映射到以 {IDF_TARGET_PSRAM_ADDR_STAR
* 一般来说,片外 RAM 不会用作任务堆栈存储器。:cpp:func:`xTaskCreate` 及类似函数始终会为堆栈和任务 TCB 分配片上储存器。
.. only:: esp32
可以使用 :ref:`CONFIG_SPIRAM_ALLOW_STACK_EXTERNAL_MEMORY` 选项将任务堆栈放入片外存储器。这时,必须使用 :cpp:func:`xTaskCreateStatic` 指定从片外存储器分配的任务堆栈缓冲区,否则任务堆栈将会从片上存储器分配。
.. only:: not esp32
可以使用 :cpp:func:`xTaskCreateStatic` 显式地将任务堆栈放入片外存储器。
可以使用 :ref:`CONFIG_SPIRAM_ALLOW_STACK_EXTERNAL_MEMORY` 选项将任务堆栈放入片外存储器。这时,必须使用 :cpp:func:`xTaskCreateStatic` 指定从片外存储器分配的任务堆栈缓冲区,否则任务堆栈将会从片上存储器分配。
初始化失败
=====================