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.

Testing external SDRAM and NVRAM connected to DSP TMS320DM642

Other Parts Discussed in Thread: TMS320DM642

Greetings!

I am working with a circuit board that has a TMS320DM642 DSP connected to external SDRAM and NVRAM. I wish to be able to test this external memory, either via the Ethernet interface using TCP/IP protocol or via the JTAG interface. Can the testing be implemented this way? Do you have any code examples of how this would be done?

Kenny G

Artisan Electronics

  • Ken Grohman,

    You can get the external memory test code at the below link,
    The "Target Content" have the BSL and test code.  
    http://c6000.spectrumdigital.com/evmdm642/
    In addition that,get more details refer the below link,
    http://www.ti.com/tool/tmdsevm642

  • Hi Pubesh!

    1.) Thank you for your quick response. It was very helpful. However, I am concerned about the test time required to test 512 MB of external SDRAM, connected to the TMS320DM642, via the JTAG connection. Can the SDRAM be accessed through the DSP via the Ethernet connection?

    2.) Does Code Composer shift BIT patterns through the JTAG chain to test the SDRAM? I saw no patterns in the example code for Test.c.

    /*  *  Memory functions  */

    Int16 MEM_fill(Uint32 start, Uint32 len, Uint32 val) {     Uint32 i, end;

        /* Calculate end of range */     end = start + len;

        /* Fill a range with a value */     for (i = start; i < end; i+=4)     {         *((Uint32 *)i) = val;     }

        /* Verify the data */     for (i = start; i < end; i+=4)     {         if (*((Uint32 *)i) != val)             return 1;     }

        return 0; }

    Int16 MEM_addr(Uint32 start, Uint32 len) {     Uint32 i, end;

        /* Calculate end of range */     end = start + len;

        /* Fill the range with its address */     for (i = start; i < end; i+=4)     {         *((Uint32 *)i) = i;     }

        /* Verify the data */     for (i = start; i < end; i+=4)         if (*((Uint32 *)i) != i)             return 2;

        return 0; }

    Int16 MEM_addrInv(Uint32 start, Uint32 len) {     Uint32 i, end;

        /* Calculate end of range */     end = start + len;

        /* Fill the range with its address */     for (i = start; i < end; i+=4)     {         *((Uint32 *)i) = ~i;     }

        /* Verify the data */     for (i = start; i < end; i+=4)         if (*((Uint32 *)i) != (~i))             return 4;

        return 0; }

    Int16 MEM_walking(Uint32 add) {     Int16 i;     Uint32 mask, *pdata;

        pdata = (Uint32 *)add;

        /* Walking ones and zeros */     mask = 1;     for (i = 0; i < 32; i++)     {         /* Test one in bit position i */         *pdata = mask;

            /* Do a dummy write to Flash to clear bus */         *((Uint8 *)EVMDM642_FLASH_BASE) = 0xf0;

            /* Check data */         if (*pdata != mask)             return 1;

            /* Test zero in bit position i */         *pdata = ~mask;

            /* Do a dummy write to Flash to clear bus */         *((Uint8 *)EVMDM642_FLASH_BASE) = 0xf0;

            /* Check data */         if (*pdata != (~mask))             return 8;

            mask = mask << 1;     }

        return 0; }

    Int16 MEM_bytestrobe(Uint32 add) {     Uint32 *pdata;     Uint8 *pcheck;

        /* Write pattern */     pdata = (Uint32 *)add;     *pdata = 0x12345678;

        /* Do dummy write */     pdata = (Uint32 *)EVMDM642_FLASH_BASE;     *pdata = 0x80808080;

        /* Check pattern */     pcheck = (Uint8 *)add;     if (*pcheck++ != 0x78)         return 0x10;     if (*pcheck++ != 0x56)         return 0x20;     if (*pcheck++ != 0x34)         return 0x40;     if (*pcheck++ != 0x12)         return 0x80;

        return 0; }

    Int16 MEM_test(Uint32 start, Uint32 len, Int16 patterntype) {     Int16 status = 0;

        if (!patterntype)     {         /* Run the fill tests */         status |= MEM_fill(start, len, 0x00000000);         status |= MEM_fill(start, len, 0x55555555);         status |= MEM_fill(start, len, 0xAAAAAAAA);         status |= MEM_fill(start, len, 0xFFFFFFFF);     } else     {         /* Run the address tests */         status |= MEM_addr(start, len);         status |= MEM_addrInv(start, len);     }

        return status; }

     

     

     

     

     

     

    Ken Grohman

  • Ken Grohman,

    The MEM_fill, MEM_addr and MEM_addrInv calls are used to test the external memory (SDRAM).
    Here you have to mention the SDRAM start address and length for test.
    Please have a look at the below link for how to test the memory using "CCS memory window"
    http://processors.wiki.ti.com/index.php/Troubleshooting_SDRAM_selection#Q:_what_to_do_after_the_design_is_done_and_the_board_is_assembled.2C_to_quickly_test_the_memory.3F

  • Hi Pubesh!

    You are giving me wonderful information, but let me explain my situation more clearly. I need to be able to test 512 M of SDRAM connected to my TMS320DM642 DSP from my test program. I can do this one of two ways:

     

    1) By accessing the EMIFA control registers, via the Ethernet connection, to do a MEMREAD and MEMWRITE by DMA (Direct Memory Access). Or

    2.) By shifting patterns, via JTAG into the DSP's boundary scan register chain.

    In either way, I am asking :

    What Ethernet messages do I send to set the EMIFA control registers to do a MEMREAD/MEMWRITE?

    Sample code?

    What JTAG patterns do I need to shift in to READ/WRITE to the SDRAM via the JTAG boundary scan register chain?

    Sample code?

    I am not trying to re-invent the wheel here. I am sure code for testing external SDRAM connected to the TMS320DM642 exists. I am just trying to adapt it for my particular situation.

     

    Ken Grohman