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@aps.anl.gov> Advanced Photon Source Argonne National Laboratory (630) 252-4793