LPC-Link connection problems

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

LPC-Link connection problems

1,185 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by mbeale on Thu Apr 19 20:52:06 MST 2012
Environment: System Linux Ubuntu (Lucid) 10.04 (IA64), Debugging using Eclipse/Code-red (LPCXpresso_4.2.2_238_Linux-x86) with a LPC-Link JTAG interface pcb, Micro LPC1225.

Debugger reports following error:
No emulator/board available.
This could be because it is unpowered, disconnected or already in use

However am able to debug without problems while running as sudo (root). This problem has occurred with earlier versions of Code-red compilers. Appears to be an issue with permissions. Have tried other tip from the forum without success.

Any suggestions? Don't like running applications as super user unless I absolutely have to.

Thanks
malcolm
0 Kudos
56 Replies

984 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by gogamoga on Fri May 11 02:54:45 MST 2012
lock the thread please. its already too long to read and there's nothing to be said anymore.
0 Kudos

984 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by mbeale on Fri May 11 02:44:03 MST 2012

Quote: gogamoga
YOU DONT HAVE 32BIT libusb-1.0. (dont rely on the libusb provided in lpcxpresso/bin)
cd /tmp
wget http://security.ubuntu.com/ubuntu/pool/main/libu/libusb-1.0/libusb-1.0-0_1.0.9~rc3-2ubuntu1_i386.deb
sudo dpkg -i ./libusb-1.0-0_1.0.9~rc3-2ubuntu1_i386.deb


And your problem will be gone



Hey gogamoga you're a star! That's the answer... hope CodRedSupport takes note.
Thanks heaps
0 Kudos

984 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by gogamoga on Fri May 11 01:12:49 MST 2012
YOU DONT HAVE 32BIT libusb-1.0. (dont rely on the libusb provided in lpcxpresso/bin)
cd /tmp
wget http://security.ubuntu.com/ubuntu/pool/main/libu/libusb-1.0/libusb-1.0-0_1.0.9~rc3-2ubuntu1_i386.deb
sudo dpkg -i ./libusb-1.0-0_1.0.9~rc3-2ubuntu1_i386.deb


And your problem will be gone
0 Kudos

984 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by mbeale on Fri May 11 01:02:33 MST 2012

Quote: CodeRedSupport
With 85-code-red.rules installed, LPC-Link will be automatically booted and made world-write (meaning that you do not need to be root to access it). This explain
1. why dfu-util reports no DFU device - becuase it has already been booted
2. why libusb reports
Bus 002 Device 007: ID 1fc9:0009 NXP Semiconductors
this is a booted LPC-Link

When 85-code-red.rules is copied into the rules directory, you either need to reboot, or restart the udev service. So just copying the file will have no affect.

There should never be any need to reinstall LPCXpresso, unless any parts of the installation have been changed.

We do plan to release the udev rules in a future release of LPCXpresso.



Thanks for the feedback guys, but if you look through the text files I attached you'll see my comments saying I did several types of poweroff/reboot/restart operations on the machine and the system continued to fail (with the new rules file in place). So unless I explicitly need to do this before I run LPCXpresso my feeling is there's still something unknown here. I'm not saying you're wrong, just that my environment is subtly different from yours.
0 Kudos

984 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by mbeale on Fri May 11 00:53:39 MST 2012

Quote: gogamoga
run this one and show me the output (if any). huygens had similar problem and it got fixed pretty quick.
for i in `ldconfig -p | grep -i libusb | sed -n -e 's/^.* \(\/.*\)/\1/p'`;do if [[ $(file -L $i | sed -n -e 's/^.*ELF 32-bit.*$/1/Ip') == "1" ]]; then ls -lLha $i; fi; done



Hi gogamoga, here's the output you asked for, but please note the system is working fine right now after the reinstall, so this may not reveal much.


Quote:
malcolm@malcolm:~$ for i in `ldconfig -p | grep -i libusb | sed -n -e 's/^.* \(\/.*\)/\1/p'`;do if [[ $(file -L $i | sed -n -e 's/^.*ELF 32-bit.*$/1/Ip') == "1" ]]; then ls -lLha $i; fi; done
-rwxr-xr-x 1 root root 46K Apr  4 00:49 /usr/local/lpcxpresso_4.2.2_238/lpcxpresso/bin/libusb-1.0.so.0
-rw-r--r-- 1 root root 30K Jan  8 18:12 /lib/i386-linux-gnu/libusb-0.1.so.4



I'll run it again next time I do an OS update and paste it here so you can see the changes.

Thanks
0 Kudos

984 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by CodeRedSupport on Fri May 11 00:03:16 MST 2012
With 85-code-red.rules installed, LPC-Link will be automatically booted and made world-write (meaning that you do not need to be root to access it). This explain
1. why dfu-util reports no DFU device - becuase it has already been booted
2. why libusb reports
Bus 002 Device 007: ID 1fc9:0009 NXP Semiconductors
this is a booted LPC-Link

When 85-code-red.rules is copied into the rules directory, you either need to reboot, or restart the udev service. So just copying the file will have no affect.

There should never be any need to reinstall LPCXpresso, unless any parts of the installation have been changed.

We do plan to release the udev rules in a future release of LPCXpresso.
0 Kudos

984 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by gogamoga on Thu May 10 20:29:25 MST 2012
your snapshots are mostly identical the second one (on non-working) even more permissible than the first one.
copy/paste the line i posted in previous post and tell me if any output, if you see no output - it is a 32bit libusb issue.
0 Kudos

984 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by mbeale on Thu May 10 20:05:15 MST 2012

Quote: mbeale
Oops, no attachment... hopefully this works.



Feedback requested by CodeRedSupport.
Hmm... still upload problems with file size, splitting the file.:mad:
0 Kudos

