Showing results for 
Search instead for 
Did you mean: 

Selective Breakpoints and Interrupts?

Associate III

0693W000006GNnCQAW.png0693W000006GNn7QAG.pngRunning STM32CubeIDE 1.5.1 with Nucleo-stm32L433RC trying to get LPTIM1 to work consistently. In Selective03.png I show the initialization of the LPTIM1 (LPTIM_PERIOD is 32767 and LPTIM_PULSE is 16383). So I expect CompareMatchCallback() to happen when the count is 16383. Nope. Very inconsistent (see Selective02.png). I do have one project that does this and the LED changes very consistently at 1 second intervals, but I cant duplicate it.

In Selective01.png it shows me stopped on lptim.c Line 105. When that breakpoint (BP) is active (the box is checked in the upper right window), everything works correctly, the following BPs respond. If I click on the BP for line 105 in the upper right, NO BP is hit. If I make BP on line 105 active, I immediately get a BP and after a few "resumes" I get the BP on line 109 to fire and the LED changes state. If I deactivate BP on line 105, and I let it run for 20 seconds, the LED does not change state at all, but the next time I activate BP on line 105, and look at the au16Times, I see very few new entries (see Selective2.png), and did I mention that the LED never changed state? With the BP set in line 105, I can get it to stop as quickly as I can hit the "resume" button (about 2-3 per second) and the LED toggles after the correct number of "resume" clicks (4), and yet 20 seconds and the BP on line 109 is NEVER hit, and the number of CompareMatchCallback() calls is less than 20?

That tells me that the BPs are "Selective" and the interrupts are also selective. You must consistently have an ACTIVE BP NOT in an if() statement for the interrupt to occur. HUH? How does it do that?