lpcware

[SOLVED]  LPC-Link2 always fails on second debug attempt

Discussion created by lpcware Employee on Jun 15, 2016
Latest reply on Jun 15, 2016 by lpcware
Content originally posted in LPCWare by up_in_ARMs on Wed Apr 08 14:15:25 MST 2015
Hi,

I've searched the forum, but found no answer to my situation, so I'm reaching out to the community for some help.


I'm running LPCXpresso v7.7.2 [Build 379] on Fedora Workstation 21 (64-bit),
inside Virtualbox 4.3.26. The host for Virtualbox is Debian 7.7 (64-bit)

I've succesfully performed everything described in
http://www.lpcware.com/content/faq/lpcxpresso/linux-installation
i.e. :

   yum -y update

   yum -y install gtk2.i686 glibc.i686 glibc-devel.i686 libstdc++.i686 \
       zlib-devel.i686 ncurses-devel.i686 libX11-devel.i686 libXrender.i686 \
       libXrandr.i686 libusb.i686 libXtst.i686 nss.i686

  and changed SELINUX' policy to permissive, as seen by:

      [root@localhost ~]# /usr/sbin/getenforce
      Permissive
      [root@localhost ~]#

And after finally understanding that I needed to create two USB device filters in
Virtualbox, as pointed out by larryvc here:
http://www.lpcware.com/content/forum/linux-ide-hangs-initializing-lpc-link
the LPC-LINK2 started working.

I have now single-stepped my code on the LPC11U35 target  :)  :)

But I have one remaining problem: When I click "Debug" [u]a second time,[/u]
after terminating the first Debug session with a click on the red square icon,
I get a pop-up saying:


Quote:
Error in final launch sequence
  Error: Error reported by server (redlinkserv):
RedlinkAPI: Hardware interface transfer error
Redlink Server has been terminated and will be restarted.
Please restart your debug session.
If the problem recurs, please power cycle your debug probe and restart LPCXpresso.




