OpenOCD Socket Binding Fails.

Hi,

When I run OpenOCD on one of my computers I get this error:

“Error : server.c:159 add_service(): couldn’t bind to socket: Bad Address”

When I run the same OpenOCD and config files on another computer it works fine.

Both machines are running Windows XP. The one it works on is Home edition and the one it doesn’t is Professional.

I have been running OpenOCD on the machine that it works on and debugging remotely from the machine it doesn’t work on with no problems.

Any ideas?

Thank you,

Garyio

Firewall?

Cheers

Spen

Thank you for your reply. I thought it was the firewall and have disabled it. I opened the Windows Firewall dialog and selected Off.

Is there something else I’m missing? Maybe some security settings in XP Professional? I don’t think it could have anything to do with my router or anything. Could it?

Thank you,

Garyio

well if the firewall is off then something else is using that address

what do you get for netstat -a

Cheers

Spen

I get an empty table:

Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.

C:\Documents and Settings\Gary>netstat -a

Active Connections

  Proto  Local Address          Foreign Address        State

C:\Documents and Settings\Gary>

I was searching around and found this about this particular error when calling bind:

“Bad address. The system detected an invalid pointer address in attempting to use a pointer argument of a call. This error occurs if an application passes an invalid pointer value, or if the length of the buffer is too small. For instance, if the length of an argument, which is a sockaddr structure, is smaller than the sizeof(sockaddr).”

Is it possible I am having a memory allocation problem or something like that?

Thank you,

Garyio

What does your .cfg file look like?

Here’s my config file. I have modified usbprog.c to use my own custom driver and hardware. That all works fine when I debug using the Windows XP Home machine. And when I start Openocd on the machine that fails it gets past the JTAG initialization before failing. I have debugged and programmed the flash on the LPC2458 I am working on.

 #daemon configuration
 telnet_port 4444
 gdb_port 3333

 #interface
 interface usbprog
 jtag_speed 0
 
 # reset_config <signals> [combination] [trst_type] [srst_type]
 trst_only
 #reset_config trst_and_srst

 
 #jtag scan chain
 jtag_device 4 0x1 0xf 0xe
 jtag_ntrst_delay 333

 
 #target configuration, what to do on a target reset
 target arm7tdmi little run_and_halt 0 arm7tdmi-s_r4
 run_and_halt_time 0 30
 daemon_startup reset
 #target_script 0 reset openocd.script
 working_area 0 0x40000000 0x4000 nobackup

 
 # flash bank lpc2000 <base> <size> 0 0 <variant> <target#> <clock> ['calc_checksum']
 flash bank lpc2000 0x0 0x7D000 0 0 0 lpc2000_v2 12000 calc_checksum


 # For more information about the configuration files, take a look at:
 # http://openfacts.berlios.de/index-en.phtml?title=Open+On-Chip+Debugger

Thank you,

Garyio

I am hoping the following is a typo:

# reset_config <signals> [combination] [trst_type] [srst_type]
trst_only
#reset_config trst_and_srst

Cheers

Spen

OK so that’s a typo that doesn’t help solve my socket binding problem. I fixed my reset problem any how and can now put back the line below it. It works well on my notebook (XP Home). I tried another machine running XP Professional and it works there also. There must be some winsock configuration problem on my main machine that I would like to debug with. I tried to reset the winsock registry settings but that didn’t do anything.

Still no clue why I can’t bind ports on one machine. If any one has any ideas that would be great.

Thanks,

Garyio