AnsweredAssumed Answered

STM32F7 SDRAM Initialization and usage

Question asked by THIHA KYAW on Nov 22, 2017
Latest reply on Nov 29, 2017 by john doe

Hi,

 

I would like to know how to set parameters in SDRAM Initialization. You can refer to document too.

 

From  FMC_SDRAM example project,

In STM32F769-EVAL, 

 

hsdram.Init.SDBank = FMC_SDRAM_BANK1;
hsdram.Init.ColumnBitsNumber = FMC_SDRAM_COLUMN_BITS_NUM_9;
hsdram.Init.RowBitsNumber = FMC_SDRAM_ROW_BITS_NUM_12;
hsdram.Init.MemoryDataWidth = SDRAM_MEMORY_WIDTH; //FMC_SDRAM_MEM_BUS_WIDTH_32
hsdram.Init.InternalBankNumber = FMC_SDRAM_INTERN_BANKS_NUM_4;
hsdram.Init.CASLatency = FMC_SDRAM_CAS_LATENCY_3;
hsdram.Init.WriteProtection = FMC_SDRAM_WRITE_PROTECTION_DISABLE;
hsdram.Init.SDClockPeriod = SDCLOCK_PERIOD;
hsdram.Init.ReadBurst = FMC_SDRAM_RBURST_ENABLE;
hsdram.Init.ReadPipeDelay = FMC_SDRAM_RPIPE_DELAY_0;

 

In STM32F769I_Discovery board,

hsdram.Init.SDBank = FMC_SDRAM_BANK1;
hsdram.Init.ColumnBitsNumber = FMC_SDRAM_COLUMN_BITS_NUM_8;
hsdram.Init.RowBitsNumber = FMC_SDRAM_ROW_BITS_NUM_12;
hsdram.Init.MemoryDataWidth = SDRAM_MEMORY_WIDTH; //FMC_SDRAM_MEM_BUS_WIDTH_16
hsdram.Init.InternalBankNumber = FMC_SDRAM_INTERN_BANKS_NUM_4;
hsdram.Init.CASLatency = FMC_SDRAM_CAS_LATENCY_2;
hsdram.Init.WriteProtection = FMC_SDRAM_WRITE_PROTECTION_DISABLE;
hsdram.Init.SDClockPeriod = SDCLOCK_PERIOD;
hsdram.Init.ReadBurst = FMC_SDRAM_RBURST_ENABLE;
hsdram.Init.ReadPipeDelay = FMC_SDRAM_RPIPE_DELAY_0;

 

Question: Both evaluation boards uses the same SDRAM chip, why does STM use different configuration? Please explain me.

//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

 

/* Write data to the SDRAM memory */
for (uwIndex = 0; uwIndex < BUFFER_SIZE; uwIndex++)
{
*(__IO uint32_t*) (SDRAM_BANK_ADDR + WRITE_READ_ADDR + 4*uwIndex) = aTxBuffer[uwIndex];
}

 

Question: According to example code, why do we need 4*?

 

When I check HAL API, HAL_SDRAM_Write_32b() function doesn't use like above coding.

 

This means HAL_SDRAM_Write_32b() function doesn't work for STM32F7?

 

Questioncan you give me FMC_SDRAM example using HAL_SDRAM_Write_32b() function ?

 

Regards,

Thiha Kyaw

Outcomes