cancel
Showing results for 
Search instead for 
Did you mean: 

Connect STM32G0 to Android using USB HID and USB-C

NReib.1
Associate

Hello all,

I have a STM32G0C1 MCU on an evaluation board (STM32G0C1E-EV) that I need to act as keyboard/mouse (USB HID) on Android using the USB-C connector.

I am using the latest STM32CubeG0 (v1.5.1) package with the USB Device middleware.

I am able to have keyboard and mouse recognized and working fine on a computer (Windows/Linux) using USB-A and USB-C connectors, but my Android phones won't recognize it (Samsung and Xiaomi). USB-C Power Delivery negociations are working, though.

Even the basic USB-HID example code from ST doesn't work on the phone.

An example code from Arduino (using Atmega 32u4) works out of the box though, and so do USB/Bluetooth mices and keyboards, so there shouldn't be anything wrong on the phones.

On the daughterboard side (MB1352C), I have desoldered 0 ohms resistors SB27 and SB28, and soldered SB54 and SB55 to enable Dead Battery support. Other than this, the evaluation board is pretty much default, jumper and all, as far as I can tell

Any idea as to why my device isn't recognized with Android?

Thanks!

4 REPLIES 4
PRENE.1
Associate II

Hi,

I have the same issue with my STM32G0C1E-EV evaluation board.

Furthermore, it also happens with my laptop (ubuntu) if I use a USB hub to connect the eval board.

Using dmesg, I can see a difference, the evb is detected as a USB low speed device when I use a USB hub whereas when I connect it directly to my laptop, it is recognized as a full speed device.

Direct connection works properly whereas with a hub, it fails directly after the RESET sent by the host. No setup packet is received on the eval board.

Best regards

Michael E
ST Employee

Hello @NReib.1​ ,

I suggest to try with examples available on STM32MCUwiki. There are 2/3 tutorials on USB-PD & USB-C

Regards

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

Hello Michael,

The problem is that the STM32MCUwiki does not provide an example concerning the USB device. The examples only concern the USB power delivery which works well in my case with the STM32G0C1E-EV. Moreover, the problem is specific to some conditions: using USB hub or other USB Host than Windows/Linux

Unfortunately, none of the examples provided by ST have worked on Android so far, only Windows and Linux. No issues with USB-PD though