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.

How to configure EXTRAM for TMS320VC5401?

Other Parts Discussed in Thread: TMS320VC5401

Hi,


I want to use external RAM in my program.

But i am not able to access it, if i run program from Internal memory then program is working fine.

and if i try to run program from EXTRAM then DSP is not working.

In linker command file i am listing EXTRAM from 0x10000 to 0x1FFFF and in my program SWWSR = 0x7FFF and OVLY bit is set to zero.

so as per my understanding Now the DSP can only see the EXTRAM and not the internal DARAM. Is it right?

 

Please suggest me how can i access external RAM ?

 

The below is the linker command file which i am using please let me know if any thing is missed in below file for EXTRAM.


MEMORY
{   
    MMR    (RWIX):     origin = 0x00000, length = 0x0060
    SCRATCH (RWXI):    origin = 0x00060, length = 0x0020   
    DARAM (RWXI):    origin = 0x01000, length = 0x2000   
    EXTROM (RXI):    origin = 0x0F000, length = 0x1000
     EXTRAM (RWXI):  origin = 0x10000, length = 0x10000 
   
}
 
SECTIONS
{      
    .bss        :>  EXTRAM PAGE 0                /* Global & static vars        */
    vecs        :>  EXTRAM PAGE 0                /* Interrupt vectors           */
    .stack        :>  EXTRAM PAGE 0                /* Primary system stack        */
       .sysstack    :>  EXTRAM PAGE 0                /* Secondary system stack      */
       .sysmem        :>  EXTRAM PAGE 0                /* Dynamic memory (malloc)     */
       .text        :>  EXTRAM PAGE 0                /* Code                        */
       .data        :>  EXTRAM PAGE 0                /* Initialized vars            */
       .cinit        :>  EXTRAM PAGE 0                /* Auto-initialization tables  */
       .const        :>  EXTRAM PAGE 0                /* Constant data               */
       .cio        :>  EXTRAM PAGE 0                /* C I/O buffers               */
       .switch        :>  EXTRAM PAGE 0                /* Switch statement tables     */
       .pinit        :>  EXTRAM PAGE 0                /* Initialization fn tables    */
       .args        :>  EXTRAM PAGE 0                /* Arguments to main()         */
}


Awaiting for your early reply,

Thanking you in Advance,


Best Regards,

