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.

42 REPLIES 42
Martin KJELDSEN
Chief III

Okay, let me know how you do - I'm pretty interested in whether or not this is an issue everyone will be having.

Thanks!

/Martin

jimmii
Senior II

Sure, will update this thread with the findings...

Martin KJELDSEN
Chief III

Thank you!

So, after you single-step from that line, you get the hardfault?

It's an attempt to read from an undefined address, 0x40023008. I'd say, this binary is not intended for the 'H750, you've maybe linked some incorrect library.

Show us the mixed source/disasm view, or use any other means to locate that binary to its respective source line.

@Martin KJELDSEN​ ,

What's that CRC_Lock() function, is it part of your software? If yes, do you provide it as a binary library?

JW

Yes, exactly. After single-stepping I get the fault.

I don't have a source line, because the CRC_Lock() function is located in the TouchGFX library.

And I don't know if it's the correct one, but I hope so, since it's tho only one I got from TouchGFX.

I can't imagine, that this is a library issue, since the program runs just fine when I'm not debugging.

jimmii

@Community member​ Yep, it's a CRC lock that ensures you can only run TouchGFX on STM32 micros. This issue has something to do with Keil - Jimmii is going to contact them about it. They resolved the issue for a previous customer by sending him some new libraries and I was kind of hoping they'd fixed whatever the problem was.

I'd forgotten about it since i haven't heard from anyone else about this issue in over a year.

That being said, i think i'll do some digging myself into this.

/Martin

0x40023008 is CRC->CR for the 'F4, but not on 'F7 nor 'H7 (at least not at the few models I've checked).

This should be easy to debug on your side.

JW

ECiav
Associate II

I solve using the last Keil version (5.29) and the last stlink v3 firmware version

ECiav
Associate II

Another issue for keil is bad address for CRC->INIT and CRC->POL in the "Peripheral->System Viewer->CRC Tab window"

That's right, for the H7 it should be in the rage of 0x58024C00.

@Martin KJELDSEN​ could it be possible, that the library from the examples are wrong for the F7/H7?

How can I check if it's the right version?

jimmii