Menu

#31 Support for ebay platform cable DLC9G

Unstable_(example)
open
nobody
None
5
2019-12-13
2017-03-08
No

I have a Xilinx platform cable model DLC9G that i bought for very low cost at ebay, I'm pretty sure it's not original. It was working well with Impact, but with xc3sprog it would just work the first time after it was plugged in to USB, so to program a second time I had to replugg it. After a bit debugging with the xc3sprog code I found that by adding an extra line of:
if (r>=0) r = xpcu_shift(xpcu, 0xA6, 2, 2, zero, 0, NULL);
it would work reliably every time. Don't know if this is anything that would cause any problems with any other device but I wanted to share my modifications in case others are having this problem. See svn diff atttached.

1 Attachments

Discussion

  • Uwe Bonnes

    Uwe Bonnes - 2017-03-09

    "Trond" == Trond Egil Gran trondegilgran@users.sf.net writes:

    ...

    Trond> I have a Xilinx platform cable model DLC9G that i bought for very
    Trond> low cost at ebay, I'm pretty sure it's not original. It was
    Trond> working well with Impact, but with xc3sprog it would just work
    Trond> the first time after it was plugged in to USB, so to program a
    Trond> second time I had to replugg it. After a bit debugging with the
    Trond> xc3sprog code I found that by adding an extra line of: if (r>=0)
    Trond> r = xpcu_shift(xpcu, 0xA6, 2, 2, zero, 0, NULL); it would work
    Trond> reliably every time. Don't know if this is anything that would
    Trond> cause any problems with any other device but I wanted to share my
    Trond> modifications in case others are having this problem. See svn
    Trond> diff atttached.
    

    Heya Trond,

    I don't feel easy about adding random commands. I don't see such a thing in
    urjtag neither.

    https://github.com/shuckc/urjtag/blob/master/urjtag/src/tap/cable/xpc.c

    There are several options:
    - xc3sprog misses some deinitialization. Can you test with urjtag if your
    devices works well several times with urjtag? Then this missing deinit needs
    to be found and added. Something like this would be the right approach.
    - Or is there anything that can be done programmatical to differentiate your
    device from "normal" xpc" (USB VID/PID or usb strings?. Then the added
    expression can be called only for your "unnormal" device.
    - Or some test with "normal" xps are done with the "double" A6 commands. If
    it works, that's fine too. But I don't have time to do so...

    Thank for your report!

    Uwe Bonnes bon@elektron.ikp.physik.tu-darmstadt.de

    Institut fuer Kernphysik Schlossgartenstrasse 9 64289 Darmstadt
    --------- Tel. 06151 1623569 ------- Fax. 06151 1623305 ---------

     
  • Trond Egil Gran

    Trond Egil Gran - 2017-03-10

    Hi

    I tested with urjtag and I it does not have the same problem.

    The reason I added that extra line is that the next command timed out (xpcu_request_28), I first tried to increase the timeout delay but that did not have any effect, so then I tried to add this command again, I did not know what I was doing :) but it worked for me.

    I can add one more detail:
    after plugging USB and running xc3sprog -c xpc -j
    First time OK: JTAG loc.: 0 IDCODE: 0x24001093 .......
    Second time Fails: usb_control_msg(0x28 12) Connection timed out
    Third time Fails: xpc_usb_open_desc: usb_set_configuration: failed conf 2

    So yes it seems there some deinitialization missing, but I have no idea of what it should be.

     
    • Uwe Bonnes

      Uwe Bonnes - 2017-03-10

      "Trond" == Trond Egil Gran trondegilgran@users.sf.net writes:

      Trond> So yes it seems there some deinitialization missing, but I have
      Trond> no idea of what it should be.
      

      Well, maybe a missing initialization. Urjtag first switches output off!

      Try appended patch...

      Bye

      --
      Uwe Bonnes bon@elektron.ikp.physik.tu-darmstadt.de

      Institut fuer Kernphysik Schlossgartenstrasse 9 64289 Darmstadt
      --------- Tel. 06151 1623569 ------- Fax. 06151 1623305 ---------
      From dba647c03063d303bf7030077b3571ac5158e49e Mon Sep 17 00:00:00 2001
      From: Uwe Bonnes bon@elektron.ikp.physik.tu-darmstadt.de
      Date: Fri, 10 Mar 2017 11:20:58 +0100
      Subject: ioxpc: Initialize like urjtag.


      ioxpc.cpp | 3 ++-
      1 file changed, 2 insertions(+), 1 deletion(-)

      diff --git a/ioxpc.cpp b/ioxpc.cpp
      index 65b346f..d1108f8 100644
      --- a/ioxpc.cpp
      +++ b/ioxpc.cpp
      @@ -156,7 +156,8 @@ int IOXPC::Init(struct cable_t cable, char const serial, unsigned int freq)
      {
      unsigned char zero[2] = {0,0};

      • r = xpcu_request_28(xpcu, 0x11);
      • r = xpcu_output_enable(xpcu, 0);
      • if (r>=0) r = xpcu_request_28(xpcu, 0x11);
        if (r>=0) r = xpcu_output_enable(xpcu, 1);
        if (r>=0) r = xpcu_shift(xpcu, 0xA6, 2, 2, zero, 0, NULL);
        if (r>=0) r = xpcu_request_28(xpcu, 0x12);
        --
        2.10.2
       
  • Trond Egil Gran

    Trond Egil Gran - 2017-03-13

    No, that did not help. I could try on another computer when I have the time, maybe there is a chance it could be something libusb/compiler related, urjtag seems to be using libusb 1. But I do think this particular xpc model needs something else to work as expectd.

    I did some more testing with urjtag and it's not working as well as I first tought. When the Jtag cable is plugged in it's OK, i can do detect chain and it is successful every time even when I close down the progam and start it again. However when I have nothing connected it will just fail saying TDO stuck at 0 and when I connect Jtag it will just say TDO stuck at 1 and I have to replugg USB to get it to work.

    The same thing happens wen with xc3sprog with my additional line, when everything is successfull and jtag is connected it's OK, but if I disconnect the Jtag cable it will lock the programmer untill its replugged.

    So I think there is something else required to get this XPC programmer to work as expected. The reason I started using xc3sprog was that I moved ISE to a server and did not want to use 5 giga bytes for Impac on my PC. And even with the not so perfect behaviour I prefer to use xc3sprog instead of Impact. I may change to a FTDI based solution instead.

     
  • Mike Thomson

    Mike Thomson - 2017-04-04
    Post awaiting moderation.
  • Mike Thomson

    Mike Thomson - 2017-04-04

    Oh, by the way, the only difference I can see between me and the original post is that I'm using a Xilinx Platform Cable USB II (DLC10).

     
  • Philipp Klaus Krause

    While I don't have any reason to assume my platform cable DLC9G is not original (I bought it from Digi-Key more than 10 years ago), I tried this patch, and it fixes https://sourceforge.net/p/xc3sprog/bugs/20/ for me.

    With the patch applied, I can disconnect and reconnect JTAG in between invokations of xc3sprog, never having to disconnect and reconnect USB.

     
    • Philipp Klaus Krause

      Unfortunately, I wrote too soon. The patch does not fully fix the issue for me:

      With the patch applied, I can indeed invoke xc3sprog -c xpc -v as often as I want without running into the bug.

      But if I actually write a .jed file to the device, I still see the problem on the next invokation of xc3prog.

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.