外挂SPI RAM(PSRAM)出现test fail问题

lys23926635
Posts: 9
Joined: Tue Apr 21, 2020 4:46 am

外挂SPI RAM(PSRAM)出现test fail问题

Postby lys23926635 » Tue Jul 14, 2020 1:10 am

我正在使用ESP32-PICO-KIT_V4.1 板子外挂8M的PSRAM,IO按参考设计接法如下:

psram_pin1(CS):-->esp32 gpio10
psram_pin2(SO/SIO1):-->esp32 gpio17
psram_pin3(SIO2):-->esp32 gpio7
psram_pin4:-->gnd
psram_pin5(SI/SIO0):-->esp32 gpio8
psram_pin6(SCLK):-->esp32 gpio6
psram_pin7(SIO3):-->esp32 gpio11

spiram_psram.c文件中修改引脚定义如下:

#define PSRAM_SPIQ_SD0_IO 17
#define PSRAM_SPID_SD1_IO 8
#define PSRAM_SPIWP_SD3_IO 7
#define PSRAM_SPIHD_SD2_IO 11

idf版本:
v3.3.2-270-gf4333c8e3

编译工程示例:hello_world

menuconfig 中打开SPI RAM 支持,配置CS为gpio10


出现的错误log如下:
I (221) boot: Loaded app from partition at offset 0x10000
I (221) boot: Disabling RNG early entropy source...
I (222) psram:This chip is ESP32-PICO
I (251) spiram: Found 64MBit SPI RAM device
I (259) spiram: SPI RAM mode: flash 40m sram 40m
I (265) spiram: PSRAM initialized, cache is in low/high (2-core) mode.
I (272) cpu_start: Pro cpu up.
I (276) cpu_start: Application information:
I (280) cpu_start: Project name: esp-idf
I (285) cpu_start: App version: 1
I (290) cpu_start: Compile time: Jul 13 2020 19:39:43
I (296) cpu_start: ELF file SHA256: f4ac9b655859d1b3...
I (302) cpu_start: ESP-IDF: v3.3.2-270-gf4333c8e3
I (308) cpu_start: Starting app cpu, entry point is 0x40081200
0x40081200: call_start_cpu1 at /home/szth/esp/esp-

idf/components/esp32/cpu_start.c:268

I (295) cpu_start: App cpu up.
E (1210) spiram: SPI SRAM memory test fail. 50461/131072 writes failed,

first @ 3F800040

E (1211) cpu_start: External RAM failed memory test!
abort() was called at PC 0x4008143a on core 0

看上去好像检测到psram了,但是为什么会出现test fail呢?各位帮忙看看,多谢!

costaud
Posts: 55
Joined: Wed Dec 30, 2015 5:09 pm

Re: 外挂SPI RAM(PSRAM)出现test fail问题

Postby costaud » Tue Jul 14, 2020 7:24 am

lys23926635 wrote:
Tue Jul 14, 2020 1:10 am
我正在使用ESP32-PICO-KIT_V4.1 板子外挂8M的PSRAM,IO按参考设计接法如下:

psram_pin1(CS):-->esp32 gpio10
psram_pin2(SO/SIO1):-->esp32 gpio17
psram_pin3(SIO2):-->esp32 gpio7
psram_pin4:-->gnd
psram_pin5(SI/SIO0):-->esp32 gpio8
psram_pin6(SCLK):-->esp32 gpio6
psram_pin7(SIO3):-->esp32 gpio11

spiram_psram.c文件中修改引脚定义如下:

#define PSRAM_SPIQ_SD0_IO 17
#define PSRAM_SPID_SD1_IO 8
#define PSRAM_SPIWP_SD3_IO 7
#define PSRAM_SPIHD_SD2_IO 11
1. 这里SD2和SD3的定义写错了(这里并不需要手动修改 IO 定义,只需要在menuconfig里设置CS的IO序号,即可)
psram_pin7(SIO3):-->esp32 gpio11
psram_pin3(SIO2):-->esp32 gpio7

#define PSRAM_SPIWP_SD3_IO 7
#define PSRAM_SPIHD_SD2_IO 11


2. 请确认所使用的psram 是否是3.3v版本 ?(如是,请提供psram型号。)

lys23926635
Posts: 9
Joined: Tue Apr 21, 2020 4:46 am

Re: 外挂SPI RAM(PSRAM)出现test fail问题

Postby lys23926635 » Wed Jul 15, 2020 1:07 am

感谢回复!
一、
RAM使用的是ESP-PSRAM64H ,应该确认是3.3V的;
二、
spiram_psram.c 是不需要要改动吗?但是它里面默认定义与我实际接法不一样,它默认定位如下:
#define PSRAM_SPIQ_SD0_IO 7
#define PSRAM_SPID_SD1_IO 8
#define PSRAM_SPIWP_SD3_IO 10
#define PSRAM_SPIHD_SD2_IO 9

我尝试过不改动spiram_psram.c的内容,使用默认配置,但问题依旧;

三、
SD2和SD3我尝试换了一下也不行;
我的PSRAM是手动飞线上去的,VCC连接的是板子上的3V3,这些会不会有影响呢?

Who is online

Users browsing this forum: No registered users and 51 guests