DSPRelated.com
Forums
Online · Live + on demand
February 9-11, 2027
Price goes up Jan 1: register now to lock in today's rate
Register Now →

Help for memory configura in 6711 (.cmd file)

Started by Sandip Acharya ●November 11, 2005
Hi all,
I am porting a decoder into TMS320c6711( 6711) processor.i would like to discuss some problem about memory configuration.
 
 Case 1:
  .text -> External RAM (origin : 80000000h,length : o700000h) 
   .stack-> Internal RAM (origin: 200h ,length : 0fd00h )
  stack size = 10000h 
  
  "USE MEMORY MODEL" to "far aggregate Data(-ml0)" in build options
 
   Working fine
 
 Case 2: 
  .text -> External RAM (origin : 80000000h,length : o700000h) 
   .stack-> External RAM (origin : 80000000h,length : o700000h)
  "USE MEMORY MODEL" to "far aggregate Data(-ml0)" in build options
  stack size = 10000h
  
   Working fine
 
 Case 3:
 
  .text -> Internal RAM (origin: 200h ,length : 0fd00h ) 
   .stack-> Internal RAM (origin: 200h ,length : 0fd00h )
  stack size = 10000h
 
  "USE MEMORY MODEL" to "far aggregate Data(-ml0)" in build options
  
  not running it is hanging ... some structure member is corrupted.,
 
 Question 1: is there any special setting has to be done ?
 

 so i throught that stack size is not sufficient .. so i kept some part of the code (text)  
 with in internal RAM and remains within external RAM .
 like .....
 
 -stack 0x2000
 -heap  0x3A14C 
 

MEMORY
{
    vecs:   o = 00000000h   l = 200h
    IRAM:   o = 00000200h   l = 0000fde0h
    CE0: o = 80000000h l = 07000000h
               
                                              
}
 
SECTIONS
{
    .vectors   >       vecs
    .cinit      >       CE0
    .text       >       CE0
    .stack      >       IRAM
    .bss        >       CE0
    .const      >       CE0
    .far        >       CE0
    .switch     >       CE0
    .sysmem     >       CE0
    .cio        >       CE0
    .text_1 {
      X.obj (.text)
         
    }   > IRAM
 
 i changed the "USE MEMORY MODEL" option "near calls" in file specific options for x file.
 (without changing this "USE MEMORY MODEL" i got build errors...)
 
 then i got bulid errors ..."The 29-bit PC-relative displacement 536802237 at this
 location is too large to fit into the 21-bit PC-Relative field; the called function
  is out of range from this call site.  Consider using the '--trampolines'
 linker option to generate trampolines to bridge the distance between far caller/callee pairs. "
 

 Question 2:
  what is "--trampolines"  ?
  can i place some part of code (text  ..*.obj (.text) ) with in intrenal RAM ?
  what i have to do to do this ?
 
 Thanks ............................i am waiting for ur reply...  
 

Thanks & Regards
Sandip Acharya

 

Upgrade Your Email - Click here!



Hello Sandip,

Please see my comments below.

mikedunn

--- Sandip Acharya <sandip@sand...> wrote:

> Hi all,
> I am porting a decoder into TMS320c6711( 6711)
> processor.i would like to
> discuss some problem about memory configuration.
>
> Case 1:
> .text -> External RAM (origin : 80000000h,length :
> o700000h)
^------^
I am not familiar with this designation - what type of
number is 'o700000h'??? > .stack-> Internal RAM (origin: 200h ,length :
> 0fd00h )
> stack size = 10000h
actually your useable stack size is 0fd00h.

>
> "USE MEMORY MODEL" to "far aggregate Data(-ml0)"
> in build options
>
> Working fine
>
> Case 2:
> .text -> External RAM (origin : 80000000h,length :
> o700000h)
?-^------^
> .stack-> External RAM (origin : 80000000h,length
> : o700000h)
???-^------^
I don't understand these numbers, but it is not clear
why [a] .text and .stack have the same start address
and [b] why the length of of each is the same.
> "USE MEMORY MODEL" to "far aggregate Data(-ml0)"
> in build options
> stack size = 10000h
>
> Working fine
>
> Case 3:
>
> .text -> Internal RAM (origin: 200h ,length :
> 0fd00h )
> .stack-> Internal RAM (origin: 200h ,length :
> 0fd00h )
> stack size = 10000h
There is obviously a problem understanding the linker
command file. The above info indicates that you are
trying to put your program [.text of some unknown
size] + a stack size of 10000h into a memory space of
10000h-300h [fb00h]. It does not make much sense.

>
> "USE MEMORY MODEL" to "far aggregate Data(-ml0)"
> in build options
>
> not running it is hanging ... some structure
> member is corrupted.,
>
> Question 1: is there any special setting has to be
> done ?
Some lcf guidelines that you should consider are:
1. your physical memory addresses and lengths must
represent actual memory available [or a subset].
2. your logical memory assignments [.text, .stack,
etc] must be large enough for the assigned contents to
fit.

>
>
> so i throught that stack size is not sufficient ..
> so i kept some part of
> the code (text)
> with in internal RAM and remains within external
> RAM .
> like .....
>
> -stack 0x2000
> -heap 0x3A14C > MEMORY
> {
> vecs: o = 00000000h l = 200h
> IRAM: o = 00000200h l = 0000fde0h
> CE0: o = 80000000h l = 07000000h > }
>
> SECTIONS
> {
> .vectors > vecs
> .cinit > CE0
> .text > CE0
> .stack > IRAM
> .bss > CE0
> .const > CE0
> .far > CE0
> .switch > CE0
> .sysmem > CE0
> .cio > CE0
> .text_1 {
> X.obj (.text)
>
> } > IRAM
>
> i changed the "USE MEMORY MODEL" option "near
> calls" in file specific
> options for x file.
> (without changing this "USE MEMORY MODEL" i got
> build errors...)
>
> then i got bulid errors ..."The 29-bit PC-relative
> displacement 536802237
> at this
> location is too large to fit into the 21-bit
> PC-Relative field; the called
> function
> is out of range from this call site. Consider
> using the '--trampolines'
> linker option to generate trampolines to bridge the
> distance between far
> caller/callee pairs. " > Question 2:
> what is "--trampolines" ?
As I understand it, the compiler would previously use
either 'near calls' [smaller code/faster] or 'far
calls' [larger code/slower] to generate code. With
the trampoline option, the code can be generated with
near calls. If some of the code cannot be reached
using a near call, the compiler generates a near call
to some code that it has added [the 'trampoline']
which will perform a far call.
BTW, the CCS help files contain very useful
information.

> can i place some part of code (text ..*.obj
> (.text) ) with in intrenal
> RAM ?
> what i have to do to do this ?
>
> Thanks ............................i am waiting for
> ur reply...
>
> Thanks & Regards
> Sandip Acharya >
> > The information contained in this electronic
message
> and any attachments to this message are intended for
> the exclusive use of the addressee(s)and may contain
> confidential or privileged information. If you are
> not the intended recipient, please notify the sender
> or administrator@admi...