USB OTG ID Pin vs Using a GPIO vs using I2C expander

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

USB OTG ID Pin vs Using a GPIO vs using I2C expander

345 Views
DiBosco
Contributor III

Folks,

We have an RT1062 where someone who didn't really understand how OTG works has not connected up the ID line to the USB peripheral's ID pad on the 1062 itself.

What has happened is that the ID line (which to further complicate things comes from a TUSB320 as it's a USB-C socket) has gone via a tortuous route into an I2C expander which then talks to the RT1062. The hardware team assumed that it would be possible to read that to decide on host/peripheral mode.

Now, I am willing to bet that this is not a good assumption and the BSP depends on the ID pin of the USB socket being connected to the proper pad on the processor.

The quesiton is:

1. Is it possible to read the I/O explander and decide, thus bypassing the method used in the BSP

2. If so, what sort of software effort is involved? Would be hours, days, weeks? How easy would it be to track down and what sort of risks are involved?

3. Are we much better off up issuing the board by sticking an I/O expander on the 1062 to free up the actual ID pin and connect it up properly?

Thanks!

 

 

 

 

 

0 Kudos
1 Reply

317 Views
Hui_Ma
NXP TechSupport
NXP TechSupport

Hi,

1. Is it possible to read the I/O explander and decide, thus bypassing the method used in the BSP

TS: Yes, it is possbile. RT1060 SDK software package provied <usb_pin_detect_hid_mouse> demo, which using OTG ID status to decide USB working as host or device.

Related code is below: 

/*!
* @brief get USB id pin status
*/
uint8_t USB_GetIdPinStatus(void)
{
return ((ehciRegisterBase->OTGSC & USBHS_OTGSC_ID_MASK) >> USBHS_OTGSC_ID_SHIFT);
}

So, replace related code with GPIO pad voltage check.

2. If so, what sort of software effort is involved? Would be hours, days, weeks? How easy would it be to track down and what sort of risks are involved?

TS: We have similar application to use GPIO to replace ID pin with Kinetis device. There  should be ok and no issue reported from customers.  Related GPIO pin should enable interrupt to let chip know USB ID status changed in time.

3. Are we much better off up issuing the board by sticking an I/O expander on the 1062 to free up the actual ID pin and connect it up properly?

TS: Customer can let actual ID pin floating.

best regards,

Mike

0 Kudos