Skip to main content
Associate III
February 7, 2026
Solved

AI model on Nucleo N6 compiles and flashes but won't run (even following the example guide)

  • February 7, 2026
  • 3 replies
  • 312 views

Hi, 

I followed the guide at the following link:

https://community.st.com/t5/stm32-mcus/how-to-build-an-ai-application-from-scratch-on-the-nucleo-n657x0/ta-p/828502

and I've run an example gently posted here that is similar (the link was posted on the comments of the guide):

https://github.com/YousefDessouki/STM32_N6_NuceloBoardwithNPU.git

When I run the model posted on github on my Nucleo it's all fine and it will print output results on PuTTY console.

However, when I try to change the neural network with one of those used for speech enhancement posted at the following link:

https://github.com/STMicroelectronics/stm32ai-modelzoo/blob/main/speech_enhancement/stft_tcnn/ST_pretrainedmodel_public_dataset/valentini/stft_tcnn_medium_sigmoid_257xsl_float.onnx

https://github.com/STMicroelectronics/stm32ai-modelzoo/blob/main/speech_enhancement/stft_tcnn/ST_pretrainedmodel_public_dataset/valentini/stft_tcnn_medium_sigmoid_257xsl_qdq_int8.onnx

(I need to run a speech enhancement model for a project mandatorily), when the whole code is flashed on the board, the console won't print results anymore.

It's so frustrating because it's a problem that I've tried to solve for a week without results

The code used for the modified project is uploaded here

Best answer by s319189

Update: I've eventually managed to run the Neural Network by downgrading the firmware version of STM32N6 to 1.1.1 

3 replies

Associate II
February 8, 2026

Hi,

I had exactly the same problem. CubeMX + CubeIDE and CubeAI seem to be broken and I recommend to not use them. The examples in the model zoo rely on makefiles and STEdgeAi-Core only, which makes them much more stable (although they also have issues). Generally, one has to be very careful right now, because ST seems to have introduced major changes in their software a few weeks ago, which makes even months old tutorials not usable.

Based on all the information I could find, I created a minimum example:

https://github.com/AlexGraefe/STM32N6MinimumExample

This example relies on the newest versions of VSCode, CMake, STEdgeAI-Core and STM32CubeCLT (tested under Linux) and demonstrates the entire workflow from a PyTorch model to running code on the STM32N6570-DK, without the entire camera + display overhead code the model zoo examples have.

I also recommend reading: https://stedgeai-dc.st.com/assets/embedded-docs/index.html which explains pretty well how quantization, model export etc. work under the hood.

Best,

Alex

Julian E.
Technical Moderator
February 9, 2026

Hi @s319189 , @devjalx,

 

AI and the N6 are not well supported by STM32CubeMX.

 

The projects provided in X-CUBE-AI are not created with STM32CubeMX; they are edited firmware projects located in the ST Edge AI Core source folder.

 

I provided a method to achieve the same result by using STM32CubeMX. There is nothing incorrect in the tutorial; however, if the user does not follow the instructions exactly, using the same version and in the precise order, issues may occur. Even for me, it often takes several attempts to obtain a functioning project.

 

Hopefully, we will find a better solution soon.

 

Have a good day,

Julian

​In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.
ST Employee
February 9, 2026

Hello,

Adding to what devjalx said, you will run into issues if you try to use the exact models you linked in your application.

The reason being, these models have a dynamic sequence length axis, which gets fixed to 1 by default by STEdgeAI Core. However, given that these models have (dilated !) convolutions with kernel size > 1, they expect sequences of length > 1 as input.

Instead, you should use the static input shape version of the model, also available in the model zoo : [stft_tcnn_medium_sigmoid_257x40_qdq_int8.onnx] 

The version with a dynamic sequence length axis is provided in the model zoo for evaluation and quantization purposes (and eventual retraining/fine-tuning for the torch checkpoint). For deployment, you should always use static input shape models.

For your speech enhancement project, I recommend taking a look at the model zoo documentation, [here] and [here] , especially the parts concerning lookahead and lookback frames. Inference on the board is done differently than it is done on host, due to having to run in real time.

Also take a look at the [application code documentation] for exact details on how inference is done on the board. The application code contains code for both AED and speech enhancement, but you can ignore the AED part in your case.

Best regards 

s319189Author
Associate III
February 10, 2026

The problem is that in the documentation it is written that the application can  run only on STM32N6570-DK, NOT a Nucleo N6 board...

Furthermore, until now, I've tried to run the model [stft_tcnn_medium_sigmoid_257x40_qdq_int8.onnx] using the template from https://community.st.com/t5/stm32-mcus/how-to-build-an-ai-application-from-scratch-on-the-nucleo-n657x0/ta-p/828502 , where the only thing I've modified is the model that this time is static and it still does not work... I have not tried with St Edge AI core CLI yet, because my main concern, when the make file compiles all the file, is how to link the generated C code model in my STM32CubeIDE project 

s319189AuthorBest answer
Associate III
February 17, 2026

Update: I've eventually managed to run the Neural Network by downgrading the firmware version of STM32N6 to 1.1.1