News:

Attention: For security reasons,please choose a user name *different* from your login name.
Also make sure to choose a secure password and change it regularly.

Main Menu

TE0320 TE-USB-SUITE

Started by oro06, November 14, 2012, 02:48:35 PM

Previous topic - Next topic

oro06

Hi All,

i'm willing to transfert datas from vhdl core to pc via FX2 at 5MB/s min. without using microblaze core.
due to speed requirement, vcom solution is not an option
TE-USB-SUITE(git repo) contain drivers, firmware (fx2) and pc side sample code but no hdl
and in refererence design repo there is a core for µb using dma
is there any working sample sending (even fpga generated random values) through fx2 ?

thanks & regards
OR

Oleksandr Kiyenko

Hi oro06,

1. Maximum vcom transfer speed it's much more than 115200, but it's depend on OS/system settings. Going to test it, to know average bandwidth.

2. If you want to use packet transfer via API, it's simple to make such project from vcom code
To make vcom hdl work with API you have to made 2 simple changes in vcom hdl code:
* Change read EP from EP2 to EP8
* Change usb_empty from USB_FLAGA to USB_FLAGD
Then you can send data from host PC to EP8 and receive from EP6

Best Regards


oro06

Thanks Oleksandr,

Client PC have a 6core cpu+4GB ram OS is XP32

not sure if xp driver accept more than 128000 bps

regarding using packet transfert via API modifying the vcom hdl code as you suggested
with no stall on both fpga and PC side what could be expected transfert speed ?

would you please confirm the following steps are correct : (files from git repos)

a) flash FX2 with  TE-USB-SUITE/TE_USB_FX2.firmware/ready_for_download/TE_USB_FX2-v03.01.iic
b) use libs/dll from TE-USB-SUITE/TE_USB_FX2.firmware/te_usb_api.ver.3.1/
c)install XP32 drivers  on PC
http://www.trenz-electronic.de/download/d0/Trenz_Electronic/d1/TE-USB-Suite/d2/generation_3/d3/drivers.html
->TE_USB_FX2-drivers.zip
no need to install vcom drivers ?

d)i'm then able to run samples application from TE-USB-SUITE/TE_USB_FX2.gen_3 right ?

Thanks & regards
OR

Oleksandr Kiyenko

Hi oro06,

> not sure if xp driver accept more than 128000 bps
Think that it much faster, but can't tell you exact speed now. Need to test it.
Actually driver not care about transfer speed, baudrate you set for COM port it's just parameter for hardware. Think that speed will be more that 2 MB/s

> regarding using packet transfert via API modifying the vcom hdl code as you suggested
> with no stall on both fpga and PC side what could be expected transfer speed ?
Depending on host hardware ~20 MB/s

> would you please confirm the following steps are correct : (files from git repos)
All correct

> no need to install vcom drivers ?
No needed, if you not use vcom firmware.

> d)i'm then able to run samples application from TE-USB-SUITE/TE_USB_FX2.gen_3 right ?
Not complete application, (because it mostly works with microblaze), but part which send and receive packets to endpoints.
TE_USB_FX2_SetData(ref TE_USB_FX2_USBDevice, ref buffer, ref packetlen, PI_EP8, TIMEOUT_MS, BUFFER_SIZE)
TE_USB_FX2_GetData(ref TE_USB_FX2_USBDevice, ref buffer, ref packetlen, PI_EP6, TIMEOUT_MS,BUFFER_SIZE)

Best Regards




oro06

Many Thanks for your help Oleksandr,
i'll have a try.
(btw, could be helpful to have a working sample available in the repos along with blink and other samles...you guys are running at full throttle with this fx2 µc )

oro06

Hi Oleksandr,

i had a try to these changes in order to use API without microblaze :
"* Change read EP from EP2 to EP8
* Change usb_empty from USB_FLAGA to USB_FLAGD"
it appear that i could send datas (64B up to 64KB)  on EP8OUT but reading EP6IN returned only 2 bytes in any case

looking deeper in te_usb_api.ver.3.2/fw.c  i found some explanation :

https://github.com/Trenz-Electronic/TE-USB-Suite/blob/master/TE_USB_FX2.firmware/te_usb_api.ver.3.2/fw.c
line 63 and 64 :
PINFLAGSAB = 0x00;   SYNCDELAY;   //FA: EP6E, FB: EP6F
PINFLAGSCD = 0xB0;   SYNCDELAY;   //FC: EP6P, FD: EP8 EF

according to my understanding of FX2LP reference manual, with value 0,  flags A,B and C are not tied to EP6 but to the current EP defined in fifoadr
this leading to an incorrect reading of hdl code in

https://github.com/Trenz-Electronic/TE03XX-Reference-Designs/blob/master/vcom-TE0320/src/top.vhd
line 138 :
            if(usb_full = DISABLE)then      -- If FX2 FIFO not full
at this moment fifoadr is still assigned to EP8OUT and not EP6IN

to verify this i've added :
line 135:
            fifoadr      <= EP6ADR;         -- change fifoadr earlier as usb_full indexed on current fifoadr


now i still read 2 bytes packets but as many as expected eg corresponding to the sent ones.
small packets are maybe due to "pktend   <= ENABLE;" asserted to each byte
will add counters to assert it only when required

so, IMHO, in case you plan to make any update in fw.c , there are few comments typos  :

line 63 and 64 :
PINFLAGSAB = 0x00;   SYNCDELAY;   //FA: EP6E, FB: EP6F
PINFLAGSCD = 0xB0;   SYNCDELAY;   //FC: EP6P, FD: EP8 EF

could be something like :
PINFLAGSAB = 0x00;   SYNCDELAY;   //FA: EPxP, FB: EPxF
PINFLAGSCD = 0xB0;   SYNCDELAY;   //FC: EPxE, FD: EP8E

line 50 to 53 :
EP2CFG = 0xE2; SYNCDELAY;      // EP2 IN, bulk, size 512x2
EP4CFG = 0xE0; SYNCDELAY;      // EP4 IN, bulk, size 512x2
EP6CFG = 0xE2; SYNCDELAY;      // EP6 IN, bulk, size 512x2
EP8CFG = 0xA0; SYNCDELAY;   // EP8 OUT, bulk, size 512x2

could be something like :
EP2CFG = 0xE2; SYNCDELAY;      // EP2 IN, bulk, size 512x2
EP4CFG = 0xE0; SYNCDELAY;      // EP4 IN, bulk, size 512x4
EP6CFG = 0xE2; SYNCDELAY;      // EP6 IN, bulk, size 512x2
EP8CFG = 0xA0; SYNCDELAY;   // EP8 OUT, bulk, size 512x4

thanks & regards
OR

Oleksandr Kiyenko

Hi oro06,
Thanks for your update. I correct  comments for PINFLAGS in source code.
As for
EP4CFG = 0xE0; SYNCDELAY;      // EP4 IN, bulk, size 512x2
EP8CFG = 0xA0; SYNCDELAY;   // EP8 OUT, bulk, size 512x2
it's correct - EP4 and EP8 it's "small" EPs and can't be x4.

Best Regards