Ubuntu 12.04 x64 Beta2 + Code Red LPCXpresso = LPC-Link Fail

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

Ubuntu 12.04 x64 Beta2 + Code Red LPCXpresso = LPC-Link Fail

2,299 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by fanl on Mon Apr 23 18:25:59 MST 2012
Hello,

I am here to report, and also to try to fix my problem, that LPC-Link is not working under Ubuntu 12.04 x64 beta 2.

This ubuntu is my main OS, there is no VM.

I have installed the Code Red IDE properly and it is working just fine.

When I do debug, the LPC-Link is initialized but no debug happen.

Follow below some logs to two commands on the LPC-Link through terminal:

$ dfu-util -d 0x471:0xdf55 -c 0 -t 2048 -R -D LPCXpressoWIN.enc
dfu-util - (C) 2007-2008 by OpenMoko Inc.
This program is Free Software and has ABSOLUTELY NO WARRANTY

Opening USB Device 0x0471:0xdf55...
Claiming USB DFU Runtime Interface...
Determining device status: state = dfuIDLE, status = 0
WARNING: Runtime device already in DFU state ?!?
Found Runtime: [0x0471:0xdf55] devnum=31, cfg=0, intf=0, alt=0, name="UNDEFINED"
Claiming USB DFU Interface...
Setting Alternate Setting ...
Determining device status: state = dfuIDLE, status = 0
dfuIDLE, continuing
Transfer Size = 0x0800
bytes_per_hash=604
Starting download: [##################################################] finished!
state(8) = dfuMANIFEST-WAIT-RESET, status(0) = No error condition is present
Done!
can't detach: error sending control message: Broken pipe
Resetting USB to switch back to runtime mode
and
$ ./crt_emu_cm3_nxp -info-emu -wire=winusb
Ni: LPCXpresso Debug Driver v4.0 (Mar 25 2012 14:25:27)
0 Emulators available:


My Target+Link setup works fine on my vmware machine running WinXP on this same computer.

Please, any help is welcome, I have done searching and found nothing that could fix this problem.

EDIT WITH THE SOLUTION:
Link (ln -s) the <lpcxpresso/bin>/libusbX.so.X to the /lib system folder.
0 项奖励
回复
13 回复数

2,285 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by CodeRedSupport on Fri Jan 04 01:56:20 MST 2013

Quote: ytplanet

file /lib/udev/rules.d/91-permissions.rules.


That file is not present on my Ubuntu 12.04 installation. Perhaps you installed something else that created that file?
0 项奖励
回复

2,285 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by ytplanet on Thu Jan 03 15:56:27 MST 2013
I'm not sure it is the same case, but I faced problem with usb device permissions. They were set to 0664 (not writable to anyone except root) even though it should be 0666 according to /etc/udev/rules.d/85-code-red.rules (the file installed by LPCXpresso intaller).
The reason is simple. There is another rule
SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device",  MODE="0664"
in file /lib/udev/rules.d/91-permissions.rules.
This second file is processed later and in result udev rules created by Code Red are completely useless.

The workaround is simple. I changed the name of file from 85-code-red.rules to 99-code-red.rules.
Now permissions are properly set to 0666 and in result the usb device is writable for everybody.




Quote: tsh
This is still broken for me. I had recently upgraded to ubuntu 12.4 (from having a working system before). I upgraded to lpcxpresso_4.3.0_1025 after discovering that I couldn't connect.

I have the 32 bit compatability libs installed, but no libusb in /lib.

i tried the soft-link option, but according to ltrace/ 'too many levels of soft-link', so I did a copy.

ltrace now shows me that i have a permissions problem - when using dfu-util to download the debug firmware.

Is there a udev option that needs setting to fix permissions for the usb? i didn't see it on the install instructions (but I could have missed it...)

Edit: the gui will connect to the debug probe now, but I'm not sure if I needed to run the firmware download as root in order to facilitate this...

0 项奖励
回复

2,285 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by ElectroNerd on Sun Sep 30 13:48:40 MST 2012
This worked for me immediately:

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

2,285 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by tsh on Sat Sep 29 10:49:09 MST 2012
This is still broken for me. I had recently upgraded to ubuntu 12.4 (from having a working system before). I upgraded to lpcxpresso_4.3.0_1025 after discovering that I couldn't connect.

I have the 32 bit compatability libs installed, but no libusb in /lib.

i tried the soft-link option, but according to ltrace/ 'too many levels of soft-link', so I did a copy.

ltrace now shows me that i have a permissions problem - when using dfu-util to download the debug firmware.

Is there a udev option that needs setting to fix permissions for the usb? i didn't see it on the install instructions (but I could have missed it...)

Edit: the gui will connect to the debug probe now, but I'm not sure if I needed to run the firmware download as root in order to facilitate this...
0 项奖励
回复

2,285 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by newpipe on Thu May 31 06:08:57 MST 2012
Hi!
I also had that problem. I'm running Ubuntu 12.04 final 64 bit withe the 32bit libraries.

Quote: fanl

$ sudo cp /usr/local/lpcxpresso_4.2.2_238/lpcxpresso/bin/libusb-1.0.so.0 /lib



That also fixed it for me. Thanks for that!

newpipe
0 项奖励
回复

2,285 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by CodeRedSupport on Wed Apr 25 00:33:35 MST 2012
Installation of the 32-bit compatibility libraries is documented here:
http://lpcxpresso.code-red-tech.com/LPCXpresso/Linux
Are you saying that you followed these instructions and it didn't work?
0 项奖励
回复

2,285 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by fanl on Tue Apr 24 20:26:42 MST 2012
Oh, sure, ln -s is the right thing to do.

Thanks for the tips.
0 项奖励
回复

2,285 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by gogamoga on Tue Apr 24 18:13:35 MST 2012
This is what i thought actually :P
better ln -s it though

Use ltrace next time, it shows exactly which libs it it fails to load
(Those progs in lpcxpresso/bin use dlopen() for shared libs)
0 项奖励
回复

2,285 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by fanl on Tue Apr 24 18:12:24 MST 2012
I cant believe but I have fixed it.

The problem was with the libusb 32bits compatibility, since I am running a x64 ubuntu.

The solution was extremely simple:

$ sudo cp /usr/local/lpcxpresso_4.2.2_238/lpcxpresso/bin/libusb-1.0.so.0 /lib


This command will copy the 32bit libusb that came along with lpcxpresso to the lib path. On ubuntu 12, the folder /lib is the default for 32bits lib.
0 项奖励
回复

2,285 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by gogamoga on Tue Apr 24 17:26:29 MST 2012
First, make sure you have ltrace installed.
Then, run this and post the output here:
ltrace -s 255 ./crt_emu_cm3_nxp -info-emu -wire=winusb


Also, while at it, do this, and post the results as well:
ldconfig -p | sed -n -e 's/.* \(.*libusb\.so.*\)/\1/Ip' | xargs file -L


P.S. I am in the worse problem than you atm, trying to make this shit work at FreeBSD lol
0 项奖励
回复

2,285 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by fanl on Tue Apr 24 16:58:10 MST 2012
Thank you for your support. I'll report to ubuntu developers.

Anyway, I'd like to leave an open question here, if anyone else is having similar trouble, please post, since more samples of this trouble would help on troubleshooting it.

At.
0 项奖励
回复

2,285 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by gogamoga on Tue Apr 24 16:22:53 MST 2012
Check your libs, my guess is that you dont have 32 bit libusb on your 64 bit ubuntu. Run this:
ldconfig -r | sed -n -e 's/.* \(.*libusb\.so\)/\1/p' | xargs file


and post the output.
0 项奖励
回复

2,285 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by CodeRedSupport on Tue Apr 24 03:20:27 MST 2012
I recommend that you report this to Ubuntu as it is obviously a regression from their previous releases (and it is a beta, so they should be happy to receive this feedback). Note that this does work on Ubuntu 9, 10 and 11.
0 项奖励
回复