# STM32CubeIDE HAL_Delay not working

I am trying to toggle the GPIO port 8 with:

HAL_GPIO_WritePin(GPIOA, GPIO_PIN_8, GPIO_PIN_SET);
HAL_Delay(1000);
HAL_GPIO_WritePin(GPIOA, GPIO_PIN_8, GPIO_PIN_RESET);


When I debug the application I can see, that the HAL_Delay does not work. I'm not sure if I missed a configuration option in the STM32CubeIDE to enable the SysTick.

Does anyone use STM32CubeIDE and can give me a hint?

• Is the code executing in ISR? – Marko Buršič Jun 15 at 12:34
• I don't think so. But I did not find the right option to enabel it – Pascal Jun 15 at 12:35
• The problem is that SYSTICK only works while not debugging. If you run it works fine, but if you step through the code, the interrupt is not called which updates the SYSTICK counter. It's very annoying indeed. – Michel Keijzers Jun 15 at 13:58
• @MichelKeijzers Is this a general "problem" with stm32 mcus or just with STM32Cube Ide? – Pascal Jun 15 at 14:04
• "HAL_Delay does not work" is not much of a problem description. Does your code get stuck in HAL_Delay, or does it appear to simply skip over HAL_Delay? – brhans Jun 15 at 14:06