NUCLEO-G431 hal initialization

You’re forgetting to implement the SysTick_Handler interrupt in which you must increment the HAL tick. Without that, HAL_Delay() will delay forever…

Don’t forget to use

extern "C" void SysTick_Handler(void)
{
  HAL_IncTick();
}

if you’re implementing this in a C++ file instead of a C file.