sdram read data error

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

sdram read data error

1,119 Views
yalin
Contributor II

We have a new board with RT1176 and sdram IS42S16160J, and I run the SDK evkmimxrt1170_semc_cm7 with the following modification.

sdramconfig.memsize_kbytes = 32 * 1024;
sdramconfig.portSize = kSEMC_PortSize16Bit;

The log shows that SEMC SDRAM 32/16/8 bit Data Write and Read Compare Failed! And the data read is random. I measured that the voltage and clock looks normally. I also tried modifying the semc clock frequency, the problem will still occur.

Can you give me some suggestions for this problem? Thanks.

Labels (1)
0 Kudos
11 Replies

1,086 Views
ramprakash09
Contributor II

Hi,

It's possible that the issue could be related to the timing parameters of the SDRAM. The SDRAM controller needs to be correctly configured to match the timing parameters specified in the SDRAM datasheet. If the timing parameters are not correctly set, it could lead to read/write errors.

Regards

1,056 Views
yalin
Contributor II

Thanks for support.

I tested my code ever on a sdram test board, which just has RT1176 and the sdram, and sdram can be read and written normally. And now I test it on my product board with complex function.

Can the data error problem be related to the PCB routing or other hardware reason we can measure?

0 Kudos

1,042 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi @yalin ,

  @ramprakash09 's reply is correct, your modification is not enough.

  You need to check your used SDRAM datasheet, and do the time parameter modification.

I mean this code:

status_t BOARD_InitSEMC(void)
{
    semc_config_t config;
    semc_sdram_config_t sdramconfig;
    uint32_t clockFrq = EXAMPLE_SEMC_CLK_FREQ;

    /* Initializes the MAC configure structure to zero. */
    memset(&config, 0, sizeof(semc_config_t));
    memset(&sdramconfig, 0, sizeof(semc_sdram_config_t));

    /* Initialize SEMC. */
    SEMC_GetDefaultConfig(&config);
    config.dqsMode = kSEMC_Loopbackdqspad; /* For more accurate timing. */
    SEMC_Init(SEMC, &config);

    /* Configure SDRAM. */
    sdramconfig.csxPinMux           = kSEMC_MUXCSX0;
    sdramconfig.address             = 0x80000000;
    sdramconfig.memsize_kbytes      = 2 * 32 * 1024;       /* 64MB = 2*32*1024*1KBytes*/
    sdramconfig.portSize            = kSEMC_PortSize32Bit; /*two 16-bit SDRAMs make up 32-bit portsize*/
    sdramconfig.burstLen            = kSEMC_Sdram_BurstLen8;
    sdramconfig.columnAddrBitNum    = kSEMC_SdramColunm_9bit;
    sdramconfig.casLatency          = kSEMC_LatencyThree;
    sdramconfig.tPrecharge2Act_Ns   = 15; /* tRP 15ns */
    sdramconfig.tAct2ReadWrite_Ns   = 15; /* tRCD 15ns */
    sdramconfig.tRefreshRecovery_Ns = 70; /* Use the maximum of the (Trfc , Txsr). */
    sdramconfig.tWriteRecovery_Ns   = 2;  /* tWR 2ns */
    sdramconfig.tCkeOff_Ns =
        42; /* The minimum cycle of SDRAM CLK off state. CKE is off in self refresh at a minimum period tRAS.*/
    sdramconfig.tAct2Prechage_Ns       = 40; /* tRAS 40ns */
    sdramconfig.tSelfRefRecovery_Ns    = 70;
    sdramconfig.tRefresh2Refresh_Ns    = 60;
    sdramconfig.tAct2Act_Ns            = 2; /* tRC/tRDD 2ns */
    sdramconfig.tPrescalePeriod_Ns     = 160 * (1000000000 / clockFrq);
    sdramconfig.refreshPeriod_nsPerRow = 64 * 1000000 / 8192; /* 64ms/8192 */
    sdramconfig.refreshUrgThreshold    = sdramconfig.refreshPeriod_nsPerRow;
    sdramconfig.refreshBurstLen        = 1;
    sdramconfig.delayChain             = 6; /* For all tempeatures. */

    return SEMC_ConfigureSDRAM(SEMC, kSEMC_SDRAM_CS0, &sdramconfig, clockFrq);
}

 

