#66 STM32 Eclipse Plugin always stuck in HardFault_Handler

Version 1.x
Sainath Nambiar

Hi All,
I have recently started migrating my STM32 development process to eclipse. I have installed the arm eclipse plugin and started development. Previously I was taking the template from blinky project of STM32 and importing it to eclipse i.e it had its own startup CMSIS etc with it . I was able to compile it and debug it using JLink. but when I used a standard template from the Arm plugin , though the compilation works , during debugging the control is always stuck at 'HardFault_Handler(void)'. Kindly suggest steps to be taken.

Eclipse Version: Luna Release (4.4.0)
Eclipse GCC Cross Compiler Support



  • based on the information you provided, it is hard to tell. my first guess is that you did not configure properly the template, for example flash/ram size.

    what board are you using?

  • I am using STM32-P103, and selected Medium Density line with 1000KB flash and 96 KB ram, the only change I do while using templates is remove the -Werror flag from compilation, removed the linker flag option for random-specs and remove optimsation. Any pointers on configuring the template other than the ones mentioned in the website of eclipse plugin.


  • from the STM32-P103 board description: "MCU: STM32F103RBT6 ARM 32 bit CORTEX M3 with 128K Bytes Program Flash, 20K Bytes RAM".

  • Yes, I have selected the wrong MCU that was the reason for hardware fault, but now I started a new project and when I am trying to debug with correct settings, I am unable to get the step into and other functionalities all I can see is Terminate symbol near the console. I have attached the screenshot, Thanks for pointing out the error.


  • this is a known Eclipse bug, exit Eclipse and retry

    Last edit: Liviu Ionescu (ilg) 2014-08-08
  • Thank you Liviu, really appreciate your effort in quick and apt reply, I have a last query about how to enable semi hosting because though I am able to see the variables and registers, I am unable to see the printf statement on my console, the only change I have done is removing the linker flag --specs=nano.specs from the linking process and changing the linker to arm-none-eabi-gcc.
    Thanks again.


    • changing the linker to arm-none-eabi-gcc

      bad idea, leave these things as set by the template wizard.

  • I suggest you first read the documentation pages.

    Then create a new project and study carefully the template options.

    If you already have an existing project, you need to change the preprocessor definitions to either route the trace_printf() or the global printf() to the semihosting output.

  • Will try that and also read the documentation. Kindly close the ticket.

    • status: open --> closed
    • assigned_to: Liviu Ionescu (ilg)