cancel
Showing results for 
Search instead for 
Did you mean: 

How can I successfully run the Tensorflow lite speech recognition example project on the STM32F469 Discovery kit using mbed cli? Is there any other way to do it? Details below.

TSidd.2
Associate

I have tried to follow the example in the following link to build and deploy the Google tensorflow lite micro speech recognition example on the STM32F469I Discovery board using mbed cli:

https://developer.arm.com/solutions/machine-learning-on-arm/developer-material/how-to-guides/build-arm-cortex-m-voice-assistant-with-google-tensorflow-lite/single-page

In the above link, the example is deployed on the STM32F7 discovery board. To build and compile the micro speech example, you download the Tensorflow lite source code:

git clone https://github.com/tensorflow/tensorflow.git

And navigate to the project directory and build the example for the target board as follows:

cd tensorflow

make -f tensorflow/lite/micro/tools/make/Makefile TARGET=mbed TAGS="disco_f746ng" generate_micro_speech_mbed_project

This creates a folder in `tensorflow/lite/micro/tools/make/gen/mbed_cortex-m4/prj/micro_speech/mbed ` that contains the source and header files and Mbed driver files needed to compile the project for the target board.

When I change the 'TAG' of the above 'make' command to my target board (disco_f469ni), the created project folder does not contain the necessary source/header files and/or libraries to deploy this example on my board. (corresponding files that are created in the given example link)

To be more specific, in case of the F7 board in the given example, libraries to access audio from the board is generated (AUDIO_DISCO_F746NG) which is used to read audio from the board microphone in the 'audio_provider.cc' file in the generated project. which is then used for model inference.

When I generate the project for my target board (disco_f469ni), no audio reading library is generated nor does the created 'audio_provided.cc' file contain code to access the board audio for model inference. Note that my board belongs the same family of ST boards as the one in the example and it is one of the target boards supported by mbed cli. It has a Cortex-M4 processor whereas the one in the example has an M7 processor. Note also that the project built and compiled for my target board without error when I followed the instructions in the given link.

When I compile the project for my board with the following command:

mbed compile -m DISCO_F469NI -t GCC_ARM    (target name in the given link is DISCO_F746NG)

And copy the created binary onto my board, I do not get any serial output from the board, which is not the case in the given example (I used the 'screen' command as shown in the example, as well as some other methods, i.e.- minicom/putty, to see the serial output). I believe this is a result of the missing/incorrectly generated files I mentioned before.

Can anybody please inform me if there is a way to correctly build and compile this project for my board and run it as expected, or if the necessary audio accessing library/s for my board and/or any demo/manual to access audio from this board exists such that the 'audio_provider' file in the project can be correctly updated?

Help would be highly appreciated.

#stm32f469ni #mbedcli #mbed-os #mbed #tensorflowlite #speech #speech_commands #micro_speech #microtensor #tensorflow #speechrecognition #keywordspotting

1 REPLY 1
Robmar
Senior III

Wow, no one at STM answered this during nearly 3 years!

There are now quite a few examples of Tensor Flow Lite being used on DSP MCUs, see How CEVA uses TensorFlow Lite for Always-On Speech Recognition 

Has anyone else actually used it on H-series MCUs yet?

STM are offering the services of a partner company but it's not free.