fpga4fun.com Forum Index fpga4fun.com
where FPGAs are fun
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Alternative USB JTAG communication via FX2
Goto page Previous  1, 2, 3  Next
 
Post new topic   Reply to topic    fpga4fun.com Forum Index -> FX2 FPGA boards
View previous topic :: View next topic  
Author Message
fpga4fun
Site Admin


Joined: 18 Sep 2003
Posts: 828

PostPosted: Wed Mar 07, 2007 6:15 am    Post subject: Reply with quote

I got it to work!
I found that I had to remove the @echo command...
Back to top
View user's profile Send private message
kawk



Joined: 23 Apr 2006
Posts: 13

PostPosted: Wed Mar 07, 2007 7:53 am    Post subject: echo Reply with quote

Strange - the first echo fails, the second one works? Probably Make tries the first one as an executable, the second one through a shell...

Just yesterday I found a way to make a proper libfx2.lib that doesn't depend on any external tools. GNU Make itself supports archives:

Code:
CC=sdcc
CFLAGS+=-mmcs51 --no-xinit-opt -I.
CPPFLAGS+=
OBJS=delay.rel fx2utils.rel i2c.rel isr.rel timer.rel usb_common.rel
AR=sdcclib

(%.rel) : %.c
    $(CC) -c $(CFLAGS) $(CPPFLAGS) $< -o $*.rel
    $(AR) -a $@ $*.rel
    rm $*.rel

libfx2.lib: libfx2.lib($(OBJS))


That instructions actually move all the object files into the library file. I believe that's the proper way...

Kolja
Back to top
View user's profile Send private message Visit poster's website
fpga4fun
Site Admin


Joined: 18 Sep 2003
Posts: 828

PostPosted: Wed Mar 07, 2007 6:01 pm    Post subject: Reply with quote

I'm not sure which files I need to modify to try on one of my boards.

hw_basic.c
I probably have to set all the defines to 0
#define HAVE_PS_MODE 0
#define HAVE_AS_MODE 0
#define HAVE_OE_LED 0
and overwrite the sbit definitions, and update the ProgIO_Init(void)

hw_xpcu_i.c
Do I have to also update the defines?
Also have #define HAVE_OE_LED 0 instead of 1

hw_xpcu_x.c
Use #define HAVE_OE_LED 0 ?

usbjtag.c
In void usb_jtag_init(void), I need to change the EPxCFG settings.
Back to top
View user's profile Send private message
kawk



Joined: 23 Apr 2006
Posts: 13

PostPosted: Wed Mar 07, 2007 7:24 pm    Post subject: Reply with quote

Hi,

The hw_basic is basically the original code. I suggest you change only the definitions at the top of hw_basic.c.

Copy hw_basic.c to hw_xylo.c (or whatever you want to name it) and put this in the top of the Makefile or run "make" with argument "HARDWARE=hw_xylo":

Code:
make HARDWARE=hw_xylo


Uncomment or #undef all HAVE_xyz definitions at the top of your hw_xylo.c (defining them as "0" wouldn't work) and choose the right definitions for your I/O configuration in the section just below them. No need to change anything below the #if defined(HAVE_PS_MODE)... line...

You may simply remove all the code that depends on these definitions for your custom hw_xylo.c.

I just see that I mixed some comments wrong in the sbit lines... Hm.

The hw_xpcu* are for running on a Xilinx JTAG cable ("Platform Cable USB", consisting of a FX2 and a CPLD). It is possible to turn a Xilinx cable into an USB-Blaster...

Kolja
Back to top
View user's profile Send private message Visit poster's website
fpga4fun
Site Admin


Joined: 18 Sep 2003
Posts: 828

PostPosted: Wed Mar 07, 2007 9:13 pm    Post subject: Reply with quote

