You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 9 Next »

Terminology and tips

Terminology: USB FX2 unresponsive aka USB FX2 microcontroller stall

USB FX2 microcontroller stall term/definition is used to describe the situation where your TE USB FX2 module's FPGA works normally (you are still able to connect to FPGA using JTAG connection) but you are unable to connect to it via USB connection despite having the correct USB drivers installed.

TE USB FX2 modules are industrial products and if wrong firmware is written in EEPROM (=> USB unresponsive but FPGA's working) it can easily corrected (without using JTAG connection) with EEPROM switch and USB connection: the solution is quite easy and fast (5-10 seconds) under Windows (implicit two-step recovery boot) and it is also possible under Linux (explicit two-step recovery boot).

If the user is unsure about new firmware, he/she could run the firmware in RAM

If the user is unsure about the suitability of a new firmware (wherever it is the source), it's a good idea to load it into RAM first to make sure it is not totally broken.

A reference firmware (from Trenz Electronic GitHub) is suitalble and tested; it can be used to test the functionality of TE USB FX2 module and SW APIs. The only possible problem with reference firmware files is the corruption of the downloaded .iic file. If the user have problem with reference .iic file should consider to check the integrity of the file and/or download a new copy of desired .iic file from Trenz Electronic GitHub.

Recovery boot: bring back a TE USB FX2 module's USB connection from stall

Writing wrong (or corrupted) firmware to EEPROM will bring the USB FX2 microcontroller to stall. To bring it back out of a stall, the firmware recovery procedure differs upon the host operating system:

  • use an implicit two-step recovery boot (Windows);
  • use an explicit two-step recovery boot (Linux or Windows).

Recovery Boot

To default, the FX2 hardware (i.e with EEPROM isolated =>hardware's first stage loader) enumerates the USB FX2LP microcontroller chip as VID=0x04B4 (Cypress) and PID=0x8613 (FX2LP), and provides support for loading firmware into RAM.

To default, using the FX2 hardware (i.e with EEPROM isolated => hardware's first stage loader ) it is possible to write a new firmware in RAM but not in EEPROM.


The USB FX2LP microcontroller hardware's first stage loader (supporting the 0xA0 vendor request) can't write into external memory (EEPROM for example).
Configurations that put firmware into external memory thus need a second stage loader. For typical "flat" memory architectures, a loader supporting the 0xA3 vendor request is used to write into that memory. Similarly, a second stage loader that supports the 0xA2 or 0xA9 vendor request is needed when writing boot firmware into an I2C EEPROM. These 0xA2, 0xA9 and 0xA3 vendor commands are conventions defined by Cypress.

(Implicit Two-Step) recovery boot ≈ (Explicit Two-Step) Recovery Noot

It is possible to write in EEPROM only using a 2nd stage loader firmware supporting EEPROM programming (aka intermediate good firmware) running in RAM; normally the bootloader Vend_Ax.hex is used. 
  • In the case of (IMPLICIT two-step) recovery boot (at this time, only Windows) the 2nd stage (boot)loader firmware is loaded without the explicit intervention of the user.
  • In the case of (EXPLICIT two-step) recovery boot (mainly Linux) the 2nd stage (boot)loader firmware is loaded with the explicit intervention of the user.

Both recovery boots use exactly the same procedure (under the hood, they are one and the same), but in Windows OS case the 2nd stage (boot)loader firmware step is HIDDEN in loadEEPROM() function used by CyConsole, CyControl and OpenFutNet.

(Implicit Two-Step) Recovery Boot

Second step (bootloader Vend_ax in RAM) is hidden

The 2nd stage loader firmware is loaded automatically without the explicit intervention of the user. At this time, it is only possible with Windows OS

In an implicit two-step recovery boot (see here) the user should (the necessary device driver is assumed already installed)

  • isolate the FX2 microcontroller's external EEPROM disabling the EEPROM switch;
  • use a reset if the the running SW tool is not able to recognize the TE USB FX2 module as a supported device;
  • reconnect the FX2 microcontroller's external EEPROM enabling the EEPROM switch;
  • give the command to load the desired good firmware into FX2 microcontroller's external EEPROM using CyControl, CyConsole, OpenFutNet (Windows OS, all SW tools using CyAPI.lib or CyUSB.dll) ;

    The CyConsole's "Lg EEPROM" button, CyControl's "64KB EEPROM" button and OpenFutNet's "Program USB: write IIC EEPROM" button call the loadEEPROM() function. This function is used to program 64-Kbyte EEPROMs. When the button (CyConsole's Lg EEPROM button, CyControl's EEPROM button or OpenFutNet's IIC button) is clicked, the user is prompted to select a (.iic) file to load into the EEPROM. This button first downloads the Vend_Ax(_Fx2).bix file, then sends the 0xA9 vendor request to program the EEPROM.

    The CyConsole/CyControl/OpenFutNet program will load

    1. (HIDDEN STEP 1) an intermediate good firmware supporting EEPROM programming (normally the 2nd stage bootloader Vend_Ax.hex ) in RAM;

    2. (EXPLICIT STEP 2) the desired good firmware into FX2 microcontroller's external EEPROM using the the intermediate good firmware (2nd stage bootloader Vend_Ax.hex) in RAM.
  • use a reset or write the desired good firmware into FX2 microcontroller's RAM using CyControl (Windows OS). If OpenFutNet is used in the step before, the desired good firmware is already written into FX2 microcontroller's RAM.

 

The CyConsole's "S EEPROM" button is used to program 256-byte EEPROMs. When this button is clicked, the user is prompted to select a (.iic) file to load into the EEPROM. This button first downloads the Vend_Ax(_Fx2).bix file, then sends the 0xA2 vendor request to program the EEPROM. This button should not be used.

(Explicit Two-Step) Recovery Boot

Explicit two-step recovery boot could be carried out with both Windows and Linux OSes.

In an explicit two-step recovery boot, the user should (the necessary device driver is assumed already installed):

  • isolate the FX2 microcontroller's external EEPROM disabling the EEPROM switch;
  • use a reset if the the running SW tool is not able to recognize the TE USB FX2 module as a supported device;
  • reconnect the FX2 microcontroller's EEPROM enabling the EEPROM switch;
  • (EXPLICIT STEP 1) load an intermediate good firmware supporting EEPROM programming (normally the bootloader Vend_Ax.hex ) into FX2 microcontroller's RAM using CyControl (Windows OS), fx2loader (Linux OS and Windows OS, see also here) or fxload (Linux OS, see also here) ;
  • (EXPLICIT STEP 2) load the desired good firmware into FX2 microcontroller's external EEPROM using CyControl, CyConsole, OpenFutNet (Windows OS, all 3 previous SW tools are using CyAPI.lib or CyUSB.dll), fx2loader (Linux OS and Windows OS, see also here) or fxload (Linux OS,see also here);
  • use a reset or write the desired good firmware into FX2 microcontroller's RAM using CyControl (Windows OS), fx2loader (Linux OS and Windows OS, see also here) or fxload (Linux OS,see also here).

A single command line recovery boot could be carried in Linux OS using fxload (with -c and -s "loader" option on the same command line, where loader is Vend_Ax.hex).

fxload and Linux distribution

fxload is already included in some Linux distributions.

Unfortunately, fxload of these distributions does not normally include a good second-stage boot loader for all vendor specific commands 0xAx and hence cannot directly be used to program EEPROM storage. However, such a bootloader is available separately if you dig around on the Cypress page; it is Vend_Ax.hex but it should be manually retrieved/downloaded. (Note: This "second stage bootloader" is sometimes called also "third stage").

In order to make life easier to users, this page provides a software package which contains the Cypress second stage bootloader called Vend_Ax.hex and the fxload source of 2008-10-13 (latest version at the time of writing). This version has also a patch which allows to "erase" the EEPROM again and which sets the default vendor and product IDs in the EEPROM when flashing.

  • No labels