Forum: Compiler & IDEs OpenOCD in Version 0.3.0


von Leo (Gast)


Lesenswert?

Hallo!

Ich bin ganz neu in der ARM-Welt und habe (wie sicherlich viele..) 
einige Startprobleme.

OpenOCD mit der FDTI-Lib gibt es nicht mehr als exe, man muss es sich 
selbst kompelieren. Und nun laufen unter 0.3.0 die Konfigurationskripte 
nicht mehr, es kommen viele Hinweise, dass Befehle deprecated sind.

at91sam7s256-armusbocd-flash.cfg
1
#define our ports
2
telnet_port 4444
3
gdb_port 3333
4
5
#commands specific to the Amontec JTAGKey
6
interface ft2232
7
ft2232_device_desc "Olimex OpenOCD JTAG A"
8
ft2232_layout "olimex-jtag"
9
ft2232_vid_pid 0x15BA 0x0003
10
jtag_speed 2
11
jtag_nsrst_delay 200
12
jtag_ntrst_delay 200
13
14
#reset_config <signals> [combination] [trst_type] [srst_type]
15
reset_config srst_only srst_pulls_trst
16
17
#jtag_device <IR length> <IR capture> <IR mask> <IDCODE instruction>
18
jtag_device 4 0x1 0xf 0xe
19
20
#daemon_startup <'attach'|'reset'>
21
#daemon_startup reset
22
23
#target <type> <endianess> <reset_mode> <jtag#> [variant]
24
target arm7tdmi little run_and_init 0 arm7tdmi_r4
25
26
#run_and_halt_time <target#> <time_in_ms>
27
run_and_halt_time 0 30
28
29
# commands below are specific to AT91sam7 Flash Programming
30
# ---------------------------------------------------------
31
32
#target_script specifies the flash programming script file
33
target_script 0 reset script.ocd
34
35
#working_area <target#> <address> <size> <'backup'|'nobackup'>
36
working_area 0 0x40000000 0x4000 nobackup
37
38
#flash bank at91sam7 0 0 0 0 <target#>
39
flash bank at91sam7 0 0 0 0 0

Und das spuckt OpenOCD aus:
1
Open On-Chip Debugger 0.3.0-in-development (2009-10-04-16:53) svn:2796
2
$URL: svn://svn.berlios.de/openocd/trunk/src/openocd.c $
3
For bug reports, read http://svn.berlios.de/svnroot/repos/openocd/trunk/BUGS
4
OLD SYNTAX: DEPRECATED - use jtag_khz, not jtag_speed
5
jtag_speed: 2
6
jtag_nsrst_delay: 200
7
jtag_ntrst_delay: 200
8
OLD SYNTAX: DEPRECATED - translating to new syntax
9
jtag newtap CHIP TAP -irlen 4 -ircapture 0x1 -irvalue 0xf
10
Example: STM32 has 2 taps, the cortexM3(len4) + boundaryscan(len5)
11
jtag newtap stm32 cortexm3 ....., thus creating the tap: "stm32.cortexm3"
12
jtag newtap stm32 boundary ....., and the tap: "stm32.boundary"
13
And then refer to the taps by the dotted name.
14
NEW COMMAND:
15
Runtime error, file "D:\Workspace\FirstARMProject/configs/config.cfg", line 24:
16
    bad option "arm7tdmi": must be one of count, create, current, names, number, or types

Die Seite berlios.de ist nicht erreichbar, sonst finde ich keine 
Beispiele zu OpenOCD in der aktuellen Version.

Hat jemand vll ein Beispiel für mich oder kann mir irgendwie mit der 
Sache helfen?

von OpenOCD Nutzer (Gast)


Lesenswert?

Hallo,

