Skip to content

Latest commit

 

History

History
 
 

stm32h747

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 

Porcupine Wake Word Engine Demo for STM32H747 (Multiple languages)

This package contains a demo project for the STM32H747 Discovery kit using Porcupine wake word engine.

Supported Languages

  1. English
  2. French
  3. German
  4. Spanish

Installation

For this demo, you need to:

  1. Download and install STM32CubeIDE, which is an all-in-one multi-OS development tool for STM32 microcontrollers.
  2. Download STM32Cube middleware for audio PDM to PCM conversion and copy it to the project folder. A more detailed guide can be found in the readme file.
  3. Install a serial port monitor on your system to be able to communicate with the board. Arduino environment's built-in serial monitor and Coolterm are two free options available on all platforms (Windows, Linux, and macOS).

AccessKey

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.

Usage

In the demo project, there is a separate build configuration for each supported languages. In order to activate a specific configuration:

  1. Click Project > Build Configuration > Set Active
  2. Select the target configuration

Then, to compile and run the demo project on a STM32H747 discovery board, perform the following steps:

  1. Open STM32CubeIDE
  2. Click File > Open Projects from file system... to display the Import Projects dialog box. Select the stm32h747i-disco folder from this repository, and then press the Finish button.
  3. Copy the Inc and Lib folders from the downloaded PCM2PDM library to /CM7/Middlewares/ST/STM32_Audio/Addons/PDM
  4. Select the stm32h747i-disco-demo_CM7 inner project inside the Project Explorer window
  5. Replace ACCESS_KEY in both main.c and main_multi.c with your AccessKey obtained from Picovoice Console
  6. Click Project > Build Project
  7. Connect the board to the computer and press Run > Run
  8. 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 press ok

For the single wake word demos, the default wake words are:

  • Porcupine for English language,
  • salut ordinateur for French language.
  • hey computer for German language,
  • hola computadora for Spanish language,

Below are the LED colors associated with supported wake words for the multiple wake words demo:

  • #00ff00 Porcupine
  • #ff8000 Picovoice
  • #ff0000 Bumblebee
  • #0000ff Alexa

⚠️ This project exclusively utilizes the Cortex-M7 core of the STM32H747XIH6 microcontroller. If you would like to use the Cortex-M4 core along with the Cortex-M7 core, set the BOOT_CM4_ADD0 option byte in STM32CubeProgrammer to 0x818

Create Custom Wake Word

  1. Copy the UUID of the board printed at the beginning of the session to the serial port monitor.
  2. Go to Picovoice Console to create a model for Porcupine wake word engine.
  3. Select Arm Cortex-M as the platform when training the model.
  4. 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.

Import the Custom Wake Word

  1. Download your custom voice model(s) from Picovoice Console.
  2. 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 a C array version of the binary model.
  3. Copy the contents of the array inside the .h header file and update the DEFAULT_KEYWORD_ARRAY value in /stm32h747i-disco/CM7/Inc/pv_params.h in the language section for which the model is trained.