To work around the problem I have to replug the USB cable after every Debug session  :(( .
Very annoying.....
If anyone has a remedy for this situation, I'm very grateful.


Here are some of the things I've tried to solve the issue:
-------------------------------------------------------------------------------------------------------
1. All USB ports on the laptop and on the docking station give this error.
   (It's a Dell Laitiude E6410)

2. I connected the LPC-LINK2, using the same USB cable, to a different laptop,
   which also runs Fedora Workstation 21 and LPCXpresso v7.7.2 [Build 379].
   Here the LPC-LINK2 works repeatedly, not just the first time after connecting it.
   (This Fedora instance is not a virtual machine)

3. None of the three process mentioned at the bottom of this page
   http://www.lpcware.com/content/faq/lpcxpresso/booting-lpc-link2
   survive when I terminate the debug session. All three proccesses run during the
   first debugging session:

4. If I start LPCXpresso, plug in the USB cable, and click the RedLink Server icon,
   I get this in the Console window "RedlinkServer":
       [Started server]
       [Connected on port 3025]

   At this ppoint lsusb says:
          Bus 001 Device 025: ID 1fc9:000c NXP Semiconductors


5. When I start the first Debug session I get this in the Console window "RedlinkServer":

[Started server]
[Connected on port 3025]
redlink>ProbeList
Index = 1
Manufacturer = NXP
Description = LPC-LINK2 REDLINK
VID = 21BD, PID=0006
Path = /dev/hidraw0
redlink>ProbeStatus
Index = 1
Manufacturer = NXP
Description = LPC-LINK2 REDLINK
VID = 21BD, PID=0006
Path = /dev/hidraw0
IsOpen = FALSE
WireInitialized = FALSE
WireProtocol = JTAG
CoresConfigured = FALSE
PacketSize = 1024
Reference Count = 0
HasSWV = FALSE
HasETM = FALSE
HasJTAG = TRUE
HasSWD = TRUE
Probe Type = REDLINK
Probe Reference Count = 0
redlink>ProbeIsOpen 1
FALSE
redlink>ProbeOpenByIndex 1
Probe Handle 1 Open
redlink>WireIsConnected 1
FALSE
redlink>WireSwdConnect 1
DpID = 0BB11477
redlink>ProbeStatus
Index = 1
Manufacturer = NXP
Description = LPC-LINK2 REDLINK
VID = 21BD, PID=0006
Path = /dev/hidraw0
IsOpen = TRUE
WireInitialized = TRUE
WireProtocol = SWD
CoresConfigured = FALSE
PacketSize = 1024
Reference Count = 0
HasSWV = FALSE
HasETM = FALSE
HasJTAG = TRUE
HasSWD = TRUE
Probe Type = REDLINK
Probe Reference Count = 0
redlink>CoresConfigured 1
FALSE
redlink>CoreConfig 1
Number of CORES/TAPs = 1, Fully recognized: True

and the Console window "my_project Debug messages" says:

LPCXpresso RedlinkMulti Driver v7.7 (Mar 31 2015 21:02:36 - crt_emu_cm_redlink build 317)
Emu(0): Conn&Reset. DpID: 0BB11477. CpuID: 410CC200. Info: (null)
Debug protocol: SWD. RTCK: Disabled. Vector catch: Disabled.
loaded v.2 On-chip Flash Memory LPC11_12_13_64K_8K.cfx
image 'LPC11_12_13 (64K Flash, min 8K RAM) Mar 17 2015 09:28:33'
Connected: was_reset=true. was_stopped=false
LPCXpresso Free License - Download limit is 256K
Writing 30388 bytes to address 0x00000000 in Flash
Progress meter completed at over 100% (32768/30388 bytes)
Erased/Wrote page  0-7 with 30388 bytes in 1142msec
Flash Write Done
Flash Program Summary: 30388 bytes in 1.14 seconds (25.99 KB/sec)
Stopped (Was Reset)  [Reset from Unknown]
Stopped: Breakpoint #1

Obviously, everything is working fine the first time debugging.


6. But when I terminate the first Debug session,
   click Debug again, close the pop-up from this failing Debug session, and click Redlink Server icon,
   the "Redlinkserver" Console window says:

[Started server]
[Connected on port 3025]
redlink>ProbeList
Index = 1
Manufacturer = NXP
Description = LPC-LINK2 REDLINK
VID = 21BD, PID=0006
Path = /dev/hidraw0
redlink>ProbeStatus
Index = 1
Manufacturer = NXP
Description = LPC-LINK2 REDLINK
VID = 21BD, PID=0006
Path = /dev/hidraw0
IsOpen = FALSE
WireInitialized = FALSE
WireProtocol = JTAG
CoresConfigured = FALSE
PacketSize = 1024
Reference Count = 0
HasSWV = FALSE
HasETM = FALSE
HasJTAG = TRUE
HasSWD = TRUE
Probe Type = REDLINK
Probe Reference Count = 0
redlink>ProbeIsOpen 1
FALSE
redlink>ProbeOpenByIndex 1
Probe Handle 1 Open
redlink>WireIsConnected 1
FALSE
redlink>WireSwdConnect 1
RedlinkAPI: Hardware interface transfer error
[Closed]
[Started server]
[Connected on port 3025]
redlink>ProbeStatus
redlink>exit
[Closed]
[Started server]
[Connected on port 3025]

, even though the LPC-LINK is still seen by the (Virtual machine's) Fedora installation:

[vagrant@localhost ~]$ lsusb
Bus 001 Device 004: ID 21bd:0006 
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
[vagrant@localhost ~]$



I'm very close to having a fully operational LPCXpresso environment on Fedora in Virtualbox, but this final hurdle is nullifying all my prior efforts.
After strugling to get this far with my LPCXpresso installation I'm hoping someone has seen this before and can offer some advice on how to solve the issue.
Thanks!

Outcomes