Mapping program and data to SDRAM on TS201 Ezkit

Hi,

I'm a newbie with TS201 and I'm trying to map the program code and data to the SDRAM on Ts201 EZ-KIT. In tehe default LDF, nothing is mapped to the SDRAM sections, so i thought some INPUT_SECTIONS commands might be needed to add in SECTIONS{}.

First,from“VDSP 5.0 Linker and Ulitities Manual”, it seems that i should pay attention to the input section named of program (for code) and data1 (for data). However, the functions can not be achieved by adding the following instrucitons to the default LDF.

sdram_code

{

  INPUT_SECTIONS($OBJECTS(program) $LIBRARIES(data1))

} > MSSD0

sdram_data

{

  INPUT_SECTIONS($OBJECTS(data1) $LIBRARIES(data1))

} > MSSD0

Secondly, the other sections,like ctor、data2,are already defined in the default .ldf file. I'm not sure whether it's needed to mapping such sections to SDRAM.

Thirdly, in my program heaps are used and the memory areas of M4DataB is resevered for heaps by default. Since the default allocated heaps are limited, I also want to allocate some SDRAM memory to the heap. I have attempted to set up the memory heap at runtime using heap_install and modifying the LDF as following:

SECTIONS

{

..

my_own_heapseg

{

_ldf_my_own_heap_base = .;

_ldf_my_own_heap_size = MEMORY_SIZEOF();

}>HOST

..

}

If i have mapped the code and data to SDRAM, are the above instrucitons still necessary to set up heaps in SDRAM? Can the memory be allocated using calloc automatically rather than heap_calloc? 

Here is my project files,could you give me some help to force it to run on SDRAM?

Thanks,

Jane.He 

