platform-ststm32: In the v14.0.0 version, the serial port cannot work

First of all thanks to all contributors for making it easy to use stm32. I tried to use version 14 today, the serial port does not work, but there is no problem with version 13. The hardware I use is https://github.com/WeActTC/BluePill-Plus. Hope you can get help, thank you very much.

image

This is my code

#include <Arduino.h>

void setup() {
   pinMode(PB_2, OUTPUT);

   Serial.begin(115200);
}

void loop() {
   digitalWrite(PB_2, HIGH);
   Serial.print("0.0");
   delay(1000);
   digitalWrite(PB_2, LOW);
   Serial.print("1.1");
   delay(1000);
}

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 18 (5 by maintainers)

Most upvoted comments

I can try it tomorrow, but I still don’t understand why the same program can’t run on 14. 😃

The default serial pins for Generic F103 boards were changed in the latest Arduino core v2.0. I propose two options:

  • Switch to the bluepill_f103c8 which uses PA9/PA10 by default
  • Override serial pins according to your needs:
[env:genericSTM32F103C8]
platform = ststm32
board = genericSTM32F103C8
framework = arduino
build_flags = 
    -DPIN_SERIAL_RX=PA10
    -DPIN_SERIAL_TX=PA9