cancel
Showing results for 
Search instead for 
Did you mean: 

STM32U585AII6 FMC cannot read and write PSRAM

kongking
Associate

Hello,

I have a issue to control IS66WVE4M16EBLL-70BLI with STM32U585AII6.

Although IS66WVE4M16EBLL-70BLI is 8MB, I can read and write only 8KB.

IS66WVE4M16EBLL-70BLI has 22 address lines and 16 data lines.(4M * 2 = 8MB)

 

 

The problem is 

 

if i change 2-byte at address 0x60000000 to 0x7777, 2-byte at address 0x60002000, 0x60004000 ... also changed to 0x7777.

 

My guess is

fmc tries to write data to 0x60002000, 0x60004000... but it writes to data to 0x60000000.

Also fmc tries to read data from 0x60002000, 0x60004000... but it reads data from 0x60000000.

 

MCU clock is 160MHz. so 1 clock = 6.25ns.

PSRAM time is below.

kongking_4-1718872404276.pngkongking_6-1718872451878.png

 

 My Cube configuration is below.

kongking_7-1718872567594.pngkongking_8-1718872599895.png

 

 

 

Here is configuration.

// fmc init code

hsram1.Instance = FMC_NORSRAM_DEVICE;

hsram1.Extended = FMC_NORSRAM_EXTENDED_DEVICE;

hsram1.Init.NSBank = FMC_NORSRAM_BANK1;

hsram1.Init.DataAddressMux = FMC_DATA_ADDRESS_MUX_DISABLE;

hsram1.Init.MemoryType = FMC_MEMORY_TYPE_PSRAM;

hsram1.Init.MemoryDataWidth = FMC_NORSRAM_MEM_BUS_WIDTH_16;

hsram1.Init.BurstAccessMode = FMC_BURST_ACCESS_MODE_DISABLE;

hsram1.Init.WaitSignalPolarity = FMC_WAIT_SIGNAL_POLARITY_LOW;

hsram1.Init.WaitSignalActive = FMC_WAIT_TIMING_BEFORE_WS;

hsram1.Init.WriteOperation = FMC_WRITE_OPERATION_ENABLE;

hsram1.Init.WaitSignal = FMC_WAIT_SIGNAL_DISABLE;

hsram1.Init.ExtendedMode = FMC_EXTENDED_MODE_DISABLE;

hsram1.Init.AsynchronousWait = FMC_ASYNCHRONOUS_WAIT_DISABLE;

hsram1.Init.WriteBurst = FMC_WRITE_BURST_DISABLE;

hsram1.Init.ContinuousClock = FMC_CONTINUOUS_CLOCK_SYNC_ONLY;

hsram1.Init.WriteFifo = FMC_WRITE_FIFO_DISABLE;

hsram1.Init.NBLSetupTime = 0;

hsram1.Init.PageSize = FMC_PAGE_SIZE_NONE;

hsram1.Init.MaxChipSelectPulse = DISABLE;

/* Timing */

Timing.AddressSetupTime = 8;

Timing.AddressHoldTime = 0;

Timing.DataSetupTime = 4;

Timing.DataHoldTime = 0;

Timing.BusTurnAroundDuration = 15;

Timing.CLKDivision = 16;

Timing.DataLatency = 17;

Timing.AccessMode = FMC_ACCESS_MODE_A;

And here is code.

#define SRAM_ADDR ((uint32_t)0x60000000)

ptr = (volatile uint16_t*) SRAM_ADDR;

for (uint32_t i = 0; i < 4 * 1024 * 1024; i++)

{

    if (i < 4 * 1024)

    {

        *(ptr + i) = 0x5555;

    }

    else

    {

        *(ptr + i) = 0xAAAA;

    }

}

 

Have you encountered a similar issue or can you offer any assistance?

 

 

 
 
 
 
 
 
 
 
 
 
0 REPLIES 0