Hi i am experimenting probably a bug for i2c_Bridging code.
I have this situation:
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 007: ID 0424:494a Microchip Technology, Inc. (formerly SMSC) USB47xx/49xx hub integrated WinUSB + I2S audio port
Bus 001 Device 006: ID 0424:4715 Microchip Technology, Inc. (formerly SMSC) USB4715 high-speed hub
Bus 001 Device 005: ID 05e3:0723 Genesys Logic, Inc. GL827L SD/MMC/MS Flash Card Reader
Bus 001 Device 004: ID 093a:2533 Pixart Imaging, Inc. OpticalMouse
Bus 001 Device 003: ID 046d:c31c Logitech, Inc. Keyboard K120
Bus 001 Device 002: ID 0a12:0001 Cambridge Silicon Radio, Ltd Bluetooth Dongle (HCI mode)
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
/: Bus 02.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/6p, 5000M
/: Bus 01.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/12p, 480M
|__ Port 1: Dev 2, If 1, Class=Wireless, Driver=btusb, 12M
|__ Port 1: Dev 2, If 0, Class=Wireless, Driver=btusb, 12M
|__ Port 3: Dev 3, If 0, Class=Human Interface Device, Driver=usbhid, 1.5M
|__ Port 3: Dev 3, If 1, Class=Human Interface Device, Driver=usbhid, 1.5M
|__ Port 4: Dev 4, If 1, Class=Human Interface Device, Driver=usbhid, 12M
|__ Port 4: Dev 4, If 0, Class=Human Interface Device, Driver=usbhid, 12M
|__ Port 5: Dev 5, If 0, Class=Mass Storage, Driver=usb-storage, 480M
|__ Port 6: Dev 6, If 0, Class=Hub, Driver=hub/5p, 480M
|__ Port 5: Dev 7, If 3, Class=Audio, Driver=snd-usb-audio, 480M
|__ Port 5: Dev 7, If 1, Class=Audio, Driver=snd-usb-audio, 480M
|__ Port 5: Dev 7, If 2, Class=Audio, Driver=snd-usb-audio, 480M
|__ Port 5: Dev 7, If 0, Class=Vendor Specific Class, Driver=, 480M
and it seems that the microship hub that i have that is the usb4715 is the Bus 001 Device 006: ID 0424:4715 device.
So in order to make a read of 1 byte from 12c device 0x38 (attached to one of the port of this hub) on register 0x4020 i run:
sudo ./i2cBridging 0x0424 0x4715 "1:6" 0x00 0x38 0x4020 1
but i receive this retunr:
SDK Version:1.23
VID:PID = 0424:4715, Device Path - :6
I2C Bridging Demo
DEBUGINFO: MCHP_Error_Device_Not_Found
Error: MchpUsbOpenID Failed:
i think that the usb open devic function finds only usb device with portmax at equal to 1 and not equal to 2.
in the for cycle for(;hub_index < 10;hub_index++) in MhcpUSBInterface.cpp i printed with this
printf("\nDEBUG:gasHubInfo[hub_index].wVID --> %x\n"
"gasHubInfo[hub_index].wPID --> %x\n"
"gasHubInfo[hub_index].port_max --> %d\n"
"gasHubInfo[hub_index].wDID --> %x\n"
"gasHubInfo[hub_index].wSKUNAME --> %x\n"
"gasHubInfo[hub_index].port_list[0] --> %d\n"
"gasHubInfo[hub_index].port_list[1] --> %d\n"
"gasHubInfo[hub_index].port_list[2] --> %d\n"
"gasHubInfo[hub_index].port_list[3] --> %d\n"
"gasHubInfo[hub_index].port_list[4] --> %d\n"
"gasHubInfo[hub_index].port_list[5] --> %d\n"
"gasHubInfo[hub_index].port_list[6] --> %d\n"
"gasHubInfo[hub_index].deviceName -->%s\n"
"i -->%d\n",
gasHubInfo[hub_index].wVID,
gasHubInfo[hub_index].wPID,
gasHubInfo[hub_index].port_max,
gasHubInfo[hub_index].wDID,
gasHubInfo[hub_index].wSKUNAME,
gasHubInfo[hub_index].port_list[0],
gasHubInfo[hub_index].port_list[1],
gasHubInfo[hub_index].port_list[2],
gasHubInfo[hub_index].port_list[3],
gasHubInfo[hub_index].port_list[4],
gasHubInfo[hub_index].port_list[5],
gasHubInfo[hub_index].port_list[6],
gasHubInfo[hub_index].deviceName,
i);
all device's info and it seems find only one device with portmax=1
DEBUG:gasHubInfo[hub_index].wVID --> 424
gasHubInfo[hub_index].wPID --> 4715
gasHubInfo[hub_index].port_max --> 1
gasHubInfo[hub_index].wDID --> 0
gasHubInfo[hub_index].wSKUNAME --> 0
gasHubInfo[hub_index].port_list[0] --> 6
gasHubInfo[hub_index].port_list[1] --> 0
gasHubInfo[hub_index].port_list[2] --> 0
gasHubInfo[hub_index].port_list[3] --> 0
gasHubInfo[hub_index].port_list[4] --> 0
gasHubInfo[hub_index].port_list[5] --> 0
gasHubInfo[hub_index].port_list[6] --> 6
gasHubInfo[hub_index].deviceName -->
i -->2
DEBUG:gasHubInfo[hub_index].wVID --> 0
gasHubInfo[hub_index].wPID --> 0
gasHubInfo[hub_index].port_max --> 0
gasHubInfo[hub_index].wDID --> 0
gasHubInfo[hub_index].wSKUNAME --> 0
gasHubInfo[hub_index].port_list[0] --> 0
gasHubInfo[hub_index].port_list[1] --> 0
gasHubInfo[hub_index].port_list[2] --> 0
gasHubInfo[hub_index].port_list[3] --> 0
gasHubInfo[hub_index].port_list[4] --> 0
gasHubInfo[hub_index].port_list[5] --> 0
gasHubInfo[hub_index].port_list[6] --> 0
gasHubInfo[hub_index].deviceName -->
i -->2
DEBUG:gasHubInfo[hub_index].wVID --> 0
gasHubInfo[hub_index].wPID --> 0
gasHubInfo[hub_index].port_max --> 0
gasHubInfo[hub_index].wDID --> 0
gasHubInfo[hub_index].wSKUNAME --> 0
gasHubInfo[hub_index].port_list[0] --> 0
gasHubInfo[hub_index].port_list[1] --> 0
gasHubInfo[hub_index].port_list[2] --> 0
gasHubInfo[hub_index].port_list[3] --> 0
gasHubInfo[hub_index].port_list[4] --> 0
gasHubInfo[hub_index].port_list[5] --> 0
gasHubInfo[hub_index].port_list[6] --> 0
gasHubInfo[hub_index].deviceName -->
i -->2
DEBUG:gasHubInfo[hub_index].wVID --> 0
gasHubInfo[hub_index].wPID --> 0
gasHubInfo[hub_index].port_max --> 0
gasHubInfo[hub_index].wDID --> 0
gasHubInfo[hub_index].wSKUNAME --> 0
gasHubInfo[hub_index].port_list[0] --> 0
gasHubInfo[hub_index].port_list[1] --> 0
gasHubInfo[hub_index].port_list[2] --> 0
gasHubInfo[hub_index].port_list[3] --> 0
gasHubInfo[hub_index].port_list[4] --> 0
gasHubInfo[hub_index].port_list[5] --> 0
gasHubInfo[hub_index].port_list[6] --> 0
gasHubInfo[hub_index].deviceName -->
i -->2
DEBUG:gasHubInfo[hub_index].wVID --> 0
gasHubInfo[hub_index].wPID --> 0
gasHubInfo[hub_index].port_max --> 0
gasHubInfo[hub_index].wDID --> 0
gasHubInfo[hub_index].wSKUNAME --> 0
gasHubInfo[hub_index].port_list[0] --> 0
gasHubInfo[hub_index].port_list[1] --> 0
gasHubInfo[hub_index].port_list[2] --> 0
gasHubInfo[hub_index].port_list[3] --> 0
gasHubInfo[hub_index].port_list[4] --> 0
gasHubInfo[hub_index].port_list[5] --> 0
gasHubInfo[hub_index].port_list[6] --> 0
gasHubInfo[hub_index].deviceName -->
i -->2
DEBUG:gasHubInfo[hub_index].wVID --> 0
gasHubInfo[hub_index].wPID --> 0
gasHubInfo[hub_index].port_max --> 0
gasHubInfo[hub_index].wDID --> 0
gasHubInfo[hub_index].wSKUNAME --> 0
gasHubInfo[hub_index].port_list[0] --> 0
gasHubInfo[hub_index].port_list[1] --> 0
gasHubInfo[hub_index].port_list[2] --> 0
gasHubInfo[hub_index].port_list[3] --> 0
gasHubInfo[hub_index].port_list[4] --> 0
gasHubInfo[hub_index].port_list[5] --> 0
gasHubInfo[hub_index].port_list[6] --> 0
gasHubInfo[hub_index].deviceName -->
i -->2
DEBUG:gasHubInfo[hub_index].wVID --> 0
gasHubInfo[hub_index].wPID --> 0
gasHubInfo[hub_index].port_max --> 0
gasHubInfo[hub_index].wDID --> 0
gasHubInfo[hub_index].wSKUNAME --> 0
gasHubInfo[hub_index].port_list[0] --> 0
gasHubInfo[hub_index].port_list[1] --> 0
gasHubInfo[hub_index].port_list[2] --> 0
gasHubInfo[hub_index].port_list[3] --> 0
gasHubInfo[hub_index].port_list[4] --> 0
gasHubInfo[hub_index].port_list[5] --> 0
gasHubInfo[hub_index].port_list[6] --> 0
gasHubInfo[hub_index].deviceName -->
i -->2
DEBUG:gasHubInfo[hub_index].wVID --> 0
gasHubInfo[hub_index].wPID --> 0
gasHubInfo[hub_index].port_max --> 0
gasHubInfo[hub_index].wDID --> 0
gasHubInfo[hub_index].wSKUNAME --> 0
gasHubInfo[hub_index].port_list[0] --> 0
gasHubInfo[hub_index].port_list[1] --> 0
gasHubInfo[hub_index].port_list[2] --> 0
gasHubInfo[hub_index].port_list[3] --> 0
gasHubInfo[hub_index].port_list[4] --> 0
gasHubInfo[hub_index].port_list[5] --> 0
gasHubInfo[hub_index].port_list[6] --> 0
gasHubInfo[hub_index].deviceName -->
i -->2
DEBUG:gasHubInfo[hub_index].wVID --> 0
gasHubInfo[hub_index].wPID --> 0
gasHubInfo[hub_index].port_max --> 0
gasHubInfo[hub_index].wDID --> 0
gasHubInfo[hub_index].wSKUNAME --> 0
gasHubInfo[hub_index].port_list[0] --> 0
gasHubInfo[hub_index].port_list[1] --> 0
gasHubInfo[hub_index].port_list[2] --> 0
gasHubInfo[hub_index].port_list[3] --> 0
gasHubInfo[hub_index].port_list[4] --> 0
gasHubInfo[hub_index].port_list[5] --> 0
gasHubInfo[hub_index].port_list[6] --> 0
gasHubInfo[hub_index].deviceName -->
i -->2
DEBUG:gasHubInfo[hub_index].wVID --> 0
gasHubInfo[hub_index].wPID --> 0
gasHubInfo[hub_index].port_max --> 0
gasHubInfo[hub_index].wDID --> 0
gasHubInfo[hub_index].wSKUNAME --> 0
gasHubInfo[hub_index].port_list[0] --> 0
gasHubInfo[hub_index].port_list[1] --> 0
gasHubInfo[hub_index].port_list[2] --> 0
gasHubInfo[hub_index].port_list[3] --> 0
gasHubInfo[hub_index].port_list[4] --> 0
gasHubInfo[hub_index].port_list[5] --> 0
gasHubInfo[hub_index].port_list[6] --> 0
gasHubInfo[hub_index].deviceName -->
so it will never enter into the if subsection snippet code below.
Is it a bug?