-
Couldn't load subscription status.
- Fork 1k
Description
The problem of Stm32G030F6Px Serial in Generic STM32G0 series.
I am using stm32duino 2.4.0, arduino 1.8.19 version, when using the hardware serial of USART1, there is no output. Until I use setRx to reset the port, the output is normal.
I guess there is some glitch with the port mapping in the board package?
My English is not good, thank you for understanding
`
void setup() {
// initialize digital pin LED_BUILTIN as an output.
Serial.setRx(PB7); //必须同时使用方法设定 RX->PB7,TX->PB6,否则Serial没有输出。
Serial.setTx(PB6); //通过查数据表得知,Usart1_TX是pin PB6,虽然pin PB6和PB3都是用的pin20脚,但需要单独引用
//而HardwareSerial类中定义的Serial,实际引用的是PB3~PB5中的一个。所以不setTx为PB6,串口是不输出的
Serial.begin(115200);
pinMode(PA4, OUTPUT);
}
// the loop function runs over and over again forever
void loop() {
digitalWrite(PA4, HIGH); // turn the LED on (HIGH is the voltage level)
delay(1000); // wait for a second
digitalWrite(PA4, LOW); // turn the LED off by making the voltage LOW
Serial.println("Stm32G030F6P6: Hello,world!");
delay(1000); // wait for a second
}`