cancel
Showing results for 
Search instead for 
Did you mean: 

STM32_AcousticEC_Library is not working with STM32F746 (build with IAR)

JJimm
Associate II

Hi,

I am working on STM32F746.

I am facing problem with Echo Cancellation lib, I refered fd-aud-smartmic1

uint32_t EC_Init(void)

{  

 EchoHandlerInstance.tail_length= 512;

 EchoHandlerInstance.preprocess_init = ACOUSTIC_EC_PREPROCESS_ENABLE;

 EchoHandlerInstance.ptr_primary_channels=1;

 EchoHandlerInstance.ptr_reference_channels=1;

 EchoHandlerInstance.ptr_output_channels=1;

 AcousticEC_getMemorySize(&EchoHandlerInstance);

 EchoHandlerInstance.pInternalMemory = (uint32_t *)malloc(EchoHandlerInstance.internal_memory_size);

  

 if(EchoHandlerInstance.pInternalMemory == NULL)

 {

  while(1); /*Error Management*/

 }

  

 error_value = AcousticEC_Init((AcousticEC_Handler_t *)&EchoHandlerInstance);

  

 if(error_value != 0)

 {

  while(1); /*Error Management*/

 }

  

 EchoConfigInstance.preprocess_state =ACOUSTIC_EC_PREPROCESS_ENABLE;

 EchoConfigInstance.AGC_value =0;

 EchoConfigInstance.noise_suppress_default = -15;   /* Default: -15 */

 EchoConfigInstance.echo_suppress_default = -40;    /* Default: -40 */ 

 EchoConfigInstance.echo_suppress_active = -15;    /* Default: -15 */

 EchoConfigInstance.residual_echo_remove = 1;     /* Default: 1  */

  

 error_value = AcousticEC_setConfig((AcousticEC_Handler_t *)&EchoHandlerInstance, (AcousticEC_Config_t *) &EchoConfigInstance);

  

 if(error_value != 0)

 {

  while(1); /*Error Management*/

 }

  

 //Internals.AudioOutRdPtr = 0;

 return error_value;

}

1> If I use __CRC_CLK_ENABLE() before EC_Init, sw is stucked here:

 if(EchoHandlerInstance.pInternalMemory == NULL)

 {

  while(1); /*Error Management*/

 }

I try to extand heap but not work

2> If I do not use __CRC_CLK_ENABLE() before EC_Init, sw is stucked after AcousticEC_Init : return value ACOUSTIC_LOCK_ERROR

Do you have any idea?

Thank You

4 REPLIES 4

>>Do you have any idea?

Look at how much memory it is requesting, and why your malloc() isn't providing that.

AcousticEC_getMemorySize(&EchoHandlerInstance);

printf("Requesting %d\n", EchoHandlerInstance.internal_memory_size));

>>I try to extand heap but not work

If malloc() returns a NULL, then clearly not sufficiently. Review where the heap is situated, and why the allocator fails at it's task. For GNU/GCC likely an issue with __sbrk()

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
JJimm
Associate II

Hi,

 EchoHandlerInstance.internal_memory_size is 53988. Something wrong with AcousticEC? The filterlength setting is 512 only.

Make sure to zero out EchoHandlerInstance

You have that much memory, humour it, I don't know what the overhead/requirements are.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

Hi,

Thank You for your answering.

I am going to implement EC by myself rather than working on bug lib.

Many times I faced problem with audio Lib from ST. They should open the source for community or no one will use their Lib.