board707 / w80x_arduino

w806 package for Arduino IDE
GNU Lesser General Public License v2.1
68 stars 12 forks source link

Can Not get PSRAM_test.ino to work - using Ips6404-SQPI #31

Closed jlsilicon closed 10 months ago

jlsilicon commented 10 months ago

Can Not get PSRAM_test.ino to work - using Ips6404-SQPI

I integrated the Ips6404-SQPI to W806 : -- but it only returns and prints garbage back.

Pad pin mapping relationship : SCLK -> PA_15 PSRAM_CK SI/IO0 -> PB_02 PSRAM_D0 01/SO -> PB_03 PSRAM_D1 WP -> PB_04 PSRAM_D2 HOLD -> PB_05 PSRAM_D3 CS -> PB_27 PSRAM_CS

BRD PSRAM : PB27 CS \/ +Vdd PB3 01/SO Hold PB5 PB4 WP SCLK PA15 Gnd- SI/IO0 PB2

-- I also tried SPI_Basic.ino - no results either.

-> Has the PSRAM_test.ino been tested ?

board707 commented 10 months ago

Hi This module has been added by @AnatolSher. I will ask him to review the issue.

AnatolSher commented 10 months ago

Hello! I had testing PSRAM sketch with Air103 board and PS6404L-3SQR-SN chip. It works well. Maybe your chips are fake? I received defective chips from aliexpress image In the memory browser you can see how the array in psram is reset. My bench equipment with debugger IMG_20231015_174951 image Air103 with PSRAM chip

jcoleman-oneaihealth commented 10 months ago

My Chips work - on here if I just use BitBang Code

AnatolSher commented 10 months ago

It's hard for me to imagine what's happening on your computer... But it works well image Maybe you need to lower the bus speed? hpsram.Init.Div = 3; (4,5... etc)

AnatolSher commented 10 months ago

Hello! For w801 init function must be static void PSRAM_Init(void) { HAL_RCC_PSRAM_CLK_ENABLE(); HAL_RCC_GPIO_CLK_ENABLE(); // For W801 HAL_AFIO_REMAP_PSRAM_CS(GPIOB, GPIO_PIN_27); HAL_AFIO_REMAP_PSRAM_CLK(GPIOB, GPIO_PIN_0); HAL_AFIO_REMAP_PSRAM_D0(GPIOB, GPIO_PIN_2); HAL_AFIO_REMAP_PSRAM_D1(GPIOB, GPIO_PIN_3); HAL_AFIO_REMAP_PSRAM_D2(GPIOB, GPIO_PIN_4); HAL_AFIO_REMAP_PSRAM_D3(GPIOB, GPIO_PIN_5);

hpsram.Instance = PSRAM; hpsram.Init.Div = 2; hpsram.Init.Mode = PSRAM_MODE_QSPI;

if (HAL_PSRAM_Init(&hpsram) != HAL_OK) { Serial.printf("Init error...\r\n"); } } It is work! But very strange :) image image image

jcoleman-oneaihealth commented 10 months ago

Sorry, I followed that code above, except I used : __HAL_AFIO_REMAP_PSRAM_CLK(GPIOA, GPIO_PIN_15); // __HAL_AFIO_REMAP_PSRAM_CLK(GPIOB, GPIO_PIN_0);

I used chip : Ips6404L-SQ . The specs seem to match to your chip. But the data Written - Reads back as garbage chars.

AnatolSher commented 10 months ago

Yes, I see this too. It doesn't work well on W801 :) But Air103 is the same, only there is no RF Maybe we need a blocking capacitor for the psram chip. I'll solder it now

