Skip to content

STM32F103C8T6 - USB CDC Serial port can send to USB Host but not receive #2846

@housey2k

Description

@housey2k

Describe the bug
When using the Serial monitor on Arduino IDE or any other software like PuTTY the STM32 will successfully send data to the computer, but it fails to receive and consequently reply

To Reproduce
This is the code I am using:

void setup() {
  // Initialize USB Serial
  Serial.begin(115200);
  while (!Serial) {
  }

  Serial.println("Echo");
}

void loop() {
  if (Serial.available()) {
    char c = Serial.read();   // Read a character
    Serial.print(c);          // Echo it back
  }
}

Steps to reproduce the behavior:
1 - Flash code
2 - Receive the message "Echo"
3 - When typing something in the serial monitor and sending, the board should reply with what was typed

**Expected behavior:
Receive a response from the board through USB

Desktop (please complete the following information):

  • OS: Windows 11
  • Arduino IDE version: 2.3.6
  • STM32 core version: 2.11.0
  • Upload method: SWD

Board:

  • Name: STM32 Bluepill
  • Extra hardware used if any: ST-Link V2

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions