Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » Breakpoint problem(Some breakpoints don't work)
Breakpoint problem [message #1855503] Tue, 18 October 2022 16:56 Go to next message
Alan Rouse is currently offline Alan RouseFriend
Messages: 15
Registered: July 2009
Junior Member
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 05:48 Go to previous messageGo to next message
Kent Dorfman is currently offline Kent DorfmanFriend
Messages: 21
Registered: December 2020
Junior Member
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 11:32 Go to previous messageGo to next message
Alan Rouse is currently offline Alan RouseFriend
Messages: 15
Registered: July 2009
Junior Member
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 13:11 Go to previous message
Tauno Voipio is currently offline Tauno VoipioFriend
Messages: 743
Registered: August 2014
Senior Member
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.


--

Tauno Voipio
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: Sat Jan 18 05:15:15 GMT 2025

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

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

Back to the top