Picovoice / picovoice

On-device voice assistant platform powered by deep learning
Apache License 2.0
577 stars 109 forks source link

STM32F407G-DISC1 Demo Project Issues #772

Closed GSkoumal closed 9 months ago

GSkoumal commented 9 months ago

Have you checked the docs and existing issues?

SDK

MCU

Picovoice package version

3.0.0

Framework version

STM32

Platform

ARM Cortex-M

OS/Browser version

Windows 10

Describe the bug

I am new to Picovoice and MCU development in general so forgive if some of my issues are simplistic. I am attempting to get the demo project for the STM32F407G-DISC1 board working properly but am hitting some walls.

First whenever I begin the debug process, a new tab appears with an error stating 'No source available for "Reset_Handler() at 0x8002e78"'. Sometimes the location it reports changes but it is primarily in Reset_Handler(). Additionally, as I begin to step through the code it seems to always run into an error in 'pv_audio_rec_init()', where it enters 'error_handler()' and stays forever. I should have all of the Middleware that needs to be copied into the project already.

Finally during the debug process 'printf()' does not print to the console. I know from the documentation that it uses SWO on trace port 0 but I believe both of those settings are enabled in my Debug Configuration

Steps To Reproduce

  1. Build the project.
  2. Begin the debug.
  3. Step through the code.

Expected Behavior

The demo will debug and allow the use of wake word while printing to the console.

mrrostam commented 9 months ago

Thanks for letting us know. We fixed a mistake in the params.h file, so now the demo should run without any problems on your end. As for debugging, it seems to be working fine on our side. If you encounter any issues, double-check your project settings (for instance, a common error is setting the core clock for SWV to 16 instead of 160Hz). Try running the demo again, and let us know if it's working for you now.

GSkoumal commented 9 months ago

I just copied the new pv_params.h into the demo project. I am still encountering the "No source available for ..." issue but was able to step further into the code than before. Now I am encountering a failure at line 123 in main.c after 'pv_picovoice_init()', the message stack has the value 0x20013320 if that helps at all.

Additionally I checked by debugger settings and I have SWV enabled and at a core clock of 160MHz. My interface is SWD and the access port is set to '0 - Cortex - M4'. I am still encountering the printf() issue. Thanks so much for your quick response and work.

mrrostam commented 9 months ago

It indicates that there is at least one incorrect input to pv_picovoice_init. Without the error message from the debug, I cannot help much.

GSkoumal commented 9 months ago

Thanks for all of your help, I realized I left the '$' in front of my ACCESS_KEY from the template after copying over from Picovoice console. After the change the demo is working as intended. Stupid mistake on my part. Thanks again for all of your help!

GSkoumal commented 9 months ago

If you happen to have any other recommendations for how to fix the printf() issue that would be a big help. Hard to debug things without knowing what is happening while its running.

mrrostam commented 9 months ago

Nice! I can't think of anything related to the debugging issue at the moment, but you can always refer to the ST documentation to understand and fix it.