Forum: Mikrocontroller und Digitale Elektronik arm-gdb Konfiguration für OpenOCD


von Kjartan F. (kjartan)


Lesenswert?

Hallo,

ich bekomme den gdb mit openocd nicht richtig konfiguriert Das Verbinden 
zu OpenOCD scheint zu funktionieren, sonst geht leider nichts.

(Flashen kann ich nur über OpenOCD bereits.)

Mein Versuch:
======================================================================== 
========
1. OpenOCD starten:
1
C:\openocd\bin>C:\openocd\bin\openocd.exe -f interface/openocd-usb.cfg -f target/stm32.cfg -f actions/debug.cfg
2
Open On-Chip Debugger 0.4.0 (2010-02-22-19:05)
3
Licensed under GNU GPL v2
4
For bug reports, read
5
        http://openocd.berlios.de/doc/doxygen/bugs.html
6
1000 kHz
7
jtag_nsrst_delay: 100
8
jtag_ntrst_delay: 100
9
Info : clock speed 1000 kHz
10
Info : JTAG tap: stm32.cpu tap/device found: 0x3ba00477 (mfg: 0x23b, part: 0xba00, ver: 0x3)
11
Info : JTAG tap: stm32.bs tap/device found: 0x16410041 (mfg: 0x020, part: 0x6410, ver: 0x1)
12
Info : stm32.cpu: hardware has 6 breakpoints, 4 watchpoints
13
Info : JTAG tap: stm32.cpu tap/device found: 0x3ba00477 (mfg: 0x23b, part: 0xba00, ver: 0x3)
14
Info : JTAG tap: stm32.bs tap/device found: 0x16410041 (mfg: 0x020, part: 0x6410, ver: 0x1)
15
target state: halted
16
target halted due to debug-request, current mode: Thread
17
xPSR: 0x01000000 pc: 0xfffffffe msp: 0xfffffffc
18
Info : device id = 0x20036410
19
Info : flash size = 128kbytes
20
flash 'stm32x' found at 0x08000000

2. GDB starten (aus Eclipse):
1
warning: unknown ARM EABI version 0x5000000
2
Don't know how to run.  Try "help target".

3. GDB Konfigurieren (in der Eclipse gdb Konsole Befehle händisch 
eingetippt):
1
target remote localhost:3333
Antwort von gdb:
1
Remote debugging using localhost:3333
2
0xfffffffe in ?? ()
Antwort von openocd:
1
Info : accepting 'gdb' connection from 0
2
Error: address + size wrapped(0xfffffffe, 0x00000004)
1
monitor reset
Antwort von openocd:
1
JTAG tap: stm32.cpu tap/device found: 0x3ba00477 (mfg: 0x23b, part: 0xba00, ver: 0x3)
2
JTAG tap: stm32.bs tap/device found: 0x16410041 (mfg: 0x020, part: 0x6410, ver: 0x1)
3
stm32.cpu -- clearing lockup after double fault
4
target state: halted
5
target halted due to debug-request, current mode: Handler HardFault
6
xPSR: 0x01000003 pc: 0xfffffffe msp: 0xffffffdc
1
load
Antwort von gdb:
1
Loading section .isr_vector, size 0x10c lma 0x8000000
2
Memory access error while loading section .isr_vector.

Antwort von openocd:
1
Error: JTAG-DP STICKY ERROR
2
Error: MEM_AP_CSW 0x23000052, MEM_AP_TAR 0x8000004
3
Error: JTAG-DP STICKY ERROR
4
Error: MEM_AP_CSW 0x23000052, MEM_AP_TAR 0x8000004
5
Warn : Block write error address 0x8000000, wcount 0x43
6
Error: unexpected error -107

Wäre toll, wenn ihr mir helfen könntet.

Schöne Grüße aus Linz,
Kjartan

Anhang:
======================================================================== 
========

Mein Setup:
- Windows 7 x64
- Eclipse
- Eclipse GNU ARM Plugin
- CodeSourcery G++ Lite Toolchain zum Compilieren und Linken
- gnuarm Toolchain für den GDB Server
- OpenOCD
- OpenOCD-USB Debugger aus dem Shop
- Board mit einem STM32F103RB

Was funktioniert:
- Flashen mit OpenOCD
- Eclipse compilieren und linken

Meine debug.cfg (für OpenOCD starten):
1
gdb_port 3333
2
init
3
reset halt
4
flash probe 0

Meine funktionierende cfg fürs Flashen:
1
# start device communication session
2
init
3
4
# stop the controller
5
reset halt
6
7
# test and ?select? a flash bank
8
flash probe 0
9
10
# write the image 
11
flash write_image erase upload.hex
12
13
# start de controller
14
reset run
15
16
# quit the device communication session, close openocd
17
shutdown

von Kjartan F. (kjartan)


Lesenswert?

bump

von Micha (Gast)


Lesenswert?

Hallo Kjartan Ferstl,

helfen kann ich Dir zwar noch nicht, aber Dein Post hat mich auf jeden 
Fall einen Schritt weiter gebracht. Durch Deinen Post funktioniert 
Flashen mit OpenOCD.

Mein Setup ist:
- Ubuntu 10.10 - »Maverick Meerkat«
- Eclipse INDIGO
- GDB Hardware Debugging (pluginn)
- CodeSourcery G++ Lite Toolchain zum Compilieren und Linken
- OpenOCD
- Board LM3S6965

Vielen Dank und VG,
Micha

Bitte melde dich an um einen Beitrag zu schreiben. Anmeldung ist kostenlos und dauert nur eine Minute.
Bestehender Account
Schon ein Account bei Google/GoogleMail? Keine Anmeldung erforderlich!
Mit Google-Account einloggen
Noch kein Account? Hier anmelden.