Skip to main content
Graduate
December 18, 2023
Solved

Error while configuring STM32H747BIT6 with SDRAM IS42S16320D(SDRAM IC).

  • December 18, 2023
  • 2 replies
  • 2002 views

When ever i am trying to copy data in SDRAM garbage value is getting transferred. Please suggest what can i do

 

 

I have attached necessary files with this post.

Kindly suggest.

    This topic has been closed for replies.
    Best answer by KDJEM.1

    Hello @Rushali ,

    --> unable to change command mode value after sending commands.

    Thank you for bringing this issue to our attention.

    After checking, I confirm that the MODE Bits read as zero after the command is issued and this is normal behavior.

    The MODE bits are write only. For that I reported the reference manual internally for correction.

    Internal ticket number: 169917 (This is an internal tracking number and is not accessible or usable by customers).

    Thank you.

    Kaouthar

    2 replies

    Technical Moderator
    December 18, 2023

    Hello @Rushali and welcome to the Community :),

    Please make sure that the timing parameters are set correctly.

    I think that How to set up the FMC peripheral to interface with the SDRAM IS42S16800F-6BLI from ISSI FAQ  can help you.

    Also, you can start by an available example such as FMC_SDRAM_DataMemory and get inspired to configure your project.

    Note that, this example has been tested with STM32H747I-EVAL board with SMPS (SD Converter) power supply config when the SDRAM is IS42S32800G, but can be easily tailored to any other supported device and development board.

    I hope this help you!

    Kaouthar

    RushaliAuthor
    Graduate
    December 19, 2023

    Thank you for your reply.But i have narrowed down the problem.i found out that while initalizing SDRAM with FMC i have written following code.

    void FMC_INIT(void) {

    HAL_StatusTypeDef status;

     

    /* Step 1 and Step 2 already done in HAL_SDRAM_Init() */

    /* Step 3: Configure a clock configuration enable command */

    Command.CommandMode = FMC_SDRAM_CMD_CLK_ENABLE; /* Set MODE bits to "001" */

    Command.CommandTarget = FMC_SDRAM_CMD_TARGET_BANK2 ; /* configure the Target Bank bits */

    Command.AutoRefreshNumber = 3;

    Command.ModeRegisterDefinition = 0;

    /* while (FMC_GetFlagStatus(FMC_Bank2_SDRAM, FMC_FLAG_Busy) != RESET) {

    }*/

    /* Send the command */

    status = HAL_SDRAM_SendCommand(&hsdram1, &Command, 0xfff);

    HAL_Delay(1); /* Step 4: Insert 100 us minimum delay - Min HAL Delay is 1ms */

    /* Step 5: Configure a PALL (precharge all) command */

    Command.CommandMode = FMC_SDRAM_CMD_PALL; /* Set MODE bits to "010" */

    HAL_SDRAM_SendCommand(&hsdram1, &Command, 0xfff);

    /* Step 6: Configure an Auto Refresh command */

    Command.CommandMode = FMC_SDRAM_CMD_AUTOREFRESH_MODE; /* Set MODE bits to "011" */

    Command.AutoRefreshNumber = 2;

    HAL_SDRAM_SendCommand(&hsdram1, &Command, 0xfff);

    /* Step 7: Program the external memory mode register */

    Command.CommandMode = FMC_SDRAM_CMD_LOAD_MODE;/*set the MODE bits to "100" */

    Command.ModeRegisterDefinition = (uint32_t)0 | 0<<3 | 2<<4 | 0<<7 | 1<<9;

    HAL_SDRAM_SendCommand(&hsdram1, &Command, 0xfff);

    /* Step 8: Set the refresh rate counter - refer to section SDRAM refresh timer register in RM0455 */

    /* Set the device refresh rate

    * COUNT = [(SDRAM self refresh time / number of row) x SDRAM CLK] – 20

    = [(64ms/4096) * 100MHz] - 20 = 1562.5 - 20 ~ 1542 */

    HAL_SDRAM_ProgramRefreshRate(&hsdram1, 733);

     

    }

    But unable to change command mode value after sending commands.

    Rushali_0-1702991473469.png

     

     

    KDJEM.1Answer
    Technical Moderator
    January 4, 2024

    Hello @Rushali ,

    --> unable to change command mode value after sending commands.

    Thank you for bringing this issue to our attention.

    After checking, I confirm that the MODE Bits read as zero after the command is issued and this is normal behavior.

    The MODE bits are write only. For that I reported the reference manual internally for correction.

    Internal ticket number: 169917 (This is an internal tracking number and is not accessible or usable by customers).

    Thank you.

    Kaouthar