ps. did not help :(

jcoleman-oneaihealth commented 10 months ago

I am using W806 - is this code compatible with it ?

AnatolSher commented 10 months ago

Must be I plan to test this on the w806 tomorrow Now I have written a small code for wm_w80x_sdk. But, unfortunately, it doesn't work. I`m doing something wrong...

include "wm_include.h"

include "wm_psram.h"

include "wm_pmu.h"

include "wm_cpu.h"

include "wm_gpio_afsel.h"

static uint8_t psram_buf = (uint8_t )PSRAM_ADDR_START;

void UserMain(void) {
uint8_t temp[100]; uint8_t i = 0;

tls_sys_clk_set(CPU_CLK_240M);
wm_psram_config(1); //w801
psram_init(PSRAM_QPI);

while(1) {
    memset(psram_buf, 0, 100);
    printf("\r\n Clear buf: ");
    for(i = 0; i < 100; i++) printf("%x ", psram_buf[i]);
    for(i = 0; i < 100; i++) temp[i] = i % 256;
    printf("\r\n Read buf: ");
    memcpy(psram_buf, temp, 100);
    for(i = 0; i < 100; i++) printf("%x ", psram_buf[i]);

    tls_os_time_delay(1000);
}

} Result image Perhaps we should drip here image

jcoleman-oneaihealth commented 10 months ago

Your UserMain() code does not compile on the Arduino IDE with Board707 code. What are you compiling with ?

AnatolSher commented 10 months ago

https://github.com/ganhailin/wm_sdk_w801 for exam and CDK dev inv image

AnatolSher commented 10 months ago

Hello. Good news for you :) It work on W806 image You need this: image Result: image

image

jcoleman-oneaihealth commented 10 months ago

Can you compile with the ? : https://github.com/board707/w80x_arduino

AnatolSher commented 10 months ago

Certainly! bord707 and me did this Arduino core assembly together :)

jcoleman-oneaihealth commented 10 months ago

So what was the code for board707 compile ?

AnatolSher commented 10 months ago

Copy and paste to arduino ide

include "Arduino.h"

// Tested on w806 board with PS6404L-3SQR-SN chip

PSRAM_HandleTypeDef hpsram;

static void PSRAM_Init(void);

static uint8_t psram_buf = (uint8_t )PSRAM_ADDR_START;

void setup() { Serial.begin(115200); PSRAM_Init(); }

void loop() { uint8_t temp[100]; int i = 0;

memset(psram_buf, 0, 100); for(i = 0; i < 100; i++) { Serial.printf("%x ", psram_buf[i]); } Serial.printf("\r\n");

for(i = 0; i < 100; i++) { temp[i] = i % 256; }

memcpy(psram_buf, temp, 100); for(i = 0; i < 100; i++) { Serial.printf("%x ", psram_buf[i]); } Serial.printf("\r\n");

delay(1000); }

static void PSRAM_Init(void) { HAL_RCC_PSRAM_CLK_ENABLE(); HAL_RCC_GPIO_CLK_ENABLE(); HAL_AFIO_REMAP_PSRAM_CS(GPIOB, GPIO_PIN_1); HAL_AFIO_REMAP_PSRAM_CLK(GPIOB, GPIO_PIN_0); HAL_AFIO_REMAP_PSRAM_D0(GPIOB, GPIO_PIN_2); HAL_AFIO_REMAP_PSRAM_D1(GPIOB, GPIO_PIN_3); HAL_AFIO_REMAP_PSRAM_D2(GPIOB, GPIO_PIN_4); HAL_AFIO_REMAP_PSRAM_D3(GPIOB, GPIO_PIN_5);

hpsram.Instance = PSRAM; hpsram.Init.Div = 3; hpsram.Init.Mode = PSRAM_MODE_QSPI;

if (HAL_PSRAM_Init(&hpsram) != HAL_OK) { Serial.printf("Init error...\r\n"); } } Connect the chip correctly ! CS->PB1;CLK->PB0 Enjoy :)

PS. The wires must be very short. PSRAM runs at very high frequency

jcoleman-oneaihealth commented 10 months ago

/*

COMPILES

-

Copy and paste to arduino ide

Connect the chip correctly ! CS->PB1; CLK->PB0

// Tested on w806 board with PS6404L-3SQR-SN chip

-

BRD PSRAM : PB1 CS \/ +Vdd PB3 IO1/SO IO3/Hold PB5 PB4 IO2/WP SCLK PB0
Gnd- SI/IO0 PB2

   Ly68L6400sLi :
CE!     \/   +Vcc
SO/SIO1      SIO3
SIO2         SCLK
-Vss      SI/SIO0

*/

//

