My STM32L051K8T6 gets stuck in an infinite loop in HAL_Delay(1000); but I know its a hardware problem, not a software problem. Where should I focus my hardware debugging on?
I have used this same chip on a previous project and managed to toggle an LED on and off using HAL_Delay(1000); function. I copied the same code across to my new project board, uploaded it successfully, toggled the LED on successfully but when I step into HAL_Delay(1000); it gets stuck infinitely.
I know it's a hardware problem because the same code works on my other board.
The thing that confuses me is the
- The STM32 allows me to upload my firmware and step through it, so I know the MCU isn't broken.
- I know the code works, as it works on my original board (different design, same chip).
What I'm asking for is there any places I should be looking for that might cause this problem on a hardware level, system clock problems?
Admittedly the MCUs are different batches, however I'm sure its just a layout problem.
This is the layout of the original board that works:
This is the layout of the board that isn't working:

