Skip to main content



      Home
Home » Language IDEs » C / C++ IDE (CDT) » Breakpoint problem(Some breakpoints don't work)
Breakpoint problem [message #1855503] Tue, 18 October 2022 12:56 Go to next message
Eclipse UserFriend
I use Eclipse to develop a number of projects on custom hardware using STM32 ARM processors. I have Eclipse version 2022-09, compiled for Embedded C/C++ Developers, installed on several Windows PC's. A few months have passed since I last did any development work, and I ran Help>>Check for updates before starting work.

However, I can't get breakpoints working correctly. Projects typically start like this:
main(void){
	u32 x32 = 0;

	RCC_RMVF = 1;	
	prvMain.HostAddress = -1;
	prvMain.ModuleAddress = -1;
	Tick.MainLoopCnt10us = 100000;
	Cal = *(tAnalogueCal*)FLASH_SUPER_BLOCK_ADDR;
	if ((Cal.Gain[0] < 0.5) || (Cal.Gain[0] > 2.0)){
		x32 = 4;
		for(x32 = 0; x32 < 4; x32++){
			Cal.Offset[x32] = 0;
			Cal.Gain[x32] = 1.0;
		}
	}
	InitialiseSTM32();
	while(1){
		prvCheckSwitches();
		.
		.
	}
}


I have added breakpoints on various lines before the while statement, and at the line prvCheckSwitches();. However, when I run it the only breakpoint that is actioned is the one at prvCheckSwitches();. If I look at the disassembly I can see the code and the breakpoints. The same applies regardless of which project I run or the PC on which I run it.

The only common factor is Eclipse and it's add-ons.

Any suggestions?
Re: Breakpoint problem [message #1855508 is a reply to message #1855503] Wed, 19 October 2022 01:48 Go to previous messageGo to next message
Eclipse UserFriend
c++ -O0 -g

disable all optimizations...

Also test outside of eclipse, maybe using gdb in client/server mode to remote debug on the actual hardware? otherwise you will have to provide emulated setup functions for your STM32 target.
Re: Breakpoint problem [message #1855521 is a reply to message #1855508] Wed, 19 October 2022 07:32 Go to previous messageGo to next message
Eclipse UserFriend
Thanks for the suggestion, but I have the option -O0 in the compiler and linker so optimization is disabled. Furthmore if I look at the disassembly code when stopped at the breakpoint within the while loop, then scroll up, I can see that the code is linear back as far as the previous breakpoints, so I can't see any reason why the second should be actioned but not the first.

It would be quite complex to debug outside of Eclipse, and since it worked previously I believe there should be a way of getting it to work now.
Re: Breakpoint problem [message #1855523 is a reply to message #1855503] Wed, 19 October 2022 09:11 Go to previous message
Eclipse UserFriend
The devil is in the details, and you have left them out.

I guess that you're running a STM32 processor and connecting to it via an USB - to - JTAG dongle (ST-link?).

If you're running the target code from Flash memory on the target chip, GDB has to use the built-in debug registers in the chip to implement breakpoints. There is actually nothing of the breakpoints in the code.

My guess it that InitialiseSTM32() plays with the registers, and they are not fully functional before the initialisation. I'm not going to wade again the swampy mess of STM code to look at it.
Previous Topic:Is there a way to modify GNU Linker Error Parser options for a headless build?
Next Topic:Eclipse will not start
Goto Forum:
  


Current Time: Fri Nov 14 18:58:42 EST 2025

Powered by FUDForum. Page generated in 0.03846 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top