User guide
CY3687 MoBL-USB FX2LP18 Development Kit User Guide, Doc. # 001-68582 Rev. *B 67
MoBL-USB Development Kit Firmware Examples
// disable IBN for all endpoints
IBNIE = 0x00;
EZUSB_IRQ_CLEAR(); // clear the global USB IRQ
// Find the EP with its IBN bit set
for (i=0;i<8;i++)
{
if (IBNIRQ & (1 << i))
{
IbnFlag |= (1 << i); // set the appropriate IBN flag bit
IBNIRQ |= (1 << i); // clear the IBN IRQ for this endpoint
}
}
NAKIRQ |= bmBIT0; // clear the global IBN IRQ
// re-enable IBN interrupt for any endpoints that don't already have
// an IBN pending in IbnFlag
IBNIE = (bmEP6IBN | bmEP8IBN) & ~IbnFlag;
}
8.3.2 Building Firmware Example Code for MoBL-USB FX2LP18 Internal RAM and
EEPROM
Click on Build Target button at the top right corner of the IDE. The firmware example builds suc-
cessfully since the total code bytes of IBN firmware example is less than the 4k code limit Keil
uVision2 IDE provided along with the kit. The output of the Build Target is ibn.hex and ibn.iic files.
8.3.3 Method to Download Firmware Image to MoBL-USB FX2LP18 device Internal RAM
and External EEPROM
Refer to section Method to Download Firmware Image to MoBL-USB Internal RAM Memory on
page 62 and Method to Download Firmware Image to External I2C EEPROM on page 63 and follow
similar procedure to download ibn.hex to either RAM memory or ibn.iic to large EEPROM using
Cyconsole/CyControlCenter.After download the firmware re-enumerates with PC using its internal
VID/PID-0x04B4/0x1004.
8.3.4 Binding Cypress USB Driver for the Downloaded Firmware Image
The IBN project uses vendor class (0xFF) with VID/PID-0x04B4/1004.This example should bind with
Cypress generic USB driver cyusb.sys and driver information file cyusbfx2lp18.inf which contains the
relevant VID/PID of this example. Follow the procedure outlined in section Binding Cypress USB
Driver to MoBL-USB Development Board on page 43 to manually bind the driver using Windows
Hardware Wizard.
8.3.5 Testing the IBN Firmware Functionality
Following are the detailed steps to test the functionality
1. After the board has enumerated, use CyConsole to send 512 bytes from EP2 to EP6.The data
received should be same as the data sent. 512 bytes of user-defined data can be sent from the
host to Endpoint 2 using CyConsole. For example, select Endpoint 2 OUT in the pipe window
near Bulk Trans button of EZ-USB interface window, enter the length as 512 and HexBytes as
5, and then press the Bulk Trans button.
2. This data can be read back from Endpoint 6 using CyConsole For example, select Endpoint 6 IN
in the pipe, enter the length as 512, and then press the Bulk Trans button. Similarly, loopback