Skip to main content
jvavra
Associate III
August 2, 2017
Question

JTAG Debug Auto-Starts

  • August 2, 2017
  • 3 replies
  • 929 views
Posted on August 02, 2017 at 13:06

I'm using the ST-Link with IAR, trying to do on-chip debugging via JTAG on a STM32F432. However, when I click 'Download and Debug', my application seems to randomly start running, instead of sitting in man at the reset vector, waiting for me to click 'Go'. If I stop, it's executing real code, but inserting  breakpoint in the beginning of main shows it's not starting at the entry vector for my application.  The strange thing is this behavior seems intermittent. Some sort of clock issue?

#iar #jtag
This topic has been closed for replies.

3 replies

howard n2wx
Associate III
August 2, 2017
Posted on August 02, 2017 at 13:57

Sounds like the 'IAR project options->Debugger->Run to' box isn't checked.

Check it off and put 'main' in the edit box

jvavra
jvavraAuthor
Associate III
August 2, 2017
Posted on August 02, 2017 at 14:06

howard,

Thanks for the reply, but it is indeed already checked off. I should have mentioned that in my original post.

howard n2wx
Associate III
August 2, 2017
Posted on August 02, 2017 at 14:10

Is 'connect to running target' checked?  It's not on my setup.

If you're using ST-Link the connect pulldown should probably be on Connect during reset.

Tesla DeLorean
Guru
August 2, 2017
Posted on August 02, 2017 at 16:31

Not much to work with, where is it executing?

Custom board?

External clock?

Full JTAG? or SWD?

If it is executing code in ROM make sure the BOOT0 pin is pulled LOW.

If 'run to main()' type option is checked, it might still be running SystemInit() to configure clocks and memories, if that is locking up in HSE or PLL code it won't get to main(). Check the HSE if you are using that.

Tips, Buy me a coffee, or three.. PayPal VenmoUp vote any posts that you find helpful, it shows what's working..