Сompiles, but Serial work not over USB, just two pins Tx, Rx (Expands to: Serial1). After plug-in USB in computer - “Unknown device”.
It happened after upgrade STM32 platform to 5.1.0 version. On v4.5.0 everything workd fine - appeared virtual COM-port over USB.
Unfortunately, even uninstall 5.1 and install 4.5 again - nothing compiling with numerous errors " duplicate ‘inline".
I,
i also have a bluepill board. When i connect usb to my win10 notebook i also have “Unknown device” error. I got working serial1, serial2, serial3 but can’t use USB.
Tried both latest stable and upstream platform with same result.
I even tried maple core (with no errors during compiling) but using it my test code don’t work at all.
I modified my bluepill with famous 1,5k resistor in place of 10k wrong one.
#include <Arduino.h>
#define LED_BUILTIN PC13
void setup()
{
pinMode(LED_BUILTIN, OUTPUT);
Serial.begin(9600);
Serial1.begin(9600);
Serial2.begin(9600);
Serial3.begin(9600);
}
void loop()
{
digitalWrite(LED_BUILTIN, 1);
Serial1.println("Serial LED OFF");
Serial.println("Serial zero LED OFF");
Serial2.println("Serial DUE LED OFF");
Serial3.println("Serial TRE LED OFF");
delay(1000);
digitalWrite(LED_BUILTIN, 0);
Serial1.println("Serial LED ON");
Serial.println("Serial zero LED ON");
Serial2.println("Serial DUE LED ON");
Serial3.println("Serial TRE LED ON");
delay(1000);
}
My original post is missing USBD_PID (it’s also very old and was correct, at the time of posting), I’ve corrected it. The post I linked to directly had everything.