Please check your SDRAM datasheet and do the modification, thanks.

If you still have issues about it, please kindly let me know.

Best Regards,

kerry

0 Kudos

1,035 Views
yalin
Contributor II

Thanks for support, @kerryzhou

I have ever read and written sdram IS45S16160J correctly on a test board, just with rt1176 and the sdram, and I found it is not sensitive to the timing parameters, with modifying the sdramconfig.memsize_kbytes and sdramconfig.portSize, it can work well. But it can't work on our product board, so I guess it may be because of some hardware reason.

Also, I tried to modify the timing parameters according to the datasheet, but the sdram will still fail to read and write, and the error data seems same as before like the following.

error dataerror data

Do you have other ideas for us to check? Thanks.

0 Kudos

1,026 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi @yalin ,

   From your picture, the external SDRAM seems not working.

  Do you test this code in the customer board:

SDK_2_14_0_MIMXRT1170-EVK\boards\evkmimxrt1170\driver_examples\semc\sdram\cm7

 You can debug it.

What's the printf result? Write, read situation. Can you write it successful or just read is wrong.

  Please also check the hardware, SDRAM hardware is recommended like this:

kerryzhou_0-1693288603250.png

  Then, it is the design, whether it is similar to the EVK board or not?

 

Best Regards,

Kerry

 

0 Kudos

1,010 Views
yalin
Contributor II

@kerryzhou Thanks for support.

The log is like the following, and it can't show 'Read' is wrong or 'Write' is wrong, just 'Compare Failed'

SEMC SDRAM Memory 32 bit Write Start, Start Address 0x80000000, Data Length 4096 !

 SEMC SDRAM Read 32 bit Data Start, Start Address 0x80000000, Data Length 4096 !

SEMC SDRAM 32 bit Data Write and Read Compare Start!

SEMC SDRAM 32 bit Data Write and Read Compare Failed!

Is there any way to see that 'Read' is wrong or 'Write' is wrong?

0 Kudos

989 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi @yalin ,

  Please debug this code:

kerryzhou_0-1693371991563.png

 

Step by step, check the sdram_writeBuffer and sdram, sdram_readBuffer array.

make sure the writebuffer is 0,1,2,3...

Then, sdram arry write it, then readout the sdram to check it.

If still have issues, please also share me your partical schematic.

If you are not convenient to share it in the public community, you can create a new private case and at kerry zhou, then I will reply email to you directly iin private nstead of the public community.

About the process to create the private case:

1. Open below SUPPORT site, click blue "Go to Tickets" in the middle.
http://www.nxp.com/support/support:SUPPORTHOME

2.Then you will be requested to Login, if you have no an account, please first Register with your business email.

3.After login, please "Create New Cases" button in the middle, then you can submit your question.

In the case content, write assign to kerry zhou, then I will help you to check your schematic.

 

Best Regards,

kerry

0 Kudos

987 Views
yalin
Contributor II

Thanks for support, @kerryzhou 

I have checked that the sdram_writeBuffer is right, the value of sdram array is wrong from the 'Memory Monitor', and then, sdram_readBuffer can read back the wrong value.

So, it is a write error problem, what's the possible reason about that?

0 Kudos

984 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi @yalin ,

  It means your SDRAM totally not work.

  So, need to check your SDRAM RT related schematic, and the SDRAM initialization code.

   Just as I told you, if you are not convenient, create the private case, share the schematic, the SDRAM modified project to me, then I will help you to check it in details.

 

Best Regards,

Kerry

0 Kudos

980 Views
yalin
Contributor II

Thanks for support, @kerryzhou 

I forget write 'Please assign to kerry zhou' while creating the sase, but updating a comment for it. And the case number is 00561113, can you get it?

0 Kudos

972 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi @yalin ,

  Don't worry, I already take your case.

  I will help you to check it and reply to you privately in your new case.

   Thanks a lot for your cooperation.

best Regards,

kerry

0 Kudos