Edward Buckley wrote:
>
> Hello all,
>
> I am currently writing an algorithm using the 6711DSK board in which I
> attempt to allocate a 2D array. Unfortunately, it seems that I can't
> allocate a very large array without malloc() returning NULL.
> Presumably this is because I am not accessing the external memory.
> This may be a silly question, but how exactly do I store and access
> data in external memory? Is it just a question of increasing the heap
> size?
>
> Many thanks,
>
> Edward Buckley.
Edward,
This is not a silly question at all. On the contrary, if the 67x tools
work similarly to the 54x/55x tools, then you're in for quite a
learning curve. Also caveat this advice since I've never done exactly this,
but I have done my fair share of hacking the relevent tool files in similar
ways.
The way I understand it, you have to do it in a linker command file. The .sysmem
section has to exist in at least one source file, then in the linker command
file point it into a defined memory section that points to your external
memory. Something like this:
*****************Begin Linker Command File***********************
-heap 08000h
MEMORY
{
HEAP_MEM : origin = 18000h, length = 08000h
}
SECTIONS
{
.sysmem : { } > HEAP_MEM
}
*****************End Linker Command File*************************
Note that you also have to specify the heap size with the "-heap"
directive.
Anyway, that's where I would start.
--
% Randy Yates % "...the answer lies within your soul
%% Fuquay-Varina, NC % 'cause no one knows which side
%%% 919-577-9882 % the coin will fall."
%%%% <
[email protected]> % 'Big Wheels', *Out of the Blue*, ELO
http://home.earthlink.net/~yatesc