Forum: Mikrocontroller und Digitale Elektronik OpenOcd.cfg starten


von Testdummy (Gast)


Lesenswert?

Hey Leute,

jetzt sitze ich schon das ganze Wochenende und versuche mit Yagarto mein 
ARM-Board zum laufen zu bekommen. Ich hänge jedoch immer an dieser 
Fehlermeldung (siehe Anhang)Ich bin bisher der Anleitung von der 
Yagarto-Site gefolgt...

habt ihr vielleicht eine Ahnung was das sein kann? Das Board ist aus dem 
Shop: "AT91SAM7X256 + TFT+ Ethernet" außerdem verwende ich den "ARM USB 
JTAG TINY für OpenOCD" auch aus dem Shop.

Wäre echt super, wenn ihr mir helfen könntet!

Gruß
Marius

von Testdummy (Gast)


Angehängte Dateien:

Lesenswert?

Sorry, vergessen Fehlermeldung anzuhängen :-)

von Testdummy (Gast)


Lesenswert?

Ach so ja,
übrigens spielt es keine Rolle ob ich das Board angeschlossen habe oder 
nicht.
Auch firewall ist ausgeschaltet...

von Dominic R. (dominic)


Lesenswert?

Hi,

die Fehlermeldung besagt, dass der OpenOCD das gewünschte FTDI device 
nicht finden konnte, und zeigt dir an, wie die zwei heissen, die er 
gefunden hat.

In deiner .cfg sollte demnach z.B.
ft2232_device_desc "Olimex OpenOCD JTAG TINY A"
stehen. Das "A" wird vom FTDI Treiber benutzt, um den ersten Kanal zu 
identifizieren. Der zweite Kanal "B" wird vom Tiny nicht benutzt, der 
"grosse" ARM-USB-OCD hat hier ein RS232 Interface.

Gruß,

Dominic

von Testdummy (Gast)


Lesenswert?

Danke Domenic,

hätte nie gedacht, das das daran liegen kann....

Hat funktionier! :-)
Jippy!

Viele Grüße
Marius

von Testdummy (Gast)


Lesenswert?