Ashwin Panchal

  • It appears that this post is the same as

    http://e2e.ti.com/support/dsp/tms320c5000_power-efficient_dsps/f/109/p/84168/328707.aspx#328707

     

    Hyun Kim will take a look at this issue sometime next week once. Hope it is OK with you.

     

    Regards,

    Peter Chung

  • Hi Hyun,

     

    I am still waiting for your reply.

     

     

    Regards,

    Ashwin Panchal

  • Hi,

    I reviewed your linker file and found out the .text is not in the  right spot.

    .text :>  ROM_EXT  PAGE 1  /* Code                        */

    ==> .text :> DARAM1 | DARAM2 PAGE 0 /* code */

    When it compile your program it should be at the ram area. 

     

    After compile, Hex tool converts it to bootable code. 

    When it boots, bootloader reads codes from ROM and moves to ram.

    Regards,

    Hyun

  • Hi Hyum,

     

    Thanks for your reply & above information.

     

    Please suggest me how can i configure EXTRAM in linker file and in my program?

    The latest i used linker file is as below for TMS320VC5401 with initialized XPC=1; OVLY=0; & DROM=0 in my main program,

    MEMORY
    {   
        MMR    (RWIX) :    origin = 0x00000, length = 0x0060
        SCRATCH (RWXI):    origin = 0x00060, length = 0x0020   
        DARAM (RWXI)  :    origin = 0x01000, length = 0x2000   
        EXTROM (RXI)  :    origin = 0x0F000, length = 0x1000
        EXTRAM (RWXI) :    origin = 0x10000, length = 0x10000 
       
    }
     
    SECTIONS
    {      
        .bss          :>  EXTRAM PAGE 0                /* Global & static vars        */
        vecs          :>  EXTRAM PAGE 0                /* Interrupt vectors           */
        .stack        :>  EXTRAM PAGE 0                /* Primary system stack        */
        .sysstack     :>  EXTRAM PAGE 0                /* Secondary system stack      */
        .sysmem       :>  EXTRAM PAGE 0                /* Dynamic memory (malloc)     */
        .text         :>  EXTRAM PAGE 0                /* Code                        */
        .data         :>  EXTRAM PAGE 0                /* Initialized vars            */
        .cinit        :>  EXTRAM PAGE 0                /* Auto-initialization tables  */
        .const        :>  EXTRAM PAGE 0                /* Constant data               */
        .cio          :>  EXTRAM PAGE 0                /* C I/O buffers               */
        .switch       :>  EXTRAM PAGE 0                /* Switch statement tables     */
        .pinit        :>  EXTRAM PAGE 0                /* Initialization fn tables    */
        .args         :>  EXTRAM PAGE 0                /* Arguments to main()         */
    }

    But still it is not working, Can you please suggest me if any mistake in above used linker file and initialization in my main program?

     

    Awaiting for your reply,

    Regards,

    Ashwin Panchal

  • Hi Hyun,

     

    I am still waiting for your reply.

     

     

    Regards,

    Ashwin Panchal

  • Hi,

    Can you explain what you're trying to do?

    1. Do you have memory map for your custom board?

    2. What is your boot load process? Where does it boot from?

    3. Where do you want put your code running from?

    Regards,

    Hyun

  • Hi,

    i  am developing delay effects for audio mixers. The delay time should be 50ms to 1000ms minimum.

    by using internal DARAM i am only able to generate maximum 100ms delay. so to get the more larger delay time i require more larger RAM for ".bss" section.

    Normal 0 false false false EN-US X-NONE X-NONE MicrosoftInternetExplorer4

     

    Please find below details for your reference regarding above quries,

    • 1)     Writing C Program in CCS V4 environment with sent one linker file.
    • 2)     Compile it.
    • 3)     The generated *.out file is converting to *.hex using hex500.exe. Please find attached word file for this process.
    • 4)     Then *.hex file burning in 8-Bit EPROM using standard Parallel programmer.
    • 5)     And then Insert the programmed EPROM in our Main Board (which is having TMS320VC5401, 9.8MHz Crystal, 16-Bit RAM connected with A0-A15, D0-D15, PS/ and   R/W pins.)
    • 6)     And Now we apply the supply and start testing of the board (Please note that Board is doesn’t have any interfacing between PC & CCS.).

     

    I hope this information will clarify your queries & doubts.

    Normal 0 false false false EN-US X-NONE X-NONE MicrosoftInternetExplorer4

     

    Best regards,

    Ashwin Panchal

    Out_to_Hex.docx
  • Hi,

    Thanks for your detail information. Now I understand what you are dealing with. I went through a similar process with my C5416DSK board. 

    Without debugger, it's very painful to work with.  There are many areas it can be wrong. But you only know it's failed.

    Let's go through one by one.

    1) Do you have a method to check your code is correct?

    2) Compiler takes care of it.

    3) Generating .hex file.

        1. Do you know your programmer format? i.e. ASCII, Intel, Motorola, Tektronix or TI?

        2. Your hex command file is checked. What is your ROM width and RAM width?

        3. Where is your entry point?

    4) Have you checked small program residue in the internal RAM working?

    You may refer below two documents:

    http://focus.ti.com/lit/an/spra618b/spra618b.pdf

    http://focus.ti.com/lit/ug/spru102f/spru102f.pdf

     

    Regards,

    Hyun

  • Hi,

    Please find my reply against your query,

    1) Do you have a method to check your code is correct?

    Ashwin: Before trying on EXTRAM, i have made same program with small array and putting it on internal DARAM and the program is working fine without any problem.

    3) Generating .hex file.

        1. Do you know your programmer format? i.e. ASCII, Intel, Motorola, Tektronix or TI?

    Ashwin: My programmer format is "Intel" type.

        2. Your hex command file is checked. What is your ROM width and RAM width?

    Ashwin:  ROM width is 8-bit and RAM width is 16-bit.

        3. Where is your entry point?

    Ashwin:  "0xF000" On EXTROM.

    4) Have you checked small program residue in the internal RAM working?

    Ashwin: Yes by using internal RAM program is working fine.

     

    Awaiting for your early reply,

    Regards,

    Ashwin Panchal

  • Hi Ashwin,

    Have you tried to use small program using internal memory and access external ram? 

    This will check whether you can access external memory and keep your booting work.

    Also which bootloader are you using internal or external?

    Regards,

    Hyun

  • Hi, 

     

    I found a good document. It explains 2 stage bootloader.

    What is your code size?

    Regards,

    Hyun

    C5402_flash_booting_spra773.pdf
  • Hi,

    The total hex size is arround 2K to 2.5K maximum.


    Regards

    Ashwin Panchal

  • Hi,

    The code size is small so that it can fit in internal DARAM. Why do you need to put the code in the external RAM?

    Regards,

    Hyun

  • Hi Hyun,


    Again i am repeating that the i  am developing delay effects for audio mixers. The delay time should be 50ms to 1000ms minimum.

    by using internal DARAM i am only able to generate maximum Hundred millisecond delay.

    So to get the more larger delay time i need more larger RAM specially  for ".bss" section.

     

    For your information, each and every details of this program is kept on this page with my hardware schematics also.

    I hope you will be able to solve my problem.


    Regards,

    Ashwin Panchal

     

     

  • Hi,

    This are things you need to do.

    1.  You said you completed a small program tested. It fits in internal DARAM. It has been verified doing boot from external EPROM.

    2. Since your target code size fits small so that you can program to internal DARAM.

    3. Only thing you need is to use external memory access to data area not program.

    4. Linker file will be like this: Keep your working linker file and add dataMem section. This is your external data memory.

    5. Make sure you can access external RAM from your code. 

    MEMORY
    {      

    ..... your existing MEMORY 

     RAM_EXT (RWIX) : origin = 0x004000, length = 0x009fff  

    }
     
    SECTIONS
    {       

          ... your existing Sections
           dataMem  :> RAM_EXT  PAGE x /* your PAGE configuration */

     

    }

     

    In your code add following: This is a way you can use data assigning in the external memory.

    #pragma DATA_SECTION(src,"dmaMem")

    Uint16 src[N];   /* your external RAM data */

     

    #pragma DATA_SECTION(dst, "dmaMem")

    Uint16 dst[N];  /* your external RAM data */

    ... you can add up to your external memory size 

     

    I hope that this helps you.

    Regards,

    Hyun


     

  • Hi Hyun,


    I have tried as you said above, but still i am not able to access EXTRAM which is connected to PS (PS-Bar).

    as per my understanding the PS-Bar should be driven low to access EXTRAM .


    currently the PS-Bar driven high and DS-Bar driven low and whatever address i am accessing in my program that are reflecting on the A0-A15 address lines.

    I think now we are pointing in right direction

    Just now we need to drive PS-Bar low and DS-Bar high during EXTRAM access.

    Please suggest.


    Awaiting for your early reply,

    Regards,

    Ashwin Panchal

     

  • Hi Ashwin,

    Ok, we have progress. 

    How did you PAGE set for EXTRAM?

    If it was set to RAGE 1, then switch to PAGE 0.

    Regards,

    Hyun

  • Hi Hyun,


    I have tried on both PAGE 0 & 1 and also i tried 0x4000+0x9FFF address range and 0x18000+0x7FFF address range.

    but it is not working.


    Please suggest.


    Regards,

    Ashwin Panchal

  • Hi,

     

    How about 0x10000?

     

    Regards,

    Hyun

  • Hi Hyun,

    How it is possible?

    As per TMS320VC5401 user guide and datasheet when OVLY = 1 in PMST register, the extended address from XX0000h to XX7FFF is only giving access to internal DARAM.

    and therefore i tried with 0x18000 to 0x1FFFF.

     

    and also i tried with OVLY=0 and extended address is in linker file is set from 0x10000 to 0x1FFFF. but this also not working.

    Please unserstand my problem and try to solve my problem as soon as possible as we have very large time gap to comunicate with each other.

    if you don't mind can you try to solve my problem on Normal 0 false false false EN-US X-NONE X-NONE MicrosoftInternetExplorer4

    Skype ID: ashwinp_prosound

    E-Mail: ashwin@uplbin.com


    Regards,

    Ashwin Panchal

  • Hi Hyun,


    Still i am waiting for your reply.



    Regards,

    Ashwin Panchal

  • Hi,

    Did you check DS and PS during booting time?

    Are they toggling checked? I'm in doubt your boot working.

    If you don't see PS/DS toggling, it means internal execution.

    Regards,

    Hyun

  • Hi,

    PS / DS pins was not toggled.

    So finally I changed my linker file as below

    TEST_VC5401.obj
    vecs.obj
    -stack    0x256
    -heap    0x256
    -boot
    -a
    -m TEST_VC5401.map
    -o TEST_VC5401.out

    MEMORY
    {   
        PAGE 0: EXTPROG (RWIX)  :    origin = 0x10000, length = 0xF000       
        PAGE 1: MMR    (RWIX)   :    origin = 0x00000, length = 0x0060
                SCRATCH (RWIX)  :    origin = 0x00060, length = 0x0020   
                IDATA(RWIX)     :    origin = 0x01000, length = 0x2000   
        PAGE 2: EXTDATA (RIX)   :    origin = 0x0F000, length = 0x1000   
    }
     
    SECTIONS

        vectors (NOLOAD)        
        vecs        :>  EXTPROG PAGE 0        /* Interrupt vectors           */
        progMem     :>  EXTPROG PAGE 0
        .args       :>  EXTPROG PAGE 0        /* Arguments to main()         */     
        .cio        :>  EXTPROG PAGE 0        /* C I/O buffers               */   
          
    /* The .text, .cinit, .pinit and .switch sections are usually linked
    into either ROM or RAM, and must be in program memory (page 0).    */
          
        .text       :>  EXTPROG PAGE 0        /* Code                        */
        .cinit      :>  EXTPROG PAGE 0        /* Auto-initialization tables  */
        .pinit      :>  EXTPROG PAGE 0        /* Initialization fn tables    */
        .switch     :>  EXTPROG PAGE 0        /* Switch statement tables     */
     
    /* The .bss, .stack, and .sysmem sections must be linked into RAM
    and must be in data memory (page 1).                               */

        .stack      :>  IDATA PAGE 1        /* Primary system stack        */
        .sysmem     :>  IDATA PAGE 1        /* Dynamic memory (malloc)     */
        .bss        :>  IDATA PAGE 1        /* Global & static vars        */
          
    /* The .data and .const sections can also be linked into either
    ROM or RAM but must be in data memory (page 1).                        */
          
        .const      :>  IDATA PAGE 1        /* Constant data               */      
        .data       :>  IDATA PAGE 1        /* Initialized vars            */
       
    }


    and set the OVLY = 0; DROM = 0; and MP/MC = 0;

    and then found the PS-DS pins are now toggling,

    But still there is problem, the processor is fail to write data (at every 100-180ms) in declared array in program memory.

    #pragma DATA_SECTION(delay_buffer,"progMem")
    unsigned int delay_buffer[32500];   

    Please suggest.


    Regards,

    Ashwin Panchal


  • Hi,

     

    It's repeating again that we are back stepped again. Without debugger, it's real pain in our butt.

    Are you able to boot? This should be the first step.

    Regards,

    Hyun

  • Hi,


    Yes processor is booting properly and all other peripheral is working also fine except reading from program memory is fail.

    please see below coding for your reference,

    In below program the LEFT-IN data is route the RIGHT-OUT Immediately and after some delay it route to the LEFT-OUT.

    while(1)
    {
        McBSP0_send(
    delay_buffer[arr_no]);        // Reading Data from Delay Buffer and send it to the Codec for LEFT-OUT.
        delay_buffer[arr_no] = McBSP0_receive();  // Get the Data from codec for LEFT-IN and save it to the Delay Buffer.
        McBSP0_send(delay_buffer[arr_no]);        //
    For Conformity of above written data to buffer is ok or not ok, It Reads Data from Delay Buffer and send it to the Codec for RIGHT-OUT.
        arr_no++; if(arr_no>BFR_LEN)arr_no=0;    // The delay buffer array pointer is increments by one.
        temp_data = McBSP0_receive();            //
    Get the Data from codec for RIGHT-IN and save it in temporary data.
    }

    The processor is not  able to read data continuously from program memory during execution of first line of while loop.

    but during execution of third line of while loop, it perfectly reads data from program memory.


    So why it is fail to read data from program memory during execution of first line of while loop?


    Regards,

    Ashwin Panchal

     

  • Hi Hyun & TI's Great Engineers

    since there is no reply from your side in last few days,

    what should I consider?  Is the TI & TI persons are not capable to solve their own developed DSP's development problems which are facing by your customers.

    from so many days (Arround 2-months) I posted my problem details and replying your queries regarding same but still my problem is not solved.

    Is there no one Experienced & Skilled person who can understand my problem and able to solve it?

     

     

  • Hi,

    You were pointing me wrong direction. So far you said you have not been able to access external memory. But it seems that you are able to read data from the memory

    Your actual problem is debugging in your code without debugger. Is it right?

    Can you send me your whole projects to hyunkim@ti.com? Let me see what is really wrong?

    Regards,

    Hyun

  • Hi Hyun,


    I never tried to pointing you in wrong direction and also my intension is never like that specially some body cook for me & I'll eat that.

    i just want quick and proper guidance from TI side to solve my problem.

    and really today & before my previous post i never get the proper access to external memory.


    so regarding this same problem below is the new findings,

    Normal 0 false false false EN-US X-NONE X-NONE MicrosoftInternetExplorer4

    I also tried the PS-pin which is connected to external CE-bar pin (of external RAM) forcing to low after booting process and find the reading and writing process to external RAM is working. So, it seems like the internal PS-pin or Address or data bus timings are mismatching or conflicting with some other.

     May be this info will helpful to pointing that area to find out reason for above problem.

     

    Awaiting for your early reply,


    Regards,

    Ashwin Panchal

  • HI Ashwin,

     

    I'm also want to help you out of this issue asap.

    So external RAM accessing is working, right?

    THen, the problem is in your code:

    while(1) 

        McBSP0_send(delay_buffer[arr_no]);        // Reading Data from Delay Buffer and send it to the Codec for LEFT-OUT. <--Problem
        delay_buffer[arr_no] = McBSP0_receive();  // Get the Data from codec for LEFT-IN and save it to the Delay Buffer.
        McBSP0_send(delay_buffer[arr_no]);        // For Conformity of above written data to buffer is ok or not ok, It Reads Data from Delay Buffer and send it to the Codec for RIGHT-OUT.
        arr_no++; if(arr_no>BFR_LEN)arr_no=0;    // The delay buffer array pointer is increments by one.
        temp_data = McBSP0_receive();            // Get the Data from codec for RIGHT-IN and save it in temporary data.
    }

     

    What is the initialized value of arr_no? What is  the delay_buffer size?

    Is it difficult for you to send me your whole project? Looking at this piece of code is not enough to determine where the problem is.

     

    Regards,

    Hyun

  • Hi Hyun,


    Please find attached latest main C code file, vecs.asm and linker file for your reference.

    FYI: The same code is working fine if we use internal DARAM with small length of delay buffer[arry_no].


    Regards,

    Ashwin Panchal

    VC5401.rar