include "Arduino.h"

//

PSRAM_HandleTypeDef hpsram;

static void PSRAM_Init(void);

static uint8_t psram_buf = (uint8_t )PSRAM_ADDR_START;

//

void setup() { Serial.begin(115200); Serial.printf("\r\n> : W806_PSRAM_test_3 : \r\n\r\n");

PSRAM_Init(); }

void loop() { uint8_t temp[100]; int i = 0;

Serial.printf("- Clear & Read PSRAM : \r\n"); memset(psram_buf, 0, 100); for(i = 0; i < 100; i++) { Serial.printf("%x ", psram_buf[i]); } Serial.printf("\r\n");

Serial.printf("- Write Inc# & Read PSRAM : \r\n"); for(i = 0; i < 100; i++) { temp[i] = i % 256; }

Serial.printf("- Clear & Read PSRAM : \r\n"); memcpy(psram_buf, temp, 100); for(i = 0; i < 100; i++) { Serial.printf("%x ", psram_buf[i]); } Serial.printf("\r\n");

Serial.printf("- Write Letters & Read PSRAM : \r\n"); Serial.printf( "- W: #0=[A] "); psram_buf[0] = 'A' ; Serial.printf( "R: #0=>[%c] ",psram_buf[0]);

Serial.printf("; - W: #1=[A] ");
 psram_buf[1] = 'z' ;
 Serial.printf(", R: #1=>[%c] ",psram_buf[1]);

 Serial.printf("; R: #0=>[%c] ",psram_buf[0]);
 Serial.printf(", R: #1=>[%c] ",psram_buf[1]);

Serial.printf("\r\n");

Serial.printf("\r\n");

delay(1000); }

//

static void PSRAM_Init(void) { HAL_RCC_PSRAM_CLK_ENABLE(); HAL_RCC_GPIO_CLK_ENABLE(); HAL_AFIO_REMAP_PSRAM_CS(GPIOB, GPIO_PIN_1); HAL_AFIO_REMAP_PSRAM_CLK(GPIOB, GPIO_PIN_0); HAL_AFIO_REMAP_PSRAM_D0(GPIOB, GPIO_PIN_2); HAL_AFIO_REMAP_PSRAM_D1(GPIOB, GPIO_PIN_3); HAL_AFIO_REMAP_PSRAM_D2(GPIOB, GPIO_PIN_4); HAL_AFIO_REMAP_PSRAM_D3(GPIOB, GPIO_PIN_5);

hpsram.Instance = PSRAM; hpsram.Init.Div = 3; hpsram.Init.Mode = PSRAM_MODE_QSPI;

if (HAL_PSRAM_Init(&hpsram) != HAL_OK) { Serial.printf("Init error...\r\n"); } }

///

jcoleman-oneaihealth commented 10 months ago

OUTPUT :

-- Clear & Read PSRAM : 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -- Write Inc# & Read PSRAM : 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -- Clear & Read PSRAM : 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 60 61 62 63 // <- Old Data ??? -- Write Letters & Read PSRAM : -- W: #0=[A] R: #0=>[A] ;

-- W: #1=[A] , R: #1=>[z] ;

-- R: #0=>[] , // <- The data is last char Written , but not Reading / Writing PSRAM => char z ??? -- R: #1=>[z]

--

The data is last char Written , but not Reading PSRAM

jcoleman-oneaihealth commented 10 months ago

Does your PSRAM code include ? :

// WrtByt: RESET_EN = 0x66 = 0b01100110 : // digitalWrite( PB1 , LOW ); SPI.transfer( 0x66 ); digitalWrite( PB1 , HIGH );

// WrtByt: RESET = 0x99 = 0b10011001 : // digitalWrite( PB1 , LOW ); SPI.transfer( 0x99 ); digitalWrite( PB1 , HIGH );

-- Needed after PSRAM powerup , before Writing data

jcoleman-oneaihealth commented 10 months ago

My chip seems to be Reading data, but Not Writing Data to PSRAM.

jcoleman-oneaihealth commented 10 months ago

I dont see SPI.begin();

AnatolSher commented 10 months ago

