Running straight into _Error_Handler() after compiling the PinMux example
In some version of CubeMX, there is a possibility that the PinMux file example compiled send the debugger straight into _Error_Handler() during SystemClock_Config(). This is due to the wrong clock initialization.
Please erase the HSI clock in this code line in main.c and recompile.
/* Initializes the CPU, AHB and APB busses clocks */
RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSI | RCC_OSCILLATORTYPE_HSE | RCC_OSCILLATORTYPE_LSE;