Quantcast
Channel: Embedded Software (Read Only)
Viewing all articles
Browse latest Browse all 25965

Forum Post: How to allocate memory on DSP based on codec engine in DM3730

$
0
0

Hi,

I am trying to allocate memory on dsp through Memory_alloc() function. This work is based on codec engine in DM3730, which is modified from the videnc_copy example. I made some changes in the (.tcf) file  as follows:

bios.setMemDataHeapSections (prog, bios.DDRALGHEAP);

bios.MEM.MALLOCSEG  = bios.DDRALGHEAP;

(the default setup is

bios.setMemDataHeapSections (prog, bios.DDR2);

bios.MEM.MALLOCSEG  = bios.DDR2;

)

and also in the .cfg file, change is made  as follows:

DSKT2.ALLOW_EXTERNAL_SCRATCH = true;

(the default setup is false)

And then in the videnc_copy.c file, i coded :

Memory_AllocParams allocParams;
allocParams.type = Memory_CONTIGPOOL;
allocParams.flags = Memory_NONCACHED;
allocParams.align = 128;
allocParams.seg = 0;

tempBuf2 = (XDAS_UInt8 *)Memory_alloc( minSamples, &allocParams);

I can build the files well. But the run result is wrong. FT_trace print the result

shows that the memory request failed.

How can i copy with this problem?

In addition,

I tried to use malloc function after i changed the setup as described above. i found the

function malloc can work well, though the malloc function is  not allowed in XDAS.

thks in advance!

F.H. Sun


Viewing all articles
Browse latest Browse all 25965

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>