0
\$\begingroup\$

I made a USB device based on STM32 blue pill board (STM32F103C8T6) having USB-C female socket. It works well when connected via a type C to type C cable. The Blue Pill board itself doesn't have any resistors on CC1/CC2 USB pins, but the cable I use has a 1k resistor internally on CC1, so my device gets 5 V from the computer.

Now I'm trying to get the USB negotiation working on my own PCB, which has a USB male connector. The idea is to plug it directly into a laptop without any cables. I have a 1k resistor on CC1 and 5k on CC2, not sure if that's correct, but at least I can get 5 V supply from any device.

Now, the problem is that nothing happens when I plug my device into the laptop. I expect at least a message in system logs like usb 3-1.1: new full-speed USB device number 28 using xhci_hcd, but it says nothing at all. I tried replacing the microcontroller, but with no luck. How to make USB male plug device be recognized properly by a computer? Is such a mode even supported?

All connections are checked multiple times. D+/D- lines are connected through 22 ohms resistors as on Blue Pill.

enter image description here enter image description here

\$\endgroup\$
6
  • 1
    \$\begingroup\$ Is there any USB firmware programmed in the STM32F103C8T6 on the custom board? \$\endgroup\$ Commented Sep 21 at 11:05
  • 2
    \$\begingroup\$ What do you expect to happen? Have you uploaded some USB firmware to STM32? Where is the schematics to see if the wires are correct? And no, there should be no 1K resistor in your CC pin. And the 22 ohm series resistors are incorrect too. Do you have the required 1k5 pull-up on DP? Is it a good idea to plug unknown and weird stuff that might do damage to your expensive laptop? \$\endgroup\$
    – Justme
    Commented Sep 21 at 11:41
  • \$\begingroup\$ Thank you @Justme! I added a 1.5k pull-up to D+ and now everything works!! The schematic/device photo are attached. \$\endgroup\$ Commented Sep 21 at 13:07
  • 1
    \$\begingroup\$ Both CC1 and CC2 pulldown resistors must be 5.1k. \$\endgroup\$ Commented Sep 22 at 5:21
  • 1
    \$\begingroup\$ Per Application note AN4879 for STM32 family, "The USB FS impedance driver is always managed internally to avoid the need to add external serial resistors on the data line path" , see electronics.stackexchange.com/a/705615/117785 and electronics.stackexchange.com/a/599061/117785 \$\endgroup\$ Commented Sep 22 at 5:38

1 Answer 1

2
\$\begingroup\$

The schematics had a missing pull-up for detection.

Pulling it up to 5V VBUS is wrong though. It needs to be pulled to 3.3V so nothing damages.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.