I use Arduino IDE and "STM32 MCU based boards" to program Nucleo32. Here are the settings:
I connect it directly to computer using USB.
Here is my code:
#include <SoftwareSerial.h>
SoftwareSerial mySerial(PB6, PB1); // RX, TX
void setup() {
Serial.begin(115200);
Serial.println("Hi");
mySerial.begin(115200); // When I add this line, nothing works anymore
}
void loop() {
if (Serial.available()) {
String command = Serial.readStringUntil('\n');
Serial.print("Just received a Serial from PC: ");
Serial.println(command);
}
}
I reset it and it writes "Hi" in the Serial monitor, but when I begin() the software serial (line 8), nothing works anymore. Unable to toggle pins, no output appears in the Serial monitor and everything gets stuck.
When I remove line 8, it works without any problems.