There is a specialized SPRAM controller on board the w806 chip. Thanks to it, we can address it like regular memory. SPI interface is not needed here. Show me a photo of how you connected the psram chip and the board

AnatolSher commented 10 months ago

Initialization of the psram controller is described in the HAL. You can find this in the drivers folder C:\Users\User\AppData\Local\Arduino15\packages\w80x_duino\hardware\XT804\0.0.5\cores\w806\lib\drivers This file - wm_psram.c

jcoleman-oneaihealth commented 10 months ago

I think its wired correctly - if I keep reading ABC at address 96.

W806_to_PSRAM

jcoleman-oneaihealth commented 10 months ago

OUTPUT - always repeated reading address 0 - 100 :

Read works , but Write does not with this code.

AnatolSher commented 10 months ago

Thank you! Very long wires!!! Do it as I showed in my photo with w806. https://github.com/board707/w80x_arduino/issues/31#issuecomment-1770407561 The operating frequency of psram is more than 100 MHz. It won't work with this connection.

AnatolSher commented 10 months ago

I glued it with 2-sided tape. make sure it doesn't short out any components on the board

jcoleman-oneaihealth commented 10 months ago

no. As I said , it seems to be Reading old values from my Bitbang SPI. Just not Successfully Writing new data to the PSRAM.

AnatolSher commented 10 months ago

you are reading the latest data from the controller's psram buffer. not from a chip... maybe

jcoleman-oneaihealth commented 10 months ago

I dont write x60 x61 x62 x63 in my code anywhere

I also changed the Div to 32 :

hpsram.Init.Div = 32;

jcoleman-oneaihealth commented 10 months ago

strcpy((char)psram_buf, (char)"AbCdEfGhIjKlMnOpQrStUvWxYz ** ");
=> 00 . 00 . 00 . 00 . 00 . 00 . 00 . 00 . 00 . 00 . 00 . 00 . 2A
2A * 20 00 .

// strcpy((char)psram_buf, (char)"0 1 2 3 4 5 6 7 8 9 *** "); => 00 . 00 . 00 . 7A z 00 . 00 . 00 . 00 . 00 . 00 . 00 . 00 . 00 . 00 . 00 . 00 .

jcoleman-oneaihealth commented 10 months ago

I recompiled at 80MHz with div=32 - but no difference. I recompiled at 80MHz with div=15 - but no difference.

AnatolSher commented 10 months ago

hpsram.Init.Div = 32; - no; from 2 to 15. 4 binary digits - max 0b1111

AnatolSher commented 10 months ago

You need to solder the chip on top of the board. psram is a very capricious thing. There may be bad contacts on the bredboard

AnatolSher commented 10 months ago

Does your PSRAM code include ? :

// WrtByt: RESET_EN = 0x66 = 0b01100110 : // digitalWrite( PB1 , LOW ); SPI.transfer( 0x66 ); digitalWrite( PB1 , HIGH );

// WrtByt: RESET = 0x99 = 0b10011001 : // digitalWrite( PB1 , LOW ); SPI.transfer( 0x99 ); digitalWrite( PB1 , HIGH );

-- Needed after PSRAM powerup , before Writing data

When we to do soft reset the psram controller, this sequence is transmitted automatically. PSRAM reset Writing 1 to control register (b[0]) starts the reset operation to PSRAM, and it is automatically cleared after reset.

The datasheet says that the psram controller is clocked from the AHB-1 bus. This is the processor clock bus. They also say that psram operates at 80 MHz. Therefore we have two possible values ​​for the divisor. 3 for 240Mhz and 2 for 160Mhz. The divisor cannot be less than 2. Other processor clock frequencies will not work with psram.

Employees of the WinnerMicro company told me a long time ago that they use the original LY68L6400SLIT (Lyontek) as a psram chip only. It's a miracle that other chips sometimes work :)... maybe

jcoleman-oneaihealth commented 10 months ago

I see, I am stuck with just BitBang or SPI.tx/rx .

Let me try the SPI.tx/rx then... No

Just the SPI Bitbanging works so far ...

jcoleman-oneaihealth commented 10 months ago

OK. Figured out part of the problem. I had PSRAM +Vcc connected to Gnd.

