Cypress Perform

Home > Design Support > Cypress Developer CommunityTM > Cypress Forums > USB Controllers > How to reload from EEPROM without fysical reconnect device

Bookmark and Share
Cypress Developer CommunityTM
Forums | Videos | Blogs | Training | Rewards Program | Community Components



How to reload from EEPROM without fysical reconnect device
Moderator:
RSKV

Post Reply
Follow this topic



How to reload from EEPROM without fysical reconnect device

Gijs posted on 16 Mar 2012 8:54 AM PST
Member
4 Forum Posts

I use the Cypress Vend_Ax.hex firmware file (loaded in RAM) to write our own firmware to the EEPROM.

Our own firmware is converted to IIC format using the Hex2bix tool and contains a dummy string for the serial number.

Upon write to the EEPROM, this dummy string will be replaced by an unique serial number.

 

This is working fine, but the device must be disconnected (or power-down) in order to start with the newly written firmware.

Is it possible to trigger the FX2LP to load the EEPROM by itself? (a sort of hard reset/reboot)

Another possibility I could think of was to load our firmware also to the RAM (using vendor-request 0xA0) after writing to the EEPROM. But then I need to have the hex-format again and change the serial in that version also. Problem is that the characters of the dummy serial doesn't have to be in one consecutive row, which makes the replacement a bit more difficult.

Is it possible to convert the IIC format back to a format I can program to the RAM directly?

What has to be done to do this?




Re: How to reload from EEPROM without fysical reconnect device

Gayathri posted on 17 Mar 2012 11:03 AM PST
Cypress Employee
428 Forum Posts

 Hi,

 

You can find the source for Hex2bix utility at the location: C:\Cypress\USB\Util after installing FX2LP DVK. From that you can get to see what is being done to convert hex to an iic. If you can do the reverse of the same, you can convert iic to a hex file. 

 

Regards,

Gayathri



Re: How to reload from EEPROM without fysical reconnect device

PRJI posted on 17 Mar 2012 12:14 PM PST
Cypress Employee
333 Forum Posts

Hi,

       It is not  possible to trigger (a sort of hard reset/reboot)  FX2LP by itself.

 



Re: How to reload from EEPROM without fysical reconnect device

Gijs posted on 30 Mar 2012 02:28 AM PST
Member
4 Forum Posts

Just for future reference, might someone encounter the same problem.

 

I've managed to get it working, It's done as follows:

I've written a HexData object which can read .hex (see description of HEX-format here: http://www.keil.com/support/docs/1584.htm ) and IIC-format (see section 3.4.3  "Serial EEPROM Present, First Byte is 0xC2" in EZ-USB_TRM.pdf). Note that the end of an IIC-file is marked by a "1" as most significant bit in the length-field. (I missed that at first)

This is stored internally as a list of std::vectors to keep the information about the gaps between the data-blocks. (along with each vector I store the address of the 1st item)

This can be "Compressed" by searching for blocks which occupy the "next" address after a block and then concatenate them. When you compress the information, you can search for strings to replace (note the indianess of the strings, which is little-endian, while the length- and address-fields in the hex- and iic-format are big-endian) because they will not be interrupted by an end-of-vector.

After "compression" and replacing the appropriate (wide)strings you'll have to regenerate a IIC-file again to upload to the EEPROM starting at address 0.

The HEX-file must be "interpreted" when writing to RAM. So writing a number of bytes starting at address X must really write at those addresses in RAM. Write to RAM is done using Vendor Request 0xA0.

- first put the 8051 to reset (write '1' to RAM address 0xE600 for the FX2LP).

- write Vend_Ax.hex to the RAM

- clear reset (write '0' to RAM address 0xE600

- write entire IIC-file with own firmware to EEPROM using Vendor Request 0xA9 (for small (<= 256 bytes) EEPROM use 0xA2) starting at address 0

- put 8051 to reset

- write hex of own firmware to RAM using 0xA0

- clear 8051 reset

- cycle port (see CyUSB.pdf "IOCTL_ADAPT_CYCLE_PORT")

 

Now Windows will find a new device and install a driver for it. This will be an entire new entry when a serial number is being used which is never been seen on that PC.

 

This can also be used for other purposes which require a temporary firmware, like updating the firmware of a connected FPGA or write to the (or another) EEPROM without write EEPROM-support in your own firmware.






ALL CONTENT AND MATERIALS ON THIS SITE ARE PROVIDED "AS IS". CYPRESS SEMICONDUCTOR AND ITS RESPECTIVE SUPPLIERS MAKE NO REPRESENTATIONS ABOUT THE SUITABILITY OF THESE MATERIALS FOR ANY PURPOSE AND DISCLAIM ALL WARRANTIES AND CONDITIONS WITH REGARD TO THESE MATERIALS, INCLUDING BUT NOT LIMITED TO, ALL IMPLIED WARRANTIES AND CONDITIONS OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT OF ANY THIRD PARTY INTELLECTUAL PROPERTY RIGHT. NO LICENSE, EITHER EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, IS GRANTED BY CYPRESS SEMICONDUCTOR. USE OF THE INFORMATION ON THIS SITE MAY REQUIRE A LICENSE FROM A THIRD PARTY, OR A LICENSE FROM CYPRESS SEMICONDUCTOR.

Content on this site may contain or be subject to specific guidelines or limitations on use. All postings and use of the content on this site are subject to the Terms and Conditions of the site; third parties using this content agree to abide by any limitations or guidelines and to comply with the Terms and Conditions of this site. Cypress Semiconductor and its suppliers reserve the right to make corrections, deletions, modifications, enhancements, improvements and other changes to the content and materials, its products, programs and services at any time or to move or discontinue any content, products, programs, or services without notice.

Spec No: None; Sunset Owner: GRAA; Secondary Owner: RAIK; Sunset Date: 01/01/20