Skip to main content
Senior II
February 9, 2021
Solved

New ST32MX prjoject goes straight to HardFault_Handler

  • February 9, 2021
  • 4 replies
  • 2756 views

Hi All,

I have created a new ST32IDE/ST32MX project for controller STM32G473CET6-01 at my own PCB.

USART, CRC and FREERTOS is added .

This project compiles fine, but the moment i press the debug button ,it goes straight to void HardFault_Handler(void) ?

This happens without pressing the Resume(F8) button after debugger is loaded.

Wondering why this happen?

As STM is new for me , i hope to get an easyer asnwer then "search the hardware fault", i didn't expect this problem with an empty project . :grinning_face_with_sweat:

The first thing i wanted to try do is remove RTOS, but it seems that not possible, do i need to create a new project in that case?

Thank you !

0693W000007EZPqQAO.png 

This topic has been closed for replies.
Best answer by sde c.1

misterie solved, a wrong STM32 was placed . thanks for the responses !

4 replies

KnarfB
Super User
February 9, 2021

Would create a new minimal project for testing. You can set a breakpoint at the very first instruction (Reset_Handler) instead of main: Debug Configuration > Startup and then step-trough the code. You should also check the .map file that the addresses look reasonable (Flash, SRAM). Sometimes there were issues with reading the right .ld file. RTOS should not matter before main().

Pavel A.
February 9, 2021

The fault analyzer shows stacking error and MSP=2001FDD8

Is this a valid RAM address for this part?

-- pa

Tesla DeLorean
Guru
February 9, 2021

It has 128KB of RAM, the 0x20018000..0x2001FFFF is an alias of the CCM at 0x10000000..0x10007FFF

Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..
sde c.1AuthorBest answer
Senior II
February 11, 2021

misterie solved, a wrong STM32 was placed . thanks for the responses !