Author Topic: Remote Debugging with Codeblocks and Segger JLink-EDU  (Read 23467 times)

Offline woehlb

  • Single posting newcomer
  • *
  • Posts: 6
Remote Debugging with Codeblocks and Segger JLink-EDU
« on: March 17, 2010, 07:50:31 pm »
I want use Codeblocks and the JLink-EDU. But I can not execute a single step.

Look here:
http://www.segger2.com/index.php?page=Thread&postID=1382#post1382

and here:
http://www.mikrocontroller.net/topic/170920#1639161

How can I configure Codeblocks for the debugging with the JLink-EDU?

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: Remote Debugging with Codeblocks and Segger JLink-EDU
« Reply #1 on: March 18, 2010, 04:38:45 pm »
How can I configure Codeblocks for the debugging with the JLink-EDU?
From a quick look: Are you aware that you can setup GDB initialisation commands from the debugger settings?
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline woehlb

  • Single posting newcomer
  • *
  • Posts: 6
Re: Remote Debugging with Codeblocks and Segger JLink-EDU
« Reply #2 on: March 18, 2010, 07:38:18 pm »
My GDB commands:

Before connection:
------------------
set mem inaccessible-by-default off
monitor speed auto
monitor endian little
monitor flash device=stm32f103rb
monitor flash breakpoints = 1
monitor flash download = 1
file "$(TARGET_OUTPUT_FILE)"
monitor reg r13 = (0x00000000)
monitor reg pc = (0x00000004)

After connection:
-----------------
load
thbreak main

Segger GDB-Server Log:
-----------------------
SEGGER J-Link GDB Server V4.12

JLinkARM.dll V4.12 (DLL compiled Feb 26 2010 19:22:53)

WARNING: Out of sync , resynchronising...

Listening on TCP/IP port 2331

J-Link connected
Firmware: J-Link ARM V8 compiled Dec  1 2009 11:42:48
Hardware: V8.00
S/N: 268000132
OEM: SEGGER-EDU
Feature(s): FlashBP

J-Link found 2 JTAG devices, Total IRLen = 9
JTAG ID: 0x3BA00477 (Cortex-M3)

Free mode: To be used for non-commercial and evaluation purposes only.

Connected to 127.0.0.1
Reading all registers
Read 4 bytes @ address 0x00000000 (Data = 0x20005000)
Read 2 bytes @ address 0x08000110 (Data = 0xF000)
Read 2 bytes @ address 0x08000110 (Data = 0xF000)
Setting breakpoint @ address 0x08000110, Size = 2, BPHandle = 0x0001
Starting target CPU...
WARNING: T-bit of XPSR is 0 but should be 1. Changed to 1.
...Target halted (PC = 0x00000000)
Reading all registers
Removing breakpoint @ address 0x08000110, Size = 2
Read 4 bytes @ address 0x00000000 (Data = 0x20005000)
Setting breakpoint @ address 0x08000110, Size = 2, BPHandle = 0x0002
Starting target CPU...
...Target halted (PC = 0x00000000)
Reading all registers
Removing breakpoint @ address 0x08000110, Size = 2
Read 4 bytes @ address 0x00000000 (Data = 0x20005000)

The Program do not stopped at the address of main, and so I can not execute a single step.

Offline woehlb

  • Single posting newcomer
  • *
  • Posts: 6
Re: Remote Debugging with Codeblocks and Segger JLink-EDU
« Reply #3 on: March 18, 2010, 07:39:30 pm »
The Log of the GDB in the environment of Codeblocks:
----------------------------------------------------

Building to ensure sources are up-to-date
Build succeeded
Selecting target:
Debug
Adding source dir: C:\Dokumente und Einstellungen\woehlb\Eigene Dateien\temp\stm32_md\
Adding source dir: C:\Dokumente und Einstellungen\woehlb\Eigene Dateien\temp\stm32_md\
Changing directory to: bin/Debug
Adding file: bin\Debug\stm32_md.elf
Starting debugger:
done
Registered new type: wxString
Registered new type: STL String
Registered new type: STL Vector
Connecting to remote target
Setting breakpoints
Debugger name and version: GNU gdb (Sourcery G++ Lite 2009q3-68) 6.8.50.20090630-cvs
Connected
In ?? () ()
Program received signal SIGTRAP, Trace/breakpoint trap.
Program received signal SIGTRAP, Trace/breakpoint trap.


Offline woehlb

  • Single posting newcomer
  • *
  • Posts: 6
Re: Remote Debugging with Codeblocks and Segger JLink-EDU
« Reply #4 on: March 20, 2010, 05:03:01 pm »
OK, I changed to Eclipse, Sourcery G++ Lite und the JLink-EDU. This combination works problemless.

Offline lehua768

  • Single posting newcomer
  • *
  • Posts: 2
Re: Remote Debugging with Codeblocks and Segger JLink-EDU
« Reply #5 on: April 20, 2010, 09:32:44 am »
rom a quick look: Are you aware that you can setup GDB initialisation commands from the debugger settings?
removed ad from signature
Jens