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 API overs EP1

Started by oro06, August 07, 2013, 09:59:49 AM

Previous topic - Next topic

oro06

Good morning,

it seems that something is going wrong when sending any request to EP1 via TE_API.

in fact,  any TE_USB_FX2_SendCommand return true (success) but no data are transfered

test 1°)
with a recently received te0320 module with stock firmware for both fx2 and fpga
running TE_USB_FX2.gen_3/TE_USB_FX2.Cpp/TE_USB_FX2_CyAPI_SampleApplication (from github)
1:Get number of cards ->
1
2: Connect cardNo 0 ->
Module is connected!
5:Get FX2 firmware version ->
Major version: 224
Minor version: 253
Device hi: 18
Device lo: 0

we expect here fw version :  3.2.1.1
as from fw:te_api.c line 107
case   CMD_READ_VERSION:
EP1INBUF[0] = fx2_ver_maj_;
EP1INBUF[1] = fx2_ver_min_;
EP1INBUF[2] = fx2_tip_maj_;
EP1INBUF[3] = fx2_tip_min_;
new_data = 1;
break;
and from fw:te_api.h
// Version Definition
#define fx2_ver_maj_    3
#define fx2_ver_min_   2
#define fx2_tip_maj_    1
#define fx2_tip_min_   1

this was also tested several times and with other TE0320 boards
same result.

test 2°)
using direct CyAPI.dll with proper endpoint (0x01 for sending and 0x81 for reading) and timout configured to 2000
Command[0]=CMD_READ_VERSION; //0x00
CmdLength=64;
bResultCommand=BulkEP->XferData(Command, CmdLength);

in return bResultCommand=True but CmdLength=0 instead or 64

test 3°)
using cypress CyConsole v1.7.0.2 and with EZ-USB Interface sending '00' to ep1 ->
Bulk OUT Transfer
Bulk OUT success.
Buffer Contents
0000 
you can see here after 0000 there is nothing we should have displayed transfered datas

test 4°)
using cypress CyControl and sending '00' to ep1 ->
BULK OUT transfer
Zero-length data transfer completed

please note that with non stock fpga bitgen uploaded
using same method i can send successully bulk write to EP8 and read form EP86
so don't think it's a driver issue (i'm using TE_USB_FX2_32.sys drivers version 3.4.7.0)

would you mind letting me know if you can reproduce this  ?

thank & regards
OR

Hengist

#1
Hello OR.

(0) We do not have a 32 bit operating system to test on at this moment. We tried to reproduce your problem with a TE0320 and a 64 bit Microsoft Windows operating system, but everything worked fine. Anyway, we have tested long time on 32 bit Microsoft Windows operating systems as well before releasing our whole technology stack.
The code published on GitHub is for 32 bit systems and doesn't run well (or at all) on 64 bit systems. The library must be tweaked a bit (modify project properties and change the libraries from 32 to 64 bit) for 64 bit systems s explained in http://www.trenz-electronic.de/fileadmin/docs/Trenz_Electronic/TE-USB-Suite/generation_3/APIs/UM-TE_USB_API.cpp.pdf (section 7).
If you write your own software project, you must import the two .h files contained here
https://github.com/Trenz-Electronic/TE-USB-Suite/tree/master/TE_USB_FX2.gen_3/TE_USB_FX2.Cpp/FilesToImportForApplicationCpp
into your software project. If they already exist, you shall overwrite them.

(1) At the moment we are not able to reproduce your error because this is a kind of error that occurred to us during the development phase, such as for instance
(1a) corrupted firmware file;
(1b) system conflicts between the old (2nd) generation DEWESoft driver (particularly on Windows XP systems) and the new (3rd) generation Trenz Electronic driver.

(2) If you are using the 3rd generation technology stack, you should check that in "Device Manager" a device is registered as "Trenz Electronic USB FX2" under the "Trenz Electronic USB devices" class. Otherwise, the driver is not correctly installed.
Download the latest 3rd generation driver here:
http://www.trenz-electronic.de/download/d0/Trenz_Electronic/d1/TE-USB-Suite/d2/generation_3/d3/drivers.html
Follow the procedure described in the pdf file. We are migrating documentation in our wiki pages:
https://wiki.trenz-electronic.de/display/TEUSB/Device+Driver+Layer

(3) Are you sure that your firmware is not corrupt?
Could you repeat the firmware update
https://github.com/Trenz-Electronic/TE-USB-Suite/blob/master/TE_USB_FX2.firmware/ready_for_download/TE-USB-FX2_v03.02_TE.iic
using Cypress USB Console (CyConsole)?
For the recovery procedure you should
a) Put EEPROM switch on your module to "OFF" state.
b) Connect module to PC, using USB cable.
c) Install Cypress generic driver if needed.
d) Put EEPROM switch on your module to "ON" state.
e) Run Cypress USB Console.
f) Go Options->EZ-USB Interface
g) Press "Lg EEPROM" button
h) Select TE-USB-FX2_v03.02_TE.iic from firmware folder ready_to_download
i) Wait till operation completed
f) Reconnect module from USB

(4) Did you test hardware-verified reference designs for 32 bit systems (if you actually use a 32 bit system)?
http://www.trenz-electronic.de/download/d0/Trenz_Electronic/d1/TE-USB-Suite/d2/generation_3/d3/reference_designs/d4/TE_USB_FX2.Cpp.html
http://www.trenz-electronic.de/fileadmin/docs/Trenz_Electronic/TE-USB-Suite/generation_3/reference_designs/TE_USB_FX2.Cpp/executable-32.zip
http://www.trenz-electronic.de/fileadmin/docs/Trenz_Electronic/TE-USB-Suite/generation_3/reference_designs/TE_USB_FX2.Cpp/TE_USB_FX2_CyAPI_SampleApplication-32-VSExpress+VSProfessional.zip

If you use a 64 bit system, hardware-verified reference designs for 64 bit systems are also available.
http://www.trenz-electronic.de/fileadmin/docs/Trenz_Electronic/TE-USB-Suite/generation_3/reference_designs/TE_USB_FX2.Cpp/TE_USB_FX2_CyAPI_SampleApplication-64-VSExpress.zip
http://www.trenz-electronic.de/fileadmin/docs/Trenz_Electronic/TE-USB-Suite/generation_3/reference_designs/TE_USB_FX2.Cpp/TE_USB_FX2_CyAPI_SampleApplication-64-VSProfessional.zip
http://www.trenz-electronic.de/fileadmin/docs/Trenz_Electronic/TE-USB-Suite/generation_3/reference_designs/TE_USB_FX2.Cpp/executable-64.zip

Note:
If the hardware-verified reference designs for 32 bit systems work on your 32 bit system experiencing the issues you described, then
(4a) either you shall double check your Visual Studio setting
(4b) or we shall check our code on GitHub for 32 bit
We invite you to open and test the whole 32 bit project above.

(5) Did you set your switches correctly?


Please reply giving full details of your working environment (operating system version, firmware version, driver version, ...)

oro06

Dear Hengist,

thanks for your fast answer and help, very much appreciated.

0..2)sorry for lack of informations : i'm using:
XP32 SP3 VM inside VirtualBox v4.2.16 host PC is Debian Jessie x64

TE_USB driver was from early 2013, gen 3
but anyway i re-download it an re-installed it again then reboot

in the device manager, it appear in a separate branch 'Trenz Electronic USB FX2'
and inside there is only one device 'Trenz Electronic USB FX2'

then re-test :
t1)cyconsole just sending 64x 0x00 bytes to 0x01 : bulk out complete
but no data transfered
then reading 64 bytes from EP 0x81 : bulk in complete
but no data received
t2)with reference application re-downloaded (mine was from early 2013 github)
http://www.trenz-electronic.de/fileadmin/docs/Trenz_Electronic/TE-USB-Suite/generation_3/reference_designs/TE_USB_FX2.Cpp/TE_USB_FX2_CyAPI_SampleApplication-32-VSExpress+VSProfessional.zip

1:Get number of cards ->
1
2: Connect cardNo 0 ->
Module is connected!
5:Get FX2 firmware version ->
Major version: 224
Minor version: 253
Device hi: 18
Device lo: 0

instead of
Major version: 3
Minor version: 2
Device hi: 1
Device lo: 1

3)ok this is the method i use to flash
i've redone it right now with the indicated download :
https://github.com/Trenz-Electronic/TE-USB-Suite/blob/master/TE_USB_FX2.firmware/ready_for_download/TE-USB-FX2_v03.02_TE.iic

then test
t1)cyconsole → same result : fail
t2) TE_USB_FX2_CyAPI_SampleApplication-32-VSExpress+VSProfessional : fail

i've also tried with an older firmware from nov 2012
https://github.com/Trenz-Electronic/TE-USB-Suite/commit/4508a66dc81c95050e0cd685e9c6fbeda280ebfb
same result

4+note)yes it is 32bits
actual plan is not to compile anything but use the same binaries as yours to be aligned and have at least one setup running here

considering even an old firmware marked as 'verified' is not working i think it's possibly due to
either virtualbox, or my xp32 driver broken/filtered by something

i'm setting up a fresh windows 7 x64 physical machine and let you know

thanks & regards
OR


oro06

Hi,

so re-testing with fresh XPx32 and W7x64 install shown that, EP1 is running as expected
sorry for raising a false alarm and thanks again for your help.

as side note,
virtual box was faulty here,
by unchecking usb2.0 in the vm settings solved the issue
(seems that 64bytes buffer for EP1 in FX2LP being not compliant with USB2.0 that requires 512bytes is driving vbox a wrong path)

thanks & regards
OR

Horsa

#4
Dear ORO6,
thank you for sharing your workaround to the Virtualbox bug.
I have submitted this post to the Virtualbox community (Ticket #12030).
Regards,
- Horsa