OpenOCD XMC4800

Gast #4621276
Lesenswert?

Guten Morgen,

für das Debugging auf einem XMC4800 Mikrocontroller möchte ich den 
Olimex Debugger einsetzen. Hierfür habe ich die OpenOCD Version 0.9.0 
heruntergeladen. Bei  Ausführen folgender Zeilen
1
C:\openocd-0.9.0\bin-x64>openocd.exe -f interface\olimex-arm-usb-tiny-h.cfg -f target\xmc4800.cfg

erscheint diese Meldung:
1
C:\openocd-0.9.0\bin-x64>openocd.exe -f interface\olimex-arm-usb-tiny-h.cfg -f target\xmc4800.cfg
2
Open On-Chip Debugger 0.9.0 (2015-05-19-12:09)
3
Licensed under GNU GPL v2
4
For bug reports, read
5
        http://openocd.org/doc/doxygen/bugs.html
6
Info : only one transport option; autoselect 'jtag'
7
Warn : Interface already configured, ignoring
8
Error: Can't change session's transport after the initial selection was made
9
embedded:startup.tcl:21: Error:
10
in procedure 'script'
11
at file "embedded:startup.tcl", line 60
12
in procedure 'transport' called at file "C:/openocd-0.9.0//scripts/target\xmc4800.cfg", line 2
13
in procedure 'ocd_bouncer'
14
at file "embedded:startup.tcl", line 21

Welche Einstellungen müsste ich verändern, damit ich auf den Controller 
zugreifen kann?

Inahlt vom xmc4800.cfg Datei:
1
source [find interface/jlink.cfg]
2
transport select swd
3
adapter_khz 1000
4
set CHIPNAME xmc4800
5
source [find target/xmc4xxx.cfg]
Gast #4621338
Lesenswert?

Nun habe ich Zugriff allerdings das Flashen funktioniert nicht.

Anscheinend gibt es für den XMC4 keine Flashloader.
1
Open On-Chip Debugger 0.9.0 (2015-05-19-12:09)
2
Licensed under GNU GPL v2
3
For bug reports, read
4
        http://openocd.org/doc/doxygen/bugs.html
5
Info : only one transport option; autoselect 'jtag'
6
Warn : Interface already configured, ignoring
7
Error: flash driver 'xmc4xxx' not found
Gast #4621405
Lesenswert?

xmc4xxx.cfg:
1
#
2
# Infineon XMC4100/XMC4200/XMC4400/XMC4500 family (ARM Cortex-M4 @ 80-120 MHz)
3
#
4

5
if { [info exists CHIPNAME] } {
6
set _CHIPNAME $CHIPNAME
7
} else {
8
set _CHIPNAME xmc4000
9
}
10

11
source [find target/swj-dp.tcl]
12

13
#
14
# SWJ-DP
15
#
16
if { [info exists CPU_JTAG_TAPID] } {
17
set _CPU_JTAG_TAPID $CPU_JTAG_TAPID
18
} else {
19
set _CPU_JTAG_TAPID 0x4BA00477
20
}
21

22
#
23
# SW_DP
24
#
25
if { [info exists CPU_SWD_TAPID] } {
26
set _CPU_SWD_TAPID $CPU_SWD_TAPID
27
} else {
28
set _CPU_SWD_TAPID 0x2BA01477
29
}
30

31
if { [using_jtag] } {
32
set _CPU_TAPID $_CPU_JTAG_TAPID
33
} else {
34
set _CPU_TAPID $_CPU_SWD_TAPID
35
}
36

37
swj_newdap $_CHIPNAME cpu -irlen 4 -expected-id $_CPU_TAPID
38

39
set _TARGETNAME $_CHIPNAME.cpu
40
target create $_TARGETNAME cortex_m -chain-position $_TARGETNAME
41

42
# Work-area is a space in RAM used for flash programming
43
# By default use 16 kB
44
if { [info exists WORKAREASIZE] } {
45
set _WORKAREASIZE $WORKAREASIZE
46
} else {
47
set _WORKAREASIZE 0x1000
48
}
49

50
$_TARGETNAME configure -work-area-phys 0x20000000 -work-area-size $_WORKAREASIZE -work-area-backup 0
51

52
set _FLASHNAME $_CHIPNAME.flash
53
flash bank $_FLASHNAME xmc4xxx 0x0C000000 0 0 0 $_TARGETNAME
54

55
if { ![using_hla] } 
56
{
57
cortex_m reset_config sysresetreq
58
}
59

60
adapter_khz 1000

