Skip to main content
Visitor II
January 9, 2025
Question

Hard Fault Occurs When Calling ai_mnetwork_run with X-CUBE-AI

  • January 9, 2025
  • 1 reply
  • 581 views

Hello,

I am using X-CUBE-AI to run an AI model on an embedded system. While executing the following line of code:

batch = ai_mnetwork_run(net_exec_ctx[0].handle, ai_input, ai_output);

a Hard Fault error occurs.

What’s puzzling is that the error initially occurred, but without any code modifications or corrective actions, the issue temporarily resolved itself. However, after some time, the same Hard Fault error reappeared.

Has anyone encountered a similar issue, or could you suggest possible solutions?
I would greatly appreciate your help.

Thank you!

1 reply

Julian E.
Technical Moderator
April 25, 2025

Hello @dfsfdsf,

 

Sorry for the late answer.

Sometime I observe this also, but I don't really understand where it comes from.

I think it may be linked to printf. I don't know if you are using some.

 

I would suggest using the application template if you are not already and clicking no after loading a model and when cubeMX asks for automatic optimization of the clock and peripherals.

 

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.