Fwd: configuring memory size

Thomas Doerfler Thomas.Doerfler at imd-systems.de
Tue Dec 6 08:00:28 UTC 2005


Hi,

just as an additional idea: Some years ago I used the C preprocessor to 
generate linker command files from a template. The benefit was, that I 
could have ONE header file defining address/size information for the C 
compiler and for the linker.

Maybe this would also be convenient for Peter?

wkr,
Thomas.


D. Peter Siddons wrote:
> Hi Till,
> The bsp is very similar to the uC5282. _M68k_Ramsize is copied from the 
> linker value (_Ramsize) in bsp_start() (part of bspstart.c). I could 
> easily check for the two possibilities here. Is that early enough?
> Pete.
> 
> Till Straumann wrote:
> 
>> Eric Norum wrote:
>>
>>>>
>>>> Looks like what I suggested won't work.   The linker complains if  
>>>> the expressions in the  ORIGIN/LENGTH contain symbols even if those  
>>>> symbols have been defined before the assignment.
>>>>
>>>> I guess that you'll need to have two separate linkcmds files and  
>>>> use something like
>>>>     -Wl,-TlinkcmdsFor4MFlash
>>>> or
>>>>     -Wl,-TlinkcmdsFor16MFlash
>>>
>>>
>>>
>> A much better solution would be enhancing the BSP so it does
>> auto-detection. This has to be performed early enough,though.
>>
>> If an early detection is too cumbersome, then you can limit
>> the initial size to a minimum, let's say 4M and increase the
>> size later. In order to make the additional ram available to
>> RTEMS (i.e., after the malloc heap/libc have been initialized)
>> you have to implement a trivial 'sbrk()'. The only constraint
>> is that the 'late ram'-portion of the heap to be added by sbrk()
>> must be contiguous to the initial heap.
>>
>> You can look at powerpc/shared/bspstart which uses the
>> two-staged heap approach for different reasons.
>>
>> HTH
>> T.
>>
>>>>
>>>>
>>>>>
>>>>> Eric Norum wrote:
>>>>>
>>>>>>> You need to pass the --defsym option to the linker.
>>>>>>>
>>>>>>> On the compile line, add something like
>>>>>>>     -Wl,--defsym,_RamSize=0x10000000
>>>>>>>
>>>>>>> On Dec 2, 2005, at 10:50 PM, D. Peter Siddons wrote:
>>>>>>>
>>>>>>>> I have two boards which are identical except for the amounts  
>>>>>>>> of  flash and RAM. The linkcmds file has definitions for these   
>>>>>>>> parameters like:
>>>>>>>> _RamSize = DEFINED(_RamSize) ? _RamSize : 0x7f0000;
>>>>>>>>
>>>>>>>> so my question is, can I invoke a definition somewhere in the   
>>>>>>>> application make process to override the one in linkcmds? If  
>>>>>>>> so,  how and/or where?
>>>>>>>>
>>>>>>>> Pete.
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>
>>>> -- 
>>>> Eric Norum <norume at aps.anl.gov>
>>>> Advanced Photon Source
>>>> Argonne National Laboratory
>>>> (630) 252-4793
>>>>
>>>>
>>>
>>
>>


-- 
--------------------------------------------
IMD Ingenieurbuero fuer Microcomputertechnik
Thomas Doerfler           Herbststrasse 8
D-82178 Puchheim          Germany
email:    Thomas.Doerfler at imd-systems.de
PGP public key available at:
      http://www.imd-systems.de/pgpkey_en.html



More information about the users mailing list