2025-07-14 6:33 AM - last edited on 2025-07-14 6:52 AM by Andrew Neil
Hi everyone,
I'm working with an STM32N6 board and trying to deploy a custom YOLOv8n model in ONNX format using CubeMX and STM32 Edge AI. I’ve run into a few issues and was hoping someone could help clarify the process.
Here’s what I’ve done so far:
I successfully imported my yolov8n.onnx model into CubeMX + Edge AI.
When I try to test the model using a .PNG image, I get an error saying PNG format is not supported. When I generate the C code using the model, I see a line in network.c where -inf is not defined, causing compilation errors.
My Questions:
How can I test my model using a PNG image, either on the STM32N6 device or on a desktop simulation?
Do I need to convert the PNG to raw input data manually?
What’s the correct way to prepare a PNG image as an input buffer for use with STM32 inference code?
How do I resolve the -inf not defined issue in the generated network.c?
Any help, code snippets, or documentation pointers would be greatly appreciated!
Thanks in advance!
Solved! Go to Solution.
2025-07-25 6:01 AM
It should be ok next week.
Have a good day,
Julian
2025-07-30 2:24 AM
Hello @TerZer,
You can find the tutorial here:
How to build an AI application from scratch on the... - STMicroelectronics Community
Have a good day,
Julian
2025-07-31 6:26 AM - edited 2025-07-31 6:27 AM
Hello @Julian E. ,
First off, thanks for your tutorial — it was really helpful! However, I ran into an issue. I tried to create a TouchGFX application, and when I attempted to add the X-CUBE-AI component in STM32CubeMX, I got the following message:
This component cannot be selected:
- This application cannot be selected while the application Application from pack STMicroelectronics.X-CUBE-TOUCHGFX.4.25.0 is selected.
Is there a known workaround or specific setup needed to use both X-CUBE-AI and TouchGFX in the same project?
P.S.
All software is on latest version:
X-CUBE-AI version 10.2.0
X-CUBE-TOUCHGFX 4.25.0
2025-07-31 6:52 AM
Hello @TerZer,
You are right, I am asking the dev of X Cube AI the reason for that. I'll keep you updated.
Have a good day,
Julian
2025-08-07 12:42 AM
Hello @TerZer,
It seems complicated to use both X Cube AI and TouchGFX at the same time.
Both tools uses complicated configuration in CubeMX and STM32CubeMX do not support both at the same time.
I've looked at all the demo firmware we propose for the N6 and none of them use both packages.
Even the out of the box demo is using 2 different firmwares and switch between the touchGFX and X Cube AI ones.
I contacted both touchGFX and AI team but none of them tried to implement both.
I transmitted the needs to the marketing for a potential need to spend resources and people to develop an example application.
Have a good day,
Julian
2025-08-25 6:32 AM
Hello @Julian E. ,
Could you explain how this was implemented in the demo version? Specifically, how the switching between AI and TouchGFX is handled.
Also, will it be possible to use TouchGFX and AI simultaneously, and if so, is there an expected timeline for that support?
Thanks in advance!
2025-08-25 8:11 AM
Hello @TerZer,
I don't think that we will see a support for both touchgfx and cubeAI.
I will transmit the idea to use touchgfx in a AI demo to the dev team.
If they see an interest, they may add a bit of touchgfx to a getting started demo in the future.
Concerning the out of the box N6 demo:
CubeMX doesn’t support generating both together, so we used two separate firmwares.
STM32N6 boot model:
Demo architecture:
4. Switching mechanism
Where to execute each app:
When you use the st edge ai core to convert your model, you will see the size of activations and weights.
The weights can be stored in external flash and stay there (they are only read once, so no issues), the activations need to fit in internal RAM, else you will lose quite a lot in performance.
All the model in the ST Model fit in internal RAM for this reason.
You can find tutorials on how to create an AI app on the DK or Nucleo N6 app that execute in internal RAM.
DK:How to build an AI application from scratch on the... - STMicroelectronics Community
Nucleo: How to build an AI application from scratch on the... - STMicroelectronics Community
I don't know much about TouchGFX, but you can most likely create the template application.
Have a good day,
Julian