-
Notifications
You must be signed in to change notification settings - Fork 1k
Serial.available() and Serial.read() not working with USB CDC virtual COM port #2055
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Hi @vibhoregit |
I am also able to reproduce this issue, even when the "SerialUSB" device is used. Desktop (please complete the following information): OS: MacOs |
I purchased some Blue pills and recently noticed too late that they contain STM32F103 clones, and exhibit this issue with Serial.available() in the Arduino core. I noticed that a workaround using Serial.read() == -1 would allow reads... |
I'm having a similar issue too, serial reads do not work |
Whatever character sending Serial.read() is reads -1, and Serial.available() does not work |
I felt accross the problem with a BluePill that reports 256kB Flash, High Density (obviously a fake STM32). |
I didn't want to spend too much time investigating this, but if someone has time to lose vs. simply purchasing genuine hardware, I'd suggest:
|
Meanwhile I changed from STMicroelectronics core to STM32duino core. |
Oh interesting. Would you mind elaborating on « I changed from STMicroelectronics core to STM32duino core », maybe I'll take some time to check further... I don't like having a handful of unusable boards around. |
I first used the "STM32 MCU based boards by STMicroelectronics" core with which SerialUSB.available() and SerialUSB.read() didn't work. |
PS: in both cases, I didn't use a bootloader. I rather uploaded the programs with an ST-link V2 |
Just tested and indeed the other stm32duino core is working on my fake (STM "branded" where the pin 1 marker is a spherical bump) F103s (thanks Amazon...), and with the corresponding bootloader. With this core on these chips, the USB enumeration doesn't even work. I haven't tested on chips labelled APM32. The code in the other core is so different, I don't have any time to investigate how come that one works and this one not. But maybe I'll find the time to try the STM32CubeIDE hello project now. |
Made that STM32CubeIDE test (I wanted to document the steps but I used an IOC for CBT6, 72 MHz, and then it's pretty much https://deepbluembedded.com/stm32-usb-cdc-virtual-com-port-vcp-examples/) and it's also working fine. |
Describe the bug
Serial loopback with USB virtual COM port is not working as Serial.available() returns 0 always.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
"USB Serial Initialised" gets printed and whatever characters are entered in the serial monitor should echo back
Screenshots
Desktop (please complete the following information):
Board: Bluepill
Additional context
I tried a bunch of things to narrow down the problem so that actual problem can be pin pointed
The text was updated successfully, but these errors were encountered: