A few days ago I asked for help in the community about compilation problems, which you can see here “previous question” ,When doing the suggested, I compile successfully, but I noticed that my code goes into an infinite loop, I checked it using the debug
,is stuck in this place,the code to reproduce the error is the following
//-------
String i="";
void setup()
{
Serial1.begin(4800); // the Serial31 baud rate
Serial3.begin(4800); // the Serial3 port of Arduino baud rate.
pinMode(PB12, OUTPUT); //Salida LED embutido
digitalWrite(PB12, LOW);
}
void loop()
{
if (Serial3.available()>0) { // if date is comming from softwareSerial3 port ==> data is comming from Serial31 shield
Serial1.write(Serial3.read()); } // if no data transmission ends, write buffer to hardware Serial3 port }
if (Serial1.available()>0) { // if data is available on hardwareSerial3 port ==> data is comming from PC or notebook
Serial3.write(Serial1.read()); // write it to the Serial1 shield
}
}
If I coment the String instance it works, if I leave it it never turns on the PB12 led
File .ini
[env:genericSTM32F103C8]
;platform = ststm32
;platform = ststm32@3.5.0
platform = https://github.com/platformio/platform-ststm32.git
board = genericSTM32F103C8
framework = arduino
monitor_speed = 4800
debug_tool = stlink
upload_protocol = stlink