jcoleman-oneaihealth commented 10 months ago

Now I get this :

-- Write Letters & Read PSRAM : -- W: #0=[A] R: #0=>[A] -- W: #1=[x] , R: #1=>[x] -- W: #2=[y] , R: #2=>[y] -- W: #3=[z] , R: #3=>[z] = > R: #0=>[.] R: #1=>[w] R: #2=>[y] R: #3=>[z]

jcoleman-oneaihealth commented 10 months ago

Code:

` //

include "Arduino.h"

include

//

PSRAM_HandleTypeDef hpsram; static void PSRAM_Init(void); static uint8_t psram_buf = (uint8_t )PSRAM_ADDR_START; uint8_t temp[100];

//

void setup() { // SystemClock_Config(CPU_CLK_240M); /// - 240MHz

Serial.begin(115200); Serial.printf("\r\n> : W806_PSRAM_test_3 : \r\n\r\n");

define SPI_TEST_E 1

ifdef SPI_TEST_E

SPI_PSRAM_Reset();

Serial.printf("* Writing \"AZaz \" : \r\n"); digitalWrite( PB1 , LOW ); SPI.transfer( 0x02 ); SPI.transfer( 0x00 ); SPI.transfer( 0x00 ); SPI.transfer( 0x00 ); SPI.transfer( 0x41 ); SPI.transfer( 0x61 ); SPI.transfer( 0x5A ); SPI.transfer( 0x7A ); SPI.transfer( 0x20 ); digitalWrite( PB1 , HIGH );

Serial.printf("* Reading : \r\n"); digitalWrite( PB1 , LOW ); SPI.transfer( 0x03 ); SPI.transfer( 0x00 ); SPI.transfer( 0x00 ); SPI.transfer( 0x00 ); temp[0] = SPI.transfer( 0xFF ); temp[1] = SPI.transfer( 0xFF ); temp[2] = SPI.transfer( 0xFF ); temp[3] = SPI.transfer( 0xFF ); temp[4] = SPI.transfer( 0xFF ); temp[5] = 0; digitalWrite( PB1 , HIGH ); Serial.printf(" => \"%s\" : \r\n\r\n" , temp );

endif

PSRAM_Init(); // SPI_PSRAM_Reset(); }

void loop() { // uint8_t temp[100]; int i = 0; char c ;

Serial.printf("- Read Default PSRAM : \r\n"); for(i = 0; i < 100; i++) { Serial.printf("%02X ", (c=psram_buf[i]) );

if( c > 0x1F  &&  c < 0x80 )
  Serial.printf("%c ", c );  
else
  Serial.printf(". ");  

if( i % 16 == 15 )
  Serial.printf("\r\n");  

} Serial.printf("\r\n");

Serial.printf("- Clear & Read PSRAM : \r\n"); memset(psram_buf, 0, 100); for(i = 0; i < 100; i++) { Serial.printf("%02X ", (c=psram_buf[i]) );

if( c > 0x1F  &&  c < 0x80 )
  Serial.printf("%c ", c );  
else
  Serial.printf(". ");  

if( i % 16 == 15 )
  Serial.printf("\r\n");  

} Serial.printf("\r\n");

Serial.printf("- Write Inc# & Read PSRAM : \r\n"); for(i = 0; i < 100; i++) { temp[i] = i % 256; } memcpy(psram_buf, temp, 100); for(i = 0; i < 100; i++) { Serial.printf("%02X ", (c=psram_buf[i]) );

if( c > 0x1F  &&  c < 0x80 )
  Serial.printf("%c ", c );  
else
  Serial.printf(". ");  

if( i % 16 == 15 )
  Serial.printf("\r\n");  

} Serial.printf("\r\n");

Serial.printf("\r\n- Set Abc & Read PSRAM : \r\n"); strcpy((char)psram_buf, (char)"AbCdEfGhIjKlMnOpQrStUvWxYz "); // strcpy((char)psram_buf, (char)"0 1 2 3 4 5 6 7 8 9 "); // for(i = 0; i < 100; i++) for(i = 0; i < 128; i++) // for(i = 0; i < 1000; i++) // for(i = 0; i < 10000; i++) { Serial.printf("%02X ", (c=psram_buf[i]) );

if( c > 0x1F  &&  c < 0x80 )
  Serial.printf("%c ", c );  
else
  Serial.printf(". ");  

if( i % 16 == 15 )
  Serial.printf("\r\n");  

} Serial.printf("\r\n");

Serial.printf("\r\n- Write Letters & Read PSRAM : \r\n"); Serial.printf( "- W: #0=[A] "); psram_buf[0] = 'A' ; Serial.printf( ", R: #0=>[%c] \r\n",psram_buf[0]);

Serial.printf("- W: #1=[x] ");
 psram_buf[1] = 'x' ;
 Serial.printf(", R: #1=>[%c] \r\n",psram_buf[1]);

Serial.printf("- W: #2=[y] ");
 psram_buf[2] = 'y' ;
 Serial.printf(", R: #2=>[%c] \r\n",psram_buf[2]);

Serial.printf("- W: #3=[z] ");
 psram_buf[3] = 'z' ;
 Serial.printf(", R: #3=>[%c] \r\n",psram_buf[3]);

Serial.printf("=> R: #0=>[%c] \r\n",psram_buf[0]);
 Serial.printf("   R: #1=>[%c] \r\n",psram_buf[1]);
 Serial.printf("   R: #2=>[%c] \r\n",psram_buf[2]);
 Serial.printf("   R: #3=>[%c] \r\n",psram_buf[3]);

Serial.printf("\r\n");

delay(1000); }

//

static void PSRAM_Init(void) { HAL_RCC_PSRAM_CLK_ENABLE(); HAL_RCC_GPIO_CLK_ENABLE();

HAL_AFIO_REMAP_PSRAM_CS(GPIOB, GPIO_PIN_1); // PB1 / CS HAL_AFIO_REMAP_PSRAM_CLK(GPIOB, GPIO_PIN_0); // PB0 / SCLK HAL_AFIO_REMAP_PSRAM_D0(GPIOB, GPIO_PIN_2); // PB2 / MOSI HAL_AFIO_REMAP_PSRAM_D1(GPIOB, GPIO_PIN_3); // PB3 / MISO HAL_AFIO_REMAP_PSRAM_D2(GPIOB, GPIO_PIN_4); // PB4 HAL_AFIO_REMAP_PSRAM_D3(GPIOB, GPIO_PIN_5); // PB5

hpsram.Instance = PSRAM; hpsram.Init.Div = 3; // hpsram.Init.Div = 15; // - 2-15 // hpsram.Init.Div = 20; // hpsram.Init.Div = 32; hpsram.Init.Mode = PSRAM_MODE_QSPI;

if (HAL_PSRAM_Init(&hpsram) != HAL_OK) { Serial.printf("Init error...\r\n"); }

// SPI_PSRAM_Reset();

}

void SPI_PSRAM_Reset() {

/// Reset PSRAM : /// /// HardSPI::transfer(uint8_t val) : /// // HardSPI::transfer( 0x66 );

/// SPI.setSPIpins(uint8_t mosi, uint8_t miso, uint8_t sck) : /// SPI.setSPIpins( PB2, PB3, PB0 ); SPI.begin();

pinMode( PB1 , OUTPUT ); digitalWrite( PB1 , HIGH );

digitalWrite( PB1 , LOW ); SPI.transfer( 0x66 ); digitalWrite( PB1 , HIGH );

digitalWrite( PB1 , LOW ); SPI.transfer( 0x99 ); digitalWrite( PB1 , HIGH ); } `

