Skip to main content
Associate II
July 18, 2024
Question

how to use of STM32cube AI in STM32cubeIDE for STM32H7s78-DK hardware

  • July 18, 2024
  • 7 replies
  • 5401 views

Hello,

I have STM32H7S78-DK board and its have ARM cortex M7 core. As per research I saw that AI model is work on the same M7 cortex but I didn't know how it will work? would you please let us know STM32H7S78 supports AI model implements or not and if yes then can anyone provide steps to how we can implements on the board.

 

Thanks.

7 replies

hamitiya
ST Employee
July 18, 2024

Hello,

Yes, STM32H7S78-DK is supported. However, since it is a "flash-less" board, you need to:

- Enable XSPI1 and XSPI2

- Enable EXTMEM_MANAGER and EXTMEM_LOADER

- Prepare memory regions and external RAM / Flash for your target

- For external RAM, add corresponding BSP

 

These steps should allow you to execute your project in place ( "XIP" ). You can find a project template in STM32H7RS F/W Package example.

 

It is done automatically in ST Edge AI Developer Cloud if you perform a benchmark or if you generate a project from your own model, and it is also done in X-CUBE-AI when you execute "Validation on Target".

 

Best regards

​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.
Associate II
July 18, 2024

Hello hamitiya,

thanks for the fast replay.

I need to ask that can we run FP-AI-VISION SDK on STM32H7S78-DK using the changes you have mentioned ? If yes then can you please provide how it will achieve.

hamitiya
ST Employee
July 18, 2024

Hello,

Actually FP-AI-VISION function pack implementation only supports STM32H747I-DISCO. I would recommend to stay with STM32H747I-DISCO if your goal is to run FP-AI-VISION.

 

Best regards

​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.
Associate II
July 19, 2024

Hello @hamitiya ,

Okay Understood. But we want to make applications like Face Recognition, Face Detection etc. on STM32H7S78-DK. Is it possible to make this kind of applications in STM32H7S78-dk? If no then we have move to STM32H747I-DISCO rather than work on STM32H7S78-DK?

 

Thanks & Regards

 

hamitiya
ST Employee
July 19, 2024

Hello,

You have the ability to plug a camera in STM32H7S78-DK  so you should be able to make applications like Face Recognition.

You could go with your own application code on STM32H7S78-DK and get inspiration of the function pack (it is not officially supported, but you can give it a try), or you can use FP-AI-VISION + STM32H747I-DISCO directly. 

 

Best regards

​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.
Associate II
July 30, 2024

Hello @hamitiya  ,

As per your suggestions, we have picked one AI model from ST Edge AI Developer Cloud and get code for the STM32H7S78-DK. We got some files which is shows how that model uses memory of device. There is no any camera and display interface code in downloaded code from ST Edge AI Developer Cloud. Can you please guide us that how we can send captured image to AI model and got output on display. There is Flower detection model in ST Model Zoo, I have used this model in ST Edge AI Developer Cloud and got STM32CubeIDE project, I have run that project in hardware but in serial terminal only I got this output(please refer this document > stm32h7_log.txt). I have gone through code but there is no any interface of camera and display. Can you please guide us that how we can do this?

Model : fdmobilenet_0.25_128_tfs_int8_image_classification_flowers.tflite

Associate II
September 4, 2024

Hello,

Thank you for the reply.

while configuring PSRAM from X-CUBE-AI directly, i need to enable XSPI1 interface, but while running the code i'm getting error "HAL_TIMEOUT" in function "HAL_XSPI_Init".

attaching the SS of XSPI1 config.

ishanpadaliya_0-1725443431632.png

ishanpadaliya_1-1725443484531.pngishanpadaliya_2-1725443517798.png

Please guide us on the same.


Thanks and regards,
Ishan

 

hamitiya
ST Employee
September 4, 2024

You are right, you need to enable XSPI1 but X-CUBE-AI should set the parameters for you.

Could you please try these settings ?

hamitiya_0-1725449107986.png

 

You could also generate a project with ST Edge AI Developer Cloud, it sets all the parameters for you (enabling External RAM and External Flash)

 

Best regards,

Yanis

 

EDIT: it looks like you are settings parameters in Application context and not Boot. STM32H7S78-DK is quite low on internal flash, thus, in X-CUBE-AI, we generate a project which "run in place" (see in STM32H7S78-DK the template XIP). This allows you to run directly in External Flash.

​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.
Associate II
September 5, 2024

Hello,

Thank you for the reply.

I have properly configured and download a project, with configured AI_model and external RAM, from ST Edge AI Developer Cloud.

I took this project as reference and tried same configuration in my project. Still getting three issues, not able to make same configuration as reference project.

1) XSPI1/XSPI2 >> MMT >> Generic >> Device type (Not defined)

Note: If i remove EXTMEM_MANAGER and EXTMEM_LOADER, it's getting (RAM/FLASH), but once i configured EXTMEM_MANAGER and EXTMEM_LOADER, Generic option turns into pink color. and getting below error.

  - Main Config: These peripherals still have some not configured or wrong parameter values: [XSPI1, XSPI2]

ishanpadaliya_0-1725541280832.png

ishanpadaliya_1-1725541298186.png


2) In X-CUBE-AI, when i configure External Ram and External Flash, Memory option has only one option "custom". not getting options like, External SRAM or External NOR Flash.

ishanpadaliya_2-1725541597852.png


3) How can i add platform Settings in X-CUBE-AL configuration ?

ishanpadaliya_3-1725541802192.png

 




Please guide me on the same, how can i configure it properly.

Thanks and regards,
Ishan. 



Associate II
September 6, 2024


Sure,
Using STM32CubeMX version : v6.11.0

Thanks 
Ishan

hamitiya
ST Employee
September 6, 2024

Hello,

Here you will find a template using a model from ST Edge AI Model Zoo.

You can then open STM32CubeMX and replace the model.

It should compile on your side without warning and should output in COM port: 

hamitiya_0-1725623546869.png

 

 

Best regards,

Yanis

​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.
Associate II
September 16, 2024

Hello Hamitiya,

Thank you for the support.
Above given project STM32H7S78-DK.7z compiled without any error. To move forward,

I have take reference from "workspace/STM32Cube_FW_H7RS_V1.0.0/Projects/STM32H7S78-DK/Examples/DCMIPP/DCMIPP_ContinuousMode" to add camera and display, into your above given project.

But some how doesn't getting anything on display, display back light is working. As referenced example, trying to display camera stream. When i check in debugging mode, CAMERA_FRAME_BUFFER is getting updated, then why it's not displaying ?

Is there any configuration for memory for CAMERA_FRAME_BUFFER ?  If yes then what changes are required ? there are so many .ld files are there...

Please guide on the same, 
Attaching the project with camera and display added.

Thanks and Regards,
Ishan

Associate II
September 16, 2024

Couldn't understand what you said, can you please elaborate?

Thanks,
Ishan