HardFault in Function CRC_Lock
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2019-12-03 6:57 AM
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.
Solved! Go to Solution.
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2019-12-06 1:10 AM
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2019-12-03 11:01 AM
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
Up vote any posts that you find helpful, it shows what's working..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2019-12-03 2:01 PM
Try to single-step in disasm to find the exact operation which leads to the hardfault.
JW
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2019-12-04 3:28 AM
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.
And here the Fault Reports:
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2019-12-05 1:25 AM
@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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2019-12-05 1:32 AM
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2019-12-05 1:36 AM
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2019-12-05 1:48 AM
I'm trying my best to recollect :) I'll return when i have more info.
/Martin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2019-12-05 1:51 AM
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2019-12-05 1:55 AM
We are working with a H750 with the latest Keil installation.
Thanks, I will try to find someone at Keil.