984 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by gogamoga on Thu May 10 19:57:56 MST 2012
run this one and show me the output (if any). huygens had similar problem and it got fixed pretty quick.
for i in `ldconfig -p | grep -i libusb | sed -n -e 's/^.* \(\/.*\)/\1/p'`;do if [[ $(file -L $i | sed -n -e 's/^.*ELF 32-bit.*$/1/Ip') == "1" ]]; then ls -lLha $i; fi; done
0 Kudos

984 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by mbeale on Thu May 10 19:52:06 MST 2012
Oops, no attachment... hopefully this works.
0 Kudos

983 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by mbeale on Thu May 10 19:42:10 MST 2012

Quote: CodeRedSupport
I have *never* had to reinstall LPCXpresso on any Linux platform. We have used various editions of Ubuntu as they become available, and never had any problems. There is nothing in LPCXpresso which would change permissions in any of the installed files after a reboot. Therefore, it must be something else in the system that is changing permissions when you reboot.

The new udev rules are designed to make LPC-Link world-write (chmod 666) whenever the device is plugged in, and booted. If you have correctly installed this file, then it will not matter whether crt_emu* is running with root privileges or not.

I agree with gogamoga that you should 'snapshot' you system before and after. I would suggest:
ls -lR /dev/bus/usb
ls -l /use/local/lpcxpresso*/lpcxpresso/bin
ls -l /etc/init.d
ls -l /etc/udev/rules.d



Okay, its been some time but I've got your system status snapshot (before/after), and my previous conclusions are unchanged. Since the outputs are quite long I've put them into a file to avoid cluttering this post. Please read my comments within the file. Again I'll repeat uinstalling/reinstalling LPCXpresso works for me every time, whether this is the problem or not, can't say.

Malcolm
0 Kudos

984 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by gogamoga on Thu May 10 18:44:45 MST 2012
did you fix your issues?
0 Kudos

984 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by gogamoga on Wed May 09 10:22:28 MST 2012
I am totally confused myself how can it run as root and not run as regular user.
I guess something happens to LIBPATH as root which doesnt happen as regular user
do
file -L solib_name.so

to see if its elf32 or elf64

PS.
I am off, to XBOX Lanparty
0 Kudos

984 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by dmayer on Wed May 09 10:21:01 MST 2012
How could it be possibile, that it runs flawlessly as root, if there is a lib missing? I'll try to find out if there is a 32-bit libusb-1.0, but your explanation seems strange to me...

EDIT:
[B]I installed the 32-bit libusb-1.0 from here and it seemes to work [/B]now. I dont have a target to verify definitely but im quite shure this was the problem.

Thank you VERY much gogamoga! I really appreciate your help!! :)

PS: Still dont understand how there could miss libs, that only cause a failure for normal users, but not for root.
0 Kudos

984 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by gogamoga on Wed May 09 10:14:58 MST 2012
You obviously dont have any 32bit libusb-1.0
2 Possible solutions:

1. Find an official way to install 32bit libusb-1.0 (Cant help you with that - hate ubuntu :D)
2. Quick and dirty hack:
sudo ln -s /usr/local/lpcxpresso_4.2.2_238/lpcxpresso/bin/libusb-1.0.so.0 /lib/i386-linux-gnu/
sudo ldconfig
ldconfig -p | grep -i 'i386-linux-gnu/libusb-1.0'
0 Kudos

984 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by dmayer on Wed May 09 10:03:06 MST 2012
There are some:
-rw-r--r-- 1 root root 23K Jan 30 12:27 /usr/lib/libusbmuxd.so.1
-rw-r--r-- 1 root root 59K Apr 19 22:43 /lib/x86_64-linux-gnu/libusb-1.0.so.0
-rw-r--r-- 1 root root 59K Apr 19 22:43 /usr/lib/x86_64-linux-gnu/libusb-1.0.so.0
-rw-r--r-- 1 root root 31K Jan  8 11:11 /lib/x86_64-linux-gnu/libusb-0.1.so.4
-rw-r--r-- 1 root root 30K Jan  8 11:12 /lib/i386-linux-gnu/libusb-0.1.so.4
0 Kudos

984 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by gogamoga on Wed May 09 09:46:37 MST 2012
i am not familiar with ubuntu, so i dont really know where they stick 32bit libs,
but, lets try this:
for i in `ldconfig -p | grep -i libusb | sed -n -e 's/^.* \(\/.*\)/\1/p'`;do if [[ $(file -L $i | sed -n -e 's/^.*ELF 32-bit.*$/1/Ip') == "1" ]]; then ls -lLha $i; fi; done


No output = no 32bit libs
0 Kudos

984 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by gogamoga on Wed May 09 09:29:21 MST 2012
do the ls -lha libusb-1* too plz, edit the post though, dont repost (i will delete this post after you edit)
0 Kudos

984 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by dmayer on Wed May 09 09:28:30 MST 2012
Here we go:
Ni: LPCXpresso Debug Driver v4.0 (Mar 25 2012 14:25:27)
dlopen("/usr/local/lpcxpresso_4.2.2_238/lpcxpresso/bin/libLPC_Link.so", 1)   = NULL
dlerror()                                                                    = "libusb-1.0.so.0: cannot open shared object file: No such file or directory"
0 Emulators available:

+++ exited (status 0) +++

-rwxr-xr-x 1 root root 46K Apr  3 18:49 libusb-1.0.so.0
0 Kudos

984 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by gogamoga on Wed May 09 09:22:35 MST 2012
cd /usr/local/lpcxpresso*/lpcxpresso/bin
ltrace -s 255 -e dlopen,dlerror ./crt_emu_cm3_nxp -info-target -wire=winusb
ls -lha libusb-1*


And post results
0 Kudos