The CP2130 USB Endpoint 1 uses a double-buffered FIFO, whereas Endpoint 2 uses a single-buffered FIFO. To improve SPI data transfer performance, Endpoint 1 can be used to double-buffer read data or write data transfer packets.
Table below shows the CP2130 USB Bulk endpoint usage for different device configuration.
Device Configuration
Bulk OUT
(Write)
Bulk IN
(Read)
High-Priority Write Mode
EP1
EP2
High-Priority Read Mode
EP2
EP1
By default, the CP2130 is configured in high-priority write mode.
AN792 describes CP2130 Interface Specification, and AN792SW contains an example for CP2130 Write and Read commands using libusb for Linux. Just a reminder that there is a known bug on the cp2130_libusb_read_example(), the endpoint for the 2nd libusb_bulk_transfer() call should be 0x82 indicating using Bulk IN endpoint 2.
Below is an example for the CP2130 WriteRead command.
bool cp2130_libusb_writeRead_example(libusb_device_handle* cp2130Handle)
{
// This example shows how to issue a bulk read request to the SPI MISO line
unsigned char read_command_buf[12] = {
0x00, 0x00, // Reserved
0x02, // WriteRead command
0x00, // Reserved
0x03, 0x00, 0x00, 0x00, // Read 3 bytes, little-endian
0x9F, 0xFF, 0xFF, 0xFF // Write 1 byte, the reset of bytes are dummy bytes
// in order to send the SPI clock for reading.
};
int bytesWritten,tmp;
int bytesToRead;
unsigned char read_input_buf[4];
int bytesRead;
int usbTimeout = 500;
if ((tmp = libusb_bulk_transfer(cp2130Handle, 0x01, read_command_buf, sizeof(read_command_buf), &bytesWritten, usbTimeout)) != 0)
{
if (tmp < 0) {
std::cout << tmp << std::endl;
}
std::cout << "ERROR: Error in bulk write transfer" << std::endl;
return false;
}
std::cout << "Successfully wrote to SPI MOSI , number of bytes written = " << std::dec << bytesWritten << std::endl;
if ((tmp = libusb_bulk_transfer(cp2130Handle, 0x82, read_input_buf, sizeof(read_input_buf), &bytesRead, usbTimeout)) != 0)
{
if (tmp < 0) {
std::cout << tmp << std::endl;
}
std::cout << "ERROR: Error in bulk read transfer" << std::endl;
return false;
}
std::cout << "Successfully read from SPI MISO, number of bytes read = " << std::dec << bytesRead << std::endl;
for (int i = 0; i < 4; i++) {
std::cout << std::hex << "0x" << int(read_input_buf[i]) << std::endl;
}
return true;
}
The CP2130 USB Endpoint 1 uses a double-buffered FIFO, whereas Endpoint 2 uses a single-buffered FIFO. To improve SPI data transfer performance, Endpoint 1 can be used to double-buffer read data or write data transfer packets.
Table below shows the CP2130 USB Bulk endpoint usage for different device configuration.
Device Configuration
Bulk OUT
(Write)
Bulk IN
(Read)
High-Priority Write Mode
EP1
EP2
High-Priority Read Mode
EP2
EP1
By default, the CP2130 is configured in high-priority write mode.
AN792 describes CP2130 Interface Specification, and AN792SW contains an example for CP2130 Write and Read commands using libusb for Linux. Just a reminder that there is a known bug on the cp2130_libusb_read_example(), the endpoint for the 2nd libusb_bulk_transfer() call should be 0x82 indicating using Bulk IN endpoint 2.
Below is an example for the CP2130 WriteRead command.
How do I customize a CP2615 on a board I designed?
Answer
To customize a CP2615 during development and prototyping, Xpress Configurator is the recommended GUI tool.
In a production setting, the Standalone Manufacturing Tool is an available command line tool for Windows, Mac and Linux. For more information about the Standalone Manufacturing Tool, see Application Note AN721: USBXpress Device Customization Guide.
To customize a CP2615, Xpress Configurator and the Standalone Manufacturing Tool require a CP2112 USB-to-I2C bridge, and the CP2112's PID must be 0xEA93. See the following connection diagram.
An example, showing a CP2112-EK connected to a CP2615-EK for programming is shown here:
In addition to changing the PID to 0xEA90, you must also change the CP2112's serial string to a value that Simplicity Studio has not seen before, since Simplicity Studio caches device configuration by serial number. For example, in this instance, a CP2102 has previously been plugged in and detected by Simplicity Studio with the serial string '0001'. When the CP2112 is re-programmed with a serial string of '0001', it now appears as a CP2102, instead:
If the serial number remains the same as the default, or if it is the same as a previously connected CP210x device, the device will still appear as the previously connected device with the same serial number (instead of a CP2615 programmer). If this occurs, you can clear Simplicity Studio's device cache by navigating to C:\Users[USERNAME]\SimplicityStudio\v4_workspace\.metadata\.plugins\com.silabs.ss.platform.device.core\device and deleting all .info devices there.
You can also switch to a different workspace to resolve the issue.
Once the CP2112 is programmed with the PID of 0xEA93 (and new serial string), it may first appear as an "Unknown Device" within Simplicity Studio, if the device is not able to communicate with a CP2615.
Once a CP2615 is connected, Simplicity Studio will then properly detect the CP2112 as a CP2615 programmer, and it will be available as a programming option in Xpress Configurator.
Notes:
If the import from device command fails, attempt to program the CP2615 using the xpress configurator defaults. Some CP2615 devices may be shipped in an unconfigured state, and require initial programming to communicate with Studio.
A CP2112 with PID 0xEA93 is included on the CP2615 Evaluation Board. Therefore, the CP2615 on the CP2615 Evaluation Board is ready for customization by Xpress Configurator and the Standalone Manufacturing Tool.
When using the CP2112 on the CP2615 Evaluation Kit to program a CP2615 on a custom board, remove the shorting blocks on J13, J14, J15, and J16.
The CP2615 Evaluation kits does not use pull-up resistors on the CFGMODEb and RESETb pins as shown in the device datasheet. When programming a CP2615 using a CP2112 it is recommended to not include pull-ups on the CFGMODEb and RESETb pins.
Timing is critical during configuration of the CPT212B. You must make sure to adhere to the timing specifications in the I2C Configuration Interface Table in the device's datasheet. Each command must have this delay after it before sending any further command to the device.
What are some potential problems when attempting to configure a CPT213B device?
Answer
Timing is critical during configuration of the CPT213B. You must make sure to adhere to the timing specifications in the I2C Configuration Interface Table in the device's datasheet. Each command must have this delay after it before sending any further command to the device.
When writing the configuration to the device, there is no maximum delay timing between write commands. So the IEC host can do any diagnostics it needs to between writes.
Interface Knowledge Base
CP2130 WriteRead Command using LibUSB for Linux
The CP2130 USB Endpoint 1 uses a double-buffered FIFO, whereas Endpoint 2 uses a single-buffered FIFO. To improve SPI data transfer performance, Endpoint 1 can be used to double-buffer read data or write data transfer packets.
Table below shows the CP2130 USB Bulk endpoint usage for different device configuration.
Bulk OUT
(Write)
Bulk IN
(Read)
By default, the CP2130 is configured in high-priority write mode.
AN792 describes CP2130 Interface Specification, and AN792SW contains an example for CP2130 Write and Read commands using libusb for Linux. Just a reminder that there is a known bug on the cp2130_libusb_read_example(), the endpoint for the 2nd libusb_bulk_transfer() call should be 0x82 indicating using Bulk IN endpoint 2.
Below is an example for the CP2130 WriteRead command.
CP2130 WriteRead Command using LibUSB for Linux
CP2615 Customization on a Custom Board
Question
How do I customize a CP2615 on a board I designed?
Answer
To customize a CP2615 during development and prototyping, Xpress Configurator is the recommended GUI tool.
In a production setting, the Standalone Manufacturing Tool is an available command line tool for Windows, Mac and Linux. For more information about the Standalone Manufacturing Tool, see Application Note AN721: USBXpress Device Customization Guide.
To customize a CP2615, Xpress Configurator and the Standalone Manufacturing Tool require a CP2112 USB-to-I2C bridge, and the CP2112's PID must be 0xEA93. See the following connection diagram.
An example, showing a CP2112-EK connected to a CP2615-EK for programming is shown here:
By default, the CP2112 PID is 0xEA90. To change the PID of a CP2112, use Xpress Configurator and refer to Application Note AN721: USBXpress Device Customization Guide.
In addition to changing the PID to 0xEA90, you must also change the CP2112's serial string to a value that Simplicity Studio has not seen before, since Simplicity Studio caches device configuration by serial number. For example, in this instance, a CP2102 has previously been plugged in and detected by Simplicity Studio with the serial string '0001'. When the CP2112 is re-programmed with a serial string of '0001', it now appears as a CP2102, instead:
If the serial number remains the same as the default, or if it is the same as a previously connected CP210x device, the device will still appear as the previously connected device with the same serial number (instead of a CP2615 programmer). If this occurs, you can clear Simplicity Studio's device cache by navigating to C:\Users[USERNAME]\SimplicityStudio\v4_workspace\.metadata\.plugins\com.silabs.ss.platform.device.core\device and deleting all .info devices there.
You can also switch to a different workspace to resolve the issue.
Once the CP2112 is programmed with the PID of 0xEA93 (and new serial string), it may first appear as an "Unknown Device" within Simplicity Studio, if the device is not able to communicate with a CP2615.
Once a CP2615 is connected, Simplicity Studio will then properly detect the CP2112 as a CP2615 programmer, and it will be available as a programming option in Xpress Configurator.
Notes:
CPT212B Configuration
CPT213B Configuration Timing