Ok,
die Gute laune ist gebremst! :-(
Schaffe es nicht, zu flashen. wenn ich von martin thomas das script 
nehme:
1
# 
2
# The following commands will be executed on
3
# reset (because of run_and_init in the config-file)
4
# - halt target
5
# - init ecr
6
# - flash content of file main.bin into target-memory
7
# - shutdown openocd
8
#
9
# created by Martin Thomas 
10
# http://www.siwawi.arubi.uni-kl.de/avr_projects/arm_projects
11
# based on information from Dominic Rath 
12
#
13
14
halt
15
sleep 10
16
17
# Init - taken form the script openocd_at91sam7_ecr.script 
18
mww 0xfffffd44 0x00008000  # disable watchdog
19
mww 0xfffffd08 0xa5000001  # enable user reset
20
mww 0xfffffc20 0x00000601  # CKGR_MOR : enable the main oscillator
21
sleep 10
22
mww 0xfffffc2c 0x00481c0e   # CKGR_PLLR: 96.1097 MHz
23
sleep 10
24
mww 0xfffffc30 0x00000007  # PMC_MCKR : MCK = PLL / 2 ~= 48 MHz
25
sleep 10
26
mww 0xffffff60 0x003c0100  # MC_FMR: flash mode (FWS=1,FMCN=60)
27
# arm7_9 force_hw_bkpts enable  # program resides in flash
28
29
# AT91SAM7 flash command-"batch"
30
# adapted by Martin Thomas based on information from Dominic Rath - Thanks
31
arm7_9 dcc_downloads enable
32
sleep 10
33
poll
34
flash probe 0
35
flash write 0 main.bin 0x0
36
# flash write is deprecated but still available. 
37
# Update to flash write_binary 0 main.bin 0x0
38
reset run
39
sleep 10
40
shutdown

sagt er mir "suspended. don't know how to run"
ja und ich weis es auch nicht, how to run. :-(

ich habe eine Datei gefunden, die das Ram beschreibt, aber die auch 
nicht einwandfrei läuft. das heißt, er bricht mir nicht mit diesem 
komentar die session ab, läuft aber trotzdem nicht.

@domenic: hättest du da vielleicht den nötigen anstoß?

Greez
Marius

von Dominic R. (dominic)


Lesenswert?

Wer sagt "suspended. don't know how to run"?
Und wie hast du das Skript überhaupt benutzt?

Das Skript von Martin Thomas geht davon aus, dass es als "reset Skript" 
im OpenOCD verwendet wird, und sollte zusammen mit dem entsprechenden 
.cfg File verwendet werden.

Ansonsten kannst du den OpenOCD auch einfach starten, und dann die 
Kommandos per Hand im Telnet Interface (localhost port 4444) eingeben.

Gruß,

Dominic

von Testdummy (Gast)


Lesenswert?

Also ich arbeite mit Eclipse. Habe dort als externes tool openocd -f 
at91r40008_armusbocd.cfg. Bzw. vorher habe ich das einfach auch in der 
Konsole gestartet.
1
#daemon configuration
2
telnet_port 4444
3
gdb_port 3333
4
5
#interface
6
interface ft2232
7
ft2232_device_desc "Olimex OpenOCD JTAG TINY A"
8
ft2232_layout "olimex-jtag"
9
ft2232_vid_pid 0x15BA 0x0003
10
jtag_speed 0
11
jtag_nsrst_delay 200
12
jtag_ntrst_delay 200
13
14
#use combined on interfaces or targets that can't set TRST/SRST separately
15
reset_config srst_only srst_pulls_trst
16
17
#jtag scan chain
18
#format L IRC IRCM IDCODE (Length, IR Capture, IR Capture Mask, IDCODE)
19
jtag_device 4 0x1 0xf 0xe
20
21
#target configuration
22
daemon_startup reset
23
24
#target <type> <startup mode>
25
#target arm7tdmi <reset mode> <chainpos> <endianness> <variant>
26
target arm7tdmi little run_and_halt 0 arm7tdmi
27
run_and_halt_time 0 30
28
29
# For more information about the configuration files, take a look at:
30
# http://openfacts.berlios.de/index-en.phtml?title=Open+On-Chip+Debugger


Naja, nun will ich halt auf den Flash schreiben und das dacht ich mache 
ich so wie bei Yagarto über den debugger. ich folge der Anleitung bis 
auf einen Punkt:in dem "Commands" Textfeld soll man den Inhalt von 
"eclipse_ram.gdb" eingeben, doch ich möchte ja nicht ins Ram schreiben. 
außerdem funktioniert die session dann auch nicht so ganz.
Also habe ich die hier aus dem Internet: 
http://www.siwawi.arubi.uni-kl.de/avr_projects/arm_projects/openocd_intro/index.html#at91sam7int
1
# 
2
# The following commands will be executed on
3
# reset (because of run_and_init in the config-file)
4
# - halt target
5
# - init ecr
6
# - flash content of file main.bin into target-memory
7
# - shutdown openocd
8
#
9
# created by Martin Thomas 
10
# http://www.siwawi.arubi.uni-kl.de/avr_projects/arm_projects
11
# based on information from Dominic Rath 
12
#
13
14
halt
15
sleep 10
16
17
# Init - taken form the script openocd_at91sam7_ecr.script 
18
mww 0xfffffd44 0x00008000  # disable watchdog
19
mww 0xfffffd08 0xa5000001  # enable user reset
20
mww 0xfffffc20 0x00000601  # CKGR_MOR : enable the main oscillator
21
sleep 10
22
mww 0xfffffc2c 0x00481c0e   # CKGR_PLLR: 96.1097 MHz
23
sleep 10
24
mww 0xfffffc30 0x00000007  # PMC_MCKR : MCK = PLL / 2 ~= 48 MHz
25
sleep 10
26
mww 0xffffff60 0x003c0100  # MC_FMR: flash mode (FWS=1,FMCN=60)
27
# arm7_9 force_hw_bkpts enable  # program resides in flash
28
29
# AT91SAM7 flash command-"batch"
30
# adapted by Martin Thomas based on information from Dominic Rath - Thanks
31
arm7_9 dcc_downloads enable
32
sleep 10
33
poll
34
flash probe 0
35
flash write 0 main.bin 0x0
36
# flash write is deprecated but still available. 
37
# Update to flash write_binary 0 main.bin 0x0
38
reset run
39
sleep 10
40
shutdown

Aber funktionieren tut's nicht. die .cfg läuft wie bei yagarto 
beschrieben. er springt aber nicht in den debug modus. klickt man auf 
ansicht in debugmodus wechseln zeigt er mir eine session an, die ich 
aber noch starten muss. und Hier sagt er mir dann die gestern 
beschriebene Fehlermeldung. :-(

Eine Ahnung?

von Testdummy (Gast)


Lesenswert?

Habe evtl. noch eine andere Fehlerquelle. Ist meine makefile so ok?

oder gibt es irgendwo im web eine quelle, wo ich für at91sam7x256 wie er 
auf dem board im shop ist alle entsprechenden sachen runterladen kann?

makefile:
1
#
2
#       !!!! Do NOT edit this makefile with an editor which replace tabs by spaces !!!!    
3
#
4
##############################################################################################
5
# 
6
# On command line:
7
#
8
# make all = Create project
9
#
10
# make clean = Clean project files.
11
#
12
# To rebuild project do "make clean" and "make all".
13
#
14
15
##############################################################################################
16
# Start of default section
17
#
18
19
TRGT = arm-elf-
20
CC   = $(TRGT)gcc
21
CP   = $(TRGT)objcopy
22
AS   = $(TRGT)gcc -x assembler-with-cpp
23
BIN  = $(CP) -O ihex 
24
25
MCU  = arm7tdmi
26
27
# List all default C defines here, like -D_DEBUG=1
28
DDEFS = 
29
30
# List all default ASM defines here, like -D_DEBUG=1
31
DADEFS = 
32
33
# List all default directories to look for include files here
34
DINCDIR = 
35
36
# List the default directory to look for the libraries here
37
DLIBDIR =
38
39
# List all default libraries here
40
DLIBS = 
41
42
#
43
# End of default section
44
##############################################################################################
45
46
##############################################################################################
47
# Start of user section
48
#
49
50
# Define project name here
51
PROJECT = test
52
53
# Define linker script file here
54
LDSCRIPT= ./prj/sam7x256_ram.ld
55
56
# List all user C define here, like -D_DEBUG=1
57
UDEFS = 
58
59
# Define ASM defines here
60
UADEFS = 
61
62
# List C source files here
63
SRC  = ./src/main.c
64
65
# List ASM source files here
66
ASRC = ./src/crt.s
67
68
# List all user directories here
69
UINCDIR = ./inc
70
71
# List the user directory to look for the libraries here
72
ULIBDIR =
73
74
# List all user libraries here
75
ULIBS = 
76
77
# Define optimisation level here
78
OPT = -O0
79
80
#
81
# End of user defines
82
##############################################################################################
83
84
85
INCDIR  = $(patsubst %,-I%,$(DINCDIR) $(UINCDIR))
86
LIBDIR  = $(patsubst %,-L%,$(DLIBDIR) $(ULIBDIR))
87
DEFS    = $(DDEFS) $(UDEFS)
88
ADEFS   = $(DADEFS) $(UADEFS)
89
OBJS    = $(ASRC:.s=.o) $(SRC:.c=.o)
90
LIBS    = $(DLIBS) $(ULIBS)
91
MCFLAGS = -mcpu=$(MCU)
92
93
ASFLAGS = $(MCFLAGS) -g -gdwarf-2 -Wa,-amhls=$(<:.s=.lst) $(ADEFS)
94
CPFLAGS = $(MCFLAGS) $(OPT) -gdwarf-2 -mthumb-interwork -fomit-frame-pointer -Wall -Wstrict-prototypes -fverbose-asm -Wa,-ahlms=$(<:.c=.lst) $(DEFS)
95
LDFLAGS = $(MCFLAGS) -nostartfiles -T$(LDSCRIPT) -Wl,-Map=$(PROJECT).map,--cref,--no-warn-mismatch $(LIBDIR)
96
97
# Generate dependency information
98
CPFLAGS += -MD -MP -MF .dep/$(@F).d
99
100
#
101
# makefile rules
102
#
103
104
all: $(OBJS) $(PROJECT).elf $(PROJECT).hex
105
106
%o : %c
107
  $(CC) -c $(CPFLAGS) -I . $(INCDIR) $< -o $@
108
109
%o : %s
110
  $(AS) -c $(ASFLAGS) $< -o $@
111
112
%elf: $(OBJS)
113
  $(CC) $(OBJS) $(LDFLAGS) $(LIBS) -o $@
114
115
%hex: %elf
116
  $(BIN) $< $@
117
118
clean:
119
  -rm -f $(OBJS)
120
  -rm -f $(PROJECT).elf
121
  -rm -f $(PROJECT).map
122
  -rm -f $(PROJECT).hex
123
  -rm -f $(SRC:.c=.c.bak)
124
  -rm -f $(SRC:.c=.lst)
125
  -rm -f $(ASRC:.s=.s.bak)
126
  -rm -f $(ASRC:.s=.lst)
127
  -rm -fR .dep
128
129
# 
130
# Include the dependency files, should be the last of the makefile
131
#
132
-include $(shell mkdir .dep 2>/dev/null) $(wildcard .dep/*)
133
134
# *** EOF ***
135
# OpenOCD Flags
136
OPENOCDFLAGS = -f /etc/openocd_flash.cfg
137
138
INSIGHT = arm-elf-insight
139
OPENOCD = openocd
140
KILLALL = killall
141
142
# Program the device.
143
program: $(TARGET).bin
144
ifeq ($(RUN_MODE),ROM_RUN)
145
   $(OPENOCD) $(OPENOCDFLAGS)
146
endif
147
148
debug: begin insight end
149
150
insight:
151
ifeq ($(RUN_MODE),RAM_RUN)
152
  $(OPENOCD) & $(INSIGHT) $(TARGET).elf -ex "target remote localhost:3333" -ex "monitor arm7_9 sw_bkpts enable" -ex "load"
153
  $(KILLALL) $(OPENOCD)
154
else
155
  $(OPENOCD) & $(INSIGHT) $(TARGET).elf -ex "target remote localhost:3333" -ex "monitor arm7_9 force_hw_bkpts enable"
156
  $(KILLALL) $(OPENOCD)
157
endif

von Frank (Gast)


Lesenswert?

Sag mal, wie passt das zusammen?
>AT91SAM7X256

>openocd -f at91r40008_armusbocd.cfg

Außerdem hast du das Linkerscript fürs Ram im Makefile stehen.

># Define linker script file here
>LDSCRIPT= ./prj/sam7x256_ram.ld

von Testdummy (Gast)


Lesenswert?

Ja, du hast recht, ist aus verzweiflung entstanden.

Hat jemand denn irgendwo eine quelle, wo einfach alles mit drin ist?

Bei yagarto habe ich zwar in der zip SAM7X256Test die richtige 
sam7x_armusbocd.cfg gefunden, aber in der makefile steht immer noch der 
verweis LDSCRIPT= ./prj/sam7x256_ram.ld . und eine andere Datei habe ich 
nicht. Außerdem bricht er mit dem selben Fehler beim Start ab. suspended 
... etc. im command-feld steht noch das von vorhin beschriebene drin.

von Frank (Gast)


Lesenswert?

Bei den Beispielen von Martin Thomas für die AT91SAM7S sind ram und rom 
Linkerskripte dabei. Schau dir die doch mal an, da wird nicht viel um 
sein.

von Testdummy (Gast)


Lesenswert?

Also ich habe jetzt makefiles umgeschrieben und allen möglichen murks 
gemacht. Es muss doch auch leute geben, die derzeit damit arbeiten ... 
Ich kapituliere eigentlich nie, deshalb frage ich euch:

Könnte mir jemand vielleicht eine kopie der nötigen dateien für das 
Board "AT91SAM7X256 + TFT+ Ethernet" vom Mikrocontroller-Shop per mail 
zuschicken?

marius_merten85@hotmail.com

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.