sdram_map.rar.zip
  • 0
    •  Analog Employees 
    on Jun 18, 2012 7:30 AM

    Hi,

           To answer your questions:

    1. For mapping the code and data into the external SDRAM the LDF commands you have used are correct. You may use a unique section name as below instead of the standard program and data1 options.

    sdram_code

    {

      INPUT_SECTIONS($OBJECTS(SDRAM_code) )

    } > MSSD0

    sdram_data

    {

      INPUT_SECTIONS($OBJECTS(SDRAM_data))

    } > MSSD0

    You may have to add explicit section commands in the code with the SDRAM_code and SDRAM_data to map the specific code and data to external SDRAM. Otherwise the complete code and data will be mapped to both the internal memory and the external memory.

    2. You need not define the other sections in the LDF for the SDRAM.

    3. For using an additional heap from SDRAM please refer the Using Multiple Heaps chapter on the TigerSHARC Compiler manual.

    Also I could not open the files you have sent. Can you resend them only in zipped format?

    Best Regards,

    Jeyanthi

  • Thanks for your quick reply.

    I'm still want to make sure the method you mentioned is to add the command as below into the code.

    section("SDRAM_code") void main(void);

    If so, the mapping work will be quite heavy becouse of the large amount of subroutines and varialbes.  The method, mapping complete code and data to external SDRAM rather than sepecific data, will be much more helpful.

    2012-06-20

    hewenjing

    发件人: jeyanthi.jegadeesan

    发送时间: 2012-06-18  21:01:43

    收件人: He Wenjing

    抄送:

    主题: New message: "Mapping program and data toSDRAM on TS201 Ezkit"

     

    EngineerZone

    Re: Mapping program and data to SDRAM on TS201 Ezkit

    created by jeyanthi.jegadeesan in Other ADI Processors - View the full discussion

    Hi,

           To answer your questions:

    1. For mapping the code and data into the external SDRAM the LDF commands you have used are correct. You may use a unique section name as below instead of the standard program and data1 options.

    sdram_code

    {

      INPUT_SECTIONS($OBJECTS(SDRAM_code) )

    } > MSSD0

    sdram_data

    {

      INPUT_SECTIONS($OBJECTS(SDRAM_data))

    } > MSSD0

    You may have to add explicit section commands in the code with the SDRAM_code and SDRAM_data to map the specific code and data to external SDRAM. Otherwise the complete code and data will be mapped to both the internal memory and the external memory.

    2. You need not define the other sections in the LDF for the SDRAM.

    3. For using an additional heap from SDRAM please refer the Using Multiple Heaps chapter on the TigerSHARC Compiler manual.

    Also I could not open the files you have sent. Can you resend them only in zipped format?

    Best Regards,

    Jeyanthi

    Reply to this message by replying to this email -or- go to the message on EngineerZone

    Note: If you reply to this email, the entire email with the previous discussion and your signature will appear

    in the posted reply, so you may want to remove this prior to sending the email.

    Did this reply answer your question? If so, please recognize the responder

    by returning to the thread and marking it as the Correct Answer.

    Start a new discussion in Other ADI Processors at EngineerZone

  • Hi jeyanthi

    Unfortunatly,I have some troubles in logging in the engineer-zone. May I reply to this letter to discuss about the problem aout the  Boot Multi-dxe on TS201?

    In my project,two different applications,selectable using GPIO, are expected to run on a single processor TS201. At boot time, I want to choose one application

    to be booted,and when it completes, I can force the other application to be booted, using GPIO. Is it possible for TS201?  As introduced in"Loader and Utilities

    Manual", some BlackFin Processors can generate loader file containning multiple .dxe files. At boot time, the boot kernel can boots one specific application file

    exclusively. However, as to TS201, some multi-dxe description are made about the multiprocessors. I'm still confused whether the TS201 load utility supports

    multi-dxe boot in a single processor and how the code should be modified?  

    2012-06-20

    hewenjing

    发件人: jeyanthi.jegadeesan

    发送时间: 2012-06-18  21:01:43

    收件人: He Wenjing

    抄送:

    主题: New message: "Mapping program and data toSDRAM on TS201 Ezkit"

     

    EngineerZone

    Re: Mapping program and data to SDRAM on TS201 Ezkit

    created by jeyanthi.jegadeesan in Other ADI Processors - View the full discussion

    Hi,

           To answer your questions:

    1. For mapping the code and data into the external SDRAM the LDF commands you have used are correct. You may use a unique section name as below instead of the standard program and data1 options.

    sdram_code

    {

      INPUT_SECTIONS($OBJECTS(SDRAM_code) )

    } > MSSD0

    sdram_data

    {

      INPUT_SECTIONS($OBJECTS(SDRAM_data))

    } > MSSD0

    You may have to add explicit section commands in the code with the SDRAM_code and SDRAM_data to map the specific code and data to external SDRAM. Otherwise the complete code and data will be mapped to both the internal memory and the external memory.

    2. You need not define the other sections in the LDF for the SDRAM.

    3. For using an additional heap from SDRAM please refer the Using Multiple Heaps chapter on the TigerSHARC Compiler manual.

    Also I could not open the files you have sent. Can you resend them only in zipped format?

    Best Regards,

    Jeyanthi

    Reply to this message by replying to this email -or- go to the message on EngineerZone

    Note: If you reply to this email, the entire email with the previous discussion and your signature will appear

    in the posted reply, so you may want to remove this prior to sending the email.

    Did this reply answer your question? If so, please recognize the responder

    by returning to the thread and marking it as the Correct Answer.

    Start a new discussion in Other ADI Processors at EngineerZone

  • 0
    •  Analog Employees 
    on Jun 20, 2012 11:32 PM

    Hi Hewenjing,

                  Regarding the LDF question in case you want to map many functions to the external memory you may use the below approach. In this example, the code section for main and file1 will be mapped to the internal memory. The code section for file 2 and file 3 will be mapped to external SDRAM. The data section of all these files will be mapped to internal memory.

    $OBJECTS = main.doj, file1.doj;

    $OBJECTS1 = file2.doj, file3.doj;

    code

    {

                INPUT_SECTION_ALIGN(4)

                INPUT_SECTIONS( $OBJECTS(program) $LIBRARIES(program) $OBJECTS1(program))

    } >M0Code

    data1

    {

                INPUT_SECTIONS( $OBJECTS(data1)( $OBJECTS1(data1))

    } >M2DataA

    sdram_code

    {

      INPUT_SECTIONS($OBJECTS1(program) )

    } > MSSD0

    I will post the details specific to Booting related question on another post to avoid confusion.

    Best Regards,

    Jeyanthi

  • 0
    •  Analog Employees 
    on Jun 20, 2012 11:48 PM

    Hi Hewenjing,

             Yes. It is possible to boot multiple applications from the same flash.  You need to modify the default boot kernel for this purpose:

    C:\Program Files (x86)\Analog Devices\VisualDSP 5.0\TS\ldr\TS201_prom\TS201_prom.asm

    Approach 1:

    The flash should have two applications one from the address 0x0 and the other one can be from other sector. By default the codes from address 0x0 to 0x3FF will be downloaded which is the boot kernel. This code continues to download the code from the following address 0x400. You can add the GPIO check above this portion and add code to change the source index depending upon the state of the GPIO. In your case, if the second application code is placed at 0x10000 then the source index should be initialized to 0x10000 for that condition.

    xr0 = 0x400;;      // xr0 = source index

    xr3 = TCB_EPROM | TCB_NORMAL | TCB_INT;;// boot rom,prio=norm,2D=no,word=norm,int=yes,RQ=dsbl,chain=no

    Approach 2:

    You can also use the multiprocessing feature of the processor. The loader utility supports generating loader file with multiprocessor IDs.

    Best Regards,

    Jeyanthi