cancel
Showing results for 
Search instead for 
Did you mean: 

Use CubeMX STM32F103 Hard Fault exception??

sjaey.1
Associate II

Hello

i'm using stm32f103rct.

Use cubemx and just set RCC,and SYS(JTAG, Timebase Systick)

compile with IAR and then download and debug press break.

Hard fault exception

0693W000004KMPxQAO.pnghelp plz

1 ACCEPTED SOLUTION

Accepted Solutions

Make sure you're configuring the BOOT0 and BOOT1 appropriately to start your code from FLASH

Make sure HSE_VALUE reflects the actual external clock rate

Make sure to select the correct PLL settings, and have the Error_Handler() routine output actionable data if it ends up there. Ditto HardFault_Handler().

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

View solution in original post

9 REPLIES 9

Hi @sjaey.1​ 

This will be internally checked.

Best Regards,

Nesrine

A really unhelpful presentation of the problem.

Your own board?

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

​yes. we have two kind of board. they are very similar hw circuit.

use same mcu and the one use 8Mhz external clock and the other use 12Mhz external clock.

If you set the same using cubemx and only different HSE, 12Mhz works and 8Mhz does not.

Hi @sjaey.1​ 

Tested the same scenario by using a Nucleo-F103RB, i had no issue.

0693W0000059R2HQAU.pngBest regards,

Nesrine

Could you please share you .ioc file to check with.

Please specify you STM32CubeMX version.

sjaey.1
Associate II

0693W0000059RCHQA2.pngVersion 5.6.1

No issue detected when using STM32CubeMX v 6.0.1.

0693W0000059Sf0QAE.png

Make sure you're configuring the BOOT0 and BOOT1 appropriately to start your code from FLASH

Make sure HSE_VALUE reflects the actual external clock rate

Make sure to select the correct PLL settings, and have the Error_Handler() routine output actionable data if it ends up there. Ditto HardFault_Handler().

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

I have incorrectly connected the BOOT0 PIN.

Thanks a lot.