"Connection refused" when trying to debug

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

"Connection refused" when trying to debug

1,812 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by jorav on Tue Dec 17 06:31:13 MST 2013
Hi,

I just freshly installed LPCXpresso_6.1.2_177_Linux-x86 on a Debian 7 (64 bit) machine.

The IDE runs fins, however, when I try to debug a compiled project, I get the "connection refused" error mentioned in the FAQ:

http://www.lpcware.com/content/faq/lpcxpresso/connection-refused-linux

However, I have libusb0 installed and the link present.

Looking at other posts with the same problem, I tried to start redlinkserv manually:

/opt/lpcxpresso_6.1.2_177/lpcxpresso/bin/redlinkserv
/opt/lpcxpresso_6.1.2_177/lpcxpresso/bin/redlinkserv: /lib/i386-linux-gnu/i686/cmov/libc.so.6: version `GLIBC_2.15' not found (required by /opt/lpcxpresso_6.1.2_177/lpcxpresso/bin/redlinkserv)

so this looks like a problem with the compiled binaries shipped with LPCXpresso. Is there a solution?
Is there some other (open source?) software that I can use with the LPC Link?

As a sidenote, the documentation and error messages are not really helpful when confronted with this problem. Also, the package "ia32-libs" mentioned in the documentation is "deprecated" on Debian due to multiarch support.
0 项奖励
回复
16 回复数

1,679 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by lpcxpresso-support on Sat Apr 26 01:19:00 MST 2014
The alternative is to READ THE DOCS. Where it clearly states:


Quote:

For Ubuntu 13.10 or later:
Ubuntu 13.10 no longer provides a convenient method to install all 32-bit compatible
libraries, so they must all be installed individually. Those that are required for LPCXpresso
7 are as follows:
   sudo apt-get install libgtk2.0-0:i386 libxtst6:i386 libpangox-1.0-0:i386 \
       libpangoxft-1.0-0:i386 libidn11:i386 libglu1-mesa:i386 \
       libncurses5:i386 libudev1:i386 libusb-1.0:i386 libusb-0.1:i386 \
       gtk2-engines-murrine:i38

0 项奖励
回复

1,679 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by MicroPoint on Fri Apr 25 22:31:05 MST 2014
Hello

I have xubuntu 14.04 amd64 and had numerous problems getting LPCXpresso 7.1.1 to work with LPCXpresso boards.
Here is how I got it to work, I hope this helps.

1) First I installed the basic meta package for the i386 libraries and these mentioned in here: http://www.lpcware.com/content/forum/notes-installing-lpcxpresso-6-ubuntu-1310-64-bit.

2) Then I installed LPCXpresso 7.1.1. The installer will not work unless it finds its i386 libraries, although it does its own installing of libraries, but obviously not all.
At this stage the LPCXpresso IDE did work but when trying to connect to  LPCXpresso boards I got a 'Connection refused' error.

3) After some research I created this link mentioned in another post:
uuu@hhhhh:cd /lib/i386-linux-gnu
uuu@hhhhh:sudo ln -sf libudev.so.1 libudev.so.0


4) Test negative with dfu-util:
uuu@hhhhh:/usr/local/lpcxpresso_7.1.1_125/lpcxpresso/bin$ ./dfu-util --help
./dfu-util: error while loading shared libraries: libusb-0.1.so.4: cannot open shared object file: No such file or directory


5) Fix by installing libusb-0.1-4:i386:
uuu@hhhh:/usr/local/lpcxpresso_7.1.1_125/lpcxpresso/bin$ sudo apt-get install libusb-0.1-4:i386
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following NEW packages will be installed:
  libusb-0.1-4:i386
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.


6) Test again with dfu-util, this time successful :
uuu@hhhhh:/usr/local/lpcxpresso_7.1.1_125/lpcxpresso/bin$ ./dfu-util -l
dfu-util - (C) 2007-2008 by OpenMoko Inc.
This program is Free Software and has ABSOLUTELY NO WARRANTY

Found Runtime: [0x0471:0xdf55] devnum=24, cfg=0, intf=0, alt=0, name="UNDEFINED"


After restarting LPCXpresso 7.1.1 the LPCXpresso board worked as usual.
0 项奖励
回复

1,679 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Atheros on Thu Mar 06 12:41:30 MST 2014
That did it, thanks!

sudo apt-get install libudev0 libudev0:i386
0 项奖励
回复

1,679 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by starblue on Thu Mar 06 12:17:47 MST 2014
The folders are not important, I don't have them either. It just searches there but later finds the shared libraries elsewhere.

Important are the libxxx.so.y files, you should probably install the appropriate Debian i386 packages. To figure out which use
apt-cache search libxxx


It seems you need to install the udev library (I have it installed, probably from before installing LPCXpresso):
apt-get install libudev1:i386

0 项奖励
回复

1,679 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Atheros on Thu Mar 06 11:37:14 MST 2014
I see the missing libraries, it looks like a folder called "tls" and "i868" are not in the debian folder.  Can't find any of the udev libs too.

I've attached the strace output. I'll make sure I extracted that deb package correctly.

Here is the current location of the debian folder.
/usr/local/lpcxpresso_7.0.0_92/debian
/usr/local/lpcxpresso_7.0.0_92/debian/libc6_2.15-0ubuntu20_i386
drwxr-xr-x 2 root root 4.0K Mar  4 16:44 DEBIAN
drwxr-xr-x 3 root root 4.0K Mar  4 16:44 etc
drwxr-xr-x 3 root root 4.0K Mar  4 16:44 lib
drwxr-xr-x 4 root root 4.0K Mar  4 16:44 usr
0 项奖励
回复

1,679 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by starblue on Thu Mar 06 00:54:58 MST 2014
I just tried it, it seems strace doesn't execute shell scripts. The following works for me:
strace sh redlinkserv

This will produce a lot of output (all system calls and replies).
Near the end you will probably see it searching for a shared library that is missing.
0 项奖励
回复

1,679 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Atheros on Wed Mar 05 17:09:13 MST 2014
I have no idea what this returned, but it doesn't look good. Maybe because redlinkserv is the shell script?

execve("./redlinkserv", ["./redlinkserv"], [/* 21 vars */]) = -1 ENOEXEC (Exec format error)
dup(2)                                  = 3
fcntl(3, F_GETFL)                       = 0x8002 (flags O_RDWR|O_LARGEFILE)
fstat(3, {st_mode=S_IFCHR|0620, st_rdev=makedev(136, 0), ...}) = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f44740ab000
lseek(3, 0, SEEK_CUR)                   = -1 ESPIPE (Illegal seek)
write(3, "strace: exec: Exec format error\n", 32strace: exec: Exec format error
) = 32
close(3)                                = 0
munmap(0x7f44740ab000, 4096)            = 0
exit_group(1)                           = ?
0 项奖励
回复

1,679 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by starblue on Wed Mar 05 10:48:35 MST 2014
Try starting it under strace to find out what is missing.
0 项奖励
回复

1,679 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Atheros on Wed Mar 05 10:25:48 MST 2014
starblue,

looks like i have all those 32bit packages installed, and yep i unpacked the deb and moved into the same location as you mentioned.

still getting that "Could not load redlink shared object" error.

i'll keep digging, thanks for the quick reply!
0 项奖励
回复

1,679 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by starblue on Wed Mar 05 01:45:15 MST 2014
For the i386 libs see this comment: http://www.lpcware.com/content/forum/notes-installing-lpcxpresso-6-ubuntu-1310-64-bit#comment-113562...
sudo apt-get install libgtk2.0-0:i386 libpangox-1.0-0:i386 libpangoxft-1.0-0:i386 libidn11:i386 libglu1-mesa:i386 libxtst6:i386


For the script to work you need to unpack the Ubuntu package in /usr/local/lpcxpresso_7.0.0_92/debian/libc6_2.15-0ubuntu20_i386, like this (untested):

dpkg-deb -x libc6_2.15-0ubuntu20_i386.deb /usr/local/lpcxpresso_7.0.0_92/debian/libc6_2.15-0ubuntu20_i386


The LPCXpresso exception means that the server is not running, therefore it can't connect to it.
0 项奖励
回复

1,679 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Atheros on Tue Mar 04 18:12:07 MST 2014
hello starblue,

would you be able to post the i386 libraries you installed. I am running into the same issue, and can't get the debugger to work on debian wheezy 7.4

i have updated udev to use group plugdev, and using the libc6 package you posted with the script to launch redlinkserv

also i notice when i try to launch redlinkserv bash script from the commandline it says...

Could not load redlink shared object

but when i run the original redlinkserv.real binary i get this error

./redlinkserv.real: /lib/i386-linux-gnu/i686/cmov/libc.so.6: version `GLIBC_2.15' not found (required by ./redlinkserv.real)

