Using
bios_5_41_07_24
OMAP-L138 ZOOM OMAP-L138 EVM w OMAP-L138 SOM hardware platform
CCS 3.3.81.11
OMAPL138_DSP.gel
Hello: I am trying to call the DSP/BIOS API MEM_alloc(DDRHEAP, 131056, 0);
I have defined a heap in MEM DDR in DSP/BIOS config or i.e the .tcf file(s)
from dsplink-omapl138gem-base.tci
/* ============================================================================
* Load assert support
* ============================================================================
*/
utils.importFile("assert.tci");
/* ============================================================================
* Load base TCI file.
* ============================================================================
*/
utils.loadPlatform("ti.platforms.evmOMAPL138") ;
/* ============================================================================
* Enable common BIOS features used by all examples
* ============================================================================
*/
bios.disableRealTimeAnalysis(prog);
bios.enableMemoryHeaps(prog);
bios.disableRtdx(prog);
bios.enableTskManager(prog);
/* ============================================================================
* GBL
* ============================================================================
*/
prog.module("GBL").ENABLEALLTRC = false ;
/* BEF CHANGED per processors.wiki.ti.com/index.php/CCS_Project_OMAP-L137_HelloDSP_DSPLINK_example */
/* prog.module("GBL").PROCID = parseInt (arguments [0]) ; */
prog.module("GBL").PROCID = 0;
prog.module("GBL").C64PLUSCONFIGURE = true ;
prog.module("GBL").C64PLUSL2CFG = "32k" ;
prog.module("GBL").C64PLUSL1DCFG = "32k" ;
prog.module("GBL").C64PLUSMAR192to223 = 0x00000008 ;
/* ============================================================================
* MEM
* ============================================================================
*/
prog.module("MEM").STACKSIZE = 0x1000 ;
/* ============================================================================
* MEM : RESET_VECTOR
* ============================================================================
*/
var RESET_VECTOR = prog.module("MEM").create("RESET_VECTOR");
RESET_VECTOR.base = 0xC3E00000 ;
RESET_VECTOR.len = 0x00000080;
RESET_VECTOR.space = "code/data";
RESET_VECTOR.createHeap = false;
RESET_VECTOR.comment = "RESET_VECTOR";
/* ============================================================================
* MEM : DDR
* ============================================================================
*/
var DDR = prog.module("MEM").instance("DDR");
DDR.base = RESET_VECTOR.base + RESET_VECTOR.len ;
DDR.len = 0xFFF80;
DDR.space = "code/data";
DDR.createHeap = true;
DDR.heapSize = 0x10000; <--------------- Tryed to change this as well makes no difference see below.
DDR.comment = "DDR";
/* ============================================================================
* MEM : DSPLINKMEM
* ============================================================================
*/
var DSPLINKMEM = prog.module("MEM").create("DSPLINKMEM");
DSPLINKMEM.base = DDR.base + DDR.len;
DSPLINKMEM.len = 0x30000;
DSPLINKMEM.createHeap = false;
DSPLINKMEM.comment = "DSPLINKMEM";
/* ============================================================================
* MEM : POOLMEM
* ============================================================================
*/
var POOLMEM = prog.module("MEM").create("POOLMEM");
POOLMEM.base = DSPLINKMEM.base + DSPLINKMEM.len ;
POOLMEM.len = 0xD0000 ;
POOLMEM.createHeap = false;
POOLMEM.comment = "POOLMEM";
/* ============================================================================
* MEM : IRAM
* ============================================================================
*/
var IRAM = prog.module("MEM").instance("IRAM");
IRAM.base = 0x11800000 ;
IRAM.len = 0x8000 ;
-------------------------------------------------------------------------------------------
Appaplical fragments from my.tci file
utils.importFile("dsplink-omapl138gem-base.tci");
..
...
....
bios.MEM.instance("DDR").createHeap = 1;
bios.MEM.instance("DDR").heapSize = 0x00030000; <--------------- Makes no difference see below.
bios.MEM.instance("DDR").enableHeapLabel = 1;
bios.MEM.instance("DDR").heapLabel = prog.extern("DDRHEAP");
bios.MEM.BIOSOBJSEG = prog.get("DDR");
bios.MEM.MALLOCSEG = prog.get("DDR");
bios.TSK.STACKSEG = prog.get("DDR");
-------------------------------------------------------------------------------------------
I am just trying to test this, so MEM_Alloc is the first thing I am calling out of main in the applaction.
I am getting a null pointer back from MEM_alloc(DDRHEAP, 131056, 0);
Obviously, does not have enough memory available to preform the operation.
Upon examining the Kernal Oblect View for MEM--DDR it showes
NAME DDR
LargestFree Block 0xFFF8
Free Mem 0xFFF8
Used Mem 0x8
Total Size 0x10000
Start Address 0C3E11E60
End Address 0xC3E21E5F
Further with a call to MEM_stat from main before the MEM_Alloc call
static Void printmem(Int segid)
{
MEM_Stat statbuf;
MEM_stat(segid, &statbuf);
}
as in printmem(DDRHEAP);
It reflects the same information as the Kernal Object View
as in
segid = 0
statebuf.size = 0x00010000
statebuf.used = 0x00000008
statebuf.length = 0x0000FFF8
statebuf.space = 0x00000001
Now matter how big or how small I make bios.MEM.instance("DDR").heapSize
It is always the same statebuf.size / Total Size 0x10000 in Kernal object viewer.
Likewise if I rearrange and change the length of DSPLINKMEM.len to give more memory to this section it still makes no difference.
Please help, what am I doing wrong hear?