jcoleman-oneaihealth commented 10 months ago

I tried with your short Wires + Caps (1uF , 0.1uF).

Still same output.

Waiting on your PSRAM chips that I ordered : -- ESP-PSRAM64H -- LY68L6400SLIT

jcoleman-oneaihealth commented 10 months ago

I tried with your very short Wires.

Just got worse :

Waiting on your PSRAM chips that I ordered : -- ESP-PSRAM64H -- LY68L6400SLIT

jcoleman-oneaihealth commented 10 months ago

Your Code , does Not match your Chip Wiring :

` static void PSRAM_Init(void) { HAL_RCC_PSRAM_CLK_ENABLE(); HAL_RCC_GPIO_CLK_ENABLE(); HAL_AFIO_REMAP_PSRAM_CS(GPIOB, GPIO_PIN_1); HAL_AFIO_REMAP_PSRAM_CLK(GPIOB, GPIO_PIN_0); HAL_AFIO_REMAP_PSRAM_D0(GPIOB, GPIO_PIN_2); HAL_AFIO_REMAP_PSRAM_D1(GPIOB, GPIO_PIN_3); HAL_AFIO_REMAP_PSRAM_D2(GPIOB, GPIO_PIN_4); HAL_AFIO_REMAP_PSRAM_D3(GPIOB, GPIO_PIN_5);

hpsram.Instance = PSRAM; hpsram.Init.Div = 3; hpsram.Init.Mode = PSRAM_MODE_QSPI; `