die hälfte des Skripts kannst du dir sparen. In dem openocd verzeichnis 
gibt es jetzt Konfiguartionsdateien für die entsprechenden Boards bzw. 
Controller:
1
#define our ports
2
telnet_port 4444
3
gdb_port 3333
4
5
#commands specific to the Amontec JTAGKey
6
interface ft2232
7
ft2232_device_desc "Olimex OpenOCD JTAG A"
8
ft2232_layout "olimex-jtag"
9
ft2232_vid_pid 0x15BA 0x0003
10
jtag_khz 2
11
jtag_nsrst_delay 200
12
jtag_ntrst_delay 200
13
14
15
source [ find board/deinboard.cfg ] 
16
#falls kein board drin ist
17
#source [ find target/deincontroller.cfg ]
zum Flashen kannst du den befehl benutzen:
1
reset halt
2
flash write_image erase MeinProgramm.elf
3
resume 
4
shutdown
5
init

Ein Blick in die Hilfe schadet nie und spart meistens viel Zeit und 
Ärger.

von Leo (Gast)


Lesenswert?

Danke!

Ich habe etwas "rumgegoogelt" und auch in der Doku geschaut und konnte 
schließlich mit folgendem Skript flashen:
1
#define our ports
2
telnet_port 4444
3
gdb_port 3333
4
5
#commands specific to the Amontec JTAGKey
6
interface ft2232
7
ft2232_device_desc "Olimex OpenOCD JTAG TINY A"
8
ft2232_layout "olimex-jtag"
9
ft2232_vid_pid 0x15BA 0x0004
10
11
#speed
12
jtag_khz 3000
13
14
reset_config srst_only srst_pulls_trst
15
16
jtag newtap at91sam7s cpu -irlen 4 -ircapture 0x1 -irmask 0xf -expected-id 0x3f0f0f0f
17
18
target create at91sam7s.cpu arm7tdmi -endian little -chain-position at91sam7s.cpu -variant arm7tdmi
19
20
at91sam7s.cpu configure -event reset-init { 
21
  #mww 0xffffff64 0x5a000004 # clear lock bit 0 -only use if flash bank known to be locked
22
  #mww 0xffffff64 0x5a002004 # clear lock bit 1 -only use if flash bank known to be locked
23
  mww 0xfffffd44 0x00008000 # disable watchdog
24
  mww 0xfffffd08 0xa5000001 # enable user reset
25
  mww 0xfffffc20 0x00000601 # CKGR_MOR : enable the main oscillator
26
  sleep 10
27
  mww 0xfffffc2c 0x00481c0e # CKGR_PLLR: 96.1097 MHz
28
  sleep 10
29
  mww 0xfffffc30 0x00000007 # PMC_MCKR : MCK = PLL / 2 ~= 48 MHz
30
  sleep 10
31
  mww 0xffffff60 0x003c0100 # MC_FMR: flash mode (FWS=1,FMCN=60)
32
  sleep 100
33
  halt
34
  sleep 10
35
  arm7_9 dcc_downloads enable
36
  sleep 10
37
  poll
38
  flash probe 0
39
  flash write_bank 0 D:/Workspace/FirstARMProject/build/main.bin 0x0
40
  sleep 10
41
}
42
43
at91sam7s.cpu configure -work-area-virt 0 -work-area-phys 0x00200000 -work-area-size 0x4000 -work-area-backup 0 
44
45
#flash bank <driver> <base_addr> <size> <chip_width> <bus_width> <target_number> [<target_name> <banks> <sectors_per_bank> <pages_per_sector> <page_size> <num_nvmbits> <ext_freq_khz>]
46
flash bank at91sam7 0 0 0 0 0 0 0 0 0 0 0 0 18432
47
48
#gdb_memory_map enable
49
#gdb_flash_program enable
50
51
#arm7_9 dbgrq enable
52
53
# speed up memory downloads
54
#arm7_9 dcc_downloads enable
55
56
init
57
reset init
58
reset run
59
shutdown

Debuggen funktioniert auch (fast).

von Leo (Gast)


Lesenswert?

Ehm.. ist für den AT91SAM7S kein Skript dabei oder sehe ich es nicht?

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.