To stop microcontroller on the Xth pass through a function, winIDEA offers option conditional breakpoints: each time the breakpoint is passed the expression (if present) will be evaluated and if it evaluates to true, it will count as one more pass. When the breakpoint is passed for as many times as specified in the pass count, breakpoint will be hit and the CPU will be stopped.
1. Open Debug menu / Breakpoints.
2. Select a breakpoint.
3. Check the Enabled box to convert the breakpoint to a conditional breakpoint.
4. Type or select the number of passes for this specific breakpoint in Pass count section. The CPU will stop when lowest pass count is reached.
It is possible to have several breakpoints with differing pass counts.
5. Once the pass count number is reached you will be notified each further time this breakpoint is passed. If this is interfering with your operation, you can easily disable the notifications by unchecking the available Display message box when a HW BP is hit option.
CPU actually stops each time a conditional breakpoint is passed in order to evaluate the condition and then resumes the CPU.
Sorry this article didn't answer your question, we'd love to hear how we can improve it.
Note: This form won't submit a case. We'll just use it to make this article better.