I created an hw_saxo_l.c file, commented the first 3 defines, and updated the sbit definitions. I also updated the void ProgIO_Init(void) (I don't use portE for power, and I use portD instead of portC)

In usbjtag.c, I changed all the EPxFIFOCFG to 0x04, so that portD can be used as IO.

I also changed dscr.a51 to simulate a USB-Blaster. Maybe that's where I screwed up, the board beeps three times after re-numeration.
Back to top
View user's profile Send private message
klingler



Joined: 09 Apr 2007
Posts: 3

PostPosted: Tue Apr 10, 2007 7:57 am    Post subject: Reply with quote

So..what is the actual status of the Cypress FX2 solution now?

Is it really recognized as USB Blaster under Quartus?
And how about firmware loading under Windows?

I have ordered some FX2 samples from Cypress and will make an opensouorce schematic and PCB design so others can benefit as well...


cheers
rick
Back to top
View user's profile Send private message
fpga4fun
Site Admin


Joined: 18 Sep 2003
Posts: 828

PostPosted: Tue Apr 10, 2007 4:34 pm    Post subject: Reply with quote

Sure it works great, you can make the FX2 look like a USB-Blaster.
Firmware loading is done through a Cypress utility that you can download from Cypress website.


Last edited by fpga4fun on Tue Apr 10, 2007 6:03 pm; edited 1 time in total
Back to top
View user's profile Send private message
klingler



Joined: 09 Apr 2007
Posts: 3

PostPosted: Tue Apr 10, 2007 5:50 pm    Post subject: Reply with quote

Kuul (o;


And you used the TSOP56 package as well I saw...
Have you any difference besides pinout from the original code?


So I guess it's time to do schematic and layout...
good excersize to see if PADS2007 evaluation version is
enough for this...


cheers
rick
Back to top
View user's profile Send private message
fpga4fun
Site Admin


Joined: 18 Sep 2003
Posts: 828

PostPosted: Tue Apr 10, 2007 6:05 pm    Post subject: Reply with quote

I had some code differences but I posted them in this topic. It was due to the different ports I am using.
Back to top
View user's profile Send private message
klingler



Joined: 09 Apr 2007
Posts: 3

PostPosted: Wed Apr 11, 2007 7:54 pm    Post subject: Reply with quote

Just received my ECP2 Mico32 board today from Lattice...

And what they're using for USB programming? The CY7C68013A of course, but with a MachXO in between (o;


Oh...Cypress also deliverd 3 CY7C68013A samples which I ordered 2 nights ago (o;


cheers
rick
Back to top
View user's profile Send private message
Dweil



Joined: 09 May 2007
Posts: 1

PostPosted: Wed May 09, 2007 4:56 pm    Post subject: Reply with quote

Hi!

I'm currently also building this great project, with the FTDI chip and the CPLD. The problem is: Quartus hangs when I plug in the home-brew USB blaster. Can someone tell what what I am doing wrong? I already checked all connections, verified the CPLD (I'm using a 7064AETC-44) My target is a Pluto 3 board.

I hope you can help me.

Danny.
Back to top
View user's profile Send private message MSN Messenger
outer_space2



Joined: 09 Oct 2005
Posts: 51

PostPosted: Mon May 21, 2007 12:45 am    Post subject: Reply with quote

Does this software let you program the xylo fpga over fx2 usb?
Back to top
View user's profile Send private message
fpga4fun
Site Admin


Joined: 18 Sep 2003
Posts: 828

PostPosted: Mon May 21, 2007 12:57 am    Post subject: Reply with quote

Yes, it does, although on Xylo, a modification is required (4 wires to solder).
Back to top
View user's profile Send private message
outer_space2



Joined: 09 Oct 2005
Posts: 51

PostPosted: Mon May 21, 2007 2:31 am    Post subject: Reply with quote

So I can program and debug if I do this modification, otherwise I can only program? I'll look closely at this code before asking which 4 wires go where.
Back to top
View user's profile Send private message
fpga4fun
Site Admin


Joined: 18 Sep 2003
Posts: 828

PostPosted: Mon May 21, 2007 2:36 am    Post subject: Reply with quote

Yes, it makes the FX2 simulate a USB-blaster, so you can control the FPGA from Quartus.
Quartus has SignalTap, which allows to get a virtual logic analyzer inside the FPGA - very nice!
Back to top
View user's profile Send private message
jsteele



Joined: 29 Jun 2007
Posts: 5

PostPosted: Fri Jun 29, 2007 9:09 pm    Post subject: Reply with quote

Hi, I have a new Xylo-L board, and I would like to use the usb_jtag software with it. I have read through this thread and have a few questions.

1) On the Xylo-L board, are the JTAG connections the same as mentioned previously ? i.e.,

port D.4 = TDI
port D.5 = TCK
port D.6 = TDO
port D.7 = TMS

2) If so, shouldn't the ports be enabled, instead of the FIFO in the IFCONFIG register ?

i.e., IFCONFIG = 0

In one post you (fpga4fun) had IFCONFIG=3, which would disable port D.

3) On the Xylo-L board, does this JTAG chain include both the Spartan3 FPGA and the LPC2132 ARM CPU ? Which one comes first ?
Back to top
View user's profile Send private message
fpga4fun
Site Admin


Joined: 18 Sep 2003
Posts: 828

PostPosted: Fri Jun 29, 2007 9:20 pm    Post subject: Reply with quote

