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

What do you mean by "The examples" ?

/Martin

The Application templates which come with the designer.

@Community member​,

What goes wrong here is actually that the Device ID of the Chip is not read properly with a Keil project (in debug mode using some particular version of ST-Link,) and thus the lock defaults to checking a CRC on the wrong address.

Probably related to DBGMCU not being readable at all.

/Martin

Martin KJELDSEN
Chief III

Just to rule it out: Please make sure that the CRC is actually activated.

Yes it is activated. Think wouldn't work at all if it's deactivated.

Can you read anything from DBGMCU at all? 0x5C001000

The application templates contain no libraries or headerfiles - The application is bootstrapped by the particular verison of the designer you're using.

Then what's the library called touchgfx_core.lib found in C:\TouchGFXProjects\I2CTouchGfx\Middlewares\ST\TouchGFX\touchgfx\lib\core\cortex_m7\Keil

It's the library copied by the designer when you generated code. Coincidentally located in Middlewares/ST/TouchGFX/

/Martin

Ok, that's what I mean by "is this library correct to use" in Keil?

Not that I'm using the wrong library...