mirror of
https://github.com/espressif/esp-idf.git
synced 2025-08-08 04:02:27 +00:00
bugfix(psram): fix psram size acquisition method
1. Use BIT[7:5] of EID to determine psram size 2. Add ID support for 16Mbit psram 3. Remove module reset on SPI1 4. Confirmed with the vendor that only the old 32Mbit psram need special clock timing. For other psram chips, we should use standard QPI mode.
This commit is contained in:

committed by
Wangjialin

parent
81231fcc4b
commit
a0beff99d2
@@ -131,6 +131,8 @@ esp_spiram_size_t esp_spiram_get_chip_size()
|
||||
}
|
||||
psram_size_t psram_size = psram_get_size();
|
||||
switch (psram_size) {
|
||||
case PSRAM_SIZE_16MBITS:
|
||||
return ESP_SPIRAM_SIZE_16MBITS;
|
||||
case PSRAM_SIZE_32MBITS:
|
||||
return ESP_SPIRAM_SIZE_32MBITS;
|
||||
case PSRAM_SIZE_64MBITS:
|
||||
@@ -214,6 +216,7 @@ esp_err_t esp_spiram_reserve_dma_pool(size_t size) {
|
||||
size_t esp_spiram_get_size()
|
||||
{
|
||||
psram_size_t size=esp_spiram_get_chip_size();
|
||||
if (size==PSRAM_SIZE_16MBITS) return 2*1024*1024;
|
||||
if (size==PSRAM_SIZE_32MBITS) return 4*1024*1024;
|
||||
if (size==PSRAM_SIZE_64MBITS) return 8*1024*1024;
|
||||
return CONFIG_SPIRAM_SIZE;
|
||||
|
Reference in New Issue
Block a user