Skip to main content
sjaey.1
Associate II
October 20, 2020
Solved

Use CubeMX STM32F103 Hard Fault exception??

  • October 20, 2020
  • 9 replies
  • 3681 views

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

This topic has been closed for replies.
Best answer by Tesla DeLorean

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().

9 replies

Nesrine.JLASSI
Visitor II
October 26, 2020

Hi @sjaey.1​ 

This will be internally checked.

Best Regards,

Nesrine

Tesla DeLorean
Guru
October 26, 2020

A really unhelpful presentation of the problem.

Your own board?

Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..
sjaey.1
sjaey.1Author
Associate II
October 27, 2020

​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.

Tesla DeLorean
Tesla DeLoreanBest answer
Guru
October 27, 2020

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 (See Profile) Up vote any posts that you find helpful, it shows what's working..
Nesrine.JLASSI
Visitor II
October 27, 2020

Hi @sjaey.1​ 

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

0693W0000059R2HQAU.pngBest regards,

Nesrine

Nesrine.JLASSI
Visitor II
October 27, 2020

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

Please specify you STM32CubeMX version.

sjaey.1
sjaey.1Author
Associate II
October 27, 2020

0693W0000059RCHQA2.pngVersion 5.6.1

Nesrine.JLASSI
Visitor II
October 27, 2020

No issue detected when using STM32CubeMX v 6.0.1.

0693W0000059Sf0QAE.png

sjaey.1
sjaey.1Author
Associate II
October 28, 2020

I have incorrectly connected the BOOT0 PIN.

Thanks a lot.