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.

Confirmation of how to connect TMS320C6713B with Flash,RAM and ROM

Other Parts Discussed in Thread: TMS320C6713B

Hi, 

I am working on TMS320C6713B DSP. I have made a code in CCS. My research tells me that code can be placed in external Flash (256x16bit) which can then be interfaced to C6713B. Datasheet of C6713 suggests that EMIF provides glues less interface to connect peripherals like flash etc. Further following the documents like spra568 and spra542a I have concluded that in hardware I can connect DSP directly with Flash using the pins mentioned in the above documents (spra568 and spra542a). and in software I need to configure the specific registers of EMIF. 
 Can you kindly guide me if I am missing anything? that is do i need to connect any other hardware between DSP and external flash. 

Also in the design given by Spectrum digital, they have connected a CPLD in between DSP and Flash. What is the purpose of that CPLD. Do I need to connect CPLD in my case too.?

 Kindly guide me in this regard.

Thank you

Maheen

  • Hi Maheen,

    Thanks for your post.

    CPLD, A complex programmable logic device that is made up of several simple PLDs (SPLDs) with a programmable switching matrix in between the logic blocks. CPLDs typically use EEPROM, flash memory or SRAM to hold the logic design interconnections, so, connecting CPLD's are based out of your design requirement, but in your case, you shall just follow as mentioned in the documents (spra568 and spra542a), you can connect DSP directly with flash using the pinout specifications.

    Thanks & regards,

    Sivaraj K

    ------------------------------------------------------------------------------------------------------- 
    Please click the Verify Answer button on this post if it answers your question.
    --------------------------------------------------------------------------------------------------------
  • Thanks alot Sivaraj K for your kind response. 


     Now I want to configure my EMIF registers as shown in Appendix B of spra568. I am copying the exact same code in CCS. But I am having many errors in that code. for example
    ERROR:

    unresolved symbol _emif_config, first referenced in ./project.obj  EMIF_flash line 0 1390219485311 341

      In order to remove the error I searched alot if I couldn find any document/ guide on configuring EMIF but I'm unable to find any useful document.

    I followed the other link you shared i.e 

    http://processors.wiki.ti.com/index.php/Flashing_the_C6713_EVM 

    but it also doesn't give any instruction on how  to write its code in CCS. Main questions in my mind are
    Q1. Whether CCS can be used to configure EMIF.

    if yes than

    Q2 What are the values needed to be assigned to EMIF control registers?

    Q3. What are the commands to configure EMIF registers.?

    Considering my device is C6713 processor, Flash is being connected to it, working in little endian mode.

    Waiting for your kind response.

    Thank you

    Maheen  

  • Hi 

    I am waiting for your kind response.

    Thank you.

  • hi Maheen,

    Thanks for your update.

    You already have the best document in hand which is Appendix B of spra568 to get sample code to program flash through EMIF interface. This would be the better benchmark to configure EMIF control registers and the usage of flash commands to best utilize its functionality. Additionally, to address your Q1, there is no relation between CCS and EMIF configuration since CCS is an editor *** compiler which is able to compile standard C libraries as well TI based assembler intrinsics. So, there is no issue in using software configuration of flash device through EMIF interface.

    I think, the error you mentioned above like "unresolved symbol _emif_config" is due to the missing of CSL libraries mapped to the CCS project. If you notify in the spra568 document, the sample code which is a part of CCS project which uses CSL API calls which would be resolved in linking the CSL libraries to the CCS project build properties. Once the object symbol emif_config is resolved with in the project, you would be able to map the EMIF configuration with the flash device.

    In my opinion, fixing the above error mentioned in your post would be the best option for C6713B to successfully interface with flash device through EMIF.

    Thanks & regards,

    Sivaraj K

    ------------------------------------------------------------------------------------------------------- 
    Please click the Verify Answer button on this post if it answers your question.
    --------------------------------------------------------------------------------------------------------
  • Thanks alot for your help Sivaraj K.

    Following your advice in order to remove the error I made the project again

    I have added CSL library 

    "C:\C6xCSL\include" in inludes

    "C:\C6xCSL\lib_3x\csl6713.lib"

     and linker command file 
    C6713.cmd

    Now it is not giving me the error mentioned above. 

    But now it is giving me new errors in code e,g

    "declaration is incompatible with "int ctrl_addr2" (declared at line 119)  in code of spra568"

    line 119 is int * ctrl_addr1 = (int *) ((int)flash_ptr + (0x555 << 2));

    Can you help me with errors like this?

    Thank you.

    Regards,

    Maheen.

  • Okay the previous errors have been removed. Now I'm getting errors like 

    identifier "EMIF_CE0_CTRL" is undefined 

    identifier "EMIF_CE1_CTRL" is undefined 
    identifier "EMIF_CE2_CTRL" is undefined 
    identifier "EMIF_CE3_CTRL" is undefined 
    identifier "EMIF_GCTRL" is undefined 
    identifier "EMIF_SDRAM_CTRL" is undefined 
    identifier "EMIF_SDRAM_REF" is undefined 
    identifier "MTYPE_32ASYNC" is undefined 
    identifier "MTYPE_SZ" is undefined 
    identifier "MTYPE" is undefined
    identifier "READ_HOLD_SZ" is undefined 
    identifier "READ_HOLD" is undefined 
    identifier "READ_SETUP_SZ" is undefined 
    identifier "READ_SETUP" is undefined
    identifier "READ_STROBE_SZ" is undefined 
    identifier "READ_STROBE" is undefined 
    identifier "WRITE_HOLD_SZ" is undefined
    identifier "WRITE_HOLD" is undefined
    identifier "WRITE_SETUP_SZ" is undefined
    identifier "WRITE_SETUP" is undefined
    identifier "WRITE_STROBE_SZ" is undefined 
    identifier "WRITE_STROBE" is undefined
     

    I think I'm getting these errors either because I haven't added any particular library or header file or some particular function is not being called properly.

    Why do you think these errors might be occurring.?

    Thank you

    Maheen

  • I am sorry to bother you again and again but now my previous errors have also been removed I manually defined them like this

    #define EMIF_CE1_CTRL   0x01800004 //EMIF CE1 space control 

    Now it is giving me error at GET_REG and emif_init i.e 

    unsigned int g_ctrl     = GET_REG(EMIF_GCTRL);

    emif_init(g_ctrl, ce0_ctrl, ce1_ctrl, ce2_ctrl, ce3_ctrl,sdram_ctrl, sdram_ref);

    spra273 tells me to define these functions(GET_REG and emif_init). but another link told me that for C6713 , if I have added CSL library I don't need to define them. as CSL library will fill this purpose for me.

    Kindly tell me what is it them I'm doing wrong.?

    Thank you 

    Regards

    Maheen

  • Okay I don't know if its the right thing to do but now there are no errors in the code.

    I am still copying the exact code to interface flash with EMIF provided in Appendix B of spra568. The only change I've made is that  I have replaced the function of "emif_config();" with "EMIF_config(&MyConfig);". 

    My  reference was spru401j. In its chapter 9 it has mentioned in 9-5 

    This is the EMIF configuration structure used to set up the EMIF peripheral.
    You create and initialize this structure and then pass its address to the EMIF_config() function.


    that is I have removed 

    void emif_config();

     and have placed 

    void EMIF_config(EMIF_Config *config);
    EMIF_Config MyConfig = {
    0x01800000, /* gblctl */
    0x01800008, /* cectl0 */
    0x01800004, /* cectl1 */
    0x01800010, /* cectl2 */
    0x01800014, /* cectl3 */
    0x01800018, /* sdctl */
    0x0180001C, /* sdtim */
    0x01800020 /* sdext */
    };

    and have called it in main where previously  "emif_config();" was being called. 

    Rest of the code is exactly same. Values in the above registers are obtained from datasheet of DSP C6713 (peripheral register descriptions).

    Now kindly let me know if I have done the right thing? and it will work in hardware.?

    Waiting for your response.

    Thank you,

    Regards

    Maheen 

  • Hi, 

    Please reply to my posts. I'm waiting for your reply.

    Also I don't understand the addresses in erase_flash function. i.e 

    int erase_flash(int *flash_ptr)
    {
    //write erase chip cmd sequence
    int *ctrl_addr1 = flash_ptr + (0x555 << 2);
    int *ctrl_addr2 = (int *) ((int)flash_ptr + (0x2aa << 2));
    int pass = TRUE;
    *ctrl_addr1 = 0xaa; /* Erase sequence writes to addr1 and addr2 */
    *ctrl_addr2 = 0x55; /* with this data */
    *ctrl_addr1 = 0x80;
    *ctrl_addr1 = 0xaa;
    *ctrl_addr2 = 0x55;
    *ctrl_addr1 = 0x10;
    pass = poll_data(flash_ptr, (unsigned char) 0xff);
    if (!pass)
    printf("failed erase\n\n");
    return pass;
    }

    Can you plz tell what are these addresses?

    Plz do reply

  • Pubesh,

    Also please tell me that why is there no main function in this code? 

    It is giving me error 

    unresolved symbol _main, first referenced in C:/Program.

    I think it is giving me this error because of the absence of main function.

    Thanks