W806_Psram_Wiring_AnatolSher

jcoleman-oneaihealth commented 10 months ago

Ok , I Fixed it ! My Wiring was Wrong : PB9 - is mislabeled as PBS - which looks like PB5 ...

Thanks for the Help !


Aps6404 Chip is good.

LOOP :

-- Read Default PSRAM : 00 . 01 . 02 . 03 . 04 . 05 . 06 . 07 . 08 . 09 . 0A . 0B . 0C . 0D . 0E . 0F . 10 . 11 . 12 . 13 . 14 . 15 . 16 . 17 . 18 . 19 . 1A . 1B . 1C . 1D . 1E . 1F . 20 21 ! 22 " 23 # 24 $ 25 % 26 & 27 ' 28 ( 29 ) 2A * 2B + 2C , 2D - 2E . 2F / 30 0 31 1 32 2 33 3 34 4 35 5 36 6 37 7 38 8 39 9 3A : 3B ; 3C < 3D = 3E > 3F ? 40 @ 41 A 42 B 43 C 44 D 45 E 46 F 47 G 48 H 49 I 4A J 4B K 4C L 4D M 4E N 4F O 50 P 51 Q 52 R 53 S 54 T 55 U 56 V 57 W 58 X 59 Y 5A Z 5B [ 5C \ 5D ] 5E ^ 5F _ 60 ` 61 a 62 b 63 c 00 . 00 . 00 . 00 . 00 . 00 . 00 . 00 . 00 . 00 . 00 . 00 . 00 . 00 . 00 . 00 . 00 . 00 . 00 . 00 . 00 . 00 . 00 . 00 . 00 . 00 . 00 . 00 .

-- Clear & Read PSRAM : 00 . 00 . 00 . 00 . 00 . 00 . 00 . 00 . 00 . 00 . 00 . 00 . 00 . 00 . 00 . 00 . 00 . 00 . 00 . 00 . 00 . 00 . 00 . 00 . 00 . 00 . 00 . 00 . 00 . 00 . 00 . 00 . 00 . 00 . 00 . 00 . 00 . 00 . 00 . 00 . 00 . 00 . 00 . 00 . 00 . 00 . 00 . 00 . 00 . 00 . 00 . 00 . 00 . 00 . 00 . 00 . 00 . 00 . 00 . 00 . 00 . 00 . 00 . 00 . 00 . 00 . 00 . 00 . 00 . 00 . 00 . 00 . 00 . 00 . 00 . 00 . 00 . 00 . 00 . 00 . 00 . 00 . 00 . 00 . 00 . 00 . 00 . 00 . 00 . 00 . 00 . 00 . 00 . 00 . 00 . 00 . 00 . 00 . 00 . 00 . 00 . 00 . 00 . 00 . 00 . 00 . 00 . 00 . 00 . 00 . 00 . 00 . 00 . 00 . 00 . 00 . 00 . 00 . 00 . 00 . 00 . 00 . 00 . 00 . 00 . 00 . 00 . 00 .

