cancel
Showing results for 
Search instead for 
Did you mean: 

How to configure SDRAM in STM32H747i-DISCO discovery board?

Pavankumar1_
Associate II

I am using STM32H747i-DISCO board, I am trying to configure external SDRAM and board is having IS42S32800G-6BLI external SDRAM. But it will show hard fault error. Below shown code will be my configuration.

void MX_FMC_Init(void)
{

/* USER CODE BEGIN FMC_Init 0 */

/* USER CODE END FMC_Init 0 */

FMC_SDRAM_TimingTypeDef SdramTiming = {0};

/* USER CODE BEGIN FMC_Init 1 */

/* USER CODE END FMC_Init 1 */

/** Perform the SDRAM1 memory initialization sequence
*/
hsdram1.Instance = FMC_SDRAM_DEVICE;
/* hsdram1.Init */
hsdram1.Init.SDBank = FMC_SDRAM_BANK2;
hsdram1.Init.ColumnBitsNumber = FMC_SDRAM_COLUMN_BITS_NUM_8;
hsdram1.Init.RowBitsNumber = FMC_SDRAM_ROW_BITS_NUM_13;
hsdram1.Init.MemoryDataWidth = FMC_SDRAM_MEM_BUS_WIDTH_32;
hsdram1.Init.InternalBankNumber = FMC_SDRAM_INTERN_BANKS_NUM_4;
hsdram1.Init.CASLatency = FMC_SDRAM_CAS_LATENCY_1;
hsdram1.Init.WriteProtection = FMC_SDRAM_WRITE_PROTECTION_DISABLE;
hsdram1.Init.SDClockPeriod = FMC_SDRAM_CLOCK_DISABLE;
hsdram1.Init.ReadBurst = FMC_SDRAM_RBURST_DISABLE;
hsdram1.Init.ReadPipeDelay = FMC_SDRAM_RPIPE_DELAY_0;
/* SdramTiming */
SdramTiming.LoadToActiveDelay = 16;
SdramTiming.ExitSelfRefreshDelay = 16;
SdramTiming.SelfRefreshTime = 16;
SdramTiming.RowCycleDelay = 16;
SdramTiming.WriteRecoveryTime = 16;
SdramTiming.RPDelay = 16;
SdramTiming.RCDDelay = 16;

if (HAL_SDRAM_Init(&hsdram1, &SdramTiming) != HAL_OK)
{
Error_Handler( );
}

/* USER CODE BEGIN FMC_Init 2 */

/* USER CODE END FMC_Init 2 */
}

is there anything to configure please someone suggest how to configure SDRAM.

 

1 ACCEPTED SOLUTION

Accepted Solutions
SofLit
ST Employee

Hello @Pavankumar1_ ,

Simply try to use BSP as reference: stm32h747i_discovery_sdram.c located under \Drivers\BSP\STM32H747I-DISCO in STM32CubeH7

To give better visibility on the answered topics, please click on "Accept as Solution" on the reply which solved your issue or answered your question.

View solution in original post

2 REPLIES 2
FBL
ST Employee

Hello @Pavankumar1_ 

According to the user manual, the U7 8M x 32bit SDRAM is connected to SDRAM Bank1 of the STM32H747XIH6 FMC interface.

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

SofLit
ST Employee

Hello @Pavankumar1_ ,

Simply try to use BSP as reference: stm32h747i_discovery_sdram.c located under \Drivers\BSP\STM32H747I-DISCO in STM32CubeH7

To give better visibility on the answered topics, please click on "Accept as Solution" on the reply which solved your issue or answered your question.