BluePill USB CDC enumeration fails

Post here all questions related to STM32 core if you can't find a relevant section!
Post Reply
C_D
Posts: 5
Joined: Wed Apr 01, 2020 8:14 pm

BluePill USB CDC enumeration fails

Post by C_D »

Is there a known issue with USB CDC on the latest STM32 official core? I have been away from STM32 stuff for a little while and I'm sure CDC was working fine 6 months ago but I cant get any of my boards to enumerate on Windows or Linux. This is with the 1.5k resistor fixed and just a basic blink and print output to USB serial sketch. Code uploads and runs, LED blinks, but enumeration fails (device descriptor request failed) on both Windows and Linux. I had a quick skim through the forum and github and couldn't see any current reports that it wasn't working?
fredbox
Posts: 125
Joined: Thu Dec 19, 2019 3:05 am
Answers: 2

Re: BluePill USB CDC enumeration fails

Post by fredbox »

Working here in Linux:

Code: Select all

[Wed Apr  1 16:33:19 2020] usb 5-1: new full-speed USB device number 83 using uhci_hcd
[Wed Apr  1 16:33:20 2020] usb 5-1: New USB device found, idVendor=0483, idProduct=5740
[Wed Apr  1 16:33:20 2020] usb 5-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[Wed Apr  1 16:33:20 2020] usb 5-1: Product: BLUEPILL_F103C6 CDC in FS Mode
[Wed Apr  1 16:33:20 2020] usb 5-1: Manufacturer: STMicroelectronics
[Wed Apr  1 16:33:20 2020] usb 5-1: SerialNumber: 48DC64993832
[Wed Apr  1 16:33:20 2020] cdc_acm 5-1:1.0: ttyACM0: USB ACM device
Try a different USB cable. Also, about half of my boards have had bad solder connections on the micro USB port.
C_D
Posts: 5
Joined: Wed Apr 01, 2020 8:14 pm

Re: BluePill USB CDC enumeration fails

Post by C_D »

Can you post your sketch just so I can try and replicate it?
fredbox
Posts: 125
Joined: Thu Dec 19, 2019 3:05 am
Answers: 2

Re: BluePill USB CDC enumeration fails

Post by fredbox »

Code: Select all

#define mySerial SerialUSB
void setup() {
  // put your setup code here, to run once:
  mySerial.begin(9600); // baud rate not important for USB
}
void loop() {
  // put your main code here, to run repeatedly:
  mySerial.println("Hello World!");
  delay(1000);
}
Options:
USART disabled
CDC no generic serial (I usually define my own serial port instead of using Serial.x)
Board Generic STM32F1, Blue Pill, etc.
C_D
Posts: 5
Joined: Wed Apr 01, 2020 8:14 pm

Re: BluePill USB CDC enumeration fails

Post by C_D »

Ok, that definitely does not work for me.

I get 'USB Device not recognised' from windows and 'device descriptor read error' 'unable to enumerate USB device' in linux.
User avatar
fpiSTM
Posts: 1738
Joined: Wed Dec 11, 2019 7:11 pm
Answers: 91
Location: Le Mans
Contact:

Re: BluePill USB CDC enumeration fails

Post by fpiSTM »

Seems strange.
Just to be sure, you enabled the USB support in the menu ?

One other possibilities was a driver issue on windows, normally there is no need to a specific driver but already saw a third party driver installed which lead to that. Anyway the fact you get the same issue on Linux seems indicate this is not the issue or you add also some udev rules which leads to this.
C_D
Posts: 5
Joined: Wed Apr 01, 2020 8:14 pm

Re: BluePill USB CDC enumeration fails

Post by C_D »

Still havent got this working. I'll try a completely different PC but it cant be driver related can it as enumeration has to happen before a driver is assigned?

I guess I cant rule out a hardware fault, I'll see if I can find an old board which I know has worked previously so I can test that.
mrburnette
Posts: 633
Joined: Thu Dec 19, 2019 1:23 am
Answers: 7

Re: BluePill USB CDC enumeration fails

Post by mrburnette »

fredbox wrote: Wed Apr 01, 2020 9:39 pm ...
[/code]Try a different USB cable. Also, about half of my boards have had bad solder connections on the micro USB port.
+1

If using the Official core, CDC was implemented for the blue pill in early 2019, so make certain you are using latest.
https://stm32duinoforum.com/forum/viewt ... tml#p52432

Regrets, BennehBoy, I could not resist using you as an example of what we have all done! :lol:


Ray
C_D
Posts: 5
Joined: Wed Apr 01, 2020 8:14 pm

Re: BluePill USB CDC enumeration fails

Post by C_D »

Thanks for the ideas guys, I'll keep trying later and see if I can get it sorted. I really need a bunch of ADC pins and a USB serial port for some datalogging.
mrburnette
Posts: 633
Joined: Thu Dec 19, 2019 1:23 am
Answers: 7

Re: BluePill USB CDC enumeration fails

Post by mrburnette »

C_D wrote: Sun Apr 19, 2020 5:24 am Thanks for the ideas guys, I'll keep trying later and see if I can get it sorted. I really need a bunch of ADC pins and a USB serial port for some datalogging.

Extreme datalogging; Arduino ---> NodeRed
https://www.hackster.io/rayburne/arduin ... asy-28882d

Side benefit, access from most any device on the WLAN. NodeRed runs nicely on a $35 Raspberry Pi 4 and you can have an external USB drive connected for a terabyte+ of storage.


Ray
Post Reply

Return to “General discussion”