We're doing some work moving a library to use ECPY for DMA. As such, we're now integrated with SYSBIOS and the like. But we're having an issue with our malloc()'s failing. We are in need of a working CFG and Linker CMD file for simply building a binary that keeps everything out of L2SRAM and allows mallocs to run from DDR3.
The thread follows below:
I am having a problem allocating arrays on the heap. Even though we
have fixed up linker.cmd to specify a heap, and point it at DDR3, when
I try to allocate arrays I get a message like this:
Starting alg process...
A=00000000, B=00000000, C=00000000.
ti.sysbios.heaps.HeapMem: line 294: out of memory:
handle=0x81943c, size=93320
ti.sysbios.heaps.HeapMem: line 294: out of memory:
handle=0x81943c, size=93320
ti.sysbios.heaps.HeapMem: line 294: out of memory:
handle=0x81943c, size=186632
When I look at that source, it is just the Error statement for being
out of memory.
I need to allocate the above arrays for my test of the kernel, from
the Heap
I tried changing the parameters on the ".INTMEM_HEAP" section used
with fcConfig.cfg, that did not help matters. The -heap 0x0 was still
in linker.cmd.
I cannot proceed until I can allocate on the order of a few megabytes of
memory.
That was solved easy in the Bare Metal version, by pointing .sysmem at
DDR3 and setting -heap [sizeofDDR3].
I can't use the L2SRAM, or shared memory, I need the program space. I
have to use DDR3.
Can you help us figure out how to do that?
The example code does not seem to use malloc(), and I do not see in
the code anything that initializes the heap (but I saw routines that
do that in source). Should main.c be calling some heap_init() function
before I start trying to use malloc()?One of the problems seems to be a whole list of sections being pointed
at L2SRAM, even if I change all of those in fcConfig.cfg to MSMCSRAM.
My kernels use L2SRAM by native address, I configure the L2 cache as
256K of L2SRAM (and 256K of cache), and my use of that space is not
using a SECTION at all.
If other sections are pointed at L2SRAM, then as soon as I load a
matrix into it I have overwritten those segments and the machine hangs
up.
Against my design, this config generates linker.cmd with
.ti.decompress: load > L2SRAM
.pinit: load >> L2SRAM
.init_array: load > L2SRAM
.data: load >> L2SRAM
.sysmem: load > L2SRAM
.args: load > L2SRAM align = 0x4, fill = 0 {_argsize = 0x200; }
.ti.handler_table: load > L2SRAM
All of which I cannot see how to prevent. I need a way to NOT use
L2SRAM as the default destination for these Sections; My code is
optimized to use nearly every byte of the 256K L2SRAM area, there is
no room for guests.
In C6678_unified.cmd every section was pointed as MSMCSRAM, and I only
modified sysmem to point at DDR3. That is the development environment,
and what I need duplicated for the ECPY environment.
TC