This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

TMS320F28388D: EMIF getting unexpected data.

Part Number: TMS320F28388D


Tool/software:

Hi Experts,

My customer is using SDRAM IS42R86400F on F28388D. They are writing data and read back to check if the SDRAM is running normally. However, they find the data read back is incorrect starting from the 1025kb, as shown in the following picture.

If they write and read manually in the expression window, the data read back is correct. The error only happens when they write and read via a loop. Any idea what might be the issue here?

Here are their settings:

CMD setting:

SDRAM           : origin = 0x80000000, length = 0x02000000  //512Mb, 8M*16bit*4banks

buffer defination

#pragma DATA_SECTION(".sdram_data");

__attribute__((far)) volatile uint32_t extSDRAMBuf[MEM_BUFFER_PAGE][MEM_BUFFER_SIZE];

mapfile:

SDRAM                 80000000   02000000  02000000  00000000  RWIX

And also the syscfg file

emif11.$name                                    = "myEMIF10";
emif11.useCase                                  = "CUSTOM";
emif11.enableCS2                                = false;
emif11.enableCS3                                = false;
emif11.enableCS4                                = false;
emif11.cs0Narrow                                = "EMIF_SYNC_NARROW_MODE_TRUE";
emif11.useInterfacePins                         = ["EMIF1_A0","EMIF1_A1","EMIF1_A10","EMIF1_A11","EMIF1_A12","EMIF1_A2","EMIF1_A3","EMIF1_A4","EMIF1_A5","EMIF1_A6","EMIF1_A7","EMIF1_A8","EMIF1_A9","EMIF1_BA0","EMIF1_BA1","EMIF1_CAS","EMIF1_CLK","EMIF1_CS0n","EMIF1_D0","EMIF1_D1","EMIF1_D10","EMIF1_D11","EMIF1_D12","EMIF1_D13","EMIF1_D14","EMIF1_D15","EMIF1_D2","EMIF1_D3","EMIF1_D4","EMIF1_D5","EMIF1_D6","EMIF1_D7","EMIF1_D8","EMIF1_D9","EMIF1_DQM0","EMIF1_DQM1","EMIF1_RAS","EMIF1_SDCKE","EMIF1_WEn"];
emif11.cs0CAWidth                               = "EMIF_SYNC_COLUMN_WIDTH_10";
emif11.cs0AddrMSB                               = "EM1A12";
emif11.selController                            = "EMIF_CONTROLLER_CPU1_G";
emif11.enableSyncSelfrefresh                    = true;
emif11.cs0Refresh                               = 750;
emif11.cs0tRFC                                  = 6;
emif11.cs0tRP                                   = 2;
emif11.cs0tRAS                                  = 5;
emif11.cs0tWR                                   = 2;
emif11.cs0tRRD                                  = 2;
emif11.emif1.$assign                            = "EMIF1";
emif11.emif1.emif1_cs0nPin.$assign              = "GPIO32";
emif11.emif1.emif1_sdckePin.$assign             = "GPIO29";
emif11.emif1.emif1_clkPin.$assign               = "GPIO30";
emif11.emif1.emif1_wenPin.$assign               = "GPIO31";
emif11.emif1.emif1_casPin.$assign               = "GPIO86";
emif11.emif1.emif1_rasPin.$assign               = "GPIO87";
emif11.emif1.emif1_dqm0Pin.$assign              = "GPIO88";
emif11.emif1.emif1_dqm1Pin.$assign              = "GPIO89";
emif11.emif1.emif1_ba0Pin.$assign               = "GPIO33";
emif11.emif1.emif1_ba1Pin.$assign               = "GPIO34";
emif11.emif1.emif1_a0Pin.$assign                = "GPIO35";
emif11.emif1.emif1_a1Pin.$assign                = "GPIO39";
emif11.emif1.emif1_a2Pin.$assign                = "GPIO40";
emif11.emif1.emif1_a3Pin.$assign                = "GPIO38";
emif11.emif1.emif1_a4Pin.$assign                = "GPIO44";
emif11.emif1.emif1_a5Pin.$assign                = "GPIO45";
emif11.emif1.emif1_a6Pin.$assign                = "GPIO46";
emif11.emif1.emif1_a7Pin.$assign                = "GPIO47";
emif11.emif1.emif1_a8Pin.$assign                = "GPIO48";
emif11.emif1.emif1_a9Pin.$assign                = "GPIO49";
emif11.emif1.emif1_a10Pin.$assign               = "GPIO50";
emif11.emif1.emif1_a11Pin.$assign               = "GPIO51";
emif11.emif1.emif1_a12Pin.$assign               = "GPIO52";
emif11.emif1.emif1_d0Pin.$assign                = "GPIO85";
emif11.emif1.emif1_d1Pin.$assign                = "GPIO83";
emif11.emif1.emif1_d2Pin.$assign                = "GPIO82";
emif11.emif1.emif1_d3Pin.$assign                = "GPIO81";
emif11.emif1.emif1_d4Pin.$assign                = "GPIO80";
emif11.emif1.emif1_d5Pin.$assign                = "GPIO79";
emif11.emif1.emif1_d6Pin.$assign                = "GPIO78";
emif11.emif1.emif1_d7Pin.$assign                = "GPIO77";
emif11.emif1.emif1_d8Pin.$assign                = "GPIO76";
emif11.emif1.emif1_d9Pin.$assign                = "GPIO75";
emif11.emif1.emif1_d10Pin.$assign               = "GPIO74";
emif11.emif1.emif1_d11Pin.$assign               = "GPIO73";
emif11.emif1.emif1_d12Pin.$assignAllowConflicts = "GPIO72";
emif11.emif1.emif1_d13Pin.$assign               = "GPIO71";
emif11.emif1.emif1_d14Pin.$assign               = "GPIO70";
emif11.emif1.emif1_d15Pin.$assign               = "GPIO69";
emif11.ba0Qual.padConfig                        = "PULLUP";
emif11.ba1Qual.padConfig                        = "PULLUP";
emif11.d0Qual.padConfig                         = "PULLUP";
emif11.d1Qual.padConfig                         = "PULLUP";
emif11.d10Qual.padConfig                        = "PULLUP";
emif11.d11Qual.padConfig                        = "PULLUP";
emif11.d12Qual.padConfig                        = "PULLUP";
emif11.d13Qual.padConfig                        = "PULLUP";
emif11.d14Qual.padConfig                        = "PULLUP";
emif11.d15Qual.padConfig                        = "PULLUP";
emif11.d2Qual.padConfig                         = "PULLUP";
emif11.d3Qual.padConfig                         = "PULLUP";
emif11.d4Qual.padConfig                         = "PULLUP";
emif11.d5Qual.padConfig                         = "PULLUP";
emif11.d6Qual.padConfig                         = "PULLUP";
emif11.d7Qual.padConfig                         = "PULLUP";
emif11.d8Qual.padConfig                         = "PULLUP";
emif11.d9Qual.padConfig                         = "PULLUP";
emif11.dqm0Qual.padConfig                       = "PULLUP";
emif11.dqm1Qual.padConfig                       = "PULLUP";

  • Hi Hang,

    It looks like timing issue. Have you programmed the SDTIMR registers with the data from SDRAM memory datasheet properly?

  • Hi QJ,

    I'm the customer who met this issue.

    The SD Timer registers you means are below reg? we configurated them according to the datasheet.


    emif11.enableSyncSelfrefresh                    = true;
    emif11.cs0Refresh                               = 750;
    emif11.cs0tRFC                                  = 6;
    emif11.cs0tRP                                   = 2;
    emif11.cs0tRAS                                  = 5;
    emif11.cs0tWR                                   = 2;
    emif11.cs0tRRD                                  = 2;


    BTW, the test code is:

    uint16_t readWriteSyncMemory(uint32_t memSize)
    {
        uint32_t memWdl;
        
        //
        // Fill far memory buffer with data.
        //
        
        for(i=0; i < 0x400; i++)
        {
            for(j=0; j < Seg_Len; j++)
            {
                memWdl = 0x0;
                for(k=0; k < memSize; k++)
                {
                    extSDRAMBuf[i<<5+j][k] = memWdl;
                    memWdl += 0x00050001;
                }
            }
            vTaskDelay(1);
        }
    
        //
        // Read far memory buffer into local buffer and verify data.
        //
        for (i = 0; i < 0x400; i++)
        {
            for (j = 0; j < Seg_Len; j++)
            {
                memWdl = 0x0;
                for (k = 0; k < memSize; k++)
                {
                    localRAMBuf[k] = extSDRAMBuf[i<<5+j][k];
    
                    //
                    // Return error if read data is incorrect.
                    //
                    if (localRAMBuf[k] != memWdl)
                    {
                        return (k?k:1);
                    }
                    memWdl += 0x00050001;
                }
            }
            vTaskDelay(1);
        }
        return(0);
    }

    We put it in the freeRTOS task before for(;;), the code is refer the TI's example SDRAM program.

    This issue is critical for us, looking forward to get the feedback ASAP, thanks!

  • BTW, before that, we also tried modify the time reg by increasing them 1 or 2, but the test result is the same. the data corruption seems always be the same address start from 1025Kb. we add a offline SDRAM data single 16 bits read/write command, and test result is good for these space.

  • Even if the data is corrupted, the SDRAM test is pass in test code, means no entry in return (k?k:1); and return 0 finally, so i'm not sure is the issue caused by memory copy or stack corruption.

    I'll check write all the SDRAM space with same const data value to address this issue.

  • Hi Dongdong,

    How to tried SDK emif_ex3_16bit_sdram_far example with your timing parameters? 

  •        
            //
            // Configure SDRAM control registers
            //
            // Need to be programmed based on SDRAM Data-Sheet.
            //T_RFC = 60ns = 0x6
            //T_RP  = 18ns = 0x1
            //T_RCD = 18ns = 0x1
            //T_WR  = 1CLK + 6 ns = 0x1
            //T_RAS = 42ns = 0x4
            //T_RC  = 60ns = 0x6
            //T_RRD = 12ns = 0x1
            //
            Emif1Regs.SDRAM_TR.all = 0x31114610;
    
            //
            //Txsr = 70ns = 0x7
            //
            Emif1Regs.SDR_EXT_TMNG.all = 0x7;
    Tried this example time setting, same result, fail.
    Also tried copy same const data, same result, fail.
    Currently we didn't use memcpy_fast_far() and just directly copy the data, not sure will it have impact for this.
  • When we did the code change below(Line 10 to Line 11, write the pointer content instead of data array content, same address actually), it test OK. All the data write and read are correct.
        volatile uint32_t memWdl;
        volatile uint32_t *pmemWdl = extSDRAMBuf[0];
    
        //
        // Fill far memory buffer with data.
    	@@ -124,16 +125,18 @@ uint16_t readWriteSyncMemory(uint32_t memSize)
                memWdl = 0x0;
                for(k=0; k < memSize; k++)
                {
                    // extSDRAMBuf[i<<5+j][k] = memWdl;
                    *pmemWdl++ = memWdl;
                    memWdl += 0x00050001;
                }
            }
            vTaskDelay(1);
        }
    The data buffer we defined is very big (cover all the SDRAM space), we don't know why did this cause trouble, pls help to clarify.
    //
    // Buffer in far memory.
    //
    #pragma DATA_SECTION(".sdram_data");
    __attribute__((far)) volatile uint32_t extSDRAMBuf[MEM_BUFFER_PAGE][MEM_BUFFER_SIZE];
  • Hi, 

    The EMIF1 on F2837x devices has the SDRAM address at 0x80000000 which is above 22 bits address (far memory). The attribute __attribute__((far)) should be used to declare a far data object. This attribute lets the compiler use 32-bit address.

    Please refer to attached application note:

    Accessing External SDRAM on the TMS320F2837x/2807x Microcontrollers Using C/C++

  • he data buffer we defined is very big (cover all the SDRAM space), we don't know why did this cause trouble, pls help to clarify.

    The array size may exceed the upper boundary of the SDRAM memory. The maximum value of "i" in your code is 0x400 < 5 = 0x8000, if MEM_BUFFER_SIZE=0x500 (used in example), the array size is 0x8000*0x500 = 0x280.0000 which is >  memory size (0x20.0000 defined in your cmd file).

  • //total SDRAM size is 8M * 16bit * 4 banks
    #define MEM_BUFFER_SIZE 0x200  //1K words
    #define MEM_BUFFER_PAGE (uint16_t)(0x400 * 8 * 4) //8K * 4 banks

    The extSDRAMBuf total size is 0x8000*0x200 = 0x100 0000, each unit is 32bits so it's 0x200 0000 words which is same as we defined in .cmd.

  • Hi DOngdong,

    Please double check your code:

    for(i=0; i < 0x400; i++)

    {

    for(j=0; j < Seg_Len; j++)
    {
              memWdl = 0x0;
              for(k=0; k < memSize; k++)
              {
                     extSDRAMBuf[i<<5+j][k] = memWdl;
                     memWdl += 0x00050001;
               }
    }

    }

    If i=0x400, j=1, amd memSize=0x200 (MEM_BUFFER_SIZE), the address is at (0x400 << 5 + 2) *0x200 * 4 (bytes) = 0x8002*0x200 *4= 0x400_1000 (bytes)

    0r 0x200_0800 16-bit words

  • Hi QJ,

    The `i` will not to 0x400, only 0x3FF, the Seg_Len max is 0x20, so j max is 0x1F, in your formula, the addr is (0x3FF << 5 + 0x1F) *0x200 * 2 (words) = 0x1FF 0C00 which is in valid range.

  • Hi Dongdong,

    I think you have solved the problem using pointer instead of array, right? 

  • Hi Yang,

    Sent you a webex message regarding my test.

    I did a test with AS4C4M16SA SDRAM (4Mx16 bit). Writing to and reading back the whole memory work fine. Attached is my modified code. The column address is updated based on SDRAM datasheet:

    //#############################################################################
    //
    // FILE:   emif_ex3_16bit_sdram_far.c
    //
    // TITLE:  EMIF1 module accessing 16bit SDRAM using memcpy_fast_far().
    //
    //! \addtogroup driver_example_list
    //! <h1> EMIF1 module accessing 16bit SDRAM using memcpy_fast_far(). </h1>
    //!
    //! This example configures EMIF1 in 16bit SYNC mode and uses CS0 as chip
    //! enable.It will first write to an array in the SDRAM and then read it
    //! back using the FPU function, memcpy_fast_far(), for both operations.
    //!
    //! The buffer in SDRAM will be placed in the .farbss memory on account
    //! of the fact that its assigned the attribute "far" indicating it lies
    //! beyond the 22-bit program address space. The compiler will take care
    //! to avoid using instructions such as PREAD, which uses the Program
    //! Read Bus, or addressing modes restricted to the lower 22-bit space
    //! when accessing data with the attribute "far".
    //!
    //! \note The memory space beyond 22-bits must be treated as data space
    //! for load/store operations only. The user is cautioned against using
    //! this space for either instructions or working memory.
    //!
    //! \b External \b Connections \n
    //!  - External SDR-SDRAM memory (MT48LC32M16A2 -75) daughter card
    //!
    //! \b Watch \b Variables \n
    //! - \b testStatusGlobal - Equivalent to \b TEST_PASS if test finished
    //!                         correctly, else the value is set to \b TEST_FAIL
    //! - \b errCountGlobal - Error counter
    //!
    //
    //#############################################################################
    //
    // 
    // $Copyright:
    // Copyright (C) 2013-2024 Texas Instruments Incorporated - http://www.ti.com/
    //
    // Redistribution and use in source and binary forms, with or without 
    // modification, are permitted provided that the following conditions 
    // are met:
    // 
    //   Redistributions of source code must retain the above copyright 
    //   notice, this list of conditions and the following disclaimer.
    // 
    //   Redistributions in binary form must reproduce the above copyright
    //   notice, this list of conditions and the following disclaimer in the 
    //   documentation and/or other materials provided with the   
    //   distribution.
    // 
    //   Neither the name of Texas Instruments Incorporated nor the names of
    //   its contributors may be used to endorse or promote products derived
    //   from this software without specific prior written permission.
    // 
    // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
    // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
    // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
    // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 
    // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 
    // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 
    // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
    // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
    // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 
    // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 
    // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    // $
    //#############################################################################
    
    //
    // Included Files
    //
    #include "device.h"
    #include "driverlib.h"
    
    //
    // FPU header file to access memcpy_fast_far().
    //
    #include "fpu_vector.h"
    
    //
    // Defines
    //
    #define TEST_PASS 0xABCDABCD
    #define TEST_FAIL 0xDEADDEAD
    #define MEM_BUFFER_SIZE0 0x500
    #define MEM_BUFFER_SIZE 0x200000 /*the size of the SDRAM 4M x 16 bit */
    //
    // Globals
    //
    uint16_t errCountGlobal = 0;
    uint32_t testStatusGlobal;
    uint32_t errCount=0;
    
    //
    // Buffer in local memory.
    //
    uint32_t localRAMBuf[MEM_BUFFER_SIZE0];
    
    //
    // Buffer in far memory.
    //
    __attribute__((far)) volatile uint32_t extSDRAMBuf[MEM_BUFFER_SIZE];
    
    #pragma DATA_SECTION(localRAMBuf, "ramgs0");
    
    //
    // Function Prototypes
    //
    extern void setupEMIF1PinmuxSync16Bit(void);
    void clearDataBuffer(uint32_t memSize);
    uint16_t readWriteSyncMemory(uint32_t memSize);
    
    //
    // Main
    //
    void main(void)
    {
        uint16_t i;
        uint16_t errCountLocal;
        EMIF_SyncConfig sdConfig;
        EMIF_SyncTimingParams tParam;
        testStatusGlobal = TEST_FAIL;
    
        //
        // Initialize device clock and peripherals.
        //
        Device_init();
    
        //
        // Disable all the interrupts.
        //
        DINT;
    
        //
        // Setup GPIO by disabling pin locks and enabling pullups.
        //
        Device_initGPIO();
    
        //
        // This function initializes the PIE control registers. After globally
        // disabling interrupts and enabling the PIE, it clears all of the PIE
        // interrupt enable bits and interrupt flags.
        //
        Interrupt_initModule();
    
        //
        // Initializes the PIE vector table by setting all vectors to a default
        // handler function.
        //
        Interrupt_initVectorTable();
    
        //
        // Enable Global Interrupt (INTM) and realtime interrupt (DBGM).
        //
        EINT;
        ERTM;
    
        //
        // Configure to run EMIF1 on half Rate. (EMIF1CLK = CPU1SYSCLK/2)
        //
        SysCtl_setEMIF1ClockDivider(SYSCTL_EMIF1CLK_DIV_2);
    
        //
        // Grab EMIF1 For CPU1.
        //
        EMIF_selectMaster(EMIF1CONFIG_BASE, EMIF_MASTER_CPU1_G);
    
        //
        // Disable Access Protection. (CPU_FETCH/CPU_WR/DMA_WR)
        //
        EMIF_setAccessProtection(EMIF1CONFIG_BASE, 0x0);
    
        //
        // Commit the configuration related to protection. Till this bit remains
        // set content of EMIF1ACCPROT0 register can't be changed.
        //
        EMIF_commitAccessConfig(EMIF1CONFIG_BASE);
    
        //
        // Lock the configuration so that EMIF1COMMIT register can't be changed
        // any more.
        //
        EMIF_lockAccessConfig(EMIF1CONFIG_BASE);
    
        //
        // Configure GPIO pins for EMIF1.
        //
        setupEMIF1PinmuxSync16Bit();
    
        //
        // Configure SDRAM control registers. Needs to be
        // programmed based on SDRAM Data-Sheet. For this example:
        // T_RFC = 60ns = 0x6; T_RP  = 18ns = 0x1;
        // T_RCD = 18ns = 0x1; T_WR  = 1CLK + 6 ns = 0x1;
        // T_RAS = 42ns = 0x4; T_RC  = 60ns = 0x6;
        // T_RRD = 12ns = 0x1.
        //
    
        // QJ, AS4C4M16SA SDRAM
        // tRC=60ns, tRAS=42ns; t
        //
        tParam.tRfc = 0x6U;
        tParam.tRp  = 0x1U;
        tParam.tRcd = 0x1U;
        tParam.tWr  = 0x1U;
        tParam.tRas = 0x4U;
        tParam.tRc  = 0x6U;
        tParam.tRrd = 0x1U;
        EMIF_setSyncTimingParams(EMIF1_BASE, &tParam);
    
        //
        // Configure Self Refresh exit timing.
        // Txsr = 70ns = 0x7.
        //
        EMIF_setSyncSelfRefreshExitTmng(EMIF1_BASE, 0x7U);
    
        //
        // Configure Refresh Rate.
        // Tref = 64ms for 8192 ROW, RR = 64000*100(Tfrq)/8192 = 781.25 (0x30E).
        //
        EMIF_setSyncRefreshRate(EMIF1_BASE, 781);
    
        //
        // Configure SDRAM parameters. PAGESIZE=2 (1024 elements per ROW),
        // IBANK = 2 (4 BANK), CL = 3, NM = 1 (16bit).
        //
        sdConfig.casLatency = EMIF_SYNC_CAS_LAT_3;
        sdConfig.iBank = EMIF_SYNC_BANK_4;
        sdConfig.narrowMode = EMIF_SYNC_NARROW_MODE_TRUE;
        sdConfig.pageSize = EMIF_SYNC_COLUMN_WIDTH_8; //10;
        EMIF_setSyncMemoryConfig(EMIF1_BASE, &sdConfig);
    
        //
        // Adding some delay.
        //
        for(i = 0; i < 123; i++)
        {
        }
    
        //
        // Clear local and far memory buffers.
        //
       clearDataBuffer(MEM_BUFFER_SIZE);
    //    clearDataBuffer0(MEM_BUFFER_SIZE);
        //
        // Basic read/write check.
        //
        errCountLocal  = readWriteSyncMemory(MEM_BUFFER_SIZE);
        errCountGlobal = errCountGlobal + errCountLocal;
        if(errCountGlobal == 0x0)
        {
            testStatusGlobal = TEST_PASS;
        }
    
        //
        // Checking total memory accesses.
        //
        uint32_t totAccess = EMIF_getSyncTotalAccesses(EMIF1_BASE);
        uint32_t totActAccess = EMIF_getSyncTotalActivateAccesses(EMIF1_BASE);
        while(1);
    }
    
    //
    // Clear Data Buffer - This function clears the memory location of size memSize.
    //
    void clearDataBuffer(uint32_t memSize)
    {
        uint32_t i;
        uint32_t memWdl = 0x0;
    
        //
        // Clear far memory buffer.
        //
        for(i=0; i < memSize; i++)
        {
            memcpy_fast_far((extSDRAMBuf + i), &memWdl, 2);
        }
    
        //
        // Clear local memory buffer.
        //
        for(i = 0; i < 0x500; i++)
        {
            localRAMBuf[i] = memWdl;
        }
    }
    //
    // Read Write Sync Memory - This function writes data into memory & verifies
    // the written data.
    //
    uint16_t readWriteSyncMemory(uint32_t memSize)
    {
        uint32_t memWdl, abc;
        uint32_t i, k, qj=0;
    
        //
        // Fill far memory buffer with data.
        //
        memWdl = 0x0;
        for(i=0; i < memSize; i++)
        {
            abc = *(uint32_t*)(0x80000000);
            if( abc != 0x0){
               qj++;
            }
    
            if(i%0x200 == 0)
            {
                k=i*2;
            }
            memcpy_fast_far((extSDRAMBuf + i), &memWdl, 2);
            memWdl = memWdl + 2; // += 0x00050001;
        }
    
        //
        // Read far memory buffer into local buffer and verify data.
        //
        memWdl = 0x0;
        for(i=0; i < memSize/0x200; i++)
        {
            for(k=0; k < 0x200; k++)
            {
                memcpy_fast_far((localRAMBuf + k), (extSDRAMBuf + i*0x200 + k), 2);
    
                //
                // Return error if read data is incorrect.
                //
                if(localRAMBuf[k] != memWdl)
                {
                    return(1);
                    errCount++;
                }
                memWdl = memWdl + 2;
            }
        }
    
        return(errCount);
    }
    //
    // End of File
    //
    

  • Yes, we resolved this issue.

    The issue is caused by the operator priority, when change i<<5+jto (i<<5)+j resolved this issue, test OK.

    because the + priority is higher than <<.

    Thanks anyway! 

    This topic could be closed.