2022-06-23 01:42 AM
The "validate on target" option doesn't work and I was wondering if it was possible to work around the problem by sending some data manually. I thanks you in advance.
Solved! Go to Solution.
2022-06-23 05:19 AM
Hi,
What is the issue with the "validation on target"?
Have you try to generate the built-in validation project for your STM32 IDE?
If tabby terminal is equivalent to TeraTerm application, yes UART RX port other STLink VCP for example can be used, but you need to write your own protocol/application.
Else if the built-in validation project is OK, in the X-CUBE-AI pack, you have a simple Python module "ai_runner" allowing to communicate with the board. It allows to inject the data and to retreive the results through a simple interface (see "How to run locally a c-model" article in the embedded documentation).
from stm_ai_runner import AiRunner
runner = AiRunner()
runner.connect('serial')
runner.summary() # display the network/run-time information
# fill input tensor according the requsted shape/data type
inputs = FILL(runner.get_input_infos())
...
outputs, _ = runner.invoke(inputs) # invoke the model
Best regards,
Jean-Michel
2022-06-23 01:44 AM
As far as sending & receiving is concerned, it's all just data - and, clearly, data can certainly be sent & received...
2022-06-23 01:45 AM
Thanks you for your time, I'm going to try it today.
2022-06-23 05:19 AM
Hi,
What is the issue with the "validation on target"?
Have you try to generate the built-in validation project for your STM32 IDE?
If tabby terminal is equivalent to TeraTerm application, yes UART RX port other STLink VCP for example can be used, but you need to write your own protocol/application.
Else if the built-in validation project is OK, in the X-CUBE-AI pack, you have a simple Python module "ai_runner" allowing to communicate with the board. It allows to inject the data and to retreive the results through a simple interface (see "How to run locally a c-model" article in the embedded documentation).
from stm_ai_runner import AiRunner
runner = AiRunner()
runner.connect('serial')
runner.summary() # display the network/run-time information
# fill input tensor according the requsted shape/data type
inputs = FILL(runner.get_input_infos())
...
outputs, _ = runner.invoke(inputs) # invoke the model
Best regards,
Jean-Michel
2022-06-23 06:23 AM
Hello Jean-Michel,
Thank you for your attention. At first I used "validation on target" with my STm32H747-DISCO with the example FP-AI-VISION1_V3.1.0 (because with that I can determine that the problem isn't from the code) and after that I wanted to do it with a F429I-DISCO and a code of my design. And "validate on target" didn't work for the F4 and the H7, I have the same problem as this guy, but the answer didn't fix the problem.
I will show you my method, I'm surely doing it wrong. First I select the card on the select board menu. Then :
Finally I resolve cloc issues, generate the code (without changing the minimum heap and stack size), build the CM7 project, plug my board via St-Link, run the code and "validate on target" (on COM-3 and 4). I have always the same error :Thank for your informations, I will look into "How to run locally a c-model" article. It will help me a lot.
I thank you again for your time,
Numa
Edit : I tried the Validation application like so :With USART : Asynchronous as component and I get this error when building the project : "undefined reference to `MX_USART1_UART_Init"
2022-06-23 10:44 AM
Hello Numa,
I don't see the real issue in your method. I have applied the following sequence w/o issue.
0 - I have created a new project from scratch with a basic model: CubeMX 6.4.0 + X-CUBE-AI 7.1 + STM32H747I-DISCO
1 - It is preferable to not initialize all peripherals with the default mode.
2 - Select the built-in validation application (Cortex-M7)
3 - Click "YES" to atomatically set the max MCU clock
4 - Import a model
5 - Perform "automatic" validation on target. I have selected STM32CubeIDE here.
After a build and flash of the two firmwares (M7 & M4), we have:
At this step, the board is normally flashed and can be directly used to perform a new validation on target w/o re-generation of the projects with for example the user-data.
STM32 IDE project can be also generated (for debug purpose or for example to increase the heap/stack) for your prefered STM32 IDE.
You open the project with your prefered STM32 IDE, build and flash the board.
After this step, you can perform a new validation through the UI, or to use the ai_runner interface to perform new scenario of validation.
br,
JM
2022-06-23 01:26 PM
Hello Jean-Michel,
Thanks for your indication, I will try your method first thing in the morning and will give you a report about the result. You are very helpful, thank you !
Best regards,
Numa
2022-06-24 12:34 AM
It works ! The "validation on target" work thanks to you, maybe it was the version of CubeMX or I was initialize all peripherals with their defaults mode. I will play with ai_runner interface and tweak some parameters to fully understand theses tools. The step after that is to make it work on the STM32F429I-DISCO board. You have my gratitude.
Best regards,
Numa