cancel
Showing results for 
Search instead for 
Did you mean: 

USB-C Key detection

SKham.2
Associate II

Hello,

 

I am working on a Bootloader that reads USB-Key using USB_Host middleware to retrieve files before performing some operations but I have some issues detecting some USB keys.

  • USB 2.0 Keys are all detected
  • USB 3.2 Keys are not well detected

I have examinated USB File descriptors using USB Device Tree Viewer and noticed that:

  • Demanded Current <=500 mA : Detected
  • Demanded Current > 500 mA : Not Detected

Even though, I have measured Ibus and it's never over 120 mA so I assume it's not that.

If I use a USB-C to USB-A adapter to force to use USB 2.0 fallback, it doesn't work either.

 

Then I noticed that in the Device Tree that:

  • Enumerator: SCSI => Not Detected
  • Enumerator: USBSTOR => Detected

 

When I use Debugger, I can see a hard fault coming from USBH_Process :

 
case HOST_CHECK_CLASS:
if (phost->ClassNumber == 0U)
{
USBH_UsrLog("No Class has been registered.");
}
else
{
phost->pActiveClass = NULL;

for (idx = 0U; idx < USBH_MAX_NUM_SUPPORTED_CLASS; idx++)
{
if (phost->pClass[idx]->ClassCode == phost->device.CfgDesc.Itf_Desc[0].bInterfaceClass)
{
phost->pActiveClass = phost->pClass[idx];
break;
}
}

The phost->pClass[idx]->ClassCode is unknown for SCSI USB 3.2 Keys.

When I use USB 2.0 Key, it's ok ClassCode is known.

 

Any idea how to solve this issue?

2 REPLIES 2

Welcome to the forum.

Please see How to write your question to maximize your chances to find a solution; in particular How to insert source code.

What MCU are you using, and what hardware?

A complex system that works is invariably found to have evolved from a simple system that worked.
A complex system designed from scratch never works and cannot be patched up to make it work.
SKham.2
Associate II

MCU is stm32h750 and I am working on a proprietary Touch Screen.

I assume Hardware is not an issue though as I can detect USB 2.0 Keys and some USB 3.2 Keys.