btw i attached a screenshot of the error in LPCXpresso,

Thanks a million!
0 项奖励
回复

1,679 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by starblue on Tue Mar 04 12:37:46 MST 2014
You can download the Ubuntu libc6 package:
wget h_t_t_p://security.ubuntu.com/ubuntu/pool/main/e/eglibc/libc6_2.15-0ubuntu20_i386.deb

Note that the link will change when Ubuntu updates the package.

Don't install it, instead unpack it somewhere else.  Use LD_LIBRARY_PATH with the subdirectory containing the libraries and the bin-directory of the LPCXpresso installation when executing redlinkserv.

I moved redlinkserv to redlinkserv.real and replaced it by the following script:
LPCXPRESSO_ROOT_DIR=/usr/local/lpcxpresso_7.0.0_92
LPCXPRESSO_BIN_DIR="${LPCXPRESSO_ROOT_DIR}/lpcxpresso/bin"
GLIBC_DIR="${LPCXPRESSO_ROOT_DIR}/debian/libc6_2.15-0ubuntu20_i386/lib/i386-linux-gnu"

export LD_LIBRARY_PATH="${LPCXPRESSO_BIN_DIR}:${GLIBC_DIR}:${LD_LIBRARY_PATH}"

exec "${LPCXPRESSO_BIN_DIR}"/redlinkserv.real


Now debugging works under Debian 7.4 on amd64.

(There were some other issues too: I needed to install some i386 libraries, and udev didn't set the permissions for other to rw, so I changed the rules in /etc/udev/rules.d/85-lpcxpresso.rules to use group plugdev.)

Damn spam filter.
0 项奖励
回复

1,679 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by jorav on Tue Dec 17 11:27:01 MST 2013
Thanks,

that might work - however, the tool does not see my board. I guess the LPC-Link on the LPCXpresso-LPC812 board is not supported.

0 项奖励
回复

1,679 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by lpcxpresso-support on Tue Dec 17 09:05:04 MST 2013
You should be able to use the LPC-Link2 CMSIS-DAP image:
http://www.lpcware.com/lpclink2-config-tool

I understand that OpenOCD supports CMSIS-DAP.
0 项奖励
回复

1,679 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by jorav on Tue Dec 17 08:50:42 MST 2013
Thanks,

I was afraid so.

glibc is a crucial system component, so upgrading that possibly breaks lots of other stuff - this is no solution.

Since the rest of LPCXpresso works fine with an older libc version, you might consider re-building or statically linking those parts. As it is, I would be forced to install a different operating system to use the software.

I am just playing around with the LPC812 board to get a hang for the tools, because I have one of those around - the final system will need ethernet, so I was thinking about the LPC1768.

I think I'll have a look at the STM32 board I have next - the STLink is supported by OpenOCD, which runs fine on Debian.

Is there any alternative solution to use the LPC-Link debugger with a bare gdb, just like OpenOCD? I am happy to use my own IDE instead of LPCXpresso if the basic download/debug functionality works.

0 项奖励
回复

1,679 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by lpcxpresso-support on Tue Dec 17 07:24:40 MST 2013
Unfortunately, Debian 7 is not one of the supported Linux distros. As stated in the User Guide, supported distributions are:
Ubuntu 11 and greater
Fedora 17 and greater

We have also had reports of LPCXpresso working well with OpenSuse 13.

As you have discovered, not all distros offer the same functionality, and it is frankly impossible for us to keep track of all of the different requirements across all the different distros. This is why we state only the distros that we have tested ourselves.

Searching for "debian 7 glibc 2.15" provides some results that may be helpful for you - but if you follow any of the instructions for installing glibc 2.15, you do so at your own risk.

Regards
0 项奖励
回复