error when trying to build using eclipse. Target is STM32 Nucleo-64 board
The problem is in the low-power mode! When CPU core clock is halted the debugger connection fails and debug session is halted. Check in your FW if you are invoking low power mode of the CPU.

The solution is either to entirely disable low-power modes, or allow low-power debugging in the DBGMCU_CR register:

DBGMCU_Config(DBGMCU_SLEEP | DBGMCU_STOP | DBGMCU_STANDBY, ENABLE);


This code must be executed during CPU initialization before any low-power mode is first activated. After this, debugger connections will be kept even in sleep, standby and stop modes