cancel
Showing results for 
Search instead for 
Did you mean: 

I am creating a codes from STM32CubeMx. Every code generated from the CubeMx (6.2.1) is going in hard fault when I open in CubeIde (Ver 1.6.1). I could not understand where is the problem?

DSaha.3
Associate II

Request cumunity member to guide on this topic. I am unable to download any single code which is generated from the CubeMx for Cubeide. Each generated code is going in hard fault.

Please tell me the issue and suggest correct way if I am doing any mistake or may someone has already faced this kind of issue.

Regards,

Dnyanesh

12 REPLIES 12
MM..1
Chief II

Try send ioc file example

TJM
Senior

OS and error codes?

This is the only configuration I was trying when it was not working with multiple configuration.

I had pasted here the ioc file snap but its not visible.

What should I share with you?

Windows OS. Where I will get the error code??

Code is directly jumping to Hard fault function.

TDK
Guru

Examine the SCB registers to determine the cause of the hard fault.

Consider adding details on what board you're using, and what your code does. Hard to debug problems with no detail provided. In general, the CubeMX generated stuff will not cause hard faults.

If you feel a post has answered your question, please click "Accept as Solution".
Hgfdg.1
Associate

I am also working on a similar task and looking for its solution I tried hard to solve it but did not find the reason behind it please help us to solve this issue.

Hello TDK,

I would just provide you the details that its new developed board for my application. Other codes are working which I have generated initially and I working on application code as well. Only whatever code I am generating from CubeMx each code going in hard fault.

I dont know what exactly where is the issue in Cubeide or CubeMx. I have reinstalled CubeMx but still same issue I am facing.

Amel NASRI
ST Employee

Hi @DSaha.3​ ,

Make sure that clock is configured properly. If an external oscillator is configured as clock source, please review your hardware setup.

In such case, you can check using HSI for example as clock source.

-Amel

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.

Hello Amel,

With external clock the board setup is working on another code which I have created earlier in the cubeIde. Example code with external clock settings also I tested and it is working.

Only those codes are generated from the CubeMx which are not working.

Regards,

Dnyaneshwar ​