cancel
Showing results for 
Search instead for 
Did you mean: 

HardFault in Function CRC_Lock

jimmii
Senior II

Hi,

I'm using the STM32H750 Discoveryboard.

When running my code from TouchGFX Designer, everything works fine.

But when running with Keil IDE, something strange is happening:

-Flashing the application and loading with the debugger -> hard fault occurs in funtion crc_lock

If I unplug and replug the board, the application starts just fine. Only when connected to the debugger, the hard fault occurs.

Do you have any hints?

__HAL_RCC_CRC_CLK_ENABLE is being called, so that shouldn't be a problem

Thanks.

1 ACCEPTED SOLUTION

Accepted Solutions
jimmii
Senior II

So, after updating the ST Drivers and Keil uVision to the latest Version (couldn't do it earlier because of other projects), everything seems to work now.

Thank you all for the great support.

@Martin KJELDSEN​ keep up the good work!

If I get response from Keil, I will post it here.

View solution in original post

42 REPLIES 42

Yes, very odd

Perhaps dump processor registers and disassembly at the offending code.

Could perhaps be linking wrong libraries, or pulling wrong include files.

See previous suggestions on using USART/VCP, and having an effective Hard Fault Handler to dump current state in an actionable form.

https://www.st.com/en/evaluation-tools/stm32h750b-dk.html

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

Try to single-step in disasm to find the exact operation which leads to the hardfault.

JW

jimmii
Senior II

In attached screenshot, you can see the exact operation and the corresponding registers. This is in Function CRC_Lock

Maybe you can help me identifying the problem, because I have no idea what could be wrong here.

0690X00000AtHtNQAV.png

And here the Fault Reports:

0690X00000AtHv9QAF.png

One other "funny thing": After flashing the software (without debugging) the application does not start after pressing the reset button on the DK. Only a power off / power on cycle dose help.

jimmii
Senior II

@Martin KJELDSEN​  maybe you can help? And I just saw, that I'm not the only one, please see https://community.st.com/s/question/0D50X0000Bh7igVSQQ/hardfault-with-very-basic-touchgfx-application

We are evaluating a library for our next product and I would like to use TouchGFX, but if this can't be solved, we are forced to check for an alternative.

Could this problem be related to the keil library? Or Keil in general?

Thanks a lot.

Martin KJELDSEN
Chief III

Hi @Roman Schläpfer​, 

I think it's actually something to do with Keil - I recall a customer having help specifically from Keil to resolve this issue. It had something to do with the device type read by TouchGFX being read wrong for a particular device (H7 - can you confirm?) and thus defaulting to something else in our stm32 locking mechanism - forcing a hard fault because of unknown device type.

/Martin

jimmii
Senior II

Thanks for you quick reply @Martin KJELDSEN​ 

Yes it's the H7 we're using here.

Do you have any contact information for me? Do you have by any chance the solution (from Keil) to this problem? I couldn't find anything on the internet...

Thanks again

Martin KJELDSEN
Chief III

I'm trying my best to recollect :) I'll return when i have more info.

/Martin

Martin KJELDSEN
Chief III

Okay, i found the ticket from way back (2018). This was on an H743.

"The Keil/Arm support found a solution for me, provided some Keil DLL´s to install and now my project is running correctly."

Which version are you running? Can you contact Keil? I'm sure they're aware of the issue if they haven't fixed it already.

/Martin

jimmii
Senior II

We are working with a H750 with the latest Keil installation.

Thanks, I will try to find someone at Keil.