cancel
Showing results for 
Search instead for 
Did you mean: 

osxAcousticEC Implementation on STM32F4-DISCOVERY

Nikil Rao
Associate II
Posted on May 18, 2017 at 15:19

Hey everyone,

I'm trying to implement the osxAcousticEC library on a STM32F4-DISCOVERY. The first problem was that I wasn't able to compile the library as it is and had to change this in system_stm32f4xx.c - 

-    __I uint8_t AHBPrescTable[16] = {0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 4, 6, 7, 8, 9};

+   const uint8_t AHBPrescTable[16] = {0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 4, 6, 7, 8, 9};

+   const uint8_t APBPrescTable[8] = {0, 0, 0, 0, 1, 2, 3, 4};

I was able to compile after making the above changes. However, when I connect the board to the PC and observe the audio output on Audacity, I just see a large amount of noise on the first channel (Channel with echo cancellation) and lesser noise on the second channel. I tried commenting the call to the function 'Send_Audio_to_USB' so that there's no audio sent to the USB at all. The second channel is now empty but there's still the same noise in the first channel. I've tried different boards and by connecting an external microphone instead of the on-board microphone but still have the same error. Can somebody help me out?

Thanks a lot in advance!

#acousticec #stm32-f4
7 REPLIES 7
Imen.D
ST Employee
Posted on May 26, 2017 at 15:30

Hi

nikilrao

,

Which firmware version are you using ?

I have checked that

system_stm32f4xx.c file

in the last version of STM32CubeF4

contains these lines:

const uint8_t AHBPrescTable[16] = {0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 4, 6, 7, 8, 9};

const uint8_t APBPrescTable[8] = {0, 0, 0, 0, 1, 2, 3, 4};

Thanks

Imen

When your question is answered, please close this topic by clicking "Accept as Solution".
Thanks
Imen
Posted on May 26, 2017 at 15:40

Hi Imen,

I'm using STM32Cube_FW_F4_V1.16.0. The 

system_stm32f4xx.c included in the src folder of the osxAcousticEC library does not contain those lines. Thanks!

Mojtaba Hajiabadi
Associate II
Posted on February 16, 2018 at 19:16

Hi Nikil Rao,

I am using STM32F407 board to implement osxAcousticEC library. However, I had your problem with the following error:

-    __I uint8_t AHBPrescTable[16] = {0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 4, 6, 7, 8, 9};

How can I fix this problem?

Could you please help me with your experience?

please do not hesitate to contact me.

mailto:mhajiabadifum@gmail.com

Regards,

Mojtaba Hajiabadi.

Posted on February 16, 2018 at 22:40

Ok, but what tool chain and what specific error are you getting?

It is only used in a few places, if you have it defined in multiple places consider localizing it within the scope of the function(s) it is being used in.

{

  static const

uint8_t AHBPrescTable[16] = {0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 4, 6, 7, 8, 9};

 // local to here, not visible outside the scope of the braces

}

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Posted on February 18, 2018 at 16:20

Dear Clive One,

Thanks for your answer.

My tool chain is MDK-ARM Keil uvision V.5.

I have solved the previous errors.

Now, my STM32F407 board is working but the problem is that, I can not

observe the Echo or Noise cancellation performance.

After compiling and downloading the codes onto the STM32F407 board, the 4

LEDSs are blinked and 3 audio sound are played from the DAC audio output

jack of my board.

Could you please help me with a picture of your board USB connection?

I have read in the application notes and datasheets that we should connect

the USB to a host PC as a USB Audio Device.

This UBS port is different from the programming / debugging port?

On Sat, Feb 17, 2018 at 1:10 AM, Clive One <st-microelectronics@jiveon.com>

Posted on February 19, 2018 at 01:20

You'd probably want a picture from Nikil Rao, not me.

The STM32F407-DISCO board has two USB jacks, the one at the 'South' end with the audio jack is the one connected physically to the F407 part. You could perhaps test this further by building a VCP or MSC type device, or using the 'firmware upgrade' code in the SPL to connect to a USB Flash drive via this connector.

The USB at the 'North' end of the board connects to the F103 providing the ST-LINK functionality.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Posted on February 19, 2018 at 05:09

Dear Clive One,

I could download the codes and could run my STM32F407 for Acoustic Echo

Cancellation application.

However, the results are not desired at all.

How can I change the osx.AcousticEC codes?

I check all the xxx.c and xxx.h files.

There is not any way to access the echo cancellation codes, Am I right?

On Mon, Feb 19, 2018 at 3:51 AM, Clive One <st-microelectronics@jiveon.com>