mirror of
https://github.com/espressif/esp-idf.git
synced 2026-06-11 11:42:39 +02:00
esp32: support to use hspi to output clock for 4MB PSRAM
Resolves https://github.com/espressif/esp-idf/issues/2128.
This commit is contained in:
+85
-70
@@ -24,7 +24,7 @@ config SPIRAM_SUPPORT
|
||||
bool "Support for external, SPI-connected RAM"
|
||||
default "n"
|
||||
help
|
||||
This enables support for an external SPI RAM chip, connected in parallel with the
|
||||
This enables support for an external SPI RAM chip, connected in parallel with the
|
||||
main SPI flash chip.
|
||||
|
||||
menu "SPI RAM config"
|
||||
@@ -98,9 +98,10 @@ choice SPIRAM_SPEED
|
||||
2. Flash SPI running at 80Mhz and RAM SPI running at 40Mhz
|
||||
3. Flash SPI running at 80Mhz and RAM SPI running at 80Mhz
|
||||
|
||||
Note: If the third mode(80Mhz+80Mhz) is enabled, the VSPI port will be occupied by the system.
|
||||
Application code should never touch VSPI hardware in this case. The option to select
|
||||
80MHz will only be visible if the flash SPI speed is also 80MHz. (ESPTOOLPY_FLASHFREQ_80M is true)
|
||||
Note: If the third mode(80Mhz+80Mhz) is enabled for SPI RAM of type 32MBit, one of the HSPI/VSPI host will
|
||||
be occupied by the system. Which SPI host to use can be selected by the config item SPIRAM_OCCUPY_SPI_HOST.
|
||||
Application code should never touch HSPI/VSPI hardware in this case. The option to select
|
||||
80MHz will only be visible if the flash SPI speed is also 80MHz. (ESPTOOLPY_FLASHFREQ_80M is true)
|
||||
|
||||
config SPIRAM_SPEED_40M
|
||||
bool "40MHz clock speed"
|
||||
@@ -125,7 +126,7 @@ config SPIRAM_CACHE_WORKAROUND
|
||||
Revision 1 of the ESP32 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.
|
||||
|
||||
|
||||
This will also not use any bits of newlib that are located in ROM, opting for a version that is compiled
|
||||
with the workaround and located in flash instead.
|
||||
|
||||
@@ -146,9 +147,9 @@ config SPIRAM_BANKSWITCH_RESERVE
|
||||
default 8
|
||||
range 1 62
|
||||
help
|
||||
Select the amount of banks reserved for bank switching. Note that the amount of RAM allocatable with
|
||||
Select the amount of banks reserved for bank switching. Note that the amount of RAM allocatable with
|
||||
malloc/esp_heap_alloc_caps will decrease by 32K for each page reserved here.
|
||||
|
||||
|
||||
Note that this reservation is only actually done if your program actually uses the himem API. Without
|
||||
any himem calls, the reservation is not done and the original amount of memory will be available
|
||||
to malloc/esp_heap_alloc_caps.
|
||||
@@ -163,7 +164,7 @@ config SPIRAM_MALLOC_ALWAYSINTERNAL
|
||||
than this size in internal memory, while allocations larger than this will be done from external RAM.
|
||||
If allocation from the preferred region fails, an attempt is made to allocate from the non-preferred
|
||||
region instead, so malloc() will not suddenly fail when either internal or external memory is full.
|
||||
|
||||
|
||||
config WIFI_LWIP_ALLOCATION_FROM_SPIRAM_FIRST
|
||||
bool "Try to allocate memories of WiFi and LWIP in SPIRAM firstly. If failed, allocate internal memory"
|
||||
depends on SPIRAM_USE_CAPS_ALLOC || SPIRAM_USE_MALLOC
|
||||
@@ -179,12 +180,12 @@ config SPIRAM_MALLOC_RESERVE_INTERNAL
|
||||
help
|
||||
Because the external/internal RAM allocation strategy is not always perfect, it sometimes may happen
|
||||
that the internal memory is entirely filled up. This causes allocations that are specifically done in
|
||||
internal memory, for example the stack for new tasks or memory to service DMA or have memory that's
|
||||
also available when SPI cache is down, to fail. This option reserves a pool specifically for requests
|
||||
internal memory, for example the stack for new tasks or memory to service DMA or have memory that's
|
||||
also available when SPI cache is down, to fail. This option reserves a pool specifically for requests
|
||||
like that; the memory in this pool is not given out when a normal malloc() is called.
|
||||
|
||||
|
||||
Set this to 0 to disable this feature.
|
||||
|
||||
|
||||
Note that because FreeRTOS stacks are forced to internal memory, they will also use this memory pool;
|
||||
be sure to keep this in mind when adjusting this value.
|
||||
|
||||
@@ -211,7 +212,21 @@ config SPIRAM_ALLOW_BSS_SEG_EXTERNAL_MEMORY
|
||||
help
|
||||
If enabled the option,and add EXT_RAM_ATTR defined your variable,then your variable will be placed
|
||||
in PSRAM instead of internal memory, and placed most of variables of lwip,net802.11,pp,bluedroid library
|
||||
to external memory defaultly.
|
||||
to external memory defaultly.
|
||||
|
||||
choice SPIRAM_OCCUPY_SPI_HOST
|
||||
prompt "SPI host to use for 32MBit PSRAM"
|
||||
default SPIRAM_OCCUPY_VSPI_HOST
|
||||
depends on SPIRAM_SPEED_80M
|
||||
help
|
||||
When both flash and PSRAM is working under 80MHz, and the PSRAM is of type 32MBit, one of the HSPI/VSPI
|
||||
host will be used to output the clock. Select which one to use here.
|
||||
|
||||
config SPIRAM_OCCUPY_HSPI_HOST
|
||||
bool "HSPI host (SPI2)"
|
||||
config SPIRAM_OCCUPY_VSPI_HOST
|
||||
bool "VSPI host (SPI3)"
|
||||
endchoice
|
||||
|
||||
endmenu
|
||||
|
||||
@@ -257,8 +272,8 @@ choice ESP32_COREDUMP_TO_FLASH_OR_UART
|
||||
help
|
||||
Select place to store core dump: flash, uart or none (to disable core dumps generation).
|
||||
|
||||
If core dump is configured to be stored in flash and custom partition table is used add
|
||||
corresponding entry to your CSV. For examples, please see predefined partition table CSV descriptions
|
||||
If core dump is configured to be stored in flash and custom partition table is used add
|
||||
corresponding entry to your CSV. For examples, please see predefined partition table CSV descriptions
|
||||
in the components/partition_table directory.
|
||||
|
||||
config ESP32_ENABLE_COREDUMP_TO_FLASH
|
||||
@@ -297,18 +312,18 @@ choice NUMBER_OF_UNIVERSAL_MAC_ADDRESS
|
||||
default FOUR_UNIVERSAL_MAC_ADDRESS
|
||||
help
|
||||
Configure the number of universally administered (by IEEE) MAC addresses.
|
||||
During initialisation, MAC addresses for each network interface are generated or derived from a
|
||||
During initialisation, MAC addresses for each network interface are generated or derived from a
|
||||
single base MAC address.
|
||||
If the number of universal MAC addresses is four, all four interfaces (WiFi station, WiFi softap,
|
||||
Bluetooth and Ethernet) receive a universally administered MAC address. These are generated
|
||||
If the number of universal MAC addresses is four, all four interfaces (WiFi station, WiFi softap,
|
||||
Bluetooth and Ethernet) receive a universally administered MAC address. These are generated
|
||||
sequentially by adding 0, 1, 2 and 3 (respectively) to the final octet of the base MAC address.
|
||||
If the number of universal MAC addresses is two, only two interfaces (WiFi station and Bluetooth)
|
||||
receive a universally administered MAC address. These are generated sequentially by adding 0
|
||||
and 1 (respectively) to the base MAC address. The remaining two interfaces (WiFi softap and Ethernet)
|
||||
receive local MAC addresses. These are derived from the universal WiFi station and Bluetooth MAC
|
||||
If the number of universal MAC addresses is two, only two interfaces (WiFi station and Bluetooth)
|
||||
receive a universally administered MAC address. These are generated sequentially by adding 0
|
||||
and 1 (respectively) to the base MAC address. The remaining two interfaces (WiFi softap and Ethernet)
|
||||
receive local MAC addresses. These are derived from the universal WiFi station and Bluetooth MAC
|
||||
addresses, respectively.
|
||||
When using the default (Espressif-assigned) base MAC address, either setting can be used. When using
|
||||
a custom universal MAC address range, the correct setting will depend on the allocation of MAC
|
||||
When using the default (Espressif-assigned) base MAC address, either setting can be used. When using
|
||||
a custom universal MAC address range, the correct setting will depend on the allocation of MAC
|
||||
addresses in this range (either 2 or 4 per device.)
|
||||
|
||||
config TWO_UNIVERSAL_MAC_ADDRESS
|
||||
@@ -318,7 +333,7 @@ config FOUR_UNIVERSAL_MAC_ADDRESS
|
||||
endchoice
|
||||
|
||||
config NUMBER_OF_UNIVERSAL_MAC_ADDRESS
|
||||
int
|
||||
int
|
||||
default 2 if TWO_UNIVERSAL_MAC_ADDRESS
|
||||
default 4 if FOUR_UNIVERSAL_MAC_ADDRESS
|
||||
|
||||
@@ -366,10 +381,10 @@ config TIMER_TASK_STACK_SIZE
|
||||
to dispatch callbacks of timers created using ets_timer and esp_timer
|
||||
APIs. If you are seing stack overflow errors in timer task, increase
|
||||
this value.
|
||||
|
||||
|
||||
Note that this is not the same as FreeRTOS timer task. To configure
|
||||
FreeRTOS timer task size, see "FreeRTOS timer task stack size" option
|
||||
in "FreeRTOS" menu.
|
||||
in "FreeRTOS" menu.
|
||||
|
||||
choice NEWLIB_STDOUT_LINE_ENDING
|
||||
prompt "Line ending for UART output"
|
||||
@@ -378,15 +393,15 @@ choice NEWLIB_STDOUT_LINE_ENDING
|
||||
This option allows configuring the desired line endings sent to UART
|
||||
when a newline ('\n', LF) appears on stdout.
|
||||
Three options are possible:
|
||||
|
||||
|
||||
CRLF: whenever LF is encountered, prepend it with CR
|
||||
|
||||
|
||||
LF: no modification is applied, stdout is sent as is
|
||||
|
||||
|
||||
CR: each occurence of LF is replaced with CR
|
||||
|
||||
|
||||
This option doesn't affect behavior of the UART driver (drivers/uart.h).
|
||||
|
||||
|
||||
config NEWLIB_STDOUT_LINE_ENDING_CRLF
|
||||
bool "CRLF"
|
||||
config NEWLIB_STDOUT_LINE_ENDING_LF
|
||||
@@ -402,15 +417,15 @@ choice NEWLIB_STDIN_LINE_ENDING
|
||||
This option allows configuring which input sequence on UART produces
|
||||
a newline ('\n', LF) on stdin.
|
||||
Three options are possible:
|
||||
|
||||
|
||||
CRLF: CRLF is converted to LF
|
||||
|
||||
|
||||
LF: no modification is applied, input is sent to stdin as is
|
||||
|
||||
|
||||
CR: each occurence of CR is replaced with LF
|
||||
|
||||
|
||||
This option doesn't affect behavior of the UART driver (drivers/uart.h).
|
||||
|
||||
|
||||
config NEWLIB_STDIN_LINE_ENDING_CRLF
|
||||
bool "CRLF"
|
||||
config NEWLIB_STDIN_LINE_ENDING_LF
|
||||
@@ -445,7 +460,7 @@ choice CONSOLE_UART
|
||||
default CONSOLE_UART_DEFAULT
|
||||
help
|
||||
Select whether to use UART for console output (through stdout and stderr).
|
||||
|
||||
|
||||
- Default is to use UART0 on pins GPIO1(TX) and GPIO3(RX).
|
||||
- If "Custom" is selected, UART0 or UART1 can be chosen,
|
||||
and any pins can be selected.
|
||||
@@ -559,10 +574,10 @@ config ESP32_DEBUG_OCDAWARE
|
||||
|
||||
config ESP32_DEBUG_STUBS_ENABLE
|
||||
bool "OpenOCD debug stubs"
|
||||
default OPTIMIZATION_LEVEL_DEBUG
|
||||
default OPTIMIZATION_LEVEL_DEBUG
|
||||
depends on !ESP32_TRAX
|
||||
help
|
||||
Debug stubs are used by OpenOCD to execute pre-compiled onboard code which does some useful debugging,
|
||||
Debug stubs are used by OpenOCD to execute pre-compiled onboard code which does some useful debugging,
|
||||
e.g. GCOV data dump.
|
||||
|
||||
config INT_WDT
|
||||
@@ -596,7 +611,7 @@ config TASK_WDT
|
||||
help
|
||||
The Task Watchdog Timer can be used to make sure individual tasks are still
|
||||
running. Enabling this option will cause the Task Watchdog Timer to be
|
||||
initialized automatically at startup. The Task Watchdog timer can be
|
||||
initialized automatically at startup. The Task Watchdog timer can be
|
||||
initialized after startup as well (see Task Watchdog Timer API Reference)
|
||||
|
||||
config TASK_WDT_PANIC
|
||||
@@ -710,7 +725,7 @@ choice ESP32_TIME_SYSCALL
|
||||
continue in deep sleep. Time will be reported at 1 microsecond
|
||||
resolution. This is the default, and the recommended option.
|
||||
- If only high-resolution timer is used, gettimeofday will
|
||||
provide time at microsecond resolution.
|
||||
provide time at microsecond resolution.
|
||||
Time will not be preserved when going into deep sleep mode.
|
||||
- If only RTC timer is used, timekeeping will continue in
|
||||
deep sleep, but time will be measured at 6.(6) microsecond
|
||||
@@ -736,7 +751,7 @@ choice ESP32_RTC_CLOCK_SOURCE
|
||||
default ESP32_RTC_CLOCK_SOURCE_INTERNAL_RC
|
||||
help
|
||||
Choose which clock is used as RTC clock source.
|
||||
|
||||
|
||||
- "Internal 150kHz oscillator" option provides lowest deep sleep current
|
||||
consumption, and does not require extra external components. However
|
||||
frequency stability with respect to temperature is poor, so time may
|
||||
@@ -752,7 +767,7 @@ choice ESP32_RTC_CLOCK_SOURCE
|
||||
ground. 32K_XN pin can not be used as a GPIO in this case.
|
||||
- "Internal 8.5MHz oscillator divided by 256" option results in higher
|
||||
deep sleep current (by 5uA) but has better frequency stability than
|
||||
the internal 150kHz oscillator. It does not require external components.
|
||||
the internal 150kHz oscillator. It does not require external components.
|
||||
|
||||
config ESP32_RTC_CLOCK_SOURCE_INTERNAL_RC
|
||||
bool "Internal 150kHz RC oscillator"
|
||||
@@ -777,7 +792,7 @@ config ESP32_RTC_CLK_CAL_CYCLES
|
||||
by the calibration routine. Higher numbers increase calibration
|
||||
precision, which may be important for applications which spend a lot of
|
||||
time in deep sleep. Lower numbers reduce startup time.
|
||||
|
||||
|
||||
When this option is set to 0, clock calibration will not be performed at
|
||||
startup, and approximate clock frequencies will be assumed:
|
||||
|
||||
@@ -792,15 +807,15 @@ config ESP32_RTC_XTAL_BOOTSTRAP_CYCLES
|
||||
default 5
|
||||
range 0 32768
|
||||
help
|
||||
To reduce the startup time of an external RTC crystal,
|
||||
we bootstrap it with a 32kHz square wave for a fixed number of cycles.
|
||||
Setting 0 will disable bootstrapping (if disabled, the crystal may take
|
||||
To reduce the startup time of an external RTC crystal,
|
||||
we bootstrap it with a 32kHz square wave for a fixed number of cycles.
|
||||
Setting 0 will disable bootstrapping (if disabled, the crystal may take
|
||||
longer to start up or fail to oscillate under some conditions).
|
||||
|
||||
If this value is too high, a faulty crystal may initially start and then fail.
|
||||
|
||||
If this value is too high, a faulty crystal may initially start and then fail.
|
||||
If this value is too low, an otherwise good crystal may not start.
|
||||
|
||||
To accurately determine if the crystal has started,
|
||||
|
||||
To accurately determine if the crystal has started,
|
||||
set a larger "Number of cycles for RTC_SLOW_CLK calibration" (about 3000).
|
||||
|
||||
config ESP32_DEEP_SLEEP_WAKEUP_DELAY
|
||||
@@ -814,9 +829,9 @@ config ESP32_DEEP_SLEEP_WAKEUP_DELAY
|
||||
time to pass between power on and first read operation. By default,
|
||||
without any extra delay, this time is approximately 900us, although
|
||||
some flash chip types need more than that.
|
||||
|
||||
|
||||
By default extra delay is set to 2000us. When optimizing startup time
|
||||
for applications which require it, this value may be reduced.
|
||||
for applications which require it, this value may be reduced.
|
||||
|
||||
If you are seeing "flash read err, 1000" message printed to the
|
||||
console after deep sleep reset, try increasing this value.
|
||||
@@ -915,7 +930,7 @@ config ESP32_RTCDATA_IN_FAST_MEM
|
||||
help
|
||||
This option allows to place .rtc_data and .rtc_rodata sections into
|
||||
RTC fast memory segment to free the slow memory region for ULP programs.
|
||||
This option depends on the CONFIG_FREERTOS_UNICORE option because RTC fast memory
|
||||
This option depends on the CONFIG_FREERTOS_UNICORE option because RTC fast memory
|
||||
can be accessed only by PRO_CPU core.
|
||||
|
||||
endmenu # ESP32-Specific
|
||||
@@ -1052,8 +1067,8 @@ config ESP32_WIFI_CSI_ENABLED
|
||||
bool "WiFi CSI(Channel State Information)"
|
||||
default n
|
||||
help
|
||||
Select this option to enable CSI(Channel State Information) feature. CSI takes about
|
||||
CONFIG_ESP32_WIFI_STATIC_RX_BUFFER_NUM KB of RAM. If CSI is not used, it is better to disable
|
||||
Select this option to enable CSI(Channel State Information) feature. CSI takes about
|
||||
CONFIG_ESP32_WIFI_STATIC_RX_BUFFER_NUM KB of RAM. If CSI is not used, it is better to disable
|
||||
this feature in order to save memory.
|
||||
|
||||
config ESP32_WIFI_AMPDU_TX_ENABLED
|
||||
@@ -1070,7 +1085,7 @@ config ESP32_WIFI_TX_BA_WIN
|
||||
default 6
|
||||
help
|
||||
Set the size of WiFi Block Ack TX window. Generally a bigger value means higher throughput but
|
||||
more memory. Most of time we should NOT change the default value unless special reason, e.g.
|
||||
more memory. Most of time we should NOT change the default value unless special reason, e.g.
|
||||
test the maximum UDP TX throughput with iperf etc. For iperf test in shieldbox, the recommended
|
||||
value is 9~12.
|
||||
|
||||
@@ -1086,8 +1101,8 @@ config ESP32_WIFI_RX_BA_WIN
|
||||
range 2 32
|
||||
default 6
|
||||
help
|
||||
Set the size of WiFi Block Ack RX window. Generally a bigger value means higher throughput but
|
||||
more memory. Most of time we should NOT change the default value unless special reason, e.g.
|
||||
Set the size of WiFi Block Ack RX window. Generally a bigger value means higher throughput but
|
||||
more memory. Most of time we should NOT change the default value unless special reason, e.g.
|
||||
test the maximum UDP RX throughput with iperf etc. For iperf test in shieldbox, the recommended
|
||||
value is 9~12.
|
||||
|
||||
@@ -1118,17 +1133,17 @@ config ESP32_WIFI_SOFTAP_BEACON_MAX_LEN
|
||||
ESP-MESH utilizes beacon frames to detect and resolve root node conflicts (see documentation). However the default
|
||||
length of a beacon frame can simultaneously hold only five root node identifier structures, meaning that a root node
|
||||
conflict of up to five nodes can be detected at one time. In the occurence of more root nodes conflict involving more
|
||||
than five root nodes, the conflict resolution process will detect five of the root nodes, resolve the conflict, and
|
||||
than five root nodes, the conflict resolution process will detect five of the root nodes, resolve the conflict, and
|
||||
re-detect more root nodes. This process will repeat until all root node conflicts are resolved. However this process
|
||||
can generally take a very long time.
|
||||
|
||||
|
||||
To counter this situation, the beacon frame length can be increased such that more root nodes can be detected simultaneously.
|
||||
Each additional root node will require 36 bytes and should be added ontop of the default beacon frame length of
|
||||
752 bytes. For example, if you want to detect 10 root nodes simultaneously, you need to set the beacon frame length as
|
||||
752 bytes. For example, if you want to detect 10 root nodes simultaneously, you need to set the beacon frame length as
|
||||
932 (752+36*5).
|
||||
|
||||
|
||||
Setting a longer beacon length also assists with debugging as the conflicting root nodes can be identified more quickly.
|
||||
|
||||
|
||||
endmenu # Wi-Fi
|
||||
|
||||
menu PHY
|
||||
@@ -1139,7 +1154,7 @@ config ESP32_PHY_CALIBRATION_AND_DATA_STORAGE
|
||||
help
|
||||
If this option is enabled, NVS will be initialized and calibration data will be loaded from there.
|
||||
PHY calibration will be skipped on deep sleep wakeup. If calibration data is not found, full calibration
|
||||
will be performed and stored in NVS. Normally, only partial calibration will be performed.
|
||||
will be performed and stored in NVS. Normally, only partial calibration will be performed.
|
||||
If this option is disabled, full calibration will be performed.
|
||||
|
||||
If it's easy that your board calibrate bad data, choose 'n'.
|
||||
@@ -1163,7 +1178,7 @@ config ESP32_PHY_INIT_DATA_IN_PARTITION
|
||||
into the application binary.
|
||||
|
||||
If unsure, choose 'n'.
|
||||
|
||||
|
||||
config ESP32_PHY_MAX_WIFI_TX_POWER
|
||||
int "Max WiFi TX power (dBm)"
|
||||
range 0 20
|
||||
@@ -1189,7 +1204,7 @@ config PM_ENABLE
|
||||
This option has run-time overhead (increased interrupt latency,
|
||||
longer time to enter idle state), and it also reduces accuracy of
|
||||
RTOS ticks and timers used for timekeeping.
|
||||
Enable this option if application uses power management APIs.
|
||||
Enable this option if application uses power management APIs.
|
||||
|
||||
config PM_DFS_INIT_AUTO
|
||||
bool "Enable dynamic frequency scaling (DFS) at startup"
|
||||
@@ -1226,7 +1241,7 @@ config PM_PROFILING
|
||||
This feature can be used to analyze which locks are preventing the chip
|
||||
from going into a lower power state, and see what time the chip spends
|
||||
in each power saving mode. This feature does incur some run-time
|
||||
overhead, so should typically be disabled in production builds.
|
||||
overhead, so should typically be disabled in production builds.
|
||||
|
||||
config PM_TRACE
|
||||
bool "Enable debug tracing of PM using GPIOs"
|
||||
@@ -1239,6 +1254,6 @@ config PM_TRACE
|
||||
This feature is intended to be used when analyzing/debugging behavior
|
||||
of power management implementation, and should be kept disabled in
|
||||
applications.
|
||||
|
||||
|
||||
|
||||
endmenu # "Power Management"
|
||||
|
||||
Reference in New Issue
Block a user