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
Parents
  • 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

Reply
  • 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

Children
No Data