[已解决]ESP32-S3R2 如何配置开启PSRAM? 我开启PSRAM后 报错:找不到PSRAM芯片

yaochuanfu
Posts: 12
Joined: Mon Mar 04, 2024 9:06 am

[已解决]ESP32-S3R2 如何配置开启PSRAM? 我开启PSRAM后 报错:找不到PSRAM芯片

Postby yaochuanfu » Mon Mar 04, 2024 9:24 am

如题 ,esp-idf V4.4.6 ESP32-S3R2 配置开启PSRAM后,编译运行代码输出异常:

E (327) psram: PSRAM ID read error: 0x00ffffff, PSRAM chip not found or not supported, or wrong PSRAM line mode
E (330) spiram: SPI RAM enabled but initialization failed. Bailing out.
I (337) cpu_start: Failed to init external RAM; continuing without it.
PSRAM的配置如下所示,这个配置是什么地方有异常?
该如何正确配置才能启用PSRAM?
  1.  
  2. CONFIG_ESP32S3_SPIRAM_SUPPORT=y
  3.  
  4. #
  5. # SPI RAM config
  6. #
  7. CONFIG_SPIRAM_MODE_QUAD=y
  8. # CONFIG_SPIRAM_MODE_OCT is not set
  9. CONFIG_SPIRAM_TYPE_AUTO=y
  10. # CONFIG_SPIRAM_TYPE_ESPPSRAM16 is not set
  11. # CONFIG_SPIRAM_TYPE_ESPPSRAM32 is not set
  12. # CONFIG_SPIRAM_TYPE_ESPPSRAM64 is not set
  13. CONFIG_SPIRAM_SIZE=-1
  14. CONFIG_SPIRAM_CLK_IO=30
  15. CONFIG_SPIRAM_CS_IO=26
  16. # CONFIG_SPIRAM_FETCH_INSTRUCTIONS is not set
  17. # CONFIG_SPIRAM_RODATA is not set
  18. # CONFIG_SPIRAM_ALLOW_STACK_EXTERNAL_MEMORY is not set
  19. # CONFIG_SPIRAM_SPEED_120M is not set
  20. CONFIG_SPIRAM_SPEED_80M=y
  21. # CONFIG_SPIRAM_SPEED_40M is not set
  22. CONFIG_SPIRAM=y
  23. CONFIG_SPIRAM_BOOT_INIT=y
  24. CONFIG_SPIRAM_IGNORE_NOTFOUND=y
  25. # CONFIG_SPIRAM_USE_MEMMAP is not set
  26. # CONFIG_SPIRAM_USE_CAPS_ALLOC is not set
  27. CONFIG_SPIRAM_USE_MALLOC=y
  28. CONFIG_SPIRAM_MEMTEST=y
  29. CONFIG_SPIRAM_MALLOC_ALWAYSINTERNAL=16384
  30. # CONFIG_SPIRAM_TRY_ALLOCATE_WIFI_LWIP is not set
  31. CONFIG_SPIRAM_MALLOC_RESERVE_INTERNAL=32768
  32. # end of SPI RAM config
Last edited by yaochuanfu on Tue Jun 04, 2024 1:11 am, edited 1 time in total.

ESP_William
Posts: 135
Joined: Tue Apr 24, 2018 5:54 am

Re: ESP32-S3R2 如何配置开启PSRAM? 我开启PSRAM后 报错:找不到PSRAM芯片

Postby ESP_William » Thu Mar 07, 2024 7:57 am

您好,

根据您提供的 sdkconfig 可以正常使用 ESP32-S3R2 的 PSRAM。

可以尝试使用附件中提供的 sdkconfig 替换 esp-idf/examples/get-started/hello_world 例程中的 sdkconfig 进行测试。
若还无法使用可以检查其他硬件问题或更换芯片排查。
Attachments
sdkconfig.txt
sdkconfig
(41.23 KiB) Downloaded 647 times

yaochuanfu
Posts: 12
Joined: Mon Mar 04, 2024 9:06 am

Re: ESP32-S3R2 如何配置开启PSRAM? 我开启PSRAM后 报错:找不到PSRAM芯片

Postby yaochuanfu » Tue Apr 16, 2024 2:15 am

重新配置后 没有问题了 ,但是出现了另外一个问题: 使用串口的时候,调用时uart_driver_install函数,uart_alloc_driver_obj()未申请到内存,查看底层发现heap_caps_calloc()未申请到内存,实际查看,空闲内存还有124K之多。请问还需要修改其他配置吗?

SPRAM配置如下:

#
# SPI RAM config
#
CONFIG_SPIRAM_MODE_QUAD=y
# CONFIG_SPIRAM_MODE_OCT is not set
CONFIG_SPIRAM_TYPE_AUTO=y
# CONFIG_SPIRAM_TYPE_ESPPSRAM16 is not set
# CONFIG_SPIRAM_TYPE_ESPPSRAM32 is not set
# CONFIG_SPIRAM_TYPE_ESPPSRAM64 is not set
CONFIG_SPIRAM_SIZE=-1
CONFIG_SPIRAM_CLK_IO=30
CONFIG_SPIRAM_CS_IO=26
# CONFIG_SPIRAM_FETCH_INSTRUCTIONS is not set
# CONFIG_SPIRAM_RODATA is not set
# CONFIG_SPIRAM_ALLOW_STACK_EXTERNAL_MEMORY is not set
# CONFIG_SPIRAM_SPEED_120M is not set
# CONFIG_SPIRAM_SPEED_80M is not set
CONFIG_SPIRAM_SPEED_40M=y
CONFIG_SPIRAM=y
CONFIG_SPIRAM_BOOT_INIT=y
# CONFIG_SPIRAM_IGNORE_NOTFOUND is not set
# CONFIG_SPIRAM_USE_MEMMAP is not set
# CONFIG_SPIRAM_USE_CAPS_ALLOC is not set
CONFIG_SPIRAM_USE_MALLOC=y
CONFIG_SPIRAM_MEMTEST=y
CONFIG_SPIRAM_MALLOC_ALWAYSINTERNAL=16384
# CONFIG_SPIRAM_TRY_ALLOCATE_WIFI_LWIP is not set
CONFIG_SPIRAM_MALLOC_RESERVE_INTERNAL=32768
# end of SPI RAM config

Who is online

Users browsing this forum: No registered users and 51 guests