This package contains a demo project for the STM32F411 Discovery kit using Porcupine wake word engine.
- Arabic
- Dutch
- English
- French
- German
- Hindi
- Italian
- Japanese
- Korean
- Mandarin
- Polish
- Portuguese
- Russian
- Spanish
- Swedish
- Vietnamese
- Support for additional languages is available for commercial customers on a case-by-case basis.
For this demo, you need to:
- Download and install STM32CubeIDE, which is an all-in-one multi-OS development tool for STM32 microcontrollers.
- Download STM32Cube MCU Package for STM32F4 series and extract it somewhere on your computer.
Porcupine requires a valid Picovoice AccessKey
at initialization. AccessKey
acts as your credentials when using
Porcupine SDKs.
You can get your AccessKey
for free. Make sure to keep your AccessKey
secret.
Signup or Login to Picovoice Console to get your AccessKey
.
In the demo project, there is a separate build configuration for each supported languages. In order to activate a specific configuration:
- Click
Project
>Build Configuration
>Set Active
- Select the target configuration
Then, to compile and run the demo project on a STM32f411 discovery board, perform the following steps:
- Open STM32CubeIDE
- Click
File
>Open Projects from file system...
to display theImport Projects
dialog box. Select the stm32f469i-disco folder from this repository, and then press theFinish
button. - Go to the folder where you extracted
STM32Cube MCU Package for STM32F4 series
, and then copy the contents of the/Middlewares/ST/STM32_Audio/Addons/PDM
folder to /Middlewares/ST/STM32_Audio/Addons/PDM. - Select the
stm32f411e-disco-demo
project inside theProject Explorer
window - Replace
ACCESS_KEY
in bothmain.c
andmain_multi.c
with your AccessKey obtained from Picovoice Console - Click
Project
>Build Project
- Connect the board to the computer and press
Run
>Debug
- There are two build configurations in this project: Single wake word demo, and Multiple wake words demo; choose one
of them in the
Qualifier
window and pressok
⚠️ printf()
uses the SWO connector and the trace port 0. For more information, refer
to STM32 microcontroller debug toolbox
, Chapter 7.
For single wake-word demos, you can identify the default keyword for each language by referring to the pv_params.h file. Within this file, locate the language section enclosed by:
#if defined(__PV_LANGUAGE_{LANGUAGE_NAME}__)
...
#endif
The default keyword for each language will be listed next to the // wake-word
comment.
Below are the LED colors associated with supported wake words for the multiple wake words demo:
- Copy the UUID of the board printed at the beginning of the session to the serial port monitor.
- Go to Picovoice Console to create a model for Porcupine wake word engine.
- Select
Arm Cortex-M
as the platform when training the model. - Select
STM32
as the board type and provide the UUID of the chipset on the board.
The model is now being trained. You will be able to download it within a few hours.
- Download your custom voice model(s) from Picovoice Console.
- Decompress the zip file. The model for Porcupine wake word is located in two files: A binary
.ppn
file, and as a.h
header file containing aC
array version of the binary model. - Copy the contents of the array inside the
.h
header file and update theDEFAULT_KEYWORD_ARRAY
value in /stm32f411e-disco/Inc/pv_params.h in the language section for which the model is trained.