Skip to main content
JWolf.3
Associate
May 12, 2021 10:14 PM UTC
Question

Failed to insert all hardware breakpoints: You may have requested too many hardware breakpoints/watchpoints.

I started getting this message when I try to debug my code. However, there are currently no breakpoints in my code at all. I have gotten this in the past and I deleted and redownloaded the IDE which I really do not want to do again. I am running it on Mac. Any suggestions are helpful.

// Simple ADC Reader
// ADC1_1 on PA1
// Port A on AHB1
// ADC on APB2
 
#include "stm32f4xx.h"
#include "printUSART.h"
 
int val = 0;
 
int main(void){
 
	USART2_Init();
 
	RCC->AHB1ENR	|= RCC_AHB1ENR_GPIOAEN;
 
	GPIOA->MODER	= GPIO_MODER_MODE0_0 | GPIO_MODER_MODE0_1;
 
	RCC->APB2ENR	|= RCC_APB2ENR_ADC1EN;
 
	ADC1->CR2	= 0;
 
	ADC1->SQR3	|= ADC_SQR3_SQ1_0;
 
	ADC1->CR2	|= ADC_CR2_ADON;
 
	while(1){
		ADC1->CR2 |= ADC_CR2_SWSTART;
		while(!(ADC1->SR & ADC_SR_EOC)){}
		val = ADC1->DR;
		printf("\n%d", val);
 
	}
 
}

7 replies

Javier1
Principal
May 13, 2021 9:18 AM UTC

I get this error in cubeIDE when indeed i add more than 6 breakout points.0693W00000AODlcQAH.png 

I can resume normal debugging when i remove breakout points down to 6

0693W00000AODlmQAH.png

hit me up in https://www.linkedin.com/in/javiermuñoz/
JWolf.3
JWolf.3Author
Associate
May 13, 2021 9:22 PM UTC

That would make sense except I don’t have any breakpoints at all in my code...

Javier1
Principal
May 18, 2021 3:02 PM UTC

do you have more than one project opened in stm32ide workspace?

maybe youre trying to debugg the wrong code?

hit me up in https://www.linkedin.com/in/javiermuñoz/
Associate
Jul 14, 2024 3:59 PM UTC

Encountered today the same problem today - no breakpoints in the breakpoint view, used brk / del debugger commands to delete all breakpoints but still no luck.

Eventually figured out that the function, where I wanted to put the breakpoint in, was likely optimised to inline and the IDE was actually trying to insert multiple breakpoints instead of one - and I only had 3 HW breakpoints available in the MCU.

If that is the case need to disable optimisation or find another way/place to insert the breakpoint.

Ozone
Principal
Apr 14, 2026 5:36 AM UTC

Your could try to start the application in the debugger (run to main), switch to mixed / instruction stepping, and set the breakpoint there, at assembler level.
I don't do Cube either, but this works fine with SeggerES.

Associate
Apr 14, 2026 3:58 AM UTC

Also had this problem today, and want to reiterate what the above commenter said: If you put a breakpoint in an inline function, it's like putting a breakpoint wherever that function is called/inlined. In my case I removed the inline keyword temporarily...