cancel
Showing results for 
Search instead for 
Did you mean: 

Odd occurrences when using USB and PC13 on STM32L476VG

shingadaddy
Senior

Good to see some familiar fac... AVATARS still here!

We have some products that use the mentioned ST micro. They were using the ST supplied virtual com port USB example code and drivers from back in the Cube 1.6 days. We've seen this occurrence in 2 different products.

  • Product 1 was using pin PC13 as an INPUT from a seldom used switch. During more or less constant communication on the USB bus at about 30 times a second, if there were random actuation of the switch input, it SOMETIMES cause the USB transmit to NOT HAPPEN ANY LONGER. All else was left working. The device just refused to transmit any longer. Turns out troubleshooting that - SOMETIMES, this causes the USB machine state to get locked in BUSY state.
  • Product 2. Was using PC13 as a STROBE out for an SPI interface. Sure enough if that interface was engaged and sent SPI data, RANDOMLY the USB stuff just STOPPED.

BOTH instances were completely resolved by using another pin. I see in the specs that PC13, 14,and 15 are a bit "SPECIAL" . We've nailed the crystal to the LAST two. But I don't see how we were violating any ratings on PC13 and don't see its internal relationship with USB . Until something is found concrete about this - which I have no time to look at, just beware if you use this pin and USB.

Best to you all!

2 REPLIES 2
gbm
Lead III
  1. That's normal if you call USB Transmit from anything other than an interrupt service routine of the same priority as the USB interrupt. If you call Transmit from main(), it will sooner or later hang.
  2. If your clock source is HSI synchronized to LSE, then you must be very careful about LSE circuitry routing details. The LSE oscillation circuit is very fragile and when it fails - it breaks the communication usually. PC13 may also influence the operation of LSE if the PCB is not routed correctly.
My STM32 stuff on github - compact USB device stack and more: https://github.com/gbm-ii/gbmUSBdevice
shingadaddy
Senior

That sounds like experience speaking! Thanks for more clues and possibilities gbm. By HANG I assume you mean just the USB TRANSMIT functionality would hang. This is what we observed. The devices were still Receiving USB and Doing IO interactions. Just NO USB TRANSMIT back to HOST. Appreciate the feedback!