-- Set Abc & Read PSRAM : 41 A 62 b 43 C 64 d 45 E 66 f 47 G 68 h 49 I 6A j 4B K BB . 4D M 6E n 4F O FF . 51 Q 72 r 53 S 74 t 55 U 76 v 57 W 78 x 59 Y 7A z 20 2A 2A 2A 20 30 0 20 31 1 20 32 2 20 33 3 20 34 4 20 35 5 20 36 6 20 37 7 20 38 8 20 39 9 20 2A 2A 2A 20 20 20 20 20 20 20 20 20 20
20 35 5 36 6 37 7 38 8 39 9 30 0 31 1 32 2 33 3 34 4 35 5 36 6 37 7 38 8 39 9 30 0 31 1 32 2 33 3 34 4 35 5 36 6 37 7 38 8 39 9 30 0 31 1 32 2 33 3 34 4 35 5 36 6 37 7 38 8 39 9 00 . 00 . 00 . 00 . 00 . 00 . 00 . 00 . 00 . 00 . 00 . 00 . 00 . 00 . 00 . 00 . 00 . 00 . 00 . 00 . 00 . 00 . 00 . 00 . 00 . 00 . 00 . 00 .

-- Write Inc# & Read PSRAM : 00 . 01 . 02 . 03 . 04 . 05 . 06 . 07 . 08 . 09 . 0A . 0B . 0C . 0D . 0E . 0F . 10 . 11 . 12 . 13 . 14 . 15 . 16 . 17 . 18 . 19 . 1A . 1B . 1C . 1D . 1E . 1F . 20 21 ! 22 " 23 # 24 $ 25 % 26 & 27 ' 28 ( 29 ) 2A * 2B + 2C , 2D - 2E . 2F / 30 0 31 1 32 2 33 3 34 4 35 5 36 6 37 7 38 8 39 9 3A : 3B ; 3C < 3D = 3E > 3F ? 40 @ 41 A 42 B 43 C 44 D 45 E 46 F 47 G 48 H 49 I 4A J 4B K 4C L 4D M 4E N 4F O 50 P 51 Q 52 R 53 S 54 T 55 U 56 V 57 W 58 X 59 Y 5A Z 5B [ 5C \ 5D ] 5E ^ 5F _ 60 ` 61 a 62 b 63 c 00 . 00 . 00 . 00 . 00 . 00 . 00 . 00 . 00 . 00 . 00 . 00 . 00 . 00 . 00 . 00 . 00 . 00 . 00 . 00 . 00 . 00 . 00 . 00 . 00 . 00 . 00 . 00 .

-- Write Letters & Read PSRAM : -- W: #0=[A] , R: #0=>[A] -- W: #1=[x] , R: #1=>[x] -- W: #2=[y] , R: #2=>[y] -- W: #3=[z] , R: #3=>[z] = > R: #0=>[A] R: #1=>[w] R: #2=>[y] R: #3=>[z]

jcoleman-oneaihealth commented 10 months ago

PSRAM Works now. -- On Short and Long Wires Boards.

Except :

Yep - Shortened the Wires - No problems now - Fixed

AnatolSher commented 10 months ago

Congratulations! LY68L6400SLIT I will check when the package arrives from Aliexpress. I hope that I will be lucky and they will send me good and original chips. Follow the discussions, I will publish the result there. malloc() is not suitable for dynamic memory allocation. There are other approaches that WinnerMicro recommends. A little bit later I will give code examples. If you have solved your problems at this stage, please close the issue

PS/ Watch lessons on YouTube from Altium designer - how to install high-frequency circuits

PPS. Today I tested the APS6404 at all clock speeds. (240...40) It works and you can even play with the divider! Perhaps I didn’t translate the datasheet correctly and the W806 allows you to flexibly adjust the PSRAM exchange rate

jcoleman-oneaihealth commented 10 months ago

I dont think Malloc() is a problem - it does not cause a problem now.

I think that it was just too long leads - which fixed it.

board707 commented 10 months ago

@jcoleman-oneaihealth If your issue has been fixed - please close the issue and star our repo! :)

jlsilicon commented 10 months ago

You are the Owner - I can Not Close it ... On Monday, October 23, 2023 at 12:22:04 PM EDT, board707 @.***> wrote:

@jcoleman-oneaihealth If your issue has been fixed - please close the issue and star our repo! :)

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>