Es liegt an dieser Zeile:
1
flash bank $_FLASHNAME xmc4xxx 0x0C000000 0 0 0 $_TARGETNAME
#4621525
Lesenswert?

LEO schrieb:
> Inahlt vom xmc4800.cfg Datei:source
> [find interface/jlink.cfg]
> transport select swd
> adapter_khz 1000
> set CHIPNAME xmc4800
> source [find target/xmc4xxx.cfg]

Irks. Diese Datei will hart einen JLink im SWD Mode haben, warum auch 
immer.

Bau Dir am Besten eine eigene CFG für Dein Board zusammen, müsste in 
etwa so aussehen:
1
source [find interface/ftdi/olimex-arm-usb-tiny-h.cfg]
2
transport select jtag
3
adapter_khz 1000
4
set CHIPNAME xmc4800
5
source [find target/xmc4xxx.cfg]

Aufruf wäre dann
1
 
2
openocd.exe -f myBoard.cfg

Die interface/ftdi Configs wollen einen anderen Treiber sehen, eventuell 
"/ftdi/" weglassen.

Neuere (aber experimentelle) Versionen von openOCD gibts fertich 
kompiliert unter: 
http://www.freddiechopin.info/en/download/category/10-openocd-dev

Da müsste dann XMC4xxx Unterstützung eigentlich mit drin sein.

Oder man kompiliert sich halt selbst eine git Version. Man ist ja 
Entwickler. ;-)
Gast #4621596
Lesenswert?

Hallo Jim,

danke für deine Unterstützung.

Ich habe die cfg Datei abgeändert. Zusätzlich habe ich noch die zwei 
Versionen (openocd-0.10.0-dev-00247-g73b676c und 
openocd-0.10.0-dev-00040-gd52070c) getestet. Leider funktioniert das 
Flashen mit DAVE Debug OpenOCD immer noch nicht richtig. In der Konsole 
kommt nun zumindest keine Fehler mehr bezüglich flash loader nicht 
gefunden.
Gast #4621685
Lesenswert?

Ausgabe (OpenOCD Version 0.10.0):

[/code]
Open On-Chip Debugger 0.10.0-dev-00247-g73b676c (2016-03-12-15:05)
Licensed under GNU GPL v2
For bug reports, read
        http://openocd.org/doc/doxygen/bugs.html
adapter speed: 1000 kHz
cortex_m reset_config sysresetreq
adapter speed: 1000 kHz
Info : clock speed 1000 kHz
Info : JTAG tap: xmc4800.cpu tap/device found: 0x4ba00477 (mfg: 0x23b 
(ARM Ltd.), part: 0xba00, ver: 0x4)
Info : JTAG tap: auto0.tap tap/device found: 0x101df083 (mfg: 0x041 
(Infineon (Siemens)), part: 0x01df, ver: 0x1)
Warn : AUTO auto0.tap - use "jtag newtap auto0 tap -irlen 8 -expected-id 
0x101df083"
Info : xmc4800.cpu: hardware has 6 breakpoints, 4 watchpoints
[/code]
Gast #4622677
Lesenswert?

Sobald ich den Debugger starte kommt nach einigen Sekunden diese 
Fehlermeldung:

Error in final launch sequence
Failed to execute MI command:
-target-select remote localhost:3333
Error message from debugger back end:
Remote communication error.  Target disconnected.: No error.
Failed to execute MI command:
-target-select remote localhost:3333
Error message from debugger back end:
Remote communication error.  Target disconnected.: No error.
Remote communication error.  Target disconnected.: No error.

In der DAVE Console erscheint diese Meldung:
GNU gdb (GNU Tools for ARM Embedded Processors) 7.8.1.20141128-cvs
Copyright (C) 2014 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later 
<http://gnu.org/licenses/gpl.html>;
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show 
copying"
and "show warranty" for details.
This GDB was configured as "--host=i686-w64-mingw32 
--target=arm-none-eabi".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>;.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>;.
For help, type "help".
Type "apropos word" to search for commands related to "word".
Gast #4623991
Lesenswert?

Es muss an den Flashloader liegen. Der wird einfach nicht in eclipse 
gestartet. Die Verbindung scheint ja zu funktionieren. Ich vermute der 
Flashloader wurde für den XMCxxxx noch nicht richtig implementiert und 
getestet.

Antwort schreiben

Bitte melde dich an, um einen Beitrag zu schreiben.

oder

Mit Google-Account einloggen

Die Registrierung ist kostenlos und dauert nur eine Minute.

Jetzt registrieren