Actually there are two JTAG chains on Xylo-L, one of the FPGA and one for the LPC.

The port D and the FIFO can be enabled together, because Xylo-L uses the FIFO in 8-bits mode, so port D is free.

Do you want to use usb-JTAG with the FPGA or with the LPC?
Back to top
View user's profile Send private message
jsteele



Joined: 29 Jun 2007
Posts: 5

PostPosted: Fri Jun 29, 2007 10:57 pm    Post subject: Reply with quote

fpga4fun wrote:
The port D and the FIFO can be enabled together, because Xylo-L uses the FIFO in 8-bits mode, so port D is free.


Okay, I get it. That's a nice advantage to an 8-bit wide FIFO.

fpga4fun wrote:

Actually there are two JTAG chains on Xylo-L, one of the FPGA and one for the LPC.

Do you want to use usb-JTAG with the FPGA or with the LPC?


Actually, I think I answered my own question using a multimeter ;-} I got the following :

D.0 FPGA TCK
D.1 FPGA TDO
D.2 FPGA TDI
D.4 FPGA TMS

D.3 LPC TMS
D.5 LPC TCK
D.6 LPC TDI
D.7 LPC TDO

Is this right ?
Back to top
View user's profile Send private message
fpga4fun
Site Admin


Joined: 18 Sep 2003
Posts: 828

PostPosted: Sat Jun 30, 2007 12:41 am    Post subject: Reply with quote

Looks good.
Back to top
View user's profile Send private message
sewsew



Joined: 22 Aug 2007
Posts: 2

PostPosted: Wed Aug 22, 2007 3:09 pm    Post subject: Reply with quote

Hello guys.

Im trying to make a custom USB-JTAG Board using the FX2, and i have some problems with it.

My pc views perfectly the FX2 as an ALTERA-BLASTER, after i uploaded the firmware etc.

When i run Quartus, and i start to detect (into the Hardware Setup into the Programmer Window), Quartus does not respond, it becames "time out", and i have to finish the program with the task manager.

But if i try with the evaluation board (SAXO-L rev.A), Quartus works perfectly.

Well, i don't know what i am doing wrong with the FX2.

I tried with and without EPROM (the pull-up resitors are always on at the I2C pins).

All the GNDs and VCCs are connected, the USB wires are ok, and i am using the PD0...PD3 like the original board.

There aren't shortmakes, my board is not damage... just i checked all the electrical parts, and everything is ok.

Well hehe, i am open for everything.... thx guys for your answers
Back to top
View user's profile Send private message
fpga4fun
Site Admin


Joined: 18 Sep 2003
Posts: 828

PostPosted: Wed Aug 22, 2007 3:18 pm    Post subject: Reply with quote

Make sure the FX2 pin WAKEUP is high. It's probable not the reason, but it is high on Saxo-L.
Back to top
View user's profile Send private message
sewsew



Joined: 22 Aug 2007
Posts: 2

PostPosted: Wed Aug 22, 2007 4:17 pm    Post subject: Reply with quote

Yes, thx for your quick answer.

WAKEUP is HIGH and RESERVED is GROUND.

Any special config for talk over the PD0...PD3 ?

Im using an external 24MHz clock too (I use only the clk IN). The Saxo is using a resonator one using boths.
Back to top
View user's profile Send private message
guopo



Joined: 05 Sep 2007
Posts: 1

PostPosted: Wed Sep 05, 2007 3:03 pm    Post subject: Reply with quote

Kawk, Thanks for your great work!!

Now, I changed source code as fpga4fun did and work well. I changed VID,PID (09FB, 6001), so it can be renumerated as usb-blaster. I saw you said that it can be usb-jtag-if have its own VID PID, but i can't find any driver for windows. so if i use your VID,PID, how can setup device?


Thanks!
Back to top
View user's profile Send private message
outer_space2



Joined: 09 Oct 2005
Posts: 51

PostPosted: Thu Sep 06, 2007 5:39 pm    Post subject: Reply with quote

I know this is probably a 'no' but is it technically possibly to port this to a usb 1.1 chip?
Back to top
View user's profile Send private message
Lonsn



Joined: 15 Oct 2007
Posts: 1

PostPosted: Mon Oct 15, 2007 9:02 am    Post subject: How about the code download speed of FX2 usb-jtag? Reply with quote

I want to know about the bit download speed using FX2 usb-jtag (Compared to using FTDI chips).
Thanks!
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    fpga4fun.com Forum Index -> FX2 FPGA boards All times are GMT
Goto page Previous  1, 2, 3  Next
Page 2 of 3

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group