I use the cy7c68013 with slave fifo and auto in-out mode. And now 4 bulk pipe is used with piptID 2,4,6,8 but I want to chage last pipe 8 to 10, so edit and compile and download iic file of dscr.a51(8051 firmWare). But and then can't communicate. Sure i change the driver and do the other needed things. Is there something wrong?
And there is some singular note in ch 8.1 of technical reference manual. "Direct connection is available only on endpoints 2,4,6,8" What's this?, and what's meaning?
Pipe ID stands for the endpoint address. It is fixed on the EZUSB-FX2(LP) chip. There is no endpoint of address 10. Then, you have to rewrite the PC app or PC device driver, so that it doesn't depend on the endpoint address directly.
Programmer of less USB experience writes hard-coded endpoint address directly in his PC application or in the device driver. When he encounters migration of the chip, he learns that the direct endpoint address is evil, it disturbs the migration.
On the PC side, the endpoint address should be retrieved using index. The index shows the order with which the endpoint appears in the interface on the descriptor set of the device.
For WinUSB, WinUsb_QueryPipe returns WINUSB_PIPE_INFORMATION structure for the specified PipeIndex. This structure gives the PipeId for the pipe. PipeIndex, starting from zero, corresponds to the order of endpoint descriptors on the interface. In this way, you use a fixed index for the pipe, instead of fixed PipeId.
On the migration of chip, any endpoint address will do for the pipe. Just keep the order of the endpoint descriptors on the config set on the device.
Most of PC USB libraries and some device drivers have similar indexing mechanism of pipe, which hides the endpoint address.
- Cypress CyUSB.sys driver exposes Endpoint address directly. But when the code follows the example of CCyUSBDevice::BulkInEndPt in CyAPI.chm, the Endpoint address is hidden behind the index of the Endpoint array.
- USBIO.SYS driver from Thesycon driver exposes Endpoint address directly. But the endpoint address is specified programatically in USBIO_PIPE_CONFIGURATION_INFO. USBIO_PIPE_CONFIGURATION_INFO array is retrieved on the USBIO_CONFIGURATION_INFO structure by IOCTL_USBIO_GET_CONFIGURATION_INFO request.
- MS WinDDK bulkusb and isousb example driver hide Endpoint address behind the pipe name. etc.
Tsuneo
I think that's more generally true than just USB:
Inexperienced (or just plain lazy) programmers tend to write hard-coded constants where configurable parameters would be far more maintainable...