Forum: Mikrocontroller und Digitale Elektronik LPC-H2148 OpenOCD(rev 1454) mit Olimex ARM-USB-OCD


von Oliver B. (building21)


Lesenswert?

Hallo,

ich versuch schon seit Wochen OpenOCD für mein eigenes Projekt auf dem 
Olimex LPC-H2148 zum laufen zu bekommen. Bisher konnten mir keine Hilfen 
durch Google und diversen Foren weiterhelfen, daher nun diesen Beitrag.

Als Betriebsystem nutze ich nen Archlinux mit 2.6er Kernel.
LibUSB ist eingerichtet und die UDEV-Reglen auch angepasst.
Mein Projekt basiert auf dem LPC-H2148 Headerboard von Olimex. Dies ist 
über den Olimex ARM-USB-OCD mit dem PC verbunden. Das Headerboard wird 
derweil auch über USB mit Strom versorgt.

Leider schlägt die OpenOCD-Konfiguration anscheint immer fehl. Ich nutze 
aus Absicht nicht die interface/arm-usb-ocd.cfg und 
target/lpc2148_2mhz.cfg, weil bei denen der selbe Fehler auftritt.
Alle wichtigen Ausgaben und Dateien hab denk ich hinzugefügt. Falls 
etwas fehlen sollte lade ich das gern hoch.

Danke für die Hilfe.

MfG building21




Die Konsolenausgabe bei debug_level 3:
1
./openocd -f openocd_lpc2148.script.test
2
Open On-Chip Debugger 1.0 (2009-04-05-14:17) svn:exportiert           
3
4
5
BUGS? Read http://svn.berlios.de/svnroot/repos/openocd/trunk/BUGS
6
7
8
$URL: svn://svn.berlios.de/openocd/trunk/src/openocd.c $
9
Debug: 6 0 command.c:91 script_command(): script_command - telnet_port
10
Debug: 7 0 command.c:108 script_command(): script_command - telnet_port, argv[0]=ocd_telnet_port
11
Debug: 8 0 command.c:108 script_command(): script_command - telnet_port, argv[1]=4444           
12
Debug: 10 0 command.c:91 script_command(): script_command - gdb_port                            
13
Debug: 11 0 command.c:108 script_command(): script_command - gdb_port, argv[0]=ocd_gdb_port     
14
Debug: 12 0 command.c:108 script_command(): script_command - gdb_port, argv[1]=3333             
15
Debug: 14 0 command.c:91 script_command(): script_command - tcl_port                            
16
Debug: 15 0 command.c:108 script_command(): script_command - tcl_port, argv[0]=ocd_tcl_port     
17
Debug: 16 0 command.c:108 script_command(): script_command - tcl_port, argv[1]=6666             
18
Debug: 18 0 command.c:91 script_command(): script_command - interface                           
19
Debug: 19 0 command.c:108 script_command(): script_command - interface, argv[0]=ocd_interface   
20
Debug: 20 0 command.c:108 script_command(): script_command - interface, argv[1]=ft2232          
21
Debug: 22 0 command.c:91 script_command(): script_command - ft2232_device_desc                  
22
Debug: 23 0 command.c:108 script_command(): script_command - ft2232_device_desc, argv[0]=ocd_ft2232_device_desc
23
Debug: 24 0 command.c:108 script_command(): script_command - ft2232_device_desc, argv[1]=Olimex OpenOCD JTAG A 
24
Debug: 26 0 command.c:91 script_command(): script_command - ft2232_layout                                      
25
Debug: 27 0 command.c:108 script_command(): script_command - ft2232_layout, argv[0]=ocd_ft2232_layout          
26
Debug: 28 0 command.c:108 script_command(): script_command - ft2232_layout, argv[1]=olimex-jtag                
27
Debug: 30 1 command.c:91 script_command(): script_command - ft2232_vid_pid                                     
28
Debug: 31 1 command.c:108 script_command(): script_command - ft2232_vid_pid, argv[0]=ocd_ft2232_vid_pid        
29
Debug: 32 1 command.c:108 script_command(): script_command - ft2232_vid_pid, argv[1]=0x15ba                    
30
Debug: 33 1 command.c:108 script_command(): script_command - ft2232_vid_pid, argv[2]=0x0003                    
31
Debug: 35 1 command.c:91 script_command(): script_command - jtag_khz                                           
32
Debug: 36 1 command.c:108 script_command(): script_command - jtag_khz, argv[0]=ocd_jtag_khz                    
33
Debug: 37 1 command.c:108 script_command(): script_command - jtag_khz, argv[1]=2000                            
34
Debug: 38 1 jtag.c:2606 handle_jtag_khz_command(): handle jtag khz                                             
35
User : 39 1 command.c:383 command_print(): 2000 kHz                                                            
36
Debug: 41 1 command.c:91 script_command(): script_command - jtag_nsrst_delay                                   
37
Debug: 42 1 command.c:108 script_command(): script_command - jtag_nsrst_delay, argv[0]=ocd_jtag_nsrst_delay    
38
Debug: 43 1 command.c:108 script_command(): script_command - jtag_nsrst_delay, argv[1]=200                     
39
Debug: 45 1 command.c:91 script_command(): script_command - jtag_ntrst_delay                                   
40
Debug: 46 1 command.c:108 script_command(): script_command - jtag_ntrst_delay, argv[0]=ocd_jtag_ntrst_delay    
41
Debug: 47 1 command.c:108 script_command(): script_command - jtag_ntrst_delay, argv[1]=200                     
42
Debug: 49 1 command.c:91 script_command(): script_command - reset_config                                       
43
Debug: 50 1 command.c:108 script_command(): script_command - reset_config, argv[0]=ocd_reset_config            
44
Debug: 51 1 command.c:108 script_command(): script_command - reset_config, argv[1]=trst_and_srst               
45
Debug: 52 1 command.c:108 script_command(): script_command - reset_config, argv[2]=srst_pulls_trst             
46
Debug: 53 1 jtag.c:1853 jim_newtap_cmd(): Creating New Tap, Chip: lpc2148, Tap: cpu, Dotted: lpc2148.cpu, 8 params
47
Debug: 54 1 jtag.c:1872 jim_newtap_cmd(): Processing option: -irlen                                               
48
Debug: 55 1 jtag.c:1872 jim_newtap_cmd(): Processing option: -ircapture                                           
49
Debug: 56 1 jtag.c:1872 jim_newtap_cmd(): Processing option: -irmask                                              
50
Debug: 57 1 jtag.c:1872 jim_newtap_cmd(): Processing option: -expected-id                                         
51
Debug: 58 1 jtag.c:1985 jim_newtap_cmd(): Created Tap: lpc2148.cpu @ abs position 0, irlen 4, capture: 0x1 mask: 0xf
52
Debug: 59 1 target.c:3961 jim_target(): Target command params:                                                      
53
Debug: 60 1 target.c:3962 jim_target(): target create lpc2148.cpu arm7tdmi -endian little -chain-position lpc2148.cpu -variant arm7tdmi-s_r4                                                                                                                                        
54
Debug: 62 2 command.c:91 script_command(): script_command - bank                                                                          
55
Debug: 63 2 command.c:108 script_command(): script_command - bank, argv[0]=ocd_flash_bank                                                 
56
Debug: 64 2 command.c:108 script_command(): script_command - bank, argv[1]=lpc2000                                                        
57
Debug: 65 2 command.c:108 script_command(): script_command - bank, argv[2]=0x0                                                            
58
Debug: 66 2 command.c:108 script_command(): script_command - bank, argv[3]=0x7d000                                                        
59
Debug: 67 2 command.c:108 script_command(): script_command - bank, argv[4]=0                                                              
60
Debug: 68 2 command.c:108 script_command(): script_command - bank, argv[5]=0                                                              
61
Debug: 69 2 command.c:108 script_command(): script_command - bank, argv[6]=0                                                              
62
Debug: 70 2 command.c:108 script_command(): script_command - bank, argv[7]=lpc2000_v2                                                     
63
Debug: 71 2 command.c:108 script_command(): script_command - bank, argv[8]=14765                                                          
64
User : 72 2 command.c:494 command_run_line():                                                                                             
65
Debug: 74 2 command.c:91 script_command(): script_command - init                                                                          
66
Debug: 75 2 command.c:108 script_command(): script_command - init, argv[0]=ocd_init                                                       
67
Debug: 76 3 openocd.c:137 handle_init_command(): target init complete                                                                     
68
Debug: 77 3 ft2232.c:1540 ft2232_init_ftd2xx(): 'ft2232' interface using FTD2XX with 'olimex-jtag' layout (15ba:0003)                     
69
Debug: 78 296 ft2232.c:1651 ft2232_init_ftd2xx(): current latency timer: 2                                                                
70
Debug: 79 297 ft2232.c:2079 olimex_jtag_init(): 80 08 1b                                                                                  
71
Debug: 80 298 ft2232.c:2122 olimex_jtag_init(): 82 09 0f                                                                                  
72
Debug: 81 298 ft2232.c:294 ft2232_speed(): 86 02 00                                                                                       
73
Debug: 82 299 openocd.c:144 handle_init_command(): jtag interface init complete                                                           
74
Debug: 83 299 jtag.c:2201 jtag_init_inner(): Init JTAG chain                                                                              
75
Debug: 84 299 jtag.c:390 jtag_call_event_callbacks(): jtag event: JTAG controller reset (RESET or TRST)                                   
76
Debug: 85 299 jtag.c:1450 jtag_reset_callback(): -                                                                                        
77
Debug: 86 300 jtag.c:390 jtag_call_event_callbacks(): jtag event: JTAG controller reset (RESET or TRST)                                   
78
Debug: 87 300 jtag.c:1450 jtag_reset_callback(): -                                                                                        
79
Info : 88 302 jtag.c:1570 jtag_examine_chain(): JTAG tap: lpc2148.cpu tap/device found: 0x9f3f1f0f (Manufacturer: 0x787, Part: 0xf3f1, Version: 0x9)                                                                                                                                
80
Error: 89 302 jtag.c:1594 jtag_examine_chain(): JTAG tap: lpc2148.cpu             got: 0x9f3f1f0f (mfg: 0x787, part: 0xf3f1, ver: 0x9)    
81
Error: 90 302 jtag.c:1603 jtag_examine_chain(): JTAG tap: lpc2148.cpu expected 1 of 1: 0x9f3f1f1f (mfg: 0x78f, part: 0xf3f1, ver: 0x9)    
82
Error: 91 302 jtag.c:2216 jtag_init_inner(): trying to validate configured JTAG chain anyway...                                           
83
Debug: 92 302 jtag.c:390 jtag_call_event_callbacks(): jtag event: JTAG controller reset (RESET or TRST)                                   
84
Debug: 93 302 jtag.c:1450 jtag_reset_callback(): -                                                                                        
85
Debug: 94 305 openocd.c:150 handle_init_command(): jtag init complete                                                                     
86
Error: 95 307 embeddedice.c:197 embeddedice_build_reg_cache(): unknown EmbeddedICE version (comms ctrl: 0x80000000)                       
87
Debug: 96 307 embeddedice.c:401 embeddedice_write_reg(): 12: 0x00000000                                                                   
88
Debug: 97 307 embeddedice.c:401 embeddedice_write_reg(): 20: 0x00000000
89
Debug: 98 307 openocd.c:153 handle_init_command(): jtag examine complete
90
Debug: 99 307 openocd.c:159 handle_init_command(): flash init complete
91
Debug: 100 307 openocd.c:163 handle_init_command(): mflash init complete

Die OpenOCD-Konfigurationsdatei:
1
debug_level 3
2
3
#daemon configuration
4
telnet_port 4444
5
gdb_port 3333
6
tcl_port 6666
7
8
interface ft2232
9
ft2232_device_desc "Olimex OpenOCD JTAG A"
10
ft2232_layout olimex-jtag
11
ft2232_vid_pid 0x15ba 0x0003
12
# 2MHz
13
jtag_khz 2000
14
15
if { [info exists CHIPNAME] } {  
16
   set _CHIPNAME $CHIPNAME
17
} else {
18
   set _CHIPNAME lpc2148
19
}
20
21
if { [info exists ENDIAN] } {
22
   set _ENDIAN $ENDIAN
23
} else {
24
   set _ENDIAN little
25
}
26
27
if { [info exists CPUTAPID ] } {
28
   set _CPUTAPID $CPUTAPID
29
} else {
30
   set _CPUTAPID 0x9f3f1f1f
31
}
32
33
jtag_nsrst_delay 200
34
jtag_ntrst_delay 200
35
reset_config trst_and_srst srst_pulls_trst
36
37
jtag newtap $_CHIPNAME cpu -irlen 4 -ircapture 0x1 -irmask 0xf -expected-id $_CPUTAPID
38
set _TARGETNAME [format "%s.cpu" $_CHIPNAME]
39
target create $_TARGETNAME arm7tdmi -endian $_ENDIAN -chain-position $_TARGETNAME -variant arm7tdmi-s_r4
40
$_TARGETNAME configure -work-area-virt 0 -work-area-phys 0x40000000 -work-area-size 0x4000 -work-area-backup 0
41
42
$_TARGETNAME configure -event reset-init {
43
  # Force target into ARM state.
44
  soft_reset_halt
45
46
  # Do not remap 0x0000-0x0020 to anything but the flash (i.e. select
47
  # "User Flash Mode" where interrupt vectors are _not_ remapped,
48
  # and reside in flash instead).
49
  #
50
  # See section 7.1 on page 32 ("Memory Mapping control register") in
51
  # "UM10139: Volume 1: LPC214x User Manual", Rev. 02 -- 25 July 2006.
52
  # http://www.standardics.nxp.com/support/documents/microcontrollers/pdf/user.manual.lpc2141.lpc2142.lpc2144.lpc2146.lpc2148.pdf
53
  mwb 0xE01FC040 0x01
54
}
55
56
# flash bank lpc2000 <base> <size> 0 0 <target#> <variant> <clock> [calc_checksum]
57
flash bank lpc2000 0x0 0x7d000 0 0 0 lpc2000_v2 14765

Kommandos mit denen OpenOCD gebaut wurde:
1
   ./bootstrap 
2
   mkdir build
3
   cd build
4
   ../configure --prefix=$(targetdir) --enable-ft2232_ftd2xx -with-ftd2xx-linux-tardir=$(libdir/libftd2xx0.4.16/
5
   make all install

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.