This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Need help with ECU.

I'm trying to get ECU to work on omap l-138. I've successfully linked libs and build my app but I always get an error in ecuNew.
My configuration:
//----------------------------------------------------------------------------
// global
//----------------------------------------------------------------------------

void my_exception_fcn (tuint _id, tuint _type, tuint _code, tuint _length, tuint *_data)
{
db_printk4(DEBUG_EC,"EXC-id:%x, Type: %d, Code: %d len:%d", _id, _type, _code,_length);
}


ecuContext_t ecuContext = {
(vfnptr)my_exception_fcn, /* Debug streaming function pointer */
NULL, /* Debug streaming function pointer */
NULL,
NULL, /* Search filter swapping function */
NULL, /* Send out function pointer */
NULL, /* Receive out function pointer */
160, /* Maximum number of samples per frame */
1024, /* Maximum filter length in taps */
256, /* Maximum filter segment buffer length in taps */
3, /* Maximum allowed active filter segments */
80+160, /* Maximum y2x delay in samples */
0L, /* Bitfield representing those portions of the
* delay line already expanded. */
NULL, /* Pointer to base of the scratch delay line */
NULL, /* TDM aligned pointer within scratch delay line */
NULL, /* TDM aligned pointer within packed delay line */
};


//----------------------------------------------------------------------------
// init
//----------------------------------------------------------------------------

stat = ecuGetSizes (&ecuNbufs, &bufs, (void *)NULL);

if (stat == ecu_NOERR)
db_printk1(DEBUG_EC," ECU NO ERROR Nbufs=%d ",ecuNbufs);
else
db_printk1(DEBUG_EC," ECU ERROR Nbufs=%d ",ecuNbufs);

ec->ecuBufs = (ecomemBuffer_t*)MEM_calloc(DDR,ecuNbufs*sizeof(ecomemBuffer_t),4);

if (ec->ecuBufs)
db_printk1(DEBUG_EC,"malloc ok size=%d ",ecuNbufs*sizeof(ecomemBuffer_t));
else
db_printk1(DEBUG_EC,"malloc err size=%d ",ecuNbufs*sizeof(ecomemBuffer_t));

for (i = 0; i < ecuNbufs; i++)
{
ec->ecuBufs[i] = bufs[i];
if (bufs[i].size > 0)
ec->ecuBufs[i].base = (void*)MEM_calloc(DDR,bufs[i].size,1<<bufs[i].log2align);
else
ec->ecuBufs[i].base = NULL;

ec->ecuBufs[i].size = bufs[i].size;
db_printk4(DEBUG_EC,"malloc: bufs[%d].size=%d base=%x l2a=%d", i, ec->ecuBufs[i].size, ec->ecuBufs[i].base, ec->ecuBufs[i].log2align);
}


ecuCfgNew.ID = 0x0001;
stat = ecuNew (&ec->ecuInst, ecuNbufs, ec->ecuBufs, &ecuCfgNew);


if (stat == ecu_NOERR)
db_printk0(DEBUG_EC,"ecuNew NO ERROR");
else
{
if (stat == ecu_NOMEMORY)
db_printk0(DEBUG_EC,"ecuNew NOmem");
else
db_printk0(DEBUG_EC,"ecuNew ERROR ");

}

ecuCfg.cfgParam = &cfgParam;
ecuCfg.y2x_delay = 160;
ecuCfg.samples_per_frame = 160;
cfgParam.filter_length = 256;
cfgParam.noise_level = 0; /* Use default (-70) if fixed */
cfgParam.config_bitfield = ecu_ENABLE_ECHO_CANCELLER | /* ENABLE ECU, ENABLE NLP, ENABLE UPDATE */
ecu_ENABLE_UPDATE |
// ecu_ENABLE_NLP |
ecu_ENABLE_AUTO_UPDATE |
ecu_ENABLE_SEARCH |
ecu_ENABLE_CNG_ADAPT |
ecu_ENABLE_OPNLP_DETECT;
cfgParam.config_bitfield1 = ecu_ENABLE_NLP_PHASE_RND;
cfgParam.nlp_aggress = 0; /* balance performance */
cfgParam.cn_config = 0; /* pink noise */

ecuOpen (ec->ecuInst, &ecuCfg);


//----------------------------------------------------------------------------
//Console out after init:
//----------------------------------------------------------------------------
ECU NO ERROR Nbufs=17
malloc ok size=204
malloc: bufs[0].size=664 base=c3eaefa8 l2a=3
malloc: bufs[1].size=512 base=c3eaf240 l2a=3
malloc: bufs[2].size=512 base=c3eaf440 l2a=3
malloc: bufs[3].size=80 base=c3eaf640 l2a=1
malloc: bufs[4].size=1424 base=c3eaf690 l2a=3
malloc: bufs[5].size=2368 base=c3eb0000 l2a=12
malloc: bufs[6].size=0 base=0 l2a=1
malloc: bufs[7].size=28 base=c3eaecd8 l2a=2
malloc: bufs[8].size=54 base=c3eafc20 l2a=1
malloc: bufs[9].size=54 base=c3eafc58 l2a=1
malloc: bufs[10].size=12 base=c3eaedd8 l2a=2
malloc: bufs[11].size=12 base=c3eaede8 l2a=2
malloc: bufs[12].size=0 base=0 l2a=1
malloc: bufs[13].size=0 base=0 l2a=1
malloc: bufs[14].size=2048 base=c3eb0940 l2a=2
malloc: bufs[15].size=512 base=c3eafc90 l2a=2
malloc: bufs[16].size=256 base=c3eafe90 l2a=1
ecuNew ERROR
EXC-id:fc, Type: 2, Code: 1 len:0

//----------------------------------------------------------------------------
When I call ecuOpen even after error in ecuNew I get exception
but can't find in documentation how to interpret this exception.

Any help would be greatly appreciated.

 

  • Hi Merol,

    I see no obvious problems with the buffers you've provided.

    Can you provide the values for all parameters passed to the ecuNew() API function -- including all structure values?  This will allow me to step through and find the problem.

    One quick note -- if the ECU instance pointer passed (by pointer) is not NULL, we exit assuming the instance is already allocated. 

    Regards,
    Charlie

     

     

  • This is it!!

    After I have set ec->ecuInst = NULL the ecuNew return OK.

    thanks Charlie.

    Regards,

     merol