0
\$\begingroup\$

I'm trying to execute my project in the debugger but it doesn't go to the interrupt routine. the project is correct and it works without the debugger nicely.

How do I use it?

Ok, here we go!

at first, I connect the J-link debugger to the board and I click on the start/stop debug session button. now I'm in the debug environment. I go to the Peripheral > System Viewer menu and choose these peripherals to observe them: RCC & NVIC & EXTI & GPIOA and finally GPIOB. the configuration is enough (I'm not sure that these configurations are enough. if there are some other configuration that have to do, tell me).

Ok, lets go to start the debugging. I pass all functions between int main(void) and while (1) by clicking on the Step Over button. well now I'm in the infinite loop and time to show! before push the button in the circuit, the registers are:

figure1

figure2

Now I push the button and click on the Step button in the debugger environment and the registers for interrupt are:

figure3

figure4

I expect that if I click on the Step button, it jump to the interrupt routine but when I click on it, it doesn't go! click-click-click-click-... No, it doesn't go!

Why? What is the problem?

\$\endgroup\$
  • 1
    \$\begingroup\$ I don't think you can be brought to an ISR by stepping code. You need to have a breakpoint in there. \$\endgroup\$ – Dzarda Aug 23 '14 at 14:22
  • \$\begingroup\$ @Dzarda you tell me that I have to use a breakpoint for reaching to my purpose? \$\endgroup\$ – Roh Aug 23 '14 at 14:24
  • \$\begingroup\$ Did you enable the interrupt in NVIC and did you write a proper ISR function? For me it always worked even without a breakpoint. \$\endgroup\$ – venny Aug 23 '14 at 14:37
  • \$\begingroup\$ @venny As I said it works very well without the debugger and about enable the interrupt, I have to say you that it's enable and no need to enable it. \$\endgroup\$ – Roh Aug 23 '14 at 14:47
1
\$\begingroup\$

You should be able to put a breakpoint at the start of the ISR. Then let the program run as normal without any stepping.

When you click the button, it should stop in the ISR and be in the debugger.

I would expect when the program is 'stopped' waiting for an interrupt, either the debugger allows interrupts to happen at full speed, and you won't see them in the debugger unless they contain a breakpoint, or the debugger is blocking interrupts.

If that is not the case, write back to say what is happening.

\$\endgroup\$
  • \$\begingroup\$ Thanks to you and @Dzarda . is this alone way to go to the ISR? venny's comment is interesting to me. have you seen it? \$\endgroup\$ – Roh Aug 23 '14 at 14:52

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.