UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Observer ahansson
Observer
15,639 Views
Registered: ‎04-13-2010

Using the EZ-HOST (CY7C67300) on a ML605 board

Jump to solution

Dear all, 

 

For a few days now I have been struggling to get the EZ-HOST/CY7C67300 to do anything useful, but with little success. I have observed a number of odd behaviours:

 

1) When the ML605 board powers up, it seems that the CY7C67300 sporadically comes out of reset properly in standalone mode (despite the reset pin being connected to the FPGA), and in those cases it loads the Cypress default BIOS successfully. This is with the J39 ("Abort boot") open. In these cases the board enumerates as a peripheral (0x04b4/0x7200 Cypress Semiconductor Corp) with the PC (host) and I can use e.g. libusb to interact with the simple endpoints setup by the BIOS. Everything seems to be fine, but there is no way to interact with the CY7C67300 as the FPGA is not programmed.

 

2) With the ML605 built-in self test reference design comes a "hello_key" application that is disabled. This application relies on the xps_epc to interact with the HPI of the CY7C67300. The reset pin of the latter (usb_reset_n) is attached to the reset generator of the example. However, the CY7C67300 needs 1.3 us of reset and from what I can tell it never properly comes out of reset using the example. The reset generator only keeps the (inverted) peripheral reset low for 16 cycles at 100 MHz (the speed of the uBlaze). The result is that when the FPGA is programmed, the CY7C67300 does not even load the BIOS properly and the PC does not enumerate it. Any attempt to interact with the CY7C67300 using the HPI (over the EPC) fails and the status bits are 0xFFFF.

 

3) Inspired by the ML40x example that uses the USB controller in host mode (to interact with a USB keyboard), I connected the reset of the CY7C67300 to a memory-mapped xps_gpio module and keep the reset low for a few ms. After this, the CY7C67300 enumerates (0x04b4/0x7200 Cypress Semiconductor Corp) with the PC, but as soon as a control connection (to end-point 0) is opened, the device seems to go into an error state from which it does not return until hard reset. This seems to suggest that the CY7C67300 is no longer in standalone mode or that the contents of the EEPROM has modified one or more of the default handlers.

 

In all these cases, what confuses me is that there is no documentation on J39 ("Abort boot") and the U5 EEPROM from which the CY7C67300 supposedly boots. There seems to be no good way to get the CY7C67300 to boot properly into standalone mode in a "deterministic" fashion. The latter only happens sporadically on power up, which leads me to believe that it is merely a result of a fortunate reset and GPIO30 & GPIO31 being interpreted as 11 (standalone). I do not see how the J39 jumper and how the EEPROM is intended to be used. The IIC bus of the EEPROM is only connected tot he CY7C67300 and there is no documentation on what code it contains. From the examples you would hope that the code in the EEPROM would enable the HPI, but how to check?

 

Did anyone get further with the CY7C67300? Did anyone actually manage to use the HPI to interact with the chip? Does anyone have an educated guess on J39 and how to inspect/modify the contents of U5?

 

All ideas are appreciated at this point.

 

 

 

0 Kudos
1 Solution

Accepted Solutions
Observer ahansson
Observer
19,485 Views
Registered: ‎04-13-2010

Re: Using the EZ-HOST (CY7C67300) on a ML605 board

Jump to solution

Dear all,

 

I decided to reply to my own post as I have made considerable progress over the last week, and hopefully can save someone else both time and frustration by sharing my experience.

 

The first step in getting the EZ-HOST working properly is indeed a proper reset timing. The examples that use the inverted peripheral reset are fine most of the time, but are not robust as the actual time is much shorter than the 1.3 us prescribed by the EZ-HOST. My solution is to fall back on using a memory-mapped xps_gpio module to generate the reset signal. With the default of that module set to output and 0x0 I simply have to set it to one after a sufficiently long usleep.

 

The second step in getting the EZ-HOST to do something useful is to place a jumper over J39 and thus short the I2C bus of the chip. This will result in the EZ-HOST booting a factory BIOS and enumerate as 0x04b4 0x7200. From here, the next step is to download the Cypress EZ-HOST development kit. This includes a complete Cygwin cross-compiler environment to build firmware for the EZ-HOST. The development kit also includes the Windows USB drivers for interaction with the BIOS, and a Windows command line tool (qtui2c) to program the EEPROM via the USB.

 

The third step is to write firmware for the EZ-HOST, and I simply started from one of the design examples shipped with the development kit. The crucial point is to enable the HPI, despite the EZ-HOST being booted into stand-alone mode and reading from the EEPROM. After much reading of the various documents on Cypress website I found that adding a __asm("call 0xe7c6") to the initialisation routine does the trick.

 

Next, compile the firmware, remove the jumper over J39, use qtui2c to program the new firmware into the EEPROM, and finally reset the EZ-HOST.

 

At this point, the EZ-HOST should enumerate according to your firmware, and enable the HPI during the booting process. Give the EZ-HOST a few tens of ms to reset before you attempt to access it via the HPI. The final step is to try the HPI access from a MicroBlaze. A crucial point here is the address bus of the EZ-HOST. The xps_ehc I set to 4 bit address output, and then add a util_bus_split to drop the 2 LSBs. The resulting two bits are connected to the pins driving A0 and A1 of the EZ-HOST. For some reason the ordering of the bits [0:n] for Xilinx and [n:0] for Cypress has caused the mailbox and address to be shifted in my case, but maybe that can be fixed through the ordering in the UCF file. 

 

In my current setup, the EZ-HOST firmware creates a number of endpoints and enables the HPI. A Linux PC interfaces with the USB side using libusb and the MicroBlaze in turn interacts with the EZ-HOST using the HPI. The resulting solution is working fine and seems robust and consistent. In conclusion: Problem solved!

 

Tags (4)
10 Replies
Observer ahansson
Observer
19,486 Views
Registered: ‎04-13-2010

Re: Using the EZ-HOST (CY7C67300) on a ML605 board

Jump to solution

Dear all,

 

I decided to reply to my own post as I have made considerable progress over the last week, and hopefully can save someone else both time and frustration by sharing my experience.

 

The first step in getting the EZ-HOST working properly is indeed a proper reset timing. The examples that use the inverted peripheral reset are fine most of the time, but are not robust as the actual time is much shorter than the 1.3 us prescribed by the EZ-HOST. My solution is to fall back on using a memory-mapped xps_gpio module to generate the reset signal. With the default of that module set to output and 0x0 I simply have to set it to one after a sufficiently long usleep.

 

The second step in getting the EZ-HOST to do something useful is to place a jumper over J39 and thus short the I2C bus of the chip. This will result in the EZ-HOST booting a factory BIOS and enumerate as 0x04b4 0x7200. From here, the next step is to download the Cypress EZ-HOST development kit. This includes a complete Cygwin cross-compiler environment to build firmware for the EZ-HOST. The development kit also includes the Windows USB drivers for interaction with the BIOS, and a Windows command line tool (qtui2c) to program the EEPROM via the USB.

 

The third step is to write firmware for the EZ-HOST, and I simply started from one of the design examples shipped with the development kit. The crucial point is to enable the HPI, despite the EZ-HOST being booted into stand-alone mode and reading from the EEPROM. After much reading of the various documents on Cypress website I found that adding a __asm("call 0xe7c6") to the initialisation routine does the trick.

 

Next, compile the firmware, remove the jumper over J39, use qtui2c to program the new firmware into the EEPROM, and finally reset the EZ-HOST.

 

At this point, the EZ-HOST should enumerate according to your firmware, and enable the HPI during the booting process. Give the EZ-HOST a few tens of ms to reset before you attempt to access it via the HPI. The final step is to try the HPI access from a MicroBlaze. A crucial point here is the address bus of the EZ-HOST. The xps_ehc I set to 4 bit address output, and then add a util_bus_split to drop the 2 LSBs. The resulting two bits are connected to the pins driving A0 and A1 of the EZ-HOST. For some reason the ordering of the bits [0:n] for Xilinx and [n:0] for Cypress has caused the mailbox and address to be shifted in my case, but maybe that can be fixed through the ordering in the UCF file. 

 

In my current setup, the EZ-HOST firmware creates a number of endpoints and enables the HPI. A Linux PC interfaces with the USB side using libusb and the MicroBlaze in turn interacts with the EZ-HOST using the HPI. The resulting solution is working fine and seems robust and consistent. In conclusion: Problem solved!

 

Tags (4)
Observer arthornton
Observer
15,090 Views
Registered: ‎06-21-2010

Re: Using the EZ-HOST (CY7C67300) on a ML605 board

Jump to solution

Hi,


I'm trying to get the CY7C67300 to work on an ML402 board and am having the same issues with 3 drivers, CyUSBGen.sys, CYUSB.sys and WinUSB.sys.

 

In regards to your first step, when you say memory-mapped xps_gpio module, are you referring to HDL programming of the FPGA to generate the reset?

 

My application only needs to transfer one batch of sequential data from the ML402 to a PC via the CY7C67300 USB.

0 Kudos
13,594 Views
Registered: ‎10-12-2009

Re: Using the EZ-HOST (CY7C67300) on a ML605 board

Jump to solution

Hi all,

 

I am also trying to bring-up cypress CY7C67300 on a ML605 board. Ahansson, thank you for very useful info - it's the best I could find on the web. 

 

I have question about "hello_key" application. Where did you find it? I find built-in self test but inside there is no any xps_epc test application. 

Tags (3)
0 Kudos
Visitor kylet92
Visitor
13,380 Views
Registered: ‎10-13-2011

Re: Using the EZ-HOST (CY7C67300) on a ML605 board

Jump to solution

Hi all,

 

I'm also trying to use the CY7C67300 on an ML605 board, and I've run into, I think, a slightly different problem. I have no issue getting the CY7C67300 to enumerate while connected to a PC, but as soon as I program the FPGA with a useful bitstream, the Cypress chip disconnects and I can't get it back without a hard reset. However, this occurs before I even try to access it via HPI and hold the reset low for a while.

 

Am I missing something? Any input would be greatly appreciated. Thanks in advance!

 

EDIT: Solved. I was using XPS 12.4. When I switched to v13.2, this issue went away. 

0 Kudos
Visitor kylet92
Visitor
12,958 Views
Registered: ‎10-13-2011

Re: Using the EZ-HOST (CY7C67300) on a ML605 board

Jump to solution

I've been struggling with getting the CY7C67300 to work correctly for some time and finally got it functioning correctly. I thought I would share my major issue with everyone so no one else has this same problem. 

 

The 67300 is a LITTLE - ENDIAN chip. If you use a microblaze with a PLB bus, the microblaze runs in big-endian mode. Using an AXI bus puts the microblaze in little-endian mode, or you can use the PLB bus and half word swap everything you need to send to the 67300. 

 

Hope this helps!

0 Kudos
Visitor sunleisls
Visitor
12,615 Views
Registered: ‎03-14-2012

Re: Using the EZ-HOST (CY7C67300) on a ML605 board

Jump to solution

Hi,

I am excited to find your post! I have been struggling with the communication between Microblaze and cy7c67300 for some times, and I want to pass the data at u-disk which is in USB Port1A of 67300 to EZ-Host, then pass the data to the Microblaze through HPI. My board is a custom board and the FPGA chip is V5LX110T. I make success in the usb keyboard demo without Linux OS on the Microblaze, and now I want to read the data at u-disk though HPI without Linux OS, but it doesn’t work. So I think that the Linux OS is necessary after looking for mass documents at Cypress and Xilinx website. Above on, I want to ask you 2 qustions.

1. Can I achieve my project with Linux OS on Microblaze or is there any better way?

2. Which free Linux OS is appropriate to the Microblaze of my FPGA chip?

 

Regards

0 Kudos
Visitor kylet92
Visitor
12,571 Views
Registered: ‎10-13-2011

Re: Using the EZ-HOST (CY7C67300) on a ML605 board

Jump to solution

Hi,

 

The answer I eventually got from Cypress and Xilinx support is that you either need to run Linux on the Microblaze, or convert the Cypress Linux drivers to run natively on the Microblaze.  Check out this link for information on which version of Linux : http://wiki.xilinx.com/microblaze-linux.

 

Hope that helps.

 

0 Kudos
Visitor kermani
Visitor
12,200 Views
Registered: ‎06-26-2012

Re: Using the EZ-HOST (CY7C67300) on a ML605 board

Jump to solution
Hi, I have a same problem. I need to attach usb flash to xupv5 board and perform read/write from/to usb flash using cy7c67300 in HPI mode. I have been ran keyboard example and veything is ok, but I don't know how can perform read/write with usb flash attached to xupv5 board. Can you guide me? Thanks kermani
0 Kudos
Visitor jenjel
Visitor
12,114 Views
Registered: ‎05-30-2012

Re: Using the EZ-HOST (CY7C67300) on a ML605 board

Jump to solution

What did you do please to drive the HPI cypress cy7c67300 usb controller ?

0 Kudos
1,086 Views
Registered: ‎11-22-2017

Re: Using the EZ-HOST (CY7C67300) on a ML605 board

Jump to solution

 Hello sunleisls,can please share the code to configure Host controller with FPGA ,communicating with keyboard.

0 Kudos