1
\$\begingroup\$

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?

enter image description here

enter image description here

\$\endgroup\$
  • \$\begingroup\$ Is the code executing in ISR? \$\endgroup\$ – Marko Buršič Jun 15 at 12:34
  • \$\begingroup\$ I don't think so. But I did not find the right option to enabel it \$\endgroup\$ – Pascal Jun 15 at 12:35
  • \$\begingroup\$ 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. \$\endgroup\$ – Michel Keijzers Jun 15 at 13:58
  • \$\begingroup\$ @MichelKeijzers Is this a general "problem" with stm32 mcus or just with STM32Cube Ide? \$\endgroup\$ – Pascal Jun 15 at 14:04
  • 4
    \$\begingroup\$ "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? \$\endgroup\$ – brhans Jun 15 at 14:06
1
\$\begingroup\$

I found my error. I have a jumper on my board to select the boot mode. I did not connect any of the pins (so no connection to VSS or VCC). This somehow resulted in the error described above. As soon as I set the jumper to connect Pin BOOT to VCC the clock started to work.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.