cancel
Showing results for 
Search instead for 
Did you mean: 

Guidelines to port codes of ST FP-AUD-SMARTMIC1

HS.19
Associate II

Hey guys,

I am using a STM32 F411E DISCO board and downloaded ST FP AUD_SMARTMIC1 library to learn audio feedback suppression caused by a mic and a PA ampliflier nearby. In the library C files given in the projects folder of FP AUD_SMARTMIC1, they are coded keeping a NUCLEO- F446RE, CCA01M1 board (for audio terminal, interfacing with speaker/PC) and CCA02M1 board (for microphone plugging), in mind.

The F411E DISCO board has an embedded mic(and I am going to use it), a port to connect to external amplifiers and a USB port to transfer audio data to PC, all in one board. So I won't be needing the expansions board for my purpose.

I need to tweak the SMARTMIC1 library according to my F411E DISCO board, so I may need to make some changes in "usbd_audio_cdc_interface","STCmdP_interpreter" and maybe "usbd_audio_if" C library files and other non-mentioned library files too.

I don't know how to start and where to start to edit the SMARTMIC1 library according to the F411E DISCO board. I tried to search in google for guidelines to do such tweaking, but unable to find a reliable guideline document. I would be grateful if someone can give me a set of steps or guidelines to follow, to tweak the library according to my need.

Please correct me if I was wrong anywhere. Please help me to solve this issue.

Thanks in advance!

2 REPLIES 2
HS.19
Associate II

Edit 1: I tried to open the example that they have given in "Projects/ STM32F446RE-Nucleo/ Demonstrations/ SMARTMIC1/ Src/ main.c" in Truestudio. The file opened but the compile button in toolbar was disabled. The user manual of SMARTMIC1 in Section 2.3 Folder structure, describes what the example program do. Since I don't have at present the Nucleo F446RE and other peripherals with me now, I opened a new project for NUCLEO-F446RE in CubeMX and copied all the C files and header files of the example program given in SMARTMIC1 folder to "Src" and "Inc" folder in my project and gave all the copied C files as

#include "corresponding C file name.c"

in the "private include" section in my project's main.c between "USER CODE BEGIN and USER CODE END". Some files with the same name such as "main.c"(of the SMARTMIC1 example) "stm32f4xx_it.c" repeated and I kept both the one in my project and the one in the SMARTMIC1 example by renaming the latter's file as "main (2).c" "stm32f4xx_it (2).c" and included them in private include section.

In short, without any code addition, with the default code generated by CubeMX for NUCLEO-F446RE and inclusion of the SMARTMIC1 example's .c and .h files in the Inc and Src directories in current project and mentioning them as

#include "corresponding C file name.c"

and compiled the main.c of my project.

It said that some header files were missing. I found the header files in some folder in the SMARTMIC1 library and pasted them in "Inc" folder of my project and compiled them. It threw around 550 errors as a result. When I clicked one such error, I had to remove a space in highlighted area as shown in PIC1 and recompiled. It threw all of a suddnly only 1 error asking a missing header file as shown in PIC2. When I copied and pasted it from a subfolder in SMARTMIC1 folder to "Inc" folder of my project and recompiled it again threw suddenly 550 errors and this is going as an infinite loop after two tries.

I just want to use the "Echo Cancellation capability" of FP AUD-SMARTMIC1 in a F411E DISCO or F746G DISCO(preferably latter). How should I tweak the library and which files in the set of library files do I need to copy to a new project in either of the boards to observe the echo cancellation?

Please help me to solve this issue.

HS.19
Associate II