cancel
Showing results for 
Search instead for 
Did you mean: 

Debuging fails after HAL_Init()

KMill
Senior

I am debugging an application for an STMF103RCTX Using STM32CubeIDE and an STLINK v2 debugger.

This is my usual combination of tools and my usual hookup.

I find that I can start a debug session and step into main() and even step over anything befoer HAL_Init(); but as soon as I hit that the begugger connection fails.

I've made a short video showing this issue:

 

My hookup from the STLINK to the device is as follows:

STLINK           --->  DEVICE
Pin 2 VCC ---> VCC
Pin 4 GND ---> GND
Pin 7 TMS/SWDIO ---> PA13/TMS/SWDIO (46)
Pin 9 TCLK/SWCLK ---> PA14/TCLK/SWCLK (50)
Pin 15 --> RESET ---> nRST (7)

 Any ideas? (The app runs perfectly when not trying to debug it)

12 REPLIES 12
Karl Yamashita
Lead III

Nevermind i found it. I started a new project with just serial debugging enabled, nothing else. I show the same code.

Tips and Tricks with TimerCallback https://www.youtube.com/@eebykarl
If you find my solution useful, please click the Accept as Solution so others see the solution.

I was wondering why the pins were yellow? I did some testing. So it turns out that you must have manually set the pins, which it then turns yellow. But if you set it to Serial Wire it turns green.

Tips and Tricks with TimerCallback https://www.youtube.com/@eebykarl
If you find my solution useful, please click the Accept as Solution so others see the solution.

@Karl Yamashita That's good to know. Thanks.