Describe the bug
With generic blue pill STM32F103C8 boards from multiple vendors, Serial.read and Serial.available do not report characters received from the host.
Setup
Arduino IDE 2.3.2
STM32 support 2.7.1
ST-LINK v2 clone programmer
To Reproduce
Use this sketch:
void setup() {
// put your setup code here, to run once:
Serial.begin(115200);
while (!Serial) {
delay(100);
}
Serial.println("Connected!");
}
void loop() {
// put your main code here, to run repeatedly:
if (Serial.available() > 0) {
char read_ch = Serial.read();
Serial.println("Got One");
if (read_ch != -1) {
Serial.print("Got a uart character ");
Serial.println(read_ch, HEX);
}
}
}
Set the following under Tools:
Board: "Generic STM32F1"
Optimize: "Smallest (-Os default)"
Board part number: "BluePill F103C8"
C Runtime library: "Newlib nano (default)"
Upload Method: "STM32CubeProgrammer (SWD)"
USB Support (if available): "CDC (Generic 'Serial' superceds U(S)ART)"
U(S)ART Support: "Disabled (no Serial support)"
Steps to reproduce the behavior:
Program the target board
Disconnect programmer
Plug the target into a serial port (accept notifications for new hardware if provided)
Select serial port installed in step 3 for Monitor
Show monitor window
Note "Connected!" message
Type characters in send control, hit enter
Note that no characters are displayed.
Expected behavior
After connection, and after typing characters that are sent to the target board, the character codes should be echoed back to the host, like this (this was taken from success STM32F103ZE board):
10:49:45.499 -> Connected!
10:49:51.093 -> Got One
10:49:51.093 -> Got a uart character 6A
10:49:51.093 -> Got One
10:49:51.093 -> Got a uart character 6B
10:49:51.093 -> Got One
10:49:51.093 -> Got a uart character 6A
10:49:51.093 -> Got One
10:49:51.093 -> Got a uart character 6B
Screenshots
If applicable, add screenshots to help explain your problem.
Desktop (please complete the following information):
OS: macos
Arduino IDE version: 2.3.2
STM32 core version: 2.7.1
Tools menu settings if not the default: Newlib Nano, USB-CDC Serial, No U(S)ART support
Upload method: SWD
Board (please complete the following information):
Name: Generic Blue Pill
Hardware Revision: unknown
Extra hardware used if any:
Additional context
Also tested with the following other boards/processors:
Describe the bug With generic blue pill STM32F103C8 boards from multiple vendors, Serial.read and Serial.available do not report characters received from the host.
Setup Arduino IDE 2.3.2 STM32 support 2.7.1 ST-LINK v2 clone programmer
To Reproduce Use this sketch:
Set the following under Tools: Board: "Generic STM32F1" Optimize: "Smallest (-Os default)" Board part number: "BluePill F103C8" C Runtime library: "Newlib nano (default)" Upload Method: "STM32CubeProgrammer (SWD)" USB Support (if available): "CDC (Generic 'Serial' superceds U(S)ART)" U(S)ART Support: "Disabled (no Serial support)"
Steps to reproduce the behavior:
Expected behavior After connection, and after typing characters that are sent to the target board, the character codes should be echoed back to the host, like this (this was taken from success STM32F103ZE board):
Screenshots If applicable, add screenshots to help explain your problem.
Desktop (please complete the following information):
Board (please complete the following information):
Additional context Also tested with the following other boards/processors: