Hi Everybody! In the meantime I did a few things. I recompiled my buildroot env. completely, got the latest openocd (svn:1245M) and pulled out some *red herrings* from the scene. Then I found out that the syntax of the configuration files changed again and adapted my scripts. But I can't get it going. It looks like some trigger is missing. Probably my adaption is not that smooth. At least I haven't received any segfaults (so far).
#> ./openocd -f jtagA9263.cfg -d 3 Open On-Chip Debugger 1.0 (2008-12-16-09:17) svn:1245M BUGS? Read http://svn.berlios.de/svnroot/repos/openocd/trunk/BUGS $URL: http://svn.berlios.de/svnroot/repos/openocd/trunk/src/openocd.c $ Debug: 5 6 configuration.c:88 find_file(): found jtagA9263.cfg Debug: 7 14 command.c:91 script_command(): script_command - telnet_port Debug: 8 15 command.c:108 script_command(): script_command - telnet_port, argv[0]=ocd_telnet_port Debug: 9 15 command.c:108 script_command(): script_command - telnet_port, argv[1]=4444 Debug: 11 17 command.c:91 script_command(): script_command - gdb_port Debug: 12 17 command.c:108 script_command(): script_command - gdb_port, argv[0]=ocd_gdb_port Debug: 13 18 command.c:108 script_command(): script_command - gdb_port, argv[1]=3333 Debug: 15 19 command.c:91 script_command(): script_command - interface Debug: 16 20 command.c:108 script_command(): script_command - interface, argv[0]=ocd_interface Debug: 17 21 command.c:108 script_command(): script_command - interface, argv[1]=at91sam926x Debug: 19 23 command.c:91 script_command(): script_command - at91sam926x_device Debug: 20 24 command.c:108 script_command(): script_command - at91sam926x_device, argv[0]=ocd_at91sam926x_device Debug: 21 24 command.c:108 script_command(): script_command - at91sam926x_device, argv[1]=jtag_A Debug: 23 26 command.c:91 script_command(): script_command - reset_config Debug: 24 27 command.c:108 script_command(): script_command - reset_config, argv[0]=ocd_reset_config Debug: 25 27 command.c:108 script_command(): script_command - reset_config, argv[1]=trst_and_srst Debug: 27 29 command.c:91 script_command(): script_command - jtag_nsrst_delay Debug: 28 29 command.c:108 script_command(): script_command - jtag_nsrst_delay, argv[0]=ocd_jtag_nsrst_delay Debug: 29 30 command.c:108 script_command(): script_command - jtag_nsrst_delay, argv[1]=20 Debug: 31 32 command.c:91 script_command(): script_command - jtag_ntrst_delay Debug: 32 32 command.c:108 script_command(): script_command - jtag_ntrst_delay, argv[0]=ocd_jtag_ntrst_delay Debug: 33 33 command.c:108 script_command(): script_command - jtag_ntrst_delay, argv[1]=20 Debug: 34 34 jtag.c:1847 jim_newtap_cmd(): Creating New Tap, Chip: at91sam9263, Tap: cpu, Dotted: at91sam9263.cpu, 8 params Debug: 35 35 jtag.c:1866 jim_newtap_cmd(): Processing option: -irlen Debug: 36 35 jtag.c:1866 jim_newtap_cmd(): Processing option: -ircapture Debug: 37 36 jtag.c:1866 jim_newtap_cmd(): Processing option: -irmask Debug: 38 36 jtag.c:1866 jim_newtap_cmd(): Processing option: -expected-id Debug: 39 37 jtag.c:1979 jim_newtap_cmd(): Created Tap: at91sam9263.cpu @ abs position 0, irlen 4, capture: 0x1 mask: 0xf Debug: 40 38 target.c:3911 jim_target(): Target command params: Debug: 41 39 target.c:3912 jim_target(): target create at91sam9263.cpu arm926ejs -endian little -chain-position at91sam9263.cpu -variant arm926ejs Debug: 43 58 command.c:91 script_command(): script_command - bank Debug: 44 59 command.c:108 script_command(): script_command - bank, argv[0]=ocd_flash_bank Debug: 45 59 command.c:108 script_command(): script_command - bank, argv[1]=cfi Debug: 46 60 command.c:108 script_command(): script_command - bank, argv[2]=0x10000000 Debug: 47 61 command.c:108 script_command(): script_command - bank, argv[3]=0x400000 Debug: 48 61 command.c:108 script_command(): script_command - bank, argv[4]=2 Debug: 49 62 command.c:108 script_command(): script_command - bank, argv[5]=2 Debug: 50 62 command.c:108 script_command(): script_command - bank, argv[6]=0 Debug: 52 64 command.c:91 script_command(): script_command - init Debug: 53 65 command.c:108 script_command(): script_command - init, argv[0]=ocd_init Debug: 54 82 openocd.c:144 handle_init_command(): target init complete Debug: 55 83 openocd.c:151 handle_init_command(): jtag interface init complete Debug: 56 84 jtag.c:2194 jtag_init_inner(): Init JTAG chain Debug: 57 84 jtag.c:427 jtag_call_event_callbacks(): jtag event: JTAG controller reset (RESET or TRST) Debug: 58 85 jtag.c:1444 jtag_reset_callback(): - At this point it waits, waits... The reason is hopefully in my configuration script or has the current openocd version some weaknesses? ############################################################ ## Target: Atmel AT91SAM9263 ## Author: Andreas Kuehn ############################################################ if { [info exists CHIPNAME] } { set _CHIPNAME $CHIPNAME } else { set _CHIPNAME at91sam9263 } if { [info exists ENDIAN] } { set _ENDIAN $ENDIAN } else { set _ENDIAN little } if { [info exists CPUTAPID ] } { set _CPUTAPID $CPUTAPID } else { # force an error till we get a good number set _CPUTAPID 0x0792603F } telnet_port 4444 gdb_port 3333 interface at91sam926x at91sam926x_device jtag_A reset_config trst_and_srst jtag_nsrst_delay 20 jtag_ntrst_delay 20 jtag newtap $_CHIPNAME cpu -irlen 4 -ircapture 0x1 -irmask 0xf -expected-id $_CPUTAPID set _TARGETNAME [format "%s.cpu" $_CHIPNAME] target create $_TARGETNAME arm926ejs -endian $_ENDIAN -chain-position $_TARGETNAME -variant arm926ejs $_TARGETNAME configure -work-area-virt 0x0 -work-area-phys 0x300000 -work-area-size 0x100000 $_TARGETNAME configure -event halted "script SAM9263_init.script" $_TARGETNAME configure -event reset-init { mww 0xFFFFFC20 0x00002001 # CKGR_MOR - enable main osc. mww 0xFFFFFC28 0x2018BF02 # CKGR_PLLA - (16.00MHz/2)*25 = 200 MHz sleep 20 # delay 20ms mww 0xFFFFFC30 0x00000102 # 0x102 - (CLK/2)MHZ, sleep 200 jtag_speed 4 mww 0xFFFFFD44 0x00008000 # disable watchdog mww 0xFFFFFD08 0xA5000301 # user reset enable mww 0xFFFFFC10 0xFFFFFFFF # PMC_PCER ## setup EBI0_CS0 (NOR Flash) - 16-bit, 15 WS @ addr 0x10000000 mww 0xFFFFE400 0x03030303 # SMC_SETUP mww 0xFFFFE404 0x09090909 # SMC_PULSE mww 0xFFFFE408 0x00120012 # SMC_CYCLE mww 0xFFFFE40C 0x00161003 # SMC_MODE } flash bank cfi 0x10000000 0x400000 2 2 0 init ############################################################ Duane Ellis wrote: > andreas> Program received signal SIGSEGV, Segmentation fault. > andreas> 0x000519ec in interface_jtag_add_dr_out (device_num=0, > num_fields=0, num_bits=0x2, value=0xf1040, end_state=TAP_RTI) at jtag.c:721 > andreas> 721 (*last_cmd)->cmd.scan->ir_scan = 0; > > Hmm - Some ideas > > 1) As rick asks - what SVN version of OpenOCD are you using? > > Look at the file: "jtag.c" - function: "cmd_queue_allocate()' is there > a *BIG*WARNING* comment that talks about alignment? > > 2) Can you run openocd under gdb on your uCLinux box? > > 3) Can you do this again (with newer SVN version) - line numbers do not > match well. > Then - get a disassembly dump of the relevent section of the code. > There are 3 different pointers going on there., (a) (*last_cmd), (b) the > -> part, and (c) the value of ".scan" > By looking at the disassembly - and the address (ie: above it iwas > 0x000519ec) one can figure out what pointer is bad > > 4) you can perhaps configure uClinux to save a core file - and look at > the register value @ the time of the crash > (other version of uCLinux - have a kernel config to dump/print the cpu > registers when the above happens) > It would be helpful to determine what they where. > > 5) A bunch of simplistic "printf()" statements at that point in the code > would be very helpful. > for example: > > printf( "LAST CMD = %p\n", last_cmd ); > printf(" last command pointer = %p\n", last_command_ptr ); > .... and all the other ones. > For example - print the return values of the "cmd_queue_allocate()" > calls. > > andreas> So I did an strace with the same configuration. In fact ioctl > calls are failing. > > That might be perfectly valid. > >> After taking a deeper look to the code I found that "fopen" calls for >> the configuration files like this fail: > > With out detail and context, it is hard to say what is happening here - > it most likely is 100% NORMAL. > > Example: When GCC is hunting for .H files you are #including, there are > multiple fails. > > > > -- Duane. > > _______________________________________________ Openocd-development mailing list Openocd-development@lists.berlios.de https://lists.berlios.de